SELECT custidss,NBRBONUS AS [Número_de_Vale], MONTOBONUS AS [Monto_de_Vale] FROM TMP_OP_BONUS WHERE CORRNBR=502713

Select SEQUENCE,INVTIDSKU,DESCRINVENTORY,QTY,SLS_PRICE,SLSPRICESALE,TOTALPEN,TOTALUSD  FROM  TMP_OP_SALESDET WHERE CORRNBR=502713

SELECT * FROM TMP_OP_SALES WHERE CORRNBR=502792

SELECT * FROM  TMP_OP_SALES WHERE CORRNBR=502898

SELECT * FROM  TMP_OP_SALESDET WHERE CORRNBR=502893 

SELECT * FROM  TMP_OP_SALES
SELECT * FROM  TMP_OP_SALESDET



WHERE CORRNBR=502835
------------------------------
SELECT DOCTYPEID,NBRDOCUMENT,SITEID FROM OP_SALES WHERE DOCTYPEID = '01' AND NBRDOCUMENT='1100000021' AND SITEID = 76 ORDER BY DATEPROCESALES DESC

SELECT * FROM OP_SALESDET WHERE DOCTYPEID = '01' ORDER BY DATEPROCESALES DESC

SELECT * FROM OP_SALES ORDER BY DATEPROCESALES,NBRDOCUMENT DESC

SELECT * FROM OP_SALES WHERE NBRDOCUMENT = '1100000034'
SELECT * FROM OP_SALESDET WHERE NBRDOCUMENT = '1100000034'

SELECT * FROM OP_SALES WHERE DOCTYPEID = '12'AND NBRDOCUMENT IN ('2000060')


SELECT * FROM OP_SALES WHERE NBRDOCUMENT IN ('1100000044')
SELECT * FROM OP_SALESDET WHERE NBRDOCUMENT IN ('1100000044')




SELECT * FROM OP_SALES WHERE NBRDOCUMENT = '115'
SELECT * FROM OP_SALES WHERE NBRDOCUMENT = '339'

SELECT * FROM OP_SALESDET WHERE NBRDOCUMENT = '227'

SELECT * FROM OP_SALES WHERE NBRDOCUMENT = '1100000022'

SELECT TOP 1 * FROM OP_SALES ORDER BY DATEDOC DESC
SELECT TOP 1 * FROM OP_SALESDET ORDER BY DATEDOC DESC

SELECT * FROM OP_SALES ORDER BY DATEDOC DESC
SELECT * FROM OP_SALESDET ORDER BY DATEDOC DESC

SP_HELPTEXT OP_EmitirDocumentodeVentaProc

SELECT * FROM OP_SALESPOINTSETTING

SELECT TYPEDISPFAC FROM OP_SALESPOINTSETTING

SELECT * FROM OP_DOCSERIES 


SELECT DOCTYPEIDVALE FROM OP_SETUP    

SELECT * FROM OP_SETUP    

SELECT * FROM OP_DOCSERIES

	    SELECT DOCTYPEID,NBRSERIES,NBRDOC FROM OP_DOCSERIES WHERE DOCTYPEID = '01' AND NBRSERIES = '110'

	    SELECT @NBRDOCUMENT=NBRDOC FROM OP_DOCSERIES

	    SELECT NBRTICKVALE,TSTAMP,TYPEDISPFAC FROM OP_SALESPOINTSETTING WHERE SALESPOINT=@SALESPOINT       


SELECT * FROM OP_TRAN

SELECT * FROM OP_SALESPOINTSETTING WHERE SALESPOINT='PTOVTA01'       		

STKTICKFAC

----------------------

SP_HELPTEXT Op_ActualizarRegistroenDetalleTempProc

SP_HELPTEXT Op_GrabarRegistroenDetalleTempProc

SELECT DOCTYPEIDTICKET  from OP_SETUP 


SELECT * FROM OP_SALES WHERE DOCTYPEID = '01' ORDER BY NBRDOCUMENT DESC

SELECT * FROM OP_SALES WHERE DOCTYPEID = '12' ORDER BY NBRDOCUMENT DESC

SELECT * FROM OP_SALESDET WHERE NBRDOCUMENT = '111' AND DOCTYPEID = '12'

DELETE  FROM OP_SALESDET WHERE NBRDOCUMENT = '110014' AND DOCTYPEID = '12'


SELECT * FROM OP_SALESDET WHERE 
DOCTYPEID = '12' AND NBRDOCUMENT IN ('1100000032','1100000031','1100000021','1100000020','1100000019','1100000018','1100000017','1100000016','1100000015','1100000014')

DELETE FROM OP_SALES WHERE 
DOCTYPEID = '12' AND NBRDOCUMENT IN ('1100000032','1100000031','1100000021','1100000020','1100000019','1100000018','1100000017','1100000016','1100000015','1100000014')


