DROP PROCEDURE op_Obtenerventasdetayuda
GO
CREATE PROCEDURE op_Obtenerventasdetayuda
(@tipodoc  ud_doctypeid,
 @numerodoc ud_correlativos,
 @siteid ud_idsite	) 
as
BEGIN

Select sequence as Lin ,InvtidSku as "Codigo",DESCRINVENTORY as "Descripcion",  SLSPRICESALE as Precio,
                      	PORCENTTAXIGV as Igv,  QTY as Cantidad,TOTALPEN as Monto from op_salesdet
			where DOCTYPEID = @tipodoc and NBRDOCUMENT=@numerodoc and SITEID=@siteid
			order by sequence 
END
GO

EXEC op_Obtenerventasdetayuda '12',5712000578,'57'
select * from op_salesdet