Process_inv SQL Begin transaction; INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(24.89, '2770180', 'CACHAÇO DE PORCO', (select art_med from art where art_ref='2770180'), 0, 0, (select art_med * 24.89 from art where art_ref='2770180'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 1, 0, 0.000, '', '2770180', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('1',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(16.30, '2770080', 'CABEÇA DE PORCO FUMADA/U', (select art_med from art where art_ref='2770080'), 0, 0, (select art_med * 16.30 from art where art_ref='2770080'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 2, 0, 0.000, '', '2770080', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('2',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(20.10, '2770046', 'PERNIL/UNHAS FRESCO', (select art_med from art where art_ref='2770046'), 0, 0, (select art_med * 20.10 from art where art_ref='2770046'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 3, 0, 0.000, '', '2770046', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('3',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(77.10, '2770056', 'FRANGO', (select art_med from art where art_ref='2770056'), 0, 0, (select art_med * 77.10 from art where art_ref='2770056'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 4, 0, 0.000, '', '2770056', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('4',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(6.28, '2770050', 'RABOS PORCO', (select art_med from art where art_ref='2770050'), 0, 0, (select art_med * 6.28 from art where art_ref='2770050'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 5, 0, 0.000, '', '2770050', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('5',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(1.20, '2770084', 'PREPARADO CARNE PICADA', (select art_med from art where art_ref='2770084'), 0, 0, (select art_med * 1.20 from art where art_ref='2770084'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 6, 0, 0.000, '', '2770084', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('6',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(11.48, '2770063', 'PEITO DE FRANGO', (select art_med from art where art_ref='2770063'), 0, 0, (select art_med * 11.48 from art where art_ref='2770063'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 7, 0, 0.000, '', '2770063', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('7',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(35.20, '2770085', 'VITELAO', (select art_med from art where art_ref='2770085'), 0, 0, (select art_med * 35.20 from art where art_ref='2770085'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 8, 0, 0.000, '', '2770085', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('8',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(144.80, '2779999', 'CARCAÇA NOVILHO', (select art_med from art where art_ref='2779999'), 0, 0, (select art_med * 144.80 from art where art_ref='2779999'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 9, 0, 0.000, '', '2779999', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('9',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(16.51, '2770043', 'COSTELA', (select art_med from art where art_ref='2770043'), 0, 0, (select art_med * 16.51 from art where art_ref='2770043'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 10, 0, 0.000, '', '2770043', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('10',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(52.90, '2770078', 'BIFANAS LAMINADAS', (select art_med from art where art_ref='2770078'), 0, 0, (select art_med * 52.90 from art where art_ref='2770078'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 11, 0, 0.000, '', '2770078', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('11',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(3.70, '2770185', 'TOCOS FUMADOS', (select art_med from art where art_ref='2770185'), 0, 0, (select art_med * 3.70 from art where art_ref='2770185'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 12, 0, 0.000, '', '2770185', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('12',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(2.82, '2770002', 'VAZIO S/ OSSO', (select art_med from art where art_ref='2770002'), 0, 0, (select art_med * 2.82 from art where art_ref='2770002'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 13, 0, 0.000, '', '2770002', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('13',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(0.85, '2770027', 'VITELA 1.', (select art_med from art where art_ref='2770027'), 0, 0, (select art_med * 0.85 from art where art_ref='2770027'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 14, 0, 0.000, '', '2770027', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('14',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(58.00, '2770039', 'FEVERAS C/ OSSO', (select art_med from art where art_ref='2770039'), 0, 0, (select art_med * 58.00 from art where art_ref='2770039'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 15, 0, 0.000, '', '2770039', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('15',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(5.20, '2770062', 'ASAS DE FRANGO', (select art_med from art where art_ref='2770062'), 0, 0, (select art_med * 5.20 from art where art_ref='2770062'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 16, 0, 0.000, '', '2770062', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('16',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(12.20, '2770017', 'ABA C/ OSSO', (select art_med from art where art_ref='2770017'), 0, 0, (select art_med * 12.20 from art where art_ref='2770017'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 17, 0, 0.000, '', '2770017', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('17',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(4.60, '2770041', 'COSTELETA PORCO DO PÉ', (select art_med from art where art_ref='2770041'), 0, 0, (select art_med * 4.60 from art where art_ref='2770041'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 18, 0, 0.000, '', '2770041', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('18',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(0.20, '2770182', 'PANADOS FRANGO', (select art_med from art where art_ref='2770182'), 0, 0, (select art_med * 0.20 from art where art_ref='2770182'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 19, 0, 0.000, '', '2770182', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('19',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(26.25, '2770067', 'BIFE DE PERU', (select art_med from art where art_ref='2770067'), 0, 0, (select art_med * 26.25 from art where art_ref='2770067'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 20, 0, 0.000, '', '2770067', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('20',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(11.40, '2770093', 'MORCELA', (select art_med from art where art_ref='2770093'), 0, 0, (select art_med * 11.40 from art where art_ref='2770093'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 21, 0, 0.000, '', '2770093', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('21',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(1.00, '2770055', 'SANGUE COZIDO PORCO', (select art_med from art where art_ref='2770055'), 0, 0, (select art_med * 1.00 from art where art_ref='2770055'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 22, 0, 0.000, '', '2770055', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('22',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(10.70, '2770014', 'NISPO', (select art_med from art where art_ref='2770014'), 0, 0, (select art_med * 10.70 from art where art_ref='2770014'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 23, 0, 0.000, '', '2770014', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('23',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(23.58, '2770042', 'BARRIGA PORCO', (select art_med from art where art_ref='2770042'), 0, 0, (select art_med * 23.58 from art where art_ref='2770042'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 24, 0, 0.000, '', '2770042', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('24',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(23490.00, '2770038', 'FEVERAS', (select art_med from art where art_ref='2770038'), 0, 0, (select art_med * 23490.00 from art where art_ref='2770038'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 25, 0, 0.000, '', '2770038', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('25',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(6.20, '2770075', 'CHOURIÇO ESPECIAL', (select art_med from art where art_ref='2770075'), 0, 0, (select art_med * 6.20 from art where art_ref='2770075'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 26, 0, 0.000, '', '2770075', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('26',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(16.00, '2770016', 'HAMBURGUER', (select art_med from art where art_ref='2770016'), 0, 0, (select art_med * 16.00 from art where art_ref='2770016'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 27, 0, 0.000, '', '2770016', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('27',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(19.30, '2770013', 'PEITO S/ OSSO', (select art_med from art where art_ref='2770013'), 0, 0, (select art_med * 19.30 from art where art_ref='2770013'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 28, 0, 0.000, '', '2770013', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('28',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(5.10, '2770076', 'CHOURIÇO VINHO/CLORAU', (select art_med from art where art_ref='2770076'), 0, 0, (select art_med * 5.10 from art where art_ref='2770076'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 29, 0, 0.000, '', '2770076', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('29',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(1.40, '2770117', 'SALSICHA FRESCA', (select art_med from art where art_ref='2770117'), 0, 0, (select art_med * 1.40 from art where art_ref='2770117'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 30, 0, 0.000, '', '2770117', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('30',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(8.70, '2770061', 'PERNA DE FRANGO', (select art_med from art where art_ref='2770061'), 0, 0, (select art_med * 8.70 from art where art_ref='2770061'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 31, 0, 0.000, '', '2770061', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('31',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(16.23, '2770092', 'ALHEIRAS', (select art_med from art where art_ref='2770092'), 0, 0, (select art_med * 16.23 from art where art_ref='2770092'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 32, 0, 0.000, '', '2770092', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('32',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(5.85, '2770005', 'BIFE POSTA FALSA', (select art_med from art where art_ref='2770005'), 0, 0, (select art_med * 5.85 from art where art_ref='2770005'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 33, 0, 0.000, '', '2770005', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('33',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(6.59, '2770007', 'PÁ DE NOVILHO', (select art_med from art where art_ref='2770007'), 0, 0, (select art_med * 6.59 from art where art_ref='2770007'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 34, 0, 0.000, '', '2770007', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('34',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(2.90, '2770071', 'COELHO FRESCO', (select art_med from art where art_ref='2770071'), 0, 0, (select art_med * 2.90 from art where art_ref='2770071'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 35, 0, 0.000, '', '2770071', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('35',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(0.29, '2770110', 'PANADOS DE PORCO', (select art_med from art where art_ref='2770110'), 0, 0, (select art_med * 0.29 from art where art_ref='2770110'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 36, 0, 0.000, '', '2770110', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('36',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(3.88, '2770112', 'ROJOES DE PORCO', (select art_med from art where art_ref='2770112'), 0, 0, (select art_med * 3.88 from art where art_ref='2770112'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 37, 0, 0.000, '', '2770112', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('37',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(15.05, '2770082', 'PICANHA PREMIUM', (select art_med from art where art_ref='2770082'), 0, 0, (select art_med * 15.05 from art where art_ref='2770082'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 38, 0, 0.000, '', '2770082', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('38',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(21.90, '2770040', 'PÁ PORCO INTEIRA', (select art_med from art where art_ref='2770040'), 0, 0, (select art_med * 21.90 from art where art_ref='2770040'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 39, 0, 0.000, '', '2770040', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('39',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(0.98, '2770216', 'BIFE BICO DA PÁ', (select art_med from art where art_ref='2770216'), 0, 0, (select art_med * 0.98 from art where art_ref='2770216'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 40, 0, 0.000, '', '2770216', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('40',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(3.00, '2770059', 'FIGADO DE FRANGO', (select art_med from art where art_ref='2770059'), 0, 0, (select art_med * 3.00 from art where art_ref='2770059'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 41, 0, 0.000, '', '2770059', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('41',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(9.55, '2770054', 'TRIPAS ENFARINHADAS', (select art_med from art where art_ref='2770054'), 0, 0, (select art_med * 9.55 from art where art_ref='2770054'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 42, 0, 0.000, '', '2770054', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('42',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(2.00, '2770068', 'CANJINHAS', (select art_med from art where art_ref='2770068'), 0, 0, (select art_med * 2.00 from art where art_ref='2770068'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 43, 0, 0.000, '', '2770068', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('43',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(1.60, '2770015', 'OCULO', (select art_med from art where art_ref='2770015'), 0, 0, (select art_med * 1.60 from art where art_ref='2770015'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 44, 0, 0.000, '', '2770015', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('44',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(2.28, '2770032', 'COSTELETA VITELA', (select art_med from art where art_ref='2770032'), 0, 0, (select art_med * 2.28 from art where art_ref='2770032'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 45, 0, 0.000, '', '2770032', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('45',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(3.28, '2770009', 'CERNELHA', (select art_med from art where art_ref='2770009'), 0, 0, (select art_med * 3.28 from art where art_ref='2770009'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 46, 0, 0.000, '', '2770009', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('46',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(9.65, '2770060', 'PERNA FRANGO C/ COSTA', (select art_med from art where art_ref='2770060'), 0, 0, (select art_med * 9.65 from art where art_ref='2770060'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 47, 0, 0.000, '', '2770060', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('47',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(11.95, '2770254', 'MAMINHA DA ALCATRA IMP.', (select art_med from art where art_ref='2770254'), 0, 0, (select art_med * 11.95 from art where art_ref='2770254'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 48, 0, 0.000, '', '2770254', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('48',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(9.00, '2770053', 'REDENHO PORCO', (select art_med from art where art_ref='2770053'), 0, 0, (select art_med * 9.00 from art where art_ref='2770053'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 49, 0, 0.000, '', '2770053', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('49',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(0.80, '2770006', 'JARRETE', (select art_med from art where art_ref='2770006'), 0, 0, (select art_med * 0.80 from art where art_ref='2770006'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 50, 0, 0.000, '', '2770006', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('50',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(8.10, '2770022', 'DOBRADA', (select art_med from art where art_ref='2770022'), 0, 0, (select art_med * 8.10 from art where art_ref='2770022'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 51, 0, 0.000, '', '2770022', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('51',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(4.90, '2770011', 'ACEM', (select art_med from art where art_ref='2770011'), 0, 0, (select art_med * 4.90 from art where art_ref='2770011'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 52, 0, 0.000, '', '2770011', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('52',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(2.98, '2770031', 'COSTELA MINDINHA C/ OSSO', (select art_med from art where art_ref='2770031'), 0, 0, (select art_med * 2.98 from art where art_ref='2770031'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 53, 0, 0.000, '', '2770031', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('53',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(2.00, '2770122', 'UNHAS FUMADAS', (select art_med from art where art_ref='2770122'), 0, 0, (select art_med * 2.00 from art where art_ref='2770122'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 54, 0, 0.000, '', '2770122', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('54',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(11.70, '2770079', 'BACON', (select art_med from art where art_ref='2770079'), 0, 0, (select art_med * 11.70 from art where art_ref='2770079'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 55, 0, 0.000, '', '2770079', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('55',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(1.00, '2958541', 'PÁ FUMADA A.L.MARINHO', (select art_med from art where art_ref='2958541'), 0, 0, (select art_med * 1.00 from art where art_ref='2958541'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 56, 0, 0.000, '', '2958541', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('56',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(3.50, '2765604', 'FARINHEIRA FUMINHO S', (select art_med from art where art_ref='2765604'), 0, 0, (select art_med * 3.50 from art where art_ref='2765604'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 57, 0, 0.000, '', '2765604', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('57',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(4.10, '2741433', 'SALPICAO FUMINHO EMB', (select art_med from art where art_ref='2741433'), 0, 0, (select art_med * 4.10 from art where art_ref='2741433'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 58, 0, 0.000, '', '2741433', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('58',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(10.30, '2709356', 'SALPICAO DO CACHAÇO FUMINHO LS', (select art_med from art where art_ref='2709356'), 0, 0, (select art_med * 10.30 from art where art_ref='2709356'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 59, 0, 0.000, '', '2709356', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('59',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(5.60, '2733816', 'CHOURIÇA D''AVO FUMINHO EMB', (select art_med from art where art_ref='2733816'), 0, 0, (select art_med * 5.60 from art where art_ref='2733816'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 60, 0, 0.000, '', '2733816', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('60',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(0.58, '2719919', 'CHOURIÇO PICANTE FUMINHO', (select art_med from art where art_ref='2719919'), 0, 0, (select art_med * 0.58 from art where art_ref='2719919'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 61, 0, 0.000, '', '2719919', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('61',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(1.30, '2798513', 'CHOURIÇA DE SANGUE FUMINHO LS', (select art_med from art where art_ref='2798513'), 0, 0, (select art_med * 1.30 from art where art_ref='2798513'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 62, 0, 0.000, '', '2798513', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('62',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(1.90, '2741420', 'MOIRA REGIONAL FUMINHO LS', (select art_med from art where art_ref='2741420'), 0, 0, (select art_med * 1.90 from art where art_ref='2741420'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 63, 0, 0.000, '', '2741420', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('63',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(1.20, '2741418', 'CHOURIÇA DE CARNE FUMINHO LS', (select art_med from art where art_ref='2741418'), 0, 0, (select art_med * 1.20 from art where art_ref='2741418'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 64, 0, 0.000, '', '2741418', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('64',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(5.70, '2958480', 'SALPICÃO EMB. UN A.L. MARINHO', (select art_med from art where art_ref='2958480'), 0, 0, (select art_med * 5.70 from art where art_ref='2958480'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 65, 0, 0.000, '', '2958480', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('65',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(3.70, '2719916', 'MISTO DE ENCHIDOS FUMINHO LS', (select art_med from art where art_ref='2719916'), 0, 0, (select art_med * 3.70 from art where art_ref='2719916'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 66, 0, 0.000, '', '2719916', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('66',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(3.35, '2958552', 'OUVIDOS FUMADOS A.L. MARINHO KG', (select art_med from art where art_ref='2958552'), 0, 0, (select art_med * 3.35 from art where art_ref='2958552'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 67, 0, 0.000, '', '2958552', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('67',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(3.70, '2741429', 'ENTREMEADA FUMADA FATIAS FUMINHO LS', (select art_med from art where art_ref='2741429'), 0, 0, (select art_med * 3.70 from art where art_ref='2741429'),'CMK200', (select ser_num from ser where ser_chv='CMK200'), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 2, 0, '', 0, 9, 68, 0, 0.000, '', '2741429', 0, '1900-01-01', (select cast(getdate()as date)), (select 'CMK200'+str((select ser_num from ser where ser_chv='CMK200'),10)+str('68',6)), (select 'CMK200'+(select str((select ser_num from ser where ser_chv='CMK200'),10))), 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); UPDATE DAD SET DAD_MXL=68, DAD_ULT=getdate(), ESTADO=9 WHERE DAD_CHV='CMK200' + str((select ser_num from ser where ser_chv='CMK200'),10); commit transaction : Violation of PRIMARY KEY constraint 'PK_lin'. Cannot insert duplicate key in object 'dbo.lin'. The duplicate key value is (CMK200 33 1).