ALTER PROCEDURE [dbo].[sp_invCargarArticulosNoContados]
(
	@codbod INT = 0
)
AS
BEGIN
	SELECT A.codbus,
	A.nomart, 
	A.codalt, 
	A.ubiinv1, 
	ISNULL(S.saltot, 0) AS stock_logico, 
	0 AS stock_fisico, 
	0 AS stock_dif, 
	'False' AS contado, 
	GETDATE() AS fecha_toma, 
	@codbod AS bodega, 
	'False' AS contabilizado ,
	0 AS numlin,
	0 AS idPretoma
	FROM invArticulos A JOIN invStock S ON A.codbus = S.codbus AND S.codbod = @codbod
	WHERE NOT EXISTS (	SELECT * 
						FROM invCierreTomaTemp C 
						WHERE A.codbus = c.codbus)

END