20250217@143344.1359 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143344.1374 e3jmhpk3gnbqacrlk9e7fqnliv Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b349786867b348c81c',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 8.000, 8.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,110000 ,83.2,83.2*200.48,83.2,83.2*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,83.2*8.000,83.2*8.000*200.48 ,23.016000,23.016000*200.48 ,23.016000,23.016000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,83.2,83.2*200.48,83.2*8.000,83.2*8.000*200.48,'av25021456655,065000012 ',83.2,83.2*8.000,83.2,83.2*8.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b346932067b348c655'
20250217@143344.1737 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.1751 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.usalote valor from st where st.ref = '324.646.00.01'
20250217@143344.1767 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.1770 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.stns valor from st where st.ref = '324.646.00.01'
20250217@143344.1789 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.1792 e3jmhpk3gnbqacrlk9e7fqnliv Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.646.00.01' and sa.armazem = 133 
20250217@143344.1870 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.1873 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.stns valor from st where st.ref = '324.646.00.01'
20250217@143344.1903 e3jmhpk3gnbqacrlk9e7fqnliv Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.646.00.01'
20250217@143344.2070 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.2162 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143344.2175 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.2195 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143344.2205 e3jmhpk3gnbqacrlk9e7fqnliv Query : select sestamp valor from se where ref ='324.646.00.01' and lote = 'r2401265300a'
20250217@143344.2221 e3jmhpk3gnbqacrlk9e7fqnliv Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143344.2360 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.2414 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143344.2426 e3jmhpk3gnbqacrlk9e7fqnliv Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b343332767b348c839','aut67b346932067b348c655',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b346932067b348c655'
20250217@143344.2590 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.2616 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143344.2637 e3jmhpk3gnbqacrlk9e7fqnliv Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b343332767b348c839',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 9.000, 9.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,120000 ,44.8,44.8*200.48,44.8,44.8*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,44.8*9.000,44.8*9.000*200.48 ,15.014000,15.014000*200.48 ,15.014000,15.014000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,44.8,44.8*200.48,44.8*9.000,44.8*9.000*200.48,'av25021456662,584000013 ',44.8,44.8*9.000,44.8,44.8*9.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b346932067b348c655'
20250217@143344.2980 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.3020 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.usalote valor from st where st.ref = '324.646.00.01'
20250217@143344.3036 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.3040 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.stns valor from st where st.ref = '324.646.00.01'
20250217@143344.3086 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.3090 e3jmhpk3gnbqacrlk9e7fqnliv Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.646.00.01' and sa.armazem = 133 
20250217@143344.3117 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.3119 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.stns valor from st where st.ref = '324.646.00.01'
20250217@143344.3243 e3jmhpk3gnbqacrlk9e7fqnliv Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.646.00.01'
20250217@143344.3258 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.3277 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143344.3291 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.3307 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143344.3315 e3jmhpk3gnbqacrlk9e7fqnliv Query : select sestamp valor from se where ref ='324.646.00.01' and lote = 'r2400836200a'
20250217@143344.3329 e3jmhpk3gnbqacrlk9e7fqnliv Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143344.3342 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.3357 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143344.3370 e3jmhpk3gnbqacrlk9e7fqnliv Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b343055267b348c851','aut67b346932067b348c655',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b346932067b348c655'
20250217@143344.3526 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.3543 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143344.3561 e3jmhpk3gnbqacrlk9e7fqnliv Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b343055267b348c851',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 6.000, 6.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,130000 ,44.8,44.8*200.48,44.8,44.8*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,44.8*6.000,44.8*6.000*200.48 ,15.014000,15.014000*200.48 ,15.014000,15.014000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,44.8,44.8*200.48,44.8*6.000,44.8*6.000*200.48,'av25021456662,584000013 ',44.8,44.8*6.000,44.8,44.8*6.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b346932067b348c655'
20250217@143344.3858 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.3867 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.usalote valor from st where st.ref = '324.1832.00.2'
20250217@143344.3886 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.3890 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.stns valor from st where st.ref = '324.1832.00.2'
20250217@143344.3911 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.3915 e3jmhpk3gnbqacrlk9e7fqnliv Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.1832.00.2' and sa.armazem = 133 
20250217@143344.3944 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.3948 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.stns valor from st where st.ref = '324.1832.00.2'
20250217@143344.3971 e3jmhpk3gnbqacrlk9e7fqnliv Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1832.00.2'
20250217@143344.3985 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.4007 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143344.4023 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.4041 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143344.4053 e3jmhpk3gnbqacrlk9e7fqnliv Query : select sestamp valor from se where ref ='324.1832.00.2' and lote = 'r2400401150a'
20250217@143344.4068 e3jmhpk3gnbqacrlk9e7fqnliv Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143344.4085 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.4102 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143344.4114 e3jmhpk3gnbqacrlk9e7fqnliv Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b348662167b348c863','aut67b346932067b348c655',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b346932067b348c655'
20250217@143344.4282 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.4307 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143344.4326 e3jmhpk3gnbqacrlk9e7fqnliv Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b348662167b348c863',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 2.000, 2.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,140000 ,67.5,67.5*200.48,67.5,67.5*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,67.5*2.000,67.5*2.000*200.48 ,31.765000,31.765000*200.48 ,31.765000,31.765000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,67.5,67.5*200.48,67.5*2.000,67.5*2.000*200.48,'av25021456668,204000014 ',67.5,67.5*2.000,67.5,67.5*2.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b346932067b348c655'
20250217@143344.4636 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.4641 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.usalote valor from st where st.ref = '324.1831.00.2'
20250217@143344.4657 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.4660 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.stns valor from st where st.ref = '324.1831.00.2'
20250217@143344.4677 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.4680 e3jmhpk3gnbqacrlk9e7fqnliv Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.1831.00.2' and sa.armazem = 133 
20250217@143344.4816 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.4819 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.stns valor from st where st.ref = '324.1831.00.2'
20250217@143344.4851 e3jmhpk3gnbqacrlk9e7fqnliv Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1831.00.2'
20250217@143344.5044 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.5063 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143344.5079 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.5122 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143344.5132 e3jmhpk3gnbqacrlk9e7fqnliv Query : select sestamp valor from se where ref ='324.1831.00.2' and lote = 'r2400922200a'
20250217@143344.5146 e3jmhpk3gnbqacrlk9e7fqnliv Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143344.5160 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.5175 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143344.5189 e3jmhpk3gnbqacrlk9e7fqnliv Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b345038867b348c87d','aut67b346932067b348c655',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b346932067b348c655'
20250217@143344.5520 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.5631 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143344.5648 e3jmhpk3gnbqacrlk9e7fqnliv Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b345038867b348c87d',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 2.000, 2.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,150000 ,67.5,67.5*200.48,67.5,67.5*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,67.5*2.000,67.5*2.000*200.48 ,31.437000,31.437000*200.48 ,31.437000,31.437000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,67.5,67.5*200.48,67.5*2.000,67.5*2.000*200.48,'av25021456676,109000015 ',67.5,67.5*2.000,67.5,67.5*2.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b346932067b348c655'
20250217@143344.6034 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.6039 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.usalote valor from st where st.ref = '324.1406.00.1'
20250217@143344.6055 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.6058 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.stns valor from st where st.ref = '324.1406.00.1'
20250217@143344.6075 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.6078 e3jmhpk3gnbqacrlk9e7fqnliv Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.1406.00.1' and sa.armazem = 133 
20250217@143344.6157 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.6163 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.stns valor from st where st.ref = '324.1406.00.1'
20250217@143344.6184 e3jmhpk3gnbqacrlk9e7fqnliv Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1406.00.1'
20250217@143344.6358 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.6375 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143344.6389 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.6403 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143344.6412 e3jmhpk3gnbqacrlk9e7fqnliv Query : select sestamp valor from se where ref ='324.1406.00.1' and lote = 'r2400744200a'
20250217@143344.6428 e3jmhpk3gnbqacrlk9e7fqnliv Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143344.6446 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.6463 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143344.6475 e3jmhpk3gnbqacrlk9e7fqnliv Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b349319767b348c89d','aut67b346932067b348c655',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b346932067b348c655'
20250217@143344.6637 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.6688 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143344.6705 e3jmhpk3gnbqacrlk9e7fqnliv Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b349319767b348c89d',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 24.000, 24.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,160000 ,22.4,22.4*200.48,22.4,22.4*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,22.4*24.000,22.4*24.000*200.48 ,10.378000,10.378000*200.48 ,10.378000,10.378000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,22.4,22.4*200.48,22.4*24.000,22.4*24.000*200.48,'av25021456706,548000018 ',22.4,22.4*24.000,22.4,22.4*24.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b346932067b348c655'
20250217@143344.7009 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.7053 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.usalote valor from st where st.ref = '324.1416.00.1'
20250217@143344.7071 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.7074 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.stns valor from st where st.ref = '324.1416.00.1'
20250217@143344.7091 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.7094 e3jmhpk3gnbqacrlk9e7fqnliv Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.1416.00.1' and sa.armazem = 133 
20250217@143344.7210 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.7213 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.stns valor from st where st.ref = '324.1416.00.1'
20250217@143344.7241 e3jmhpk3gnbqacrlk9e7fqnliv Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1416.00.1'
20250217@143344.7443 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.7460 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143344.7474 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.7489 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143344.7508 e3jmhpk3gnbqacrlk9e7fqnliv Query : select sestamp valor from se where ref ='324.1416.00.1' and lote = 'r2400079200a'
20250217@143344.7522 e3jmhpk3gnbqacrlk9e7fqnliv Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143344.7536 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.7556 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143344.7571 e3jmhpk3gnbqacrlk9e7fqnliv Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b340520867b348c8b7','aut67b346932067b348c655',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b346932067b348c655'
20250217@143344.7734 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.7755 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143344.7771 e3jmhpk3gnbqacrlk9e7fqnliv Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b340520867b348c8b7',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 4.000, 4.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,170000 ,38.4,38.4*200.48,38.4,38.4*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,38.4*4.000,38.4*4.000*200.48 ,16.035000,16.035000*200.48 ,16.035000,16.035000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,38.4,38.4*200.48,38.4*4.000,38.4*4.000*200.48,'av25021456725,091000020 ',38.4,38.4*4.000,38.4,38.4*4.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b346932067b348c655'
20250217@143344.8197 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.8202 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.usalote valor from st where st.ref = '324.4988.00.1'
20250217@143344.8218 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.8221 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.stns valor from st where st.ref = '324.4988.00.1'
20250217@143344.8238 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.8241 e3jmhpk3gnbqacrlk9e7fqnliv Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.4988.00.1' and sa.armazem = 133 
20250217@143344.8328 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.8331 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.stns valor from st where st.ref = '324.4988.00.1'
20250217@143344.8349 e3jmhpk3gnbqacrlk9e7fqnliv Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.4988.00.1'
20250217@143344.8695 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.8714 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143344.8732 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.8749 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143344.8759 e3jmhpk3gnbqacrlk9e7fqnliv Query : select sestamp valor from se where ref ='324.4988.00.1' and lote = 'r2100754100a'
20250217@143344.8773 e3jmhpk3gnbqacrlk9e7fqnliv Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143344.8794 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.8809 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143344.8823 e3jmhpk3gnbqacrlk9e7fqnliv Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b344433367b348c8d6','aut67b346932067b348c655',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b346932067b348c655'
20250217@143344.8976 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.8998 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143344.9015 e3jmhpk3gnbqacrlk9e7fqnliv Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b344433367b348c8d6',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 4.000, 4.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,180000 ,28.8,28.8*200.48,28.8,28.8*200.48 ,0,0,'un ','' ,bo.marcada,1 ,28.8*4.000,28.8*4.000*200.48 ,8.445000,8.445000*200.48 ,8.445000,8.445000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,28.8,28.8*200.48,28.8*4.000,28.8*4.000*200.48,'av25021456813,332000026 ',28.8,28.8*4.000,28.8,28.8*4.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b346932067b348c655'
20250217@143344.9320 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.9360 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.usalote valor from st where st.ref = '324.4988.00.1'
20250217@143344.9414 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.9418 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.stns valor from st where st.ref = '324.4988.00.1'
20250217@143344.9433 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.9436 e3jmhpk3gnbqacrlk9e7fqnliv Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.4988.00.1' and sa.armazem = 133 
20250217@143344.9459 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143344.9462 e3jmhpk3gnbqacrlk9e7fqnliv Query : select st.stns valor from st where st.ref = '324.4988.00.1'
20250217@143344.9480 e3jmhpk3gnbqacrlk9e7fqnliv Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.4988.00.1'
20250217@143344.9493 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.9509 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143344.9521 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.9535 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143344.9543 e3jmhpk3gnbqacrlk9e7fqnliv Query : select sestamp valor from se where ref ='324.4988.00.1' and lote = 'r2100754100a'
20250217@143344.9555 e3jmhpk3gnbqacrlk9e7fqnliv Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143344.9567 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.9581 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143344.9593 e3jmhpk3gnbqacrlk9e7fqnliv Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b349094767b348c8e9','aut67b346932067b348c655',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b346932067b348c655'
20250217@143344.9754 e3jmhpk3gnbqacrlk9e7fqnliv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143344.9772 e3jmhpk3gnbqacrlk9e7fqnliv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143344.9788 e3jmhpk3gnbqacrlk9e7fqnliv Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b349094767b348c8e9',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 36.000, 36.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,190000 ,28.8,28.8*200.48,28.8,28.8*200.48 ,0,0,'un ','' ,bo.marcada,1 ,28.8*36.000,28.8*36.000*200.48 ,8.445000,8.445000*200.48 ,8.445000,8.445000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,28.8,28.8*200.48,28.8*36.000,28.8*36.000*200.48,'av25021456813,332000026 ',28.8,28.8*36.000,28.8,28.8*36.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b346932067b348c655'
20250217@143345.9300 e3jmhpk3gnbqacrlk9e7fqnliv Query : insert into wsbocreationlog (initialstamp,externalid,creationstatus,documenttypeid,idustamp,transactionid) values ('aut67b346932067b348c655','','wait',5,'adm12071144683,938000003','')
20250217@143345.2320 e3jmhpk3gnbqacrlk9e7fqnliv Query : use flama_phc
20250217@143345.2360 e3jmhpk3gnbqacrlk9e7fqnliv Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20250217@143345.3360 e3jmhpk3gnbqacrlk9e7fqnliv Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5386';
20250217@143345.5760 e3jmhpk3gnbqacrlk9e7fqnliv Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5386';
20250217@143345.1193 391cesn1kfglbdq4in0vjgn36v Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250217@143345.1207 391cesn1kfglbdq4in0vjgn36v Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250217@143345.1292 391cesn1kfglbdq4in0vjgn36v Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5387';
20250217@143345.1375 391cesn1kfglbdq4in0vjgn36v Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5387';
20250217@143345.1464 391cesn1kfglbdq4in0vjgn36v Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5387';
20250217@143345.1518 391cesn1kfglbdq4in0vjgn36v Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5387';
20250217@143345.1795 k54v6mf3kr0c88pejfpqpih1ng Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250217@143345.1809 k54v6mf3kr0c88pejfpqpih1ng Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250217@143345.1891 k54v6mf3kr0c88pejfpqpih1ng Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5388';
20250217@143345.1963 k54v6mf3kr0c88pejfpqpih1ng Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5388';
20250217@143345.2070 k54v6mf3kr0c88pejfpqpih1ng Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5388';
20250217@143345.2150 k54v6mf3kr0c88pejfpqpih1ng Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5388';
20250217@143345.2213 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143345.2216 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250217@143345.2282 k54v6mf3kr0c88pejfpqpih1ng Query : select no, estab,szadrsdesc from szadrs where u_coddest=23
20250217@143345.2373 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '325.1290.1003'
20250217@143345.2495 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =054 and bo.boano =2025 and bo.obrano = 0000009 and bi.ref ='325.1290.1003' and bi.lordem =10000
20250217@143345.2876 k54v6mf3kr0c88pejfpqpih1ng Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'pll25021361787,353000001 ' 
20250217@143345.3246 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2028.00.2'
20250217@143345.3363 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =054 and bo.boano =2025 and bo.obrano = 0000009 and bi.ref ='324.2028.00.2' and bi.lordem =20000
20250217@143345.3683 k54v6mf3kr0c88pejfpqpih1ng Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'pll25021361816,457000002 ' 
20250217@143345.4016 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1716.00.1'
20250217@143345.4200 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =054 and bo.boano =2025 and bo.obrano = 0000009 and bi.ref ='324.1716.00.1' and bi.lordem =30000
20250217@143345.5806 k54v6mf3kr0c88pejfpqpih1ng Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'pll25021361904,040000003 ' 
20250217@143345.6135 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1317.00.1'
20250217@143345.6259 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =054 and bo.boano =2025 and bo.obrano = 0000009 and bi.ref ='324.1317.00.1' and bi.lordem =40000
20250217@143345.6601 k54v6mf3kr0c88pejfpqpih1ng Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'pll25021361969,302000004 ' 
20250217@143345.6913 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1667.00.1'
20250217@143345.7078 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =054 and bo.boano =2025 and bo.obrano = 0000009 and bi.ref ='324.1667.00.1' and bi.lordem =50000
20250217@143345.7428 k54v6mf3kr0c88pejfpqpih1ng Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'pll25021361996,432000005 ' 
20250217@143345.7731 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2366.00.1'
20250217@143345.7863 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =054 and bo.boano =2025 and bo.obrano = 0000009 and bi.ref ='324.2366.00.1' and bi.lordem =60000
20250217@143345.8220 k54v6mf3kr0c88pejfpqpih1ng Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'pll25021362023,533000006 ' 
20250217@143345.8546 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '327.8152.00.1'
20250217@143345.8866 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =054 and bo.boano =2025 and bo.obrano = 0000009 and bi.ref ='327.8152.00.1' and bi.lordem =70000
20250217@143345.9262 k54v6mf3kr0c88pejfpqpih1ng Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'pll25021362046,536000007 ' 
20250217@143345.9583 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.5540.00.1'
20250217@143345.9703 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =054 and bo.boano =2025 and bo.obrano = 0000009 and bi.ref ='324.5540.00.1' and bi.lordem =80000
20250217@143346.7000 k54v6mf3kr0c88pejfpqpih1ng Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'pll25021362161,744000008 ' 
20250217@143346.4000 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.4030 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 1 valor from ts where ts.ndos = 5
20250217@143346.4370 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.4400 k54v6mf3kr0c88pejfpqpih1ng Query : select lower(descricao) descricao ,case when valor='s' then 1 else 0 end valor from para1 where descricao in ('st_lote','st_usalogifunc', 'st_grelha')
20250217@143346.4680 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 assinadoc issigned ,ts.stocks ,ts.bdempresas origin ,case when (cmstocks between 1 and 50 or cm2stocks between 1 and 50 ) then 1 else 0 end entrada ,case when cmstocks>50 or (cm2stocks>50 and trfa =1) then 1 else 0 end saida ,stneg validatestock ,tiposaft ,veserie useserialnumber ,foserie assetin ,ftserie assetout ,veserie assets ,trfarm assetstransfer ,grelha usegridfields from ts inner join ts2 on ts.tsstamp=ts2.ts2stamp where ts.ndos =5
20250217@143346.5230 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.5260 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 ~inactivo valor from fl where no = '100999' and estab = 0 order by inactivo desc
20250217@143346.6500 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.6530 k54v6mf3kr0c88pejfpqpih1ng Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250217@143346.7060 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.7090 k54v6mf3kr0c88pejfpqpih1ng Query : select szadrsstamp valor from szadrs where szadrsdesc='flama-fab.louÇas e electrodomesticos,sa'
20250217@143346.7790 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.7830 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from ts where ndos = 5
20250217@143346.7970 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.8240 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 5
20250217@143346.8440 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.8600 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 5
20250217@143346.8700 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.8860 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 5
20250217@143346.8960 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 ts2.manternumero, ts.tiposaft, ts.idserie,ts.nmdos,ts.bdempresas from ts inner join ts2 on ts.tsstamp=ts2.ts2stamp where ts.ndos = 5
20250217@143346.9140 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 5 and boano=2025 order by obrano desc
20250217@143346.9480 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 bo.obrano valor from wsbodata bo where bo.ndos = 5 and boano=2025 order by obrano desc
20250217@143346.9640 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.9710 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='100999' and estab=0
20250217@143346.1125 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.1142 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 5
20250217@143346.1164 k54v6mf3kr0c88pejfpqpih1ng Query : insert into wsbo3data (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b345560267b348ca17',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20250217@143346.1176 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.1193 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 5
20250217@143346.1205 k54v6mf3kr0c88pejfpqpih1ng Query : insert into wsbo2data (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,xpddata,xpdhora,carga,descar) values ('aut67b345560267b348ca17','ga','bo',0 ,0,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut','20250217','15:03',?,?)
20250217@143346.1394 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.1415 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 5
20250217@143346.1433 k54v6mf3kr0c88pejfpqpih1ng Query : insert into wsbodata (bostamp, nmdos, dataobra, ndos, obrano, no, estab, nome, ncont, morada, local, codpost, moeda, boano, memissao,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,maquina ) values ('aut67b345560267b348ca17','trf entre armazéns a','2025-02-17',5,61,?,?,?,?,?,?,?,?,2025, (select valor from para1 where descricao = 'ge_euro') ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',?)
20250217@143346.1894 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.1899 k54v6mf3kr0c88pejfpqpih1ng Query : select st.usalote valor from st where st.ref = '325.1290.1003'
20250217@143346.1923 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.1928 k54v6mf3kr0c88pejfpqpih1ng Query : select st.stns valor from st where st.ref = '325.1290.1003'
20250217@143346.1948 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.1952 k54v6mf3kr0c88pejfpqpih1ng Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '325.1290.1003' and sa.armazem = 133 
20250217@143346.2053 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.2057 k54v6mf3kr0c88pejfpqpih1ng Query : select st.stns valor from st where st.ref = '325.1290.1003'
20250217@143346.2086 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '325.1290.1003'
20250217@143346.2254 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.2276 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143346.2291 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.2312 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143346.2334 k54v6mf3kr0c88pejfpqpih1ng Query : select sestamp valor from se where ref ='325.1290.1003' and lote = 'r2400796200a'
20250217@143346.2351 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143346.2365 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.2382 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143346.2394 k54v6mf3kr0c88pejfpqpih1ng Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b342294267b348ca39','aut67b345560267b348ca17',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b345560267b348ca17'
20250217@143346.2558 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.2586 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143346.2603 k54v6mf3kr0c88pejfpqpih1ng Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b342294267b348ca39',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 18.000, 18.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,10000 ,4.99,4.99*200.48,4.99,4.99*200.48 ,0,0,'un',' ' ,bo.marcada,1 ,4.99*18.000,4.99*18.000*200.48 ,.520000,.520000*200.48 ,.520000,.520000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,4.99,4.99*200.48,4.99*18.000,4.99*18.000*200.48,'pll25021361787,353000001 ',4.99,4.99*18.000,4.99,4.99*18.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b345560267b348ca17'
20250217@143346.2936 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.2941 k54v6mf3kr0c88pejfpqpih1ng Query : select st.usalote valor from st where st.ref = '324.2028.00.2'
20250217@143346.2957 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.2960 k54v6mf3kr0c88pejfpqpih1ng Query : select st.stns valor from st where st.ref = '324.2028.00.2'
20250217@143346.2980 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.2983 k54v6mf3kr0c88pejfpqpih1ng Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.2028.00.2' and sa.armazem = 133 
20250217@143346.3056 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.3059 k54v6mf3kr0c88pejfpqpih1ng Query : select st.stns valor from st where st.ref = '324.2028.00.2'
20250217@143346.3078 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.2028.00.2'
20250217@143346.3237 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.3259 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143346.3275 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.3291 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143346.3300 k54v6mf3kr0c88pejfpqpih1ng Query : select sestamp valor from se where ref ='324.2028.00.2' and lote = 'r2100875100a'
20250217@143346.3328 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143346.3342 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.3367 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143346.3382 k54v6mf3kr0c88pejfpqpih1ng Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b345035667b348ca51','aut67b345560267b348ca17',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b345560267b348ca17'
20250217@143346.3544 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.3566 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143346.3587 k54v6mf3kr0c88pejfpqpih1ng Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b345035667b348ca51',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 8.000, 8.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,20000 ,29.99,29.99*200.48,29.99,29.99*200.48 ,0,0,'un',' ' ,bo.marcada,1 ,29.99*8.000,29.99*8.000*200.48 ,8.580000,8.580000*200.48 ,8.580000,8.580000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,29.99,29.99*200.48,29.99*8.000,29.99*8.000*200.48,'pll25021361816,457000002 ',29.99,29.99*8.000,29.99,29.99*8.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b345560267b348ca17'
20250217@143346.3965 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.3970 k54v6mf3kr0c88pejfpqpih1ng Query : select st.usalote valor from st where st.ref = '324.1716.00.1'
20250217@143346.3991 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.3994 k54v6mf3kr0c88pejfpqpih1ng Query : select st.stns valor from st where st.ref = '324.1716.00.1'
20250217@143346.4009 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.4014 k54v6mf3kr0c88pejfpqpih1ng Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.1716.00.1' and sa.armazem = 133 
20250217@143346.4105 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.4109 k54v6mf3kr0c88pejfpqpih1ng Query : select st.stns valor from st where st.ref = '324.1716.00.1'
20250217@143346.4141 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1716.00.1'
20250217@143346.4343 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.4362 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143346.4374 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.4389 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143346.4397 k54v6mf3kr0c88pejfpqpih1ng Query : select sestamp valor from se where ref ='324.1716.00.1' and lote = 'r2100312300a'
20250217@143346.4424 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143346.4437 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.4452 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143346.4463 k54v6mf3kr0c88pejfpqpih1ng Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b340388667b348ca6c','aut67b345560267b348ca17',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b345560267b348ca17'
20250217@143346.4613 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.4633 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143346.4651 k54v6mf3kr0c88pejfpqpih1ng Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b340388667b348ca6c',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 8.000, 8.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,30000 ,34.99,34.99*200.48,34.99,34.99*200.48 ,0,0,'un',' ' ,bo.marcada,1 ,34.99*8.000,34.99*8.000*200.48 ,11.292000,11.292000*200.48 ,11.292000,11.292000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,34.99,34.99*200.48,34.99*8.000,34.99*8.000*200.48,'pll25021361904,040000003 ',34.99,34.99*8.000,34.99,34.99*8.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b345560267b348ca17'
20250217@143346.4981 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.4987 k54v6mf3kr0c88pejfpqpih1ng Query : select st.usalote valor from st where st.ref = '324.1317.00.1'
20250217@143346.5005 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.5007 k54v6mf3kr0c88pejfpqpih1ng Query : select st.stns valor from st where st.ref = '324.1317.00.1'
20250217@143346.5024 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.5028 k54v6mf3kr0c88pejfpqpih1ng Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.1317.00.1' and sa.armazem = 133 
20250217@143346.5107 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.5109 k54v6mf3kr0c88pejfpqpih1ng Query : select st.stns valor from st where st.ref = '324.1317.00.1'
20250217@143346.5128 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1317.00.1'
20250217@143346.5299 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.5318 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143346.5331 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.5353 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143346.5363 k54v6mf3kr0c88pejfpqpih1ng Query : select sestamp valor from se where ref ='324.1317.00.1' and lote = 'r2400459200a'
20250217@143346.5385 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143346.5401 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.5421 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143346.5435 k54v6mf3kr0c88pejfpqpih1ng Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b346427367b348ca83','aut67b345560267b348ca17',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b345560267b348ca17'
20250217@143346.5682 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.5759 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143346.5778 k54v6mf3kr0c88pejfpqpih1ng Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b346427367b348ca83',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 8.000, 8.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,40000 ,179.99,179.99*200.48,179.99,179.99*200.48 ,0,0,'un ','' ,bo.marcada,1 ,179.99*8.000,179.99*8.000*200.48 ,50.590000,50.590000*200.48 ,50.590000,50.590000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,179.99,179.99*200.48,179.99*8.000,179.99*8.000*200.48,'pll25021361969,302000004 ',179.99,179.99*8.000,179.99,179.99*8.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b345560267b348ca17'
20250217@143346.6199 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.6204 k54v6mf3kr0c88pejfpqpih1ng Query : select st.usalote valor from st where st.ref = '324.1667.00.1'
20250217@143346.6223 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.6227 k54v6mf3kr0c88pejfpqpih1ng Query : select st.stns valor from st where st.ref = '324.1667.00.1'
20250217@143346.6245 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.6248 k54v6mf3kr0c88pejfpqpih1ng Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.1667.00.1' and sa.armazem = 133 
20250217@143346.6328 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.6331 k54v6mf3kr0c88pejfpqpih1ng Query : select st.stns valor from st where st.ref = '324.1667.00.1'
20250217@143346.6350 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1667.00.1'
20250217@143346.6513 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.6534 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143346.6548 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.6566 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143346.6576 k54v6mf3kr0c88pejfpqpih1ng Query : select sestamp valor from se where ref ='324.1667.00.1' and lote = 'r2400923100a'
20250217@143346.6590 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143346.6604 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.6619 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143346.6631 k54v6mf3kr0c88pejfpqpih1ng Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b343756967b348caa1','aut67b345560267b348ca17',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b345560267b348ca17'
20250217@143346.6791 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.6810 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143346.6827 k54v6mf3kr0c88pejfpqpih1ng Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b343756967b348caa1',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 8.000, 8.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,50000 ,129.99,129.99*200.48,129.99,129.99*200.48 ,0,0,'un',' ' ,bo.marcada,1 ,129.99*8.000,129.99*8.000*200.48 ,33.202000,33.202000*200.48 ,33.202000,33.202000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,129.99,129.99*200.48,129.99*8.000,129.99*8.000*200.48,'pll25021361996,432000005 ',129.99,129.99*8.000,129.99,129.99*8.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b345560267b348ca17'
20250217@143346.7165 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.7173 k54v6mf3kr0c88pejfpqpih1ng Query : select st.usalote valor from st where st.ref = '324.2366.00.1'
20250217@143346.7195 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.7200 k54v6mf3kr0c88pejfpqpih1ng Query : select st.stns valor from st where st.ref = '324.2366.00.1'
20250217@143346.7219 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.7222 k54v6mf3kr0c88pejfpqpih1ng Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.2366.00.1' and sa.armazem = 133 
20250217@143346.7376 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.7380 k54v6mf3kr0c88pejfpqpih1ng Query : select st.stns valor from st where st.ref = '324.2366.00.1'
20250217@143346.7412 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.2366.00.1'
20250217@143346.7588 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.7605 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143346.7620 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.7638 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143346.7649 k54v6mf3kr0c88pejfpqpih1ng Query : select sestamp valor from se where ref ='324.2366.00.1' and lote = 'r2400498100a'
20250217@143346.7672 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143346.7685 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.7701 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143346.7720 k54v6mf3kr0c88pejfpqpih1ng Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b345862467b348cabb','aut67b345560267b348ca17',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b345560267b348ca17'
20250217@143346.7883 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.7904 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143346.7924 k54v6mf3kr0c88pejfpqpih1ng Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b345862467b348cabb',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 6.000, 6.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,60000 ,109.99,109.99*200.48,109.99,109.99*200.48 ,0,0,'un',' ' ,bo.marcada,1 ,109.99*6.000,109.99*6.000*200.48 ,29.441000,29.441000*200.48 ,29.441000,29.441000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,109.99,109.99*200.48,109.99*6.000,109.99*6.000*200.48,'pll25021362023,533000006 ',109.99,109.99*6.000,109.99,109.99*6.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b345560267b348ca17'
20250217@143346.8327 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.8349 k54v6mf3kr0c88pejfpqpih1ng Query : select st.usalote valor from st where st.ref = '327.8152.00.1'
20250217@143346.8369 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.8372 k54v6mf3kr0c88pejfpqpih1ng Query : select st.stns valor from st where st.ref = '327.8152.00.1'
20250217@143346.8390 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.8394 k54v6mf3kr0c88pejfpqpih1ng Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '327.8152.00.1' and sa.armazem = 133 
20250217@143346.8484 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.8487 k54v6mf3kr0c88pejfpqpih1ng Query : select st.stns valor from st where st.ref = '327.8152.00.1'
20250217@143346.8507 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '327.8152.00.1'
20250217@143346.8773 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.8792 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143346.8805 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.8819 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143346.8828 k54v6mf3kr0c88pejfpqpih1ng Query : select sestamp valor from se where ref ='327.8152.00.1' and lote = 'r2400077200a'
20250217@143346.8849 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143346.8862 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.8877 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143346.8888 k54v6mf3kr0c88pejfpqpih1ng Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b341691967b348cad8','aut67b345560267b348ca17',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b345560267b348ca17'
20250217@143346.9209 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143346.9362 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143346.9384 k54v6mf3kr0c88pejfpqpih1ng Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b341691967b348cad8',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 2.000, 2.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,70000 ,349.99,349.99*200.48,349.99,349.99*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,349.99*2.000,349.99*2.000*200.48 ,107.642000,107.642000*200.48 ,107.642000,107.642000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,349.99,349.99*200.48,349.99*2.000,349.99*2.000*200.48,'pll25021362046,536000007 ',349.99,349.99*2.000,349.99,349.99*2.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b345560267b348ca17'
20250217@143346.9723 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.9730 k54v6mf3kr0c88pejfpqpih1ng Query : select st.usalote valor from st where st.ref = '324.5540.00.1'
20250217@143346.9749 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.9752 k54v6mf3kr0c88pejfpqpih1ng Query : select st.stns valor from st where st.ref = '324.5540.00.1'
20250217@143346.9771 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.9774 k54v6mf3kr0c88pejfpqpih1ng Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.5540.00.1' and sa.armazem = 133 
20250217@143346.9870 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143346.9874 k54v6mf3kr0c88pejfpqpih1ng Query : select st.stns valor from st where st.ref = '324.5540.00.1'
20250217@143346.9902 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.5540.00.1'
20250217@143347.8200 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143347.1020 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143347.1230 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143347.1440 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143347.1540 k54v6mf3kr0c88pejfpqpih1ng Query : select sestamp valor from se where ref ='324.5540.00.1' and lote = 'r2300830100a'
20250217@143347.1780 k54v6mf3kr0c88pejfpqpih1ng Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143347.1930 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143347.2100 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143347.2240 k54v6mf3kr0c88pejfpqpih1ng Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b345841667b348cb04','aut67b345560267b348ca17',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b345560267b348ca17'
20250217@143347.3870 k54v6mf3kr0c88pejfpqpih1ng Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143347.4110 k54v6mf3kr0c88pejfpqpih1ng Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143347.4280 k54v6mf3kr0c88pejfpqpih1ng Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b345841667b348cb04',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 6.000, 6.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,80000 ,149.99,149.99*200.48,149.99,149.99*200.48 ,0,0,'un',' ' ,bo.marcada,1 ,149.99*6.000,149.99*6.000*200.48 ,36.952000,36.952000*200.48 ,36.952000,36.952000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,149.99,149.99*200.48,149.99*6.000,149.99*6.000*200.48,'pll25021362161,744000008 ',149.99,149.99*6.000,149.99,149.99*6.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b345560267b348ca17'
20250217@143347.7870 k54v6mf3kr0c88pejfpqpih1ng Query : insert into wsbocreationlog (initialstamp,externalid,creationstatus,documenttypeid,idustamp,transactionid) values ('aut67b345560267b348ca17','','wait',5,'adm12071144683,938000003','')
20250217@143347.9060 k54v6mf3kr0c88pejfpqpih1ng Query : use flama_phc
20250217@143347.9100 k54v6mf3kr0c88pejfpqpih1ng Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20250217@143347.9730 k54v6mf3kr0c88pejfpqpih1ng Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5388';
20250217@143347.1060 k54v6mf3kr0c88pejfpqpih1ng Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5388';
20250217@143347.1741 f3g21oiqd7f6nbkl2gjpo1osps Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250217@143347.1757 f3g21oiqd7f6nbkl2gjpo1osps Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250217@143347.1899 f3g21oiqd7f6nbkl2gjpo1osps Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5389';
20250217@143347.1983 f3g21oiqd7f6nbkl2gjpo1osps Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5389';
20250217@143347.2068 f3g21oiqd7f6nbkl2gjpo1osps Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5389';
20250217@143347.2122 f3g21oiqd7f6nbkl2gjpo1osps Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5389';
20250217@143347.2556 8fhesv8tpomrd79uih3gh208g6 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250217@143347.2568 8fhesv8tpomrd79uih3gh208g6 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250217@143347.2650 8fhesv8tpomrd79uih3gh208g6 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5390';
20250217@143347.2739 8fhesv8tpomrd79uih3gh208g6 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5390';
20250217@143347.2824 8fhesv8tpomrd79uih3gh208g6 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5390';
20250217@143347.2884 8fhesv8tpomrd79uih3gh208g6 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5390';
20250217@143347.2953 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143347.2958 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250217@143347.3039 8fhesv8tpomrd79uih3gh208g6 Query : select no, estab,szadrsdesc from szadrs where u_coddest=2
20250217@143347.3499 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '325.4961.0100'
20250217@143347.4066 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2025 and bo.obrano = 0000437 and bi.ref ='325.4961.0100' and bi.lordem =10000
20250217@143347.4732 8fhesv8tpomrd79uih3gh208g6 Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'az25021734792,939000001 ' 
20250217@143347.5101 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.4988.00.1'
20250217@143347.5127 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2025 and bo.obrano = 0000437 and bi.ref ='324.4988.00.1' and bi.lordem =20000
20250217@143347.5473 8fhesv8tpomrd79uih3gh208g6 Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'az25021735483,328000002 ' 
20250217@143347.5834 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1667.00.1'
20250217@143347.5979 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2025 and bo.obrano = 0000437 and bi.ref ='324.1667.00.1' and bi.lordem =30000
20250217@143347.6435 8fhesv8tpomrd79uih3gh208g6 Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'az25021735494,313000003 ' 
20250217@143347.6812 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1667.00.1'
20250217@143347.6837 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2025 and bo.obrano = 0000437 and bi.ref ='324.1667.00.1' and bi.lordem =30000
20250217@143347.6875 8fhesv8tpomrd79uih3gh208g6 Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'az25021735494,313000003 ' 
20250217@143347.6900 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1676.00.1'
20250217@143347.7044 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2025 and bo.obrano = 0000437 and bi.ref ='324.1676.00.1' and bi.lordem =40000
20250217@143347.7451 8fhesv8tpomrd79uih3gh208g6 Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'az25021735505,371000004 ' 
20250217@143347.7821 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1837.00.1'
20250217@143347.8028 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2025 and bo.obrano = 0000437 and bi.ref ='324.1837.00.1' and bi.lordem =50000
20250217@143347.8419 8fhesv8tpomrd79uih3gh208g6 Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'az25021735517,437000005 ' 
20250217@143347.8786 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1837.00.1'
20250217@143347.8815 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2025 and bo.obrano = 0000437 and bi.ref ='324.1837.00.1' and bi.lordem =50000
20250217@143347.8843 8fhesv8tpomrd79uih3gh208g6 Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'az25021735517,437000005 ' 
20250217@143347.8875 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1332.00.1'
20250217@143347.9106 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2025 and bo.obrano = 0000437 and bi.ref ='324.1332.00.1' and bi.lordem =60000
20250217@143347.9658 8fhesv8tpomrd79uih3gh208g6 Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'az25021735530,272000006 ' 
20250217@143347.9999 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '325.1675.3015'
20250217@143348.2170 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2025 and bo.obrano = 0000437 and bi.ref ='325.1675.3015' and bi.lordem =70000
20250217@143348.6130 8fhesv8tpomrd79uih3gh208g6 Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'az25021735541,365000007 ' 
20250217@143348.1290 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '328.9075.00.1'
20250217@143348.1421 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2025 and bo.obrano = 0000437 and bi.ref ='328.9075.00.1' and bi.lordem =80000
20250217@143348.1816 8fhesv8tpomrd79uih3gh208g6 Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'az25021735562,033000008 ' 
20250217@143348.2200 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.646.00.01'
20250217@143348.2235 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2025 and bo.obrano = 0000437 and bi.ref ='324.646.00.01' and bi.lordem =90000
20250217@143348.2589 8fhesv8tpomrd79uih3gh208g6 Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'az25021735588,369000009 ' 
20250217@143348.2974 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.645.00.01'
20250217@143348.3008 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2025 and bo.obrano = 0000437 and bi.ref ='324.645.00.01' and bi.lordem =100000
20250217@143348.3367 8fhesv8tpomrd79uih3gh208g6 Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'az25021735604,942000010 ' 
20250217@143348.3702 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1892.00.1'
20250217@143348.3844 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2025 and bo.obrano = 0000437 and bi.ref ='324.1892.00.1' and bi.lordem =110000
20250217@143348.4228 8fhesv8tpomrd79uih3gh208g6 Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'az25021735626,313000011 ' 
20250217@143348.4580 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1817.00.1'
20250217@143348.4719 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2025 and bo.obrano = 0000437 and bi.ref ='324.1817.00.1' and bi.lordem =120000
20250217@143348.5079 8fhesv8tpomrd79uih3gh208g6 Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'az25021735637,914000012 ' 
20250217@143348.5490 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143348.5494 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 1 valor from ts where ts.ndos = 5
20250217@143348.5539 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143348.5542 8fhesv8tpomrd79uih3gh208g6 Query : select lower(descricao) descricao ,case when valor='s' then 1 else 0 end valor from para1 where descricao in ('st_lote','st_usalogifunc', 'st_grelha')
20250217@143348.5575 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 assinadoc issigned ,ts.stocks ,ts.bdempresas origin ,case when (cmstocks between 1 and 50 or cm2stocks between 1 and 50 ) then 1 else 0 end entrada ,case when cmstocks>50 or (cm2stocks>50 and trfa =1) then 1 else 0 end saida ,stneg validatestock ,tiposaft ,veserie useserialnumber ,foserie assetin ,ftserie assetout ,veserie assets ,trfarm assetstransfer ,grelha usegridfields from ts inner join ts2 on ts.tsstamp=ts2.ts2stamp where ts.ndos =5
20250217@143348.5618 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143348.5621 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 ~inactivo valor from fl where no = '100500' and estab = 0 order by inactivo desc
20250217@143348.5673 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143348.5677 8fhesv8tpomrd79uih3gh208g6 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250217@143348.5740 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143348.5743 8fhesv8tpomrd79uih3gh208g6 Query : select szadrsstamp valor from szadrs where szadrsdesc='n/instalaÇÕes sede'
20250217@143348.5806 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143348.5809 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from ts where ndos = 5
20250217@143348.5881 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143348.5903 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 5
20250217@143348.5932 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143348.5951 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 5
20250217@143348.5962 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143348.5983 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 5
20250217@143348.5995 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 ts2.manternumero, ts.tiposaft, ts.idserie,ts.nmdos,ts.bdempresas from ts inner join ts2 on ts.tsstamp=ts2.ts2stamp where ts.ndos = 5
20250217@143348.6013 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 5 and boano=2025 order by obrano desc
20250217@143348.6048 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 bo.obrano valor from wsbodata bo where bo.ndos = 5 and boano=2025 order by obrano desc
20250217@143348.6065 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143348.6072 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='100500' and estab=0
20250217@143348.6091 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143348.6109 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 5
20250217@143348.6122 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbo3data (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b343092167b348cc94',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20250217@143348.6127 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143348.6174 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 5
20250217@143348.6188 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbo2data (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,xpddata,xpdhora,carga,descar) values ('aut67b343092167b348cc94','ga','bo',0 ,0,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut','20250217','15:03',?,?)
20250217@143348.6378 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143348.6399 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 5
20250217@143348.6419 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbodata (bostamp, nmdos, dataobra, ndos, obrano, no, estab, nome, ncont, morada, local, codpost, moeda, boano, memissao,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,maquina ) values ('aut67b343092167b348cc94','trf entre armazéns a','2025-02-17',5,62,?,?,?,?,?,?,?,?,2025, (select valor from para1 where descricao = 'ge_euro') ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',?)
20250217@143348.7039 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143348.7122 8fhesv8tpomrd79uih3gh208g6 Query : select st.usalote valor from st where st.ref = '325.4961.0100'
20250217@143348.7510 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143348.7594 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '325.4961.0100'
20250217@143348.7655 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143348.7658 8fhesv8tpomrd79uih3gh208g6 Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '325.4961.0100' and sa.armazem = 133 
20250217@143348.8232 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143348.8236 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '325.4961.0100'
20250217@143348.8263 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '325.4961.0100'
20250217@143348.8425 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143348.8445 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143348.8458 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143348.8487 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143348.8497 8fhesv8tpomrd79uih3gh208g6 Query : select sestamp valor from se where ref ='325.4961.0100' and lote = 'r210109215'
20250217@143348.8533 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143348.8547 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143348.8567 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143348.8582 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b341791067b348ccd0','aut67b343092167b348cc94',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143348.8754 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143348.8779 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143348.8801 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b341791067b348ccd0',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 30.000, 30.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,10000 ,6.4,6.4*200.48,6.4,6.4*200.48 ,0,0,'un ','' ,bo.marcada,1 ,6.4*30.000,6.4*30.000*200.48 ,2.566000,2.566000*200.48 ,2.566000,2.566000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,6.4,6.4*200.48,6.4*30.000,6.4*30.000*200.48,'az25021734792,939000001 ',6.4,6.4*30.000,6.4,6.4*30.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143348.9122 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143348.9127 8fhesv8tpomrd79uih3gh208g6 Query : select st.usalote valor from st where st.ref = '324.4988.00.1'
20250217@143348.9145 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143348.9147 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.4988.00.1'
20250217@143348.9167 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143348.9170 8fhesv8tpomrd79uih3gh208g6 Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.4988.00.1' and sa.armazem = 133 
20250217@143348.9266 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143348.9269 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.4988.00.1'
20250217@143348.9289 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.4988.00.1'
20250217@143348.9453 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143348.9470 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143348.9483 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143348.9499 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143348.9507 8fhesv8tpomrd79uih3gh208g6 Query : select sestamp valor from se where ref ='324.4988.00.1' and lote = 'r2100754100a'
20250217@143348.9520 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143348.9534 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143348.9548 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143348.9561 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b347728267b348cce8','aut67b343092167b348cc94',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143348.9756 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143348.9916 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143348.9933 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b347728267b348cce8',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 16.000, 16.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,20000 ,28.8,28.8*200.48,28.8,28.8*200.48 ,0,0,'un ','' ,bo.marcada,1 ,28.8*16.000,28.8*16.000*200.48 ,8.445000,8.445000*200.48 ,8.445000,8.445000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,28.8,28.8*200.48,28.8*16.000,28.8*16.000*200.48,'az25021735483,328000002 ',28.8,28.8*16.000,28.8,28.8*16.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143349.2360 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.2420 8fhesv8tpomrd79uih3gh208g6 Query : select st.usalote valor from st where st.ref = '324.1667.00.1'
20250217@143349.2580 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.2620 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.1667.00.1'
20250217@143349.2810 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.2920 8fhesv8tpomrd79uih3gh208g6 Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.1667.00.1' and sa.armazem = 133 
20250217@143349.3160 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.3200 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.1667.00.1'
20250217@143349.3470 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1667.00.1'
20250217@143349.3640 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.3840 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143349.3990 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.4230 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143349.4730 8fhesv8tpomrd79uih3gh208g6 Query : select sestamp valor from se where ref ='324.1667.00.1' and lote = 'r2400923100a'
20250217@143349.4910 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143349.5160 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.5370 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143349.5510 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b342711467b348cd0c','aut67b343092167b348cc94',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143349.7660 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.7930 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143349.8180 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b342711467b348cd0c',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 5.000, 5.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,30000 ,89.6,89.6*200.48,89.6,89.6*200.48 ,0,0,'un',' ' ,bo.marcada,1 ,89.6*5.000,89.6*5.000*200.48 ,33.202000,33.202000*200.48 ,33.202000,33.202000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,89.6,89.6*200.48,89.6*5.000,89.6*5.000*200.48,'az25021735494,313000003 ',89.6,89.6*5.000,89.6,89.6*5.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143349.1183 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.1188 8fhesv8tpomrd79uih3gh208g6 Query : select st.usalote valor from st where st.ref = '324.1667.00.1'
20250217@143349.1208 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.1211 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.1667.00.1'
20250217@143349.1232 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.1235 8fhesv8tpomrd79uih3gh208g6 Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.1667.00.1' and sa.armazem = 133 
20250217@143349.1260 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.1263 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.1667.00.1'
20250217@143349.1296 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1667.00.1'
20250217@143349.1329 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.1350 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143349.1366 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.1385 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143349.1396 8fhesv8tpomrd79uih3gh208g6 Query : select sestamp valor from se where ref ='324.1667.00.1' and lote = 'r2400923100a'
20250217@143349.1412 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143349.1429 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.1449 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143349.1464 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b344088367b348cd22','aut67b343092167b348cc94',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143349.1676 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.1702 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143349.1784 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b344088367b348cd22',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 7.000, 7.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,40000 ,89.6,89.6*200.48,89.6,89.6*200.48 ,0,0,'un',' ' ,bo.marcada,1 ,89.6*7.000,89.6*7.000*200.48 ,33.202000,33.202000*200.48 ,33.202000,33.202000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,89.6,89.6*200.48,89.6*7.000,89.6*7.000*200.48,'az25021735494,313000003 ',89.6,89.6*7.000,89.6,89.6*7.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143349.2152 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.2158 8fhesv8tpomrd79uih3gh208g6 Query : select st.usalote valor from st where st.ref = '324.1676.00.1'
20250217@143349.2201 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.2204 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.1676.00.1'
20250217@143349.2221 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.2224 8fhesv8tpomrd79uih3gh208g6 Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.1676.00.1' and sa.armazem = 133 
20250217@143349.2304 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.2307 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.1676.00.1'
20250217@143349.2373 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1676.00.1'
20250217@143349.2550 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.2565 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143349.2622 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.2640 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143349.2671 8fhesv8tpomrd79uih3gh208g6 Query : select sestamp valor from se where ref ='324.1676.00.1' and lote = 'r2400173900a'
20250217@143349.2689 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143349.2701 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.2791 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143349.2804 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b340591167b348cd41','aut67b343092167b348cc94',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143349.2969 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.3038 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143349.3080 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b340591167b348cd41',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 12.000, 12.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,50000 ,57.6,57.6*200.48,57.6,57.6*200.48 ,0,0,'un',' ' ,bo.marcada,1 ,57.6*12.000,57.6*12.000*200.48 ,24.530000,24.530000*200.48 ,24.530000,24.530000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,57.6,57.6*200.48,57.6*12.000,57.6*12.000*200.48,'az25021735505,371000004 ',57.6,57.6*12.000,57.6,57.6*12.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143349.3430 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.3444 8fhesv8tpomrd79uih3gh208g6 Query : select st.usalote valor from st where st.ref = '324.1837.00.1'
20250217@143349.3462 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.3465 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.1837.00.1'
20250217@143349.3481 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.3483 8fhesv8tpomrd79uih3gh208g6 Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.1837.00.1' and sa.armazem = 133 
20250217@143349.3556 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.3558 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.1837.00.1'
20250217@143349.3577 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1837.00.1'
20250217@143349.3729 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.3745 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143349.3758 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.3773 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143349.3781 8fhesv8tpomrd79uih3gh208g6 Query : select sestamp valor from se where ref ='324.1837.00.1' and lote = 'r2301207300a'
20250217@143349.3795 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143349.3807 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.3821 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143349.3835 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b347862067b348cd5c','aut67b343092167b348cc94',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143349.4021 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.4042 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143349.4060 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b347862067b348cd5c',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 8.000, 8.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,60000 ,86.3,86.3*200.48,86.3,86.3*200.48 ,0,0,'un',' ' ,bo.marcada,1 ,86.3*8.000,86.3*8.000*200.48 ,41.869000,41.869000*200.48 ,41.869000,41.869000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,86.3,86.3*200.48,86.3*8.000,86.3*8.000*200.48,'az25021735517,437000005 ',86.3,86.3*8.000,86.3,86.3*8.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143349.4367 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.4373 8fhesv8tpomrd79uih3gh208g6 Query : select st.usalote valor from st where st.ref = '324.1837.00.1'
20250217@143349.4389 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.4393 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.1837.00.1'
20250217@143349.4410 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.4412 8fhesv8tpomrd79uih3gh208g6 Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.1837.00.1' and sa.armazem = 133 
20250217@143349.4475 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.4478 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.1837.00.1'
20250217@143349.4499 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1837.00.1'
20250217@143349.4515 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.4544 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143349.4557 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.4573 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143349.4583 8fhesv8tpomrd79uih3gh208g6 Query : select sestamp valor from se where ref ='324.1837.00.1' and lote = 'r2301207300a'
20250217@143349.4597 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143349.4610 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.4626 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143349.4641 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b342043367b348cd70','aut67b343092167b348cc94',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143349.4799 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.4819 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143349.4837 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b342043367b348cd70',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 4.000, 4.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,70000 ,86.3,86.3*200.48,86.3,86.3*200.48 ,0,0,'un',' ' ,bo.marcada,1 ,86.3*4.000,86.3*4.000*200.48 ,41.869000,41.869000*200.48 ,41.869000,41.869000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,86.3,86.3*200.48,86.3*4.000,86.3*4.000*200.48,'az25021735517,437000005 ',86.3,86.3*4.000,86.3,86.3*4.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143349.5168 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.5174 8fhesv8tpomrd79uih3gh208g6 Query : select st.usalote valor from st where st.ref = '324.1332.00.1'
20250217@143349.5190 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.5194 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.1332.00.1'
20250217@143349.5210 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.5213 8fhesv8tpomrd79uih3gh208g6 Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.1332.00.1' and sa.armazem = 133 
20250217@143349.5295 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.5298 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.1332.00.1'
20250217@143349.5318 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1332.00.1'
20250217@143349.5480 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.5500 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143349.5513 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.5538 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143349.5548 8fhesv8tpomrd79uih3gh208g6 Query : select sestamp valor from se where ref ='324.1332.00.1' and lote = 'r2400759200a'
20250217@143349.5563 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143349.5577 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.5593 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143349.5606 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b345717967b348cd88','aut67b343092167b348cc94',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143349.5761 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.5783 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143349.5803 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b345717967b348cd88',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 8.000, 8.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,80000 ,192,192*200.48,192,192*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,192*8.000,192*8.000*200.48 ,82.639000,82.639000*200.48 ,82.639000,82.639000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,192,192*200.48,192*8.000,192*8.000*200.48,'az25021735530,272000006 ',192,192*8.000,192,192*8.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143349.6131 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.6137 8fhesv8tpomrd79uih3gh208g6 Query : select st.usalote valor from st where st.ref = '325.1675.3015'
20250217@143349.6155 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.6158 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '325.1675.3015'
20250217@143349.6182 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.6185 8fhesv8tpomrd79uih3gh208g6 Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '325.1675.3015' and sa.armazem = 133 
20250217@143349.6259 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.6262 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '325.1675.3015'
20250217@143349.6289 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '325.1675.3015'
20250217@143349.6454 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.6473 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143349.6487 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.6501 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143349.6511 8fhesv8tpomrd79uih3gh208g6 Query : select sestamp valor from se where ref ='325.1675.3015' and lote = '1303'
20250217@143349.6542 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143349.6555 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.6574 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143349.6588 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b348538267b348cda0','aut67b343092167b348cc94',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143349.6761 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.6781 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143349.6798 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b348538267b348cda0',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 18.000, 18.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,90000 ,6.4,6.4*200.48,6.4,6.4*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,6.4*18.000,6.4*18.000*200.48 ,2.750000,2.750000*200.48 ,2.750000,2.750000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,6.4,6.4*200.48,6.4*18.000,6.4*18.000*200.48,'az25021735541,365000007 ',6.4,6.4*18.000,6.4,6.4*18.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143349.7092 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.7097 8fhesv8tpomrd79uih3gh208g6 Query : select st.usalote valor from st where st.ref = '328.9075.00.1'
20250217@143349.7113 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.7116 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '328.9075.00.1'
20250217@143349.7131 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.7134 8fhesv8tpomrd79uih3gh208g6 Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '328.9075.00.1' and sa.armazem = 133 
20250217@143349.7213 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.7216 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '328.9075.00.1'
20250217@143349.7236 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '328.9075.00.1'
20250217@143349.7389 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.7447 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143349.7503 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.7542 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143349.7555 8fhesv8tpomrd79uih3gh208g6 Query : select sestamp valor from se where ref ='328.9075.00.1' and lote = 'r2400212150a'
20250217@143349.7579 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143349.7594 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.7612 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143349.7627 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b348117467b348cdb9','aut67b343092167b348cc94',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143349.7805 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.7827 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143349.7846 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b348117467b348cdb9',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 6.000, 6.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,100000 ,160,160*200.48,160,160*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,160*6.000,160*6.000*200.48 ,78.369000,78.369000*200.48 ,78.369000,78.369000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,160,160*200.48,160*6.000,160*6.000*200.48,'az25021735562,033000008 ',160,160*6.000,160,160*6.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143349.8228 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.8234 8fhesv8tpomrd79uih3gh208g6 Query : select st.usalote valor from st where st.ref = '324.646.00.01'
20250217@143349.8263 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.8267 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.646.00.01'
20250217@143349.8286 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.8290 8fhesv8tpomrd79uih3gh208g6 Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.646.00.01' and sa.armazem = 133 
20250217@143349.8316 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.8319 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.646.00.01'
20250217@143349.8339 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.646.00.01'
20250217@143349.8358 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.8376 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143349.8401 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.8420 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143349.8561 8fhesv8tpomrd79uih3gh208g6 Query : select sestamp valor from se where ref ='324.646.00.01' and lote = 'r2401265300a'
20250217@143349.8576 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143349.8590 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.8610 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143349.8624 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b341574767b348cdd1','aut67b343092167b348cc94',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143349.8808 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.8834 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143349.8854 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b341574767b348cdd1',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 9.000, 9.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,110000 ,44.8,44.8*200.48,44.8,44.8*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,44.8*9.000,44.8*9.000*200.48 ,15.014000,15.014000*200.48 ,15.014000,15.014000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,44.8,44.8*200.48,44.8*9.000,44.8*9.000*200.48,'az25021735588,369000009 ',44.8,44.8*9.000,44.8,44.8*9.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143349.9248 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.9282 8fhesv8tpomrd79uih3gh208g6 Query : select st.usalote valor from st where st.ref = '324.645.00.01'
20250217@143349.9302 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.9305 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.645.00.01'
20250217@143349.9343 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.9361 8fhesv8tpomrd79uih3gh208g6 Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.645.00.01' and sa.armazem = 133 
20250217@143349.9438 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143349.9442 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.645.00.01'
20250217@143349.9463 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.645.00.01'
20250217@143349.9498 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.9516 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143349.9540 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.9558 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143349.9566 8fhesv8tpomrd79uih3gh208g6 Query : select sestamp valor from se where ref ='324.645.00.01' and lote = 'r2401265200a'
20250217@143349.9592 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143349.9605 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143349.9636 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143349.9726 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b343228167b348cdea','aut67b343092167b348cc94',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143349.9909 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143350.1350 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143350.1640 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b343228167b348cdea',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 9.000, 9.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,120000 ,44.8,44.8*200.48,44.8,44.8*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,44.8*9.000,44.8*9.000*200.48 ,14.080000,14.080000*200.48 ,14.080000,14.080000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,44.8,44.8*200.48,44.8*9.000,44.8*9.000*200.48,'az25021735604,942000010 ',44.8,44.8*9.000,44.8,44.8*9.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143350.5190 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143350.5250 8fhesv8tpomrd79uih3gh208g6 Query : select st.usalote valor from st where st.ref = '324.1892.00.1'
20250217@143350.5450 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143350.5480 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.1892.00.1'
20250217@143350.5690 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143350.5720 8fhesv8tpomrd79uih3gh208g6 Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.1892.00.1' and sa.armazem = 133 
20250217@143350.6670 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143350.6700 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.1892.00.1'
20250217@143350.6930 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1892.00.1'
20250217@143350.8710 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143350.8910 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143350.9070 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143350.1338 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143350.1918 8fhesv8tpomrd79uih3gh208g6 Query : select sestamp valor from se where ref ='324.1892.00.1' and lote = 'r2400760200a'
20250217@143350.2374 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143350.2611 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143350.2632 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143350.2647 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b344386767b348ce3f','aut67b343092167b348cc94',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143350.2816 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143350.2846 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143350.2866 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b344386767b348ce3f',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 4.000, 4.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,130000 ,187.5,187.5*200.48,187.5,187.5*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,187.5*4.000,187.5*4.000*200.48 ,81.691000,81.691000*200.48 ,81.691000,81.691000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,187.5,187.5*200.48,187.5*4.000,187.5*4.000*200.48,'az25021735626,313000011 ',187.5,187.5*4.000,187.5,187.5*4.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143350.3249 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143350.3256 8fhesv8tpomrd79uih3gh208g6 Query : select st.usalote valor from st where st.ref = '324.1817.00.1'
20250217@143350.3278 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143350.3281 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.1817.00.1'
20250217@143350.3299 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143350.3303 8fhesv8tpomrd79uih3gh208g6 Query : select isnull(sum(stock) ,0)stock ,isnull(sum(qttrec),0) qttrec ,0 qttcat ,isnull(sum(rescli),0) rescli ,isnull(sum(resfor),0) resfor from sa where sa.ref = '324.1817.00.1' and sa.armazem = 133 
20250217@143350.3391 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143350.3394 8fhesv8tpomrd79uih3gh208g6 Query : select st.stns valor from st where st.ref = '324.1817.00.1'
20250217@143350.3423 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1817.00.1'
20250217@143350.3630 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143350.3649 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143350.3668 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143350.3694 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143350.3705 8fhesv8tpomrd79uih3gh208g6 Query : select sestamp valor from se where ref ='324.1817.00.1' and lote = 'r2400484200a'
20250217@143350.3729 8fhesv8tpomrd79uih3gh208g6 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@143350.3745 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143350.3763 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 5
20250217@143350.3777 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbi2data (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b340588667b348ce5b','aut67b343092167b348cc94',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143350.3946 8fhesv8tpomrd79uih3gh208g6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@143350.3973 8fhesv8tpomrd79uih3gh208g6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 5
20250217@143350.3991 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbidata (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,ar2mazem,obistamp ,stipo) select 'aut67b340588667b348ce5b',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 20.000, 20.000*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,140000 ,52.5,52.5*200.48,52.5,52.5*200.48 ,0,0,'un',' ' ,bo.marcada,1 ,52.5*20.000,52.5*20.000*200.48 ,25.508000,25.508000*200.48 ,25.508000,25.508000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,52.5,52.5*200.48,52.5*20.000,52.5*20.000*200.48,'az25021735637,914000012 ',52.5,52.5*20.000,52.5,52.5*20.000,?,?,?,?,4 from wsbodata bo where bo.bostamp = 'aut67b343092167b348cc94'
20250217@143350.4801 8fhesv8tpomrd79uih3gh208g6 Query : insert into wsbocreationlog (initialstamp,externalid,creationstatus,documenttypeid,idustamp,transactionid) values ('aut67b343092167b348cc94','','wait',5,'adm12071144683,938000003','')
20250217@143350.4899 8fhesv8tpomrd79uih3gh208g6 Query : use flama_phc
20250217@143350.4903 8fhesv8tpomrd79uih3gh208g6 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20250217@143350.4971 8fhesv8tpomrd79uih3gh208g6 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5390';
20250217@143350.5030 8fhesv8tpomrd79uih3gh208g6 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5390';

20250217@150346.5699 bvgga250121dsdbsjaunj8aboj Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5391';
20250217@150346.5780 bvgga250121dsdbsjaunj8aboj Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5391';
20250217@150346.5821 bvgga250121dsdbsjaunj8aboj Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5391';
20250217@150346.6031 bvgga250121dsdbsjaunj8aboj Query : use flama_phc
20250217@150346.6082 bvgga250121dsdbsjaunj8aboj Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250217@150346.6174 bvgga250121dsdbsjaunj8aboj Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.657.00.01'
20250217@150346.6313 bvgga250121dsdbsjaunj8aboj Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =002 and bo.boano =2024 and bo.obrano = 2401262 and bi.ref ='324.657.00.01' and bi.lordem =20000
20250217@150346.6773 bvgga250121dsdbsjaunj8aboj Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'cps24110178130,972000002 ' 
20250217@150346.7115 bvgga250121dsdbsjaunj8aboj Query : use flama_phc
20250217@150346.7118 bvgga250121dsdbsjaunj8aboj Query : select top 1 1 valor from ts where ts.ndos = 61
20250217@150346.7195 bvgga250121dsdbsjaunj8aboj Query : use flama_phc
20250217@150346.7199 bvgga250121dsdbsjaunj8aboj Query : select lower(descricao) descricao ,case when valor='s' then 1 else 0 end valor from para1 where descricao in ('st_lote','st_usalogifunc', 'st_grelha')
20250217@150346.7228 bvgga250121dsdbsjaunj8aboj Query : select top 1 assinadoc issigned ,ts.stocks ,ts.bdempresas origin ,case when (cmstocks between 1 and 50 or cm2stocks between 1 and 50 ) then 1 else 0 end entrada ,case when cmstocks>50 or (cm2stocks>50 and trfa =1) then 1 else 0 end saida ,stneg validatestock ,tiposaft ,veserie useserialnumber ,foserie assetin ,ftserie assetout ,veserie assets ,trfarm assetstransfer ,grelha usegridfields from ts inner join ts2 on ts.tsstamp=ts2.ts2stamp where ts.ndos =61
20250217@150346.7271 bvgga250121dsdbsjaunj8aboj Query : use flama_phc
20250217@150346.7274 bvgga250121dsdbsjaunj8aboj Query : select top 1 ~inactivo valor from fl where no = '202090' and estab = 00 order by inactivo desc
20250217@150346.7425 bvgga250121dsdbsjaunj8aboj Query : use flama_phc
20250217@150346.7428 bvgga250121dsdbsjaunj8aboj Query : select 1 valor from ts where ndos = 61
20250217@150346.7441 bvgga250121dsdbsjaunj8aboj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@150346.7459 bvgga250121dsdbsjaunj8aboj Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20250217@150346.7468 bvgga250121dsdbsjaunj8aboj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@150346.7483 bvgga250121dsdbsjaunj8aboj Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20250217@150346.7493 bvgga250121dsdbsjaunj8aboj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@150346.7508 bvgga250121dsdbsjaunj8aboj Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20250217@150346.7535 bvgga250121dsdbsjaunj8aboj Query : select top 1 ts2.manternumero, ts.tiposaft, ts.idserie,ts.nmdos,ts.bdempresas from ts inner join ts2 on ts.tsstamp=ts2.ts2stamp where ts.ndos = 61
20250217@150346.7560 bvgga250121dsdbsjaunj8aboj Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2025 order by obrano desc
20250217@150346.7592 bvgga250121dsdbsjaunj8aboj Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2025 order by obrano desc
20250217@150346.7614 bvgga250121dsdbsjaunj8aboj Query : use flama_phc
20250217@150346.7621 bvgga250121dsdbsjaunj8aboj Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202090' and estab=00
20250217@150346.7718 bvgga250121dsdbsjaunj8aboj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@150346.7734 bvgga250121dsdbsjaunj8aboj Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20250217@150346.7748 bvgga250121dsdbsjaunj8aboj Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b342708167b34fd2b9',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20250217@150346.7758 bvgga250121dsdbsjaunj8aboj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@150346.7780 bvgga250121dsdbsjaunj8aboj Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20250217@150346.7792 bvgga250121dsdbsjaunj8aboj Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b342708167b34fd2b9','--','bo',7.8581250000000000000 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20250217@150346.7812 bvgga250121dsdbsjaunj8aboj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@150346.7841 bvgga250121dsdbsjaunj8aboj Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20250217@150346.7853 bvgga250121dsdbsjaunj8aboj Query : insert into bo (bostamp, nmdos, dataobra, ndos, obrano, no, estab, nome, ncont, morada, local, codpost, moeda, boano, memissao,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b342708167b34fd2b9','guia r. fornecedor','2025-02-17',61,2500623,?,?,?,?,?,?,?,?,2025, (select valor from para1 where descricao = 'ge_euro') ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20250217@150349.7315 bvgga250121dsdbsjaunj8aboj Query : use flama_phc
20250217@150349.7318 bvgga250121dsdbsjaunj8aboj Query : select st.usalote valor from st where st.ref = '324.657.00.01'
20250217@150349.7345 bvgga250121dsdbsjaunj8aboj Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.657.00.01'
20250217@150349.7496 bvgga250121dsdbsjaunj8aboj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@150349.7512 bvgga250121dsdbsjaunj8aboj Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20250217@150349.7526 bvgga250121dsdbsjaunj8aboj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@150349.7543 bvgga250121dsdbsjaunj8aboj Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20250217@150349.7552 bvgga250121dsdbsjaunj8aboj Query : select sestamp valor from se where ref ='324.657.00.01' and lote = 'r2401262200a'
20250217@150349.7567 bvgga250121dsdbsjaunj8aboj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@150349.7582 bvgga250121dsdbsjaunj8aboj Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20250217@150349.7591 bvgga250121dsdbsjaunj8aboj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@150349.7606 bvgga250121dsdbsjaunj8aboj Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20250217@150349.7619 bvgga250121dsdbsjaunj8aboj Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b348406067b34fd5b9',?,?,'20250217',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20250217@150349.8261 bvgga250121dsdbsjaunj8aboj Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250217@150349.8278 bvgga250121dsdbsjaunj8aboj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@150349.8297 bvgga250121dsdbsjaunj8aboj Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20250217@150349.8310 bvgga250121dsdbsjaunj8aboj Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b340025767b34fd5ca','aut67b342708167b34fd2b9',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from bo bo where bo.bostamp = 'aut67b342708167b34fd2b9'
20250217@150349.8481 bvgga250121dsdbsjaunj8aboj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250217@150349.8499 bvgga250121dsdbsjaunj8aboj Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20250217@150349.8520 bvgga250121dsdbsjaunj8aboj Query : insert into bi (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,obistamp ,stipo) select 'aut67b340025767b34fd5ca',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1428, 1428*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,10000 ,16,16*200.48,16,16*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,16*1428,16*1428*200.48 ,19.590000,19.590000*200.48 ,19.590000,19.590000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,16,16*200.48,16*1428,16*1428*200.48,'cps24110178130,972000002 ',125.73,125.73*1428,125.73,125.73*1428,?,?,?,4 from bo bo where bo.bostamp = 'aut67b342708167b34fd2b9'
20250217@150357.1181 bvgga250121dsdbsjaunj8aboj Query : use flama_phc
20250217@150357.1187 bvgga250121dsdbsjaunj8aboj Query : declare @bostamp varchar(25) = 'aut67b342708167b34fd2b9' ,@bistamp varchar(25) = '' update bi set tecoval = qtt * ecoval ,etecoval = qtt * eecoval ,tecoval2 = qtt * ecoval2 ,etecoval2 = qtt * eecoval2 where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end -- se tiver classificação e não for normal, não calcula nada update bi set ttdeb = 0 ,ettdeb = 0 ,ttmoeda = 0 where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and bi.classifc <> '' and bi.classifc <> 'normal' -- no caso normal com moeda euro if exists ( select 1 from bo cross apply ( select valor moeda from para1 where descricao = 'ge_pteoueuro' ) par where bo.bostamp = @bostamp and bo.moeda = par.moeda ) begin -- sem ecovalores update bi set ettdeb = round(bi.qtt * ((bi.edebito * (1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100))), 6) ,ttdeb = round(bi.qtt * ((bi.debito * (1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100))), 6) ,ttmoeda = 0 from bi inner join bo on bi.bostamp = bo.bostamp where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and ( bi.classifc = '' or bi.classifc = 'normal' ) and bi.econotcalc = 1 -- com ecovalores update bi set ettdeb = round(bi.qtt * ( ( bi.edebito + ( iif(p.st_econotdesc = 1, - bi.eecoval2, bi.eecoval) * ( 1 + iif(bi.ivaincl = 1 and tiva.taxa <> 0, tiva.taxa / 100, 0) ) ) ) * (1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) ), 6) + ( bi.qtt * iif(p.st_econotdesc = 1, (bi.eecoval + bi.eecoval2) * ( 1 + iif(bi.ivaincl = 1 and tiva.taxa <> 0, tiva.taxa / 100, 0) ), 0) ) ,ttdeb = round(bi.qtt * ( ( bi.debito + ( iif(p.st_econotdesc = 1, - bi.ecoval2, bi.ecoval) * ( 1 + iif(bi.ivaincl = 1 and tiva.taxa <> 0, tiva.taxa / 100, 0) ) ) ) * (1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) ), 6) + ( bi.qtt * iif(p.st_econotdesc = 1, (bi.ecoval + bi.ecoval2) * ( 1 + iif(bi.ivaincl = 1 and tiva.taxa <> 0, tiva.taxa / 100, 0) ), 0) ) ,ttmoeda = 0 from bi inner join bo on bi.bostamp = bo.bostamp left join st on bi.ref = st.ref left join taxasiva tiva on bi.tabiva = tiva.codigo cross apply ( select max(valor) st_econotdesc from ( select case when valor = 's' then 1 else 0 end valor from para1 where descricao = 'st_econotdesc' union all select 0 ) a ) p where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and ( bi.classifc = '' or bi.classifc = 'normal' ) and bi.econotcalc = 0 --acrescenta os descontos em valor, caso existam: update bi set ettdeb = round(bi.ettdeb - (bi.qtt * bi.evaldesc), 2) ,ttdeb = round(bi.ttdeb - (bi.qtt * bi.valdesc), 2) ,ttmoeda = 0 from bi where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and ( bi.classifc = '' or bi.classifc = 'normal' ) and bi.valdesc <> 0 end else begin update bi set ttmoeda = round((1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) * bi.qtt * bi.vumoeda, 2) ,ettdeb = case when bo2.cambio <> 0 then round((round((1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) * bi.qtt * bi.vumoeda, 2)) / bo2.cambio, 2) else 0 end ,edebito = case when bi.qtt = 0 then 0 else round(abs(( case when bo2.cambio <> 0 then round((round((1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) * bi.qtt * bi.vumoeda, 2)) / bo2.cambio, 2) else 0 end ) / (1 - bi.desconto / 100) / (1 - bi.desc2 / 100) / (1 - bi.desc3 / 100) / (1 - bi.desc4 / 100) / (1 - bi.desc5 / 100) / (1 - bi.desc6 / 100) / bi.qtt), 2) end ,debito = case when bi.qtt = 0 then 0 else round(abs(( case when bo2.cambio <> 0 then round((round((1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) * bi.qtt * bi.vumoeda, 2)) / bo2.cambio, 2) else 0 end ) / (1 - bi.desconto / 100) / (1 - bi.desc2 / 100) / (1 - bi.desc3 / 100) / (1 - bi.desc4 / 100) / (1 - bi.desc5 / 100) / (1 - bi.desc6 / 100) / bi.qtt), 2) end * 200.482 from bi inner join bo2 on bi.bostamp = bo2.bo2stamp where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and ( bi.classifc = '' or bi.classifc = 'normal' ) update bi set ttdeb = round(bi.ttdeb - (bi.qtt * bi.valdesc), 2) ,ettdeb = round(bi.ettdeb - (bi.qtt * bi.evaldesc), 0) ,debito = round(bi.debito - (bi.qtt * bi.valdesc), 2) ,edebito = round(bi.edebito - (bi.qtt * bi.evaldesc), 2) where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and ( bi.classifc = '' or bi.classifc = 'normal' ) and bi.valdesc <> 0 end 
20250217@150411.2586 bvgga250121dsdbsjaunj8aboj Query : use flama_phc
20250217@150411.2589 bvgga250121dsdbsjaunj8aboj Query : select 1 valor from bo where bo.bostamp = 'aut67b342708167b34fd2b9'
20250217@150411.2614 bvgga250121dsdbsjaunj8aboj Query : declare @errno int ,@errmsg varchar(255) ,@prod bit ,@nrdec numeric(10, 0) ,@totaldeb numeric(18, 5) ,@etotaldeb numeric(19, 6) ,@total numeric(18, 5) ,@etotal numeric(19, 6) ,@custo numeric(18, 5) ,@ecusto numeric(19, 6) ,@bo_1iliq numeric(19, 6) ,@bo_2iliq numeric(19, 6) ,@base1 numeric(19, 6) ,@base2 numeric(19, 6) ,@moetotal numeric(13, 3) ,@smoe1 numeric(13, 3) ,@smoe2 numeric(13, 3) ,@smoe3 numeric(13, 3) ,@smoe4 numeric(13, 3) ,@bo11_bins numeric(18, 5) ,@bo21_bins numeric(18, 5) ,@bo31_bins numeric(18, 5) ,@bo41_bins numeric(18, 5) ,@bo51_bins numeric(18, 5) ,@bo61_bins numeric(18, 5) ,@bo71_bins numeric(18, 5) ,@bo81_bins numeric(18, 5) ,@bo91_bins numeric(18, 5) ,@bo12_bins numeric(18, 5) ,@bo22_bins numeric(18, 5) ,@bo32_bins numeric(18, 5) ,@bo42_bins numeric(18, 5) ,@bo52_bins numeric(18, 5) ,@bo62_bins numeric(18, 5) ,@bo72_bins numeric(18, 5) ,@bo82_bins numeric(18, 5) ,@bo92_bins numeric(18, 5) ,@ebo11_bins numeric(19, 6) ,@ebo21_bins numeric(19, 6) ,@ebo31_bins numeric(19, 6) ,@ebo41_bins numeric(19, 6) ,@ebo51_bins numeric(19, 6) ,@ebo61_bins numeric(19, 6) ,@ebo71_bins numeric(18, 5) ,@ebo81_bins numeric(18, 5) ,@ebo91_bins numeric(18, 5) ,@ebo12_bins numeric(19, 6) ,@ebo22_bins numeric(19, 6) ,@ebo32_bins numeric(19, 6) ,@ebo42_bins numeric(19, 6) ,@ebo52_bins numeric(19, 6) ,@ebo62_bins numeric(19, 6) ,@ebo72_bins numeric(18, 5) ,@ebo82_bins numeric(18, 5) ,@ebo92_bins numeric(18, 5) ,@bo11_iva numeric(18, 5) ,@bo21_iva numeric(18, 5) ,@bo31_iva numeric(18, 5) ,@bo41_iva numeric(18, 5) ,@bo51_iva numeric(18, 5) ,@bo61_iva numeric(18, 5) ,@bo71_iva numeric(18, 5) ,@bo81_iva numeric(18, 5) ,@bo91_iva numeric(18, 5) ,@bo12_iva numeric(18, 5) ,@bo22_iva numeric(18, 5) ,@bo32_iva numeric(18, 5) ,@bo42_iva numeric(18, 5) ,@bo52_iva numeric(18, 5) ,@bo62_iva numeric(18, 5) ,@bo72_iva numeric(18, 5) ,@bo82_iva numeric(18, 5) ,@bo92_iva numeric(18, 5) ,@ebo11_iva numeric(19, 6) ,@ebo21_iva numeric(19, 6) ,@ebo31_iva numeric(19, 6) ,@ebo41_iva numeric(19, 6) ,@ebo51_iva numeric(19, 6) ,@ebo61_iva numeric(19, 6) ,@ebo71_iva numeric(18, 5) ,@ebo81_iva numeric(18, 5) ,@ebo91_iva numeric(18, 5) ,@ebo12_iva numeric(19, 6) ,@ebo22_iva numeric(19, 6) ,@ebo32_iva numeric(19, 6) ,@ebo42_iva numeric(19, 6) ,@ebo52_iva numeric(19, 6) ,@ebo62_iva numeric(19, 6) ,@ebo72_iva numeric(18, 5) ,@ebo82_iva numeric(18, 5) ,@ebo92_iva numeric(18, 5) ,@esdeb1 numeric(19, 6) ,@esdeb2 numeric(19, 6) ,@esdeb3 numeric(19, 6) ,@esdeb4 numeric(19, 6) ,@sdeb1 numeric(18, 5) ,@sdeb2 numeric(18, 5) ,@sdeb3 numeric(18, 5) ,@sdeb4 numeric(18, 5) ,@estot1 numeric(19, 6) ,@estot2 numeric(19, 6) ,@estot3 numeric(19, 6) ,@estot4 numeric(19, 6) ,@stot1 numeric(18, 5) ,@stot2 numeric(18, 5) ,@stot3 numeric(18, 5) ,@stot4 numeric(18, 5) ,@ebo_1tvall numeric(19, 6) ,@ebo_2tvall numeric(19, 6) ,@bo_1tvall numeric(18, 5) ,@bo_2tvall numeric(18, 5) ,@ebo_totp1 numeric(19, 6) ,@ebo_totp2 numeric(19, 6) ,@bo_totp1 numeric(18, 5) ,@bo_totp2 numeric(18, 5) ,@sqtt11 numeric(13, 3) ,@sqtt21 numeric(13, 3) ,@sqtt12 numeric(13, 3) ,@sqtt22 numeric(13, 3) ,@sqtt13 numeric(13, 3) ,@sqtt23 numeric(13, 3) ,@sqtt14 numeric(13, 3) ,@sqtt24 numeric(13, 3) ,@userinis varchar (30) ,@mybostamp char(25) = 'aut67b342708167b34fd2b9' declare @totaisiva table ( bostamp varchar (25), codigo numeric(1), taxa numeric (5,2), ebaseinc numeric (19,6), baseinc numeric (18,5), evalor numeric (19,6), valor numeric (18,5) ) set @prod = ( select ts.producao from bo(nolock) inner join ts(nolock) on bo.ndos = ts.ndos and bo.bostamp = @mybostamp ) set @nrdec = ( select convert(numeric(10, 0), valor) from para1(nolock) where descricao = 'de_euro' ) --set @prod = 0 --set @nrdec = 2 select @ecusto = sum(bi.epcusto * bi.qtt) ,@custo = sum(bi.pcusto * bi.qtt) ,@bo11_bins = sum(case when bi.tabiva = 1 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo21_bins = sum(case when bi.tabiva = 2 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo31_bins = sum(case when bi.tabiva = 3 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo41_bins = sum(case when bi.tabiva = 4 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo51_bins = sum(case when bi.tabiva = 5 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo61_bins = sum(case when bi.tabiva = 6 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo71_bins = sum(case when bi.tabiva = 7 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo81_bins = sum(case when bi.tabiva = 8 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo91_bins = sum(case when bi.tabiva = 9 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo12_bins = sum(case when bi.tabiva = 1 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo22_bins = sum(case when bi.tabiva = 2 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo32_bins = sum(case when bi.tabiva = 3 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo42_bins = sum(case when bi.tabiva = 4 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo52_bins = sum(case when bi.tabiva = 5 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo62_bins = sum(case when bi.tabiva = 6 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo72_bins = sum(case when bi.tabiva = 7 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo82_bins = sum(case when bi.tabiva = 8 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo92_bins = sum(case when bi.tabiva = 9 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo11_bins = sum(case when bi.tabiva = 1 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo21_bins = sum(case when bi.tabiva = 2 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo31_bins = sum(case when bi.tabiva = 3 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo41_bins = sum(case when bi.tabiva = 4 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo51_bins = sum(case when bi.tabiva = 5 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo61_bins = sum(case when bi.tabiva = 6 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo71_bins = sum(case when bi.tabiva = 7 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo81_bins = sum(case when bi.tabiva = 8 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo91_bins = sum(case when bi.tabiva = 9 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo12_bins = sum(case when bi.tabiva = 1 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo22_bins = sum(case when bi.tabiva = 2 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo32_bins = sum(case when bi.tabiva = 3 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo42_bins = sum(case when bi.tabiva = 4 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo52_bins = sum(case when bi.tabiva = 5 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo62_bins = sum(case when bi.tabiva = 6 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo72_bins = sum(case when bi.tabiva = 7 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo82_bins = sum(case when bi.tabiva = 8 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo92_bins = sum(case when bi.tabiva = 9 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo_1iliq = round(sum(bi.qtt * bi.epu), @nrdec) ,@bo_2iliq = round(sum(bi.ettdeb), @nrdec) ,@bo11_iva = sum(case when bi.tabiva = 1 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo12_iva = sum(case when bi.tabiva = 1 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo21_iva = sum(case when bi.tabiva = 2 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo22_iva = sum(case when bi.tabiva = 2 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo31_iva = sum(case when bi.tabiva = 3 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo32_iva = sum(case when bi.tabiva = 3 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo41_iva = sum(case when bi.tabiva = 4 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo42_iva = sum(case when bi.tabiva = 4 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo51_iva = sum(case when bi.tabiva = 5 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo52_iva = sum(case when bi.tabiva = 5 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo61_iva = sum(case when bi.tabiva = 6 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo62_iva = sum(case when bi.tabiva = 6 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo71_iva = sum(case when bi.tabiva = 7 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo72_iva = sum(case when bi.tabiva = 7 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo81_iva = sum(case when bi.tabiva = 8 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo82_iva = sum(case when bi.tabiva = 8 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo91_iva = sum(case when bi.tabiva = 9 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo92_iva = sum(case when bi.tabiva = 9 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo11_iva = sum(case when bi.tabiva = 1 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo12_iva = sum(case when bi.tabiva = 1 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo21_iva = sum(case when bi.tabiva = 2 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo22_iva = sum(case when bi.tabiva = 2 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo31_iva = sum(case when bi.tabiva = 3 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo32_iva = sum(case when bi.tabiva = 3 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo41_iva = sum(case when bi.tabiva = 4 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo42_iva = sum(case when bi.tabiva = 4 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo51_iva = sum(case when bi.tabiva = 5 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo52_iva = sum(case when bi.tabiva = 5 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo61_iva = sum(case when bi.tabiva = 6 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo62_iva = sum(case when bi.tabiva = 6 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo71_iva = sum(case when bi.tabiva = 7 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo72_iva = sum(case when bi.tabiva = 7 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo81_iva = sum(case when bi.tabiva = 8 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo82_iva = sum(case when bi.tabiva = 8 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo91_iva = sum(case when bi.tabiva = 9 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else bi.ettdeb - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo92_iva = sum(case when bi.tabiva = 9 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@esdeb1 = sum(case when bi.stipo <= 1 then case when bi.ivaincl = 0 then bi.ettdeb else bi.ettdeb - round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@esdeb2 = sum(case when bi.stipo = 2 then case when bi.ivaincl = 0 then bi.ettdeb else bi.ettdeb - round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@esdeb3 = sum(case when bi.stipo = 3 then case when bi.ivaincl = 0 then bi.ettdeb else bi.ettdeb - round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@esdeb4 = sum(case when bi.stipo = 4 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) * bi.iva / 100, @nrdec) end else 0 end) ,@sdeb1 = sum(case when bi.stipo <= 1 then case when bi.ivaincl = 0 then bi.ttdeb else bi.ttdeb - round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@sdeb2 = sum(case when bi.stipo = 2 then case when bi.ivaincl = 0 then bi.ttdeb else bi.ttdeb - round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@sdeb3 = sum(case when bi.stipo = 3 then case when bi.ivaincl = 0 then bi.ttdeb else bi.ttdeb - round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@sdeb4 = sum(case when bi.stipo = 4 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) * bi.iva / 100, @nrdec) end else 0 end) ,@smoe1 = sum(case when bi.stipo <= 1 then case when bi.ivaincl = 0 then bi.ttmoeda else round(bi.ttmoeda / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@smoe2 = sum(case when bi.stipo = 2 then case when bi.ivaincl = 0 then bi.ttmoeda else round(bi.ttmoeda / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@smoe3 = sum(case when bi.stipo = 3 then case when bi.ivaincl = 0 then bi.ttmoeda else round(bi.ttmoeda / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@smoe4 = sum(case when bi.stipo = 4 then case when bi.ivaincl = 0 then bi.ttmoeda else round(bi.ttmoeda / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@estot1 = sum(case when bi.stipo <= 1 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@estot2 = sum(case when bi.stipo = 2 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@estot3 = sum(case when bi.stipo = 3 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@estot4 = sum(case when bi.stipo = 4 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@stot1 = sum(case when bi.stipo <= 1 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.pu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@stot2 = sum(case when bi.stipo = 2 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.pu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@stot3 = sum(case when bi.stipo = 3 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.pu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@stot4 = sum(case when bi.stipo = 4 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.pu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@total = @stot1 + @stot2 + @stot3 + @stot4 ,@etotal = @estot1 + @estot2 + @estot3 + @estot4 ,@totaldeb = @sdeb1 + @sdeb2 + @sdeb3 + @sdeb4 ,@etotaldeb = @esdeb1 + @esdeb2 + @esdeb3 + @esdeb4 ,@moetotal = @smoe1 + @smoe2 + @smoe3 + @smoe4 ,@ebo_1tvall = @ebo11_bins + @ebo21_bins + @ebo31_bins + @ebo41_bins + @ebo51_bins + @ebo61_bins + @ebo71_bins + @ebo81_bins + @ebo91_bins ,@ebo_2tvall = @ebo12_bins + @ebo22_bins + @ebo32_bins + @ebo42_bins + @ebo52_bins + @ebo62_bins + @ebo72_bins + @ebo82_bins + @ebo92_bins ,@bo_1tvall = @bo11_bins + @bo21_bins + @bo31_bins + @bo41_bins + @bo51_bins + @bo61_bins + @bo71_bins + @bo81_bins + @bo91_bins ,@bo_2tvall = @bo12_bins + @bo22_bins + @bo32_bins + @bo42_bins + @bo52_bins + @bo62_bins + @bo72_bins + @bo82_bins + @bo92_bins ,@ebo_totp1 = sum(case when bi.ivaincl = 0 then (bi.epu * bi.qtt) else round((bi.epu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end) ,@ebo_totp2 = sum(case when bi.ivaincl = 0 then (bi.edebito * bi.qtt) else round((bi.edebito * bi.qtt) / (1 + bi.iva / 100), @nrdec) end) ,@bo_totp1 = sum(case when bi.ivaincl = 0 then (bi.pu * bi.qtt) else round((bi.pu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end) ,@bo_totp2 = sum(case when bi.ivaincl = 0 then (bi.debito * bi.qtt) else round((bi.debito * bi.qtt) / (1 + bi.iva / 100), @nrdec) end) ,@sqtt11 = sum(case when bi.stipo = 1 then bi.qtt else 0 end) ,@sqtt21 = sum(case when bi.stipo = 1 then bi.qtt else 0 end) ,@sqtt12 = sum(case when bi.stipo = 2 then bi.qtt else 0 end) ,@sqtt22 = sum(case when bi.stipo = 2 then bi.qtt else 0 end) ,@sqtt13 = sum(case when bi.stipo = 3 then bi.qtt else 0 end) ,@sqtt23 = sum(case when bi.stipo = 3 then bi.qtt else 0 end) ,@sqtt14 = sum(case when bi.stipo = 4 then bi.qtt else 0 end) ,@sqtt24 = sum(case when bi.stipo = 5 then bi.qtt else 0 end) from bi(nolock) where bi.bostamp = @mybostamp and bi.producao = case when @prod = 1 then 1 else bi.producao end and bi.composto = 0 and bi.qtt <> 0 update bo set bo.totaldeb = isnull(@totaldeb, 0) ,bo.total = isnull(@total, 0) ,bo.etotaldeb = isnull(@etotaldeb, 0) ,bo.moetotal = isnull(@moetotal, 0) ,bo.etotal = isnull(@etotal, 0) ,bo.ecusto = isnull(@ecusto, 0) ,bo.custo = isnull(@custo, 0) ,bo.bo11_bins = isnull(@bo11_bins, 0) ,bo.bo12_bins = isnull(@bo12_bins, 0) ,bo.bo21_bins = isnull(@bo21_bins, 0) ,bo.bo22_bins = isnull(@bo22_bins, 0) ,bo.bo31_bins = isnull(@bo31_bins, 0) ,bo.bo32_bins = isnull(@bo32_bins, 0) ,bo.bo41_bins = isnull(@bo41_bins, 0) ,bo.bo42_bins = isnull(@bo42_bins, 0) ,bo.bo51_bins = isnull(@bo51_bins, 0) ,bo.bo52_bins = isnull(@bo52_bins, 0) ,bo.bo61_bins = isnull(@bo61_bins, 0) ,bo.bo62_bins = isnull(@bo62_bins, 0) ,bo.ebo11_bins = isnull(@ebo11_bins, 0) ,bo.ebo12_bins = isnull(@ebo12_bins, 0) ,bo.ebo21_bins = isnull(@ebo21_bins, 0) ,bo.ebo22_bins = isnull(@ebo22_bins, 0) ,bo.ebo31_bins = isnull(@ebo31_bins, 0) ,bo.ebo32_bins = isnull(@ebo32_bins, 0) ,bo.ebo41_bins = isnull(@ebo41_bins, 0) ,bo.ebo42_bins = isnull(@ebo42_bins, 0) ,bo.ebo51_bins = isnull(@ebo51_bins, 0) ,bo.ebo52_bins = isnull(@ebo52_bins, 0) ,bo.ebo61_bins = isnull(@ebo61_bins, 0) ,bo.ebo62_bins = isnull(@ebo62_bins, 0) ,bo.bo11_iva = isnull(@bo11_iva, 0) ,bo.bo12_iva = isnull(@bo12_iva, 0) ,bo.bo21_iva = isnull(@bo21_iva, 0) ,bo.bo22_iva = isnull(@bo22_iva, 0) ,bo.bo31_iva = isnull(@bo31_iva, 0) ,bo.bo32_iva = isnull(@bo32_iva, 0) ,bo.bo41_iva = isnull(@bo41_iva, 0) ,bo.bo42_iva = isnull(@bo42_iva, 0) ,bo.bo51_iva = isnull(@bo51_iva, 0) ,bo.bo52_iva = isnull(@bo52_iva, 0) ,bo.bo61_iva = isnull(@bo61_iva, 0) ,bo.bo62_iva = isnull(@bo62_iva, 0) ,bo.ebo11_iva = isnull(@ebo11_iva, 0) ,bo.ebo12_iva = isnull(@ebo12_iva, 0) ,bo.ebo21_iva = isnull(@ebo21_iva, 0) ,bo.ebo22_iva = isnull(@ebo22_iva, 0) ,bo.ebo31_iva = isnull(@ebo31_iva, 0) ,bo.ebo32_iva = isnull(@ebo32_iva, 0) ,bo.ebo41_iva = isnull(@ebo41_iva, 0) ,bo.ebo42_iva = isnull(@ebo42_iva, 0) ,bo.ebo51_iva = isnull(@ebo51_iva, 0) ,bo.ebo52_iva = isnull(@ebo52_iva, 0) ,bo.ebo61_iva = isnull(@ebo61_iva, 0) ,bo.ebo62_iva = isnull(@ebo62_iva, 0) ,bo.esdeb1 = isnull(@esdeb1, 0) ,bo.esdeb2 = isnull(@esdeb2, 0) ,bo.esdeb3 = isnull(@esdeb3, 0) ,bo.esdeb4 = isnull(@esdeb4, 0) ,bo.sdeb1 = isnull(@sdeb1, 0) ,bo.sdeb2 = isnull(@sdeb2, 0) ,bo.sdeb3 = isnull(@sdeb3, 0) ,bo.sdeb4 = isnull(@sdeb4, 0) ,bo.smoe1 = isnull(@smoe1, 0) ,bo.smoe2 = isnull(@smoe2, 0) ,bo.smoe3 = isnull(@smoe3, 0) ,bo.smoe4 = isnull(@smoe4, 0) ,bo.estot1 = isnull(@estot1, 0) ,bo.estot2 = isnull(@estot2, 0) ,bo.estot3 = isnull(@estot3, 0) ,bo.estot4 = isnull(@estot4, 0) ,bo.stot1 = isnull(@stot1, 0) ,bo.stot2 = isnull(@stot2, 0) ,bo.stot3 = isnull(@stot3, 0) ,bo.stot4 = isnull(@stot4, 0) ,bo.ebo_1tvall = isnull(@ebo_1tvall, 0) ,bo.ebo_2tvall = isnull(@ebo_2tvall, 0) ,bo.bo_1tvall = isnull(@bo_1tvall, 0) ,bo.bo_2tvall = isnull(@bo_2tvall, 0) ,bo.ebo_totp1 = isnull(@ebo_totp1, 0) ,bo.ebo_totp2 = isnull(@ebo_totp2, 0) ,bo.bo_totp1 = isnull(@bo_totp1, 0) ,bo.bo_totp2 = isnull(@bo_totp2, 0) ,bo.sqtt11 = isnull(@sqtt11, 0) ,bo.sqtt21 = isnull(@sqtt21, 0) ,bo.sqtt12 = isnull(@sqtt12, 0) ,bo.sqtt22 = isnull(@sqtt22, 0) ,bo.sqtt13 = isnull(@sqtt13, 0) ,bo.sqtt23 = isnull(@sqtt23, 0) ,bo.sqtt14 = isnull(@sqtt14, 0) ,bo.sqtt24 = isnull(@sqtt24, 0) where bostamp = @mybostamp update bo2 set bo2.bo71_bins = isnull(@bo71_bins, 0) ,bo2.bo72_bins = isnull(@bo72_bins, 0) ,bo2.bo81_bins = isnull(@bo81_bins, 0) ,bo2.bo82_bins = isnull(@bo82_bins, 0) ,bo2.bo91_bins = isnull(@bo91_bins, 0) ,bo2.bo92_bins = isnull(@bo92_bins, 0) ,bo2.ebo71_bins = isnull(@ebo71_bins, 0) ,bo2.ebo72_bins = isnull(@ebo72_bins, 0) ,bo2.ebo81_bins = isnull(@ebo81_bins, 0) ,bo2.ebo82_bins = isnull(@ebo82_bins, 0) ,bo2.ebo91_bins = isnull(@ebo91_bins, 0) ,bo2.ebo92_bins = isnull(@ebo92_bins, 0) ,bo2.bo71_iva = isnull(@bo71_iva, 0) ,bo2.bo72_iva = isnull(@bo72_iva, 0) ,bo2.bo81_iva = isnull(@bo81_iva, 0) ,bo2.bo82_iva = isnull(@bo82_iva, 0) ,bo2.bo91_iva = isnull(@bo91_iva, 0) ,bo2.bo92_iva = isnull(@bo92_iva, 0) ,bo2.ebo71_iva = isnull(@ebo71_iva, 0) ,bo2.ebo72_iva = isnull(@ebo72_iva, 0) ,bo2.ebo81_iva = isnull(@ebo81_iva, 0) ,bo2.ebo82_iva = isnull(@ebo82_iva, 0) ,bo2.ebo91_iva = isnull(@ebo91_iva, 0) ,bo2.ebo92_iva = isnull(@ebo92_iva, 0) ,bo2.etotalciva = isnull(@etotaldeb, 0) + isnull(@ebo12_iva, 0) +isnull(@ebo22_iva, 0) +isnull(@ebo32_iva, 0) +isnull(@ebo42_iva, 0) +isnull(@ebo52_iva, 0) +isnull(@ebo62_iva, 0) +isnull(@ebo72_iva, 0) +isnull(@ebo82_iva, 0) +isnull(@ebo92_iva, 0) --,bo2.mtotalciva =isnull(@moetotal, 0) where bo2stamp = @mybostamp -- trata os bot select @userinis = usrinis from bo where bo.bostamp=@mybostamp insert into @totaisiva ( bostamp, codigo, taxa, ebaseinc, baseinc, evalor, valor ) select @mybostamp,codigo,taxa ,case when (@ebo11_bins <>0) then @ebo11_bins else @ebo12_bins end ,case when (@ebo11_bins <>0) then @bo11_bins else @bo12_bins end ,case when (@ebo11_bins <>0) then @ebo11_iva else @ebo12_iva end ,case when (@ebo11_bins <>0) then @bo11_iva else @bo12_iva end from taxasiva where codigo = 1 union all select @mybostamp,codigo,taxa ,case when (@ebo21_bins <>0) then @ebo21_bins else @ebo22_bins end ,case when (@ebo21_bins <>0) then @bo21_bins else @bo22_bins end ,case when (@ebo21_bins <>0) then @ebo21_iva else @ebo22_iva end ,case when (@ebo21_bins <>0) then @bo21_iva else @bo22_iva end from taxasiva where codigo = 2 union all select @mybostamp,codigo,taxa ,case when (@ebo31_bins <>0) then @ebo31_bins else @ebo32_bins end ,case when (@ebo31_bins <>0) then @bo31_bins else @bo32_bins end ,case when (@ebo31_bins <>0) then @ebo31_iva else @ebo32_iva end ,case when (@ebo31_bins <>0) then @bo31_iva else @bo32_iva end from taxasiva where codigo = 3 union all select @mybostamp,codigo,taxa ,case when (@ebo41_bins <>0) then @ebo41_bins else @ebo42_bins end ,case when (@ebo41_bins <>0) then @bo41_bins else @bo42_bins end ,case when (@ebo41_bins <>0) then @ebo41_iva else @ebo42_iva end ,case when (@ebo41_bins <>0) then @bo41_iva else @bo42_iva end from taxasiva where codigo = 4 union all select @mybostamp,codigo,taxa ,case when (@ebo51_bins <>0) then @ebo51_bins else @ebo52_bins end ,case when (@ebo51_bins <>0) then @bo51_bins else @bo52_bins end ,case when (@ebo51_bins <>0) then @ebo51_iva else @ebo52_iva end ,case when (@ebo51_bins <>0) then @bo51_iva else @bo52_iva end from taxasiva where codigo = 5 union all select @mybostamp,codigo,taxa ,case when (@ebo61_bins <>0) then @ebo61_bins else @ebo62_bins end ,case when (@ebo61_bins <>0) then @bo61_bins else @bo62_bins end ,case when (@ebo61_bins <>0) then @ebo61_iva else @ebo62_iva end ,case when (@ebo61_bins <>0) then @bo61_iva else @bo62_iva end from taxasiva where codigo = 6 union all select @mybostamp,codigo,taxa ,case when (@ebo71_bins <>0) then @ebo71_bins else @ebo72_bins end ,case when (@ebo71_bins <>0) then @bo71_bins else @bo72_bins end ,case when (@ebo71_bins <>0) then @ebo71_iva else @ebo72_iva end ,case when (@ebo71_bins <>0) then @bo71_iva else @bo72_iva end from taxasiva where codigo = 7 union all select @mybostamp,codigo,taxa ,case when (@ebo81_bins <>0) then @ebo81_bins else @ebo82_bins end ,case when (@ebo81_bins <>0) then @bo81_bins else @bo82_bins end ,case when (@ebo81_bins <>0) then @ebo81_iva else @ebo82_iva end ,case when (@ebo81_bins <>0) then @bo81_iva else @bo82_iva end from taxasiva where codigo = 8 union all select @mybostamp,codigo,taxa ,case when (@ebo91_bins <>0) then @ebo91_bins else @ebo92_bins end ,case when (@ebo91_bins <>0) then @bo91_bins else @bo92_bins end ,case when (@ebo91_bins <>0) then @ebo91_iva else @ebo92_iva end ,case when (@ebo91_bins <>0) then @bo91_iva else @bo92_iva end from taxasiva where codigo = 9 update bot set ebaseinc = totiva.ebaseinc, baseinc = totiva.baseinc, evalor = totiva.evalor, valor = totiva.valor, usrinis = @userinis, usrdata = convert (date,getdate()), usrhora = convert (time,getdate()) from @totaisiva totiva inner join bot on totiva.bostamp = bot.bostamp and totiva.codigo = bot.codigo insert into bot ( botstamp ,bostamp ,codigo ,taxa ,ebaseinc ,baseinc ,evalor ,valor ,ousrinis ,ousrdata ,ousrhora ,usrinis ,usrdata ,usrhora ) select ( left(@userinis,3) + 'tt' + left(newid(),5) + right(newid(),5) + left(newid(),5) + right(newid(),5)) stamp ,@mybostamp stampbo ,totiva.codigo ,totiva.taxa ,totiva.ebaseinc ,totiva.baseinc ,totiva.evalor ,totiva.valor ,@userinis ,convert (date,getdate()) ,convert (time,getdate()) ,@userinis ,convert (date,getdate()) ,convert (time,getdate()) from @totaisiva totiva left join bot on totiva.bostamp = bot.bostamp and totiva.codigo = bot.codigo where bot.botstamp is null -- atualiza os campo bi.series e bi.series2, caso tenha equipamentos update bi set series = s1, series2=s2 from bi inner join ( select distinct bistamp,ser.s1, ser.s2 from boma cross apply (select stuff ( ( select ',' + rtrim(serie) from boma myboma where myboma.bistamp = boma.bistamp order by serie for xml path('') ), 1, 1, '' ) s1 , stuff ( ( select ',' + rtrim(serie2) from boma myboma where myboma.bistamp = boma.bistamp order by serie for xml path('') ), 1, 1, '' ) s2 ) ser where boma.bostamp = @mybostamp ) myboma on bi.bistamp = myboma.bistamp where bi.bostamp = @mybostamp 
20250217@150413.6235 bvgga250121dsdbsjaunj8aboj Query : use flama_phc
20250217@150413.6238 bvgga250121dsdbsjaunj8aboj Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20250217@150413.6310 bvgga250121dsdbsjaunj8aboj Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5391';
20250217@150413.6364 bvgga250121dsdbsjaunj8aboj Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5391';

20250217@173620.1782 gif6s70dbu9t2k8r15chj96j2s Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5392';
20250217@173620.2152 gif6s70dbu9t2k8r15chj96j2s Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5392';
20250217@173620.2478 gif6s70dbu9t2k8r15chj96j2s Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5392';
20250217@173620.2845 gif6s70dbu9t2k8r15chj96j2s Query : use flama_phc
20250217@173620.2887 gif6s70dbu9t2k8r15chj96j2s Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250217@173620.5174 gif6s70dbu9t2k8r15chj96j2s Query : use flama_phc
20250217@173620.5216 gif6s70dbu9t2k8r15chj96j2s Query : select no, estab,szadrsdesc from szadrs where u_coddest=9159
20250217@173620.5626 gif6s70dbu9t2k8r15chj96j2s Query : select bi.bistamp ,bi.ref code ,bi.qtt quantity ,bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.bostamp ,st.u_uncxcl from bi inner join bo on bo.bostamp=bi.bostamp inner join st on st.ref = bi.ref where bo.ndos = 250 and bo.boano = 2012 and bo.obrano = 2501237 
20250217@173620.7024 gif6s70dbu9t2k8r15chj96j2s Query : use flama_phc
20250217@173620.7065 gif6s70dbu9t2k8r15chj96j2s Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250217@173620.7489 gif6s70dbu9t2k8r15chj96j2s Query : use flama_phc
20250217@173620.7531 gif6s70dbu9t2k8r15chj96j2s Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -9010
20250217@173620.7932 gif6s70dbu9t2k8r15chj96j2s Query : insert into wserrorlog (errornumber, errormsg,requesttable,initialdata,finaldata) values (-9010,?,'ft',?,?)
20250217@173620.8111 gif6s70dbu9t2k8r15chj96j2s Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5392';
20250217@173620.8431 gif6s70dbu9t2k8r15chj96j2s Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5392';
20250217@173620.9111 lml0d0j4adel1rmb9edtvg6cle Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250217@173620.9138 lml0d0j4adel1rmb9edtvg6cle Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250217@173620.9212 lml0d0j4adel1rmb9edtvg6cle Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5393';
20250217@173620.9287 lml0d0j4adel1rmb9edtvg6cle Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5393';
20250217@173620.9361 lml0d0j4adel1rmb9edtvg6cle Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5393';
20250217@173620.9403 lml0d0j4adel1rmb9edtvg6cle Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5393';
20250217@173620.9484 lml0d0j4adel1rmb9edtvg6cle Query : use flama_phc
20250217@173620.9488 lml0d0j4adel1rmb9edtvg6cle Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250217@173620.9560 lml0d0j4adel1rmb9edtvg6cle Query : use flama_phc
20250217@173620.9563 lml0d0j4adel1rmb9edtvg6cle Query : select no, estab,szadrsdesc from szadrs where u_coddest=3966
20250217@173620.9661 lml0d0j4adel1rmb9edtvg6cle Query : select bi.bistamp ,bi.ref code ,bi.qtt quantity ,bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.bostamp ,st.u_uncxcl from bi inner join bo on bo.bostamp=bi.bostamp inner join st on st.ref = bi.ref where bo.ndos = 250 and bo.boano = 2012 and bo.obrano = 2501241 
20250217@173621.8400 lml0d0j4adel1rmb9edtvg6cle Query : use flama_phc
20250217@173621.8700 lml0d0j4adel1rmb9edtvg6cle Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250217@173621.1150 lml0d0j4adel1rmb9edtvg6cle Query : use flama_phc
20250217@173621.1170 lml0d0j4adel1rmb9edtvg6cle Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -9010
20250217@173621.1330 lml0d0j4adel1rmb9edtvg6cle Query : insert into wserrorlog (errornumber, errormsg,requesttable,initialdata,finaldata) values (-9010,?,'ft',?,?)
20250217@173621.1530 lml0d0j4adel1rmb9edtvg6cle Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5393';
20250217@173621.1970 lml0d0j4adel1rmb9edtvg6cle Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5393';
20250217@173621.7550 d0i1uldu3dok0ea4q9ufqvlenh Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250217@173621.7650 d0i1uldu3dok0ea4q9ufqvlenh Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250217@173621.8480 d0i1uldu3dok0ea4q9ufqvlenh Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5394';
20250217@173621.1045 d0i1uldu3dok0ea4q9ufqvlenh Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5394';
20250217@173621.1127 d0i1uldu3dok0ea4q9ufqvlenh Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5394';
20250217@173621.1171 d0i1uldu3dok0ea4q9ufqvlenh Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5394';
20250217@173621.1344 d0i1uldu3dok0ea4q9ufqvlenh Query : use flama_phc
20250217@173621.1348 d0i1uldu3dok0ea4q9ufqvlenh Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250217@173621.1780 d0i1uldu3dok0ea4q9ufqvlenh Query : use flama_phc
20250217@173621.1785 d0i1uldu3dok0ea4q9ufqvlenh Query : select no, estab,szadrsdesc from szadrs where u_coddest=743
20250217@173621.2175 d0i1uldu3dok0ea4q9ufqvlenh Query : select bi.bistamp ,bi.ref code ,bi.qtt quantity ,bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.bostamp ,st.u_uncxcl from bi inner join bo on bo.bostamp=bi.bostamp inner join st on st.ref = bi.ref where bo.ndos = 250 and bo.boano = 2012 and bo.obrano = 2501242 
20250217@173621.2737 d0i1uldu3dok0ea4q9ufqvlenh Query : use flama_phc
20250217@173621.3014 d0i1uldu3dok0ea4q9ufqvlenh Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250217@173621.3061 d0i1uldu3dok0ea4q9ufqvlenh Query : use flama_phc
20250217@173621.3066 d0i1uldu3dok0ea4q9ufqvlenh Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -9010
20250217@173621.3085 d0i1uldu3dok0ea4q9ufqvlenh Query : insert into wserrorlog (errornumber, errormsg,requesttable,initialdata,finaldata) values (-9010,?,'ft',?,?)
20250217@173621.3106 d0i1uldu3dok0ea4q9ufqvlenh Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5394';
20250217@173621.3152 d0i1uldu3dok0ea4q9ufqvlenh Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5394';
20250217@173621.3914 90khm14k3vtiibsoeth1ngr466 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250217@173621.4040 90khm14k3vtiibsoeth1ngr466 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250217@173621.4573 90khm14k3vtiibsoeth1ngr466 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5395';
20250217@173621.5007 90khm14k3vtiibsoeth1ngr466 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5395';
20250217@173621.5460 90khm14k3vtiibsoeth1ngr466 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5395';
20250217@173621.6090 90khm14k3vtiibsoeth1ngr466 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5395';
20250217@173621.6681 90khm14k3vtiibsoeth1ngr466 Query : use flama_phc
20250217@173621.6723 90khm14k3vtiibsoeth1ngr466 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250217@173621.7429 90khm14k3vtiibsoeth1ngr466 Query : use flama_phc
20250217@173621.7512 90khm14k3vtiibsoeth1ngr466 Query : select no, estab,szadrsdesc from szadrs where u_coddest=9159
20250217@173621.7943 90khm14k3vtiibsoeth1ngr466 Query : select bi.bistamp ,bi.ref code ,bi.qtt quantity ,bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.bostamp ,st.u_uncxcl from bi inner join bo on bo.bostamp=bi.bostamp inner join st on st.ref = bi.ref where bo.ndos = 250 and bo.boano = 2012 and bo.obrano = 2501243 
20250217@173621.9204 90khm14k3vtiibsoeth1ngr466 Query : use flama_phc
20250217@173621.9282 90khm14k3vtiibsoeth1ngr466 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250217@173622.1119 90khm14k3vtiibsoeth1ngr466 Query : use flama_phc
20250217@173622.1201 90khm14k3vtiibsoeth1ngr466 Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -9010
20250217@173622.1561 90khm14k3vtiibsoeth1ngr466 Query : insert into wserrorlog (errornumber, errormsg,requesttable,initialdata,finaldata) values (-9010,?,'ft',?,?)
20250217@173622.1730 90khm14k3vtiibsoeth1ngr466 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5395';
20250217@173622.2046 90khm14k3vtiibsoeth1ngr466 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5395';
20250217@173622.3478 m8rngtgoi69k15mkq8k2soub44 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250217@173622.3489 m8rngtgoi69k15mkq8k2soub44 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250217@173622.3562 m8rngtgoi69k15mkq8k2soub44 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5396';
20250217@173622.3632 m8rngtgoi69k15mkq8k2soub44 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5396';
20250217@173622.3702 m8rngtgoi69k15mkq8k2soub44 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5396';
20250217@173622.3740 m8rngtgoi69k15mkq8k2soub44 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5396';
20250217@173622.3801 m8rngtgoi69k15mkq8k2soub44 Query : use flama_phc
20250217@173622.3805 m8rngtgoi69k15mkq8k2soub44 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250217@173622.3863 m8rngtgoi69k15mkq8k2soub44 Query : use flama_phc
20250217@173622.3866 m8rngtgoi69k15mkq8k2soub44 Query : select no, estab,szadrsdesc from szadrs where u_coddest=339
20250217@173622.3955 m8rngtgoi69k15mkq8k2soub44 Query : select bi.bistamp ,bi.ref code ,bi.qtt quantity ,bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.bostamp ,st.u_uncxcl from bi inner join bo on bo.bostamp=bi.bostamp inner join st on st.ref = bi.ref where bo.ndos = 250 and bo.boano = 2012 and bo.obrano = 2501244 
20250217@173622.4354 m8rngtgoi69k15mkq8k2soub44 Query : use flama_phc
20250217@173622.4357 m8rngtgoi69k15mkq8k2soub44 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250217@173622.4386 m8rngtgoi69k15mkq8k2soub44 Query : use flama_phc
20250217@173622.4389 m8rngtgoi69k15mkq8k2soub44 Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -9010
20250217@173622.4404 m8rngtgoi69k15mkq8k2soub44 Query : insert into wserrorlog (errornumber, errormsg,requesttable,initialdata,finaldata) values (-9010,?,'ft',?,?)
20250217@173622.4426 m8rngtgoi69k15mkq8k2soub44 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5396';
20250217@173622.4471 m8rngtgoi69k15mkq8k2soub44 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5396';
20250217@173622.5145 mt6teglr345d3tinpbeao0jsvr Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250217@173622.5228 mt6teglr345d3tinpbeao0jsvr Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250217@173622.5713 mt6teglr345d3tinpbeao0jsvr Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5397';
20250217@173622.6312 mt6teglr345d3tinpbeao0jsvr Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5397';
20250217@173622.6703 mt6teglr345d3tinpbeao0jsvr Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5397';
20250217@173622.7065 mt6teglr345d3tinpbeao0jsvr Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5397';
20250217@173622.7428 mt6teglr345d3tinpbeao0jsvr Query : use flama_phc
20250217@173622.7472 mt6teglr345d3tinpbeao0jsvr Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250217@173622.8095 mt6teglr345d3tinpbeao0jsvr Query : use flama_phc
20250217@173622.8137 mt6teglr345d3tinpbeao0jsvr Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20250217@173622.8538 mt6teglr345d3tinpbeao0jsvr Query : select bi.bistamp ,bi.ref code ,bi.qtt quantity ,bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.bostamp ,st.u_uncxcl from bi inner join bo on bo.bostamp=bi.bostamp inner join st on st.ref = bi.ref where bo.ndos = 250 and bo.boano = 2012 and bo.obrano = 2501245 
20250217@173622.9537 mt6teglr345d3tinpbeao0jsvr Query : use flama_phc
20250217@173622.9580 mt6teglr345d3tinpbeao0jsvr Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250217@173623.1294 mt6teglr345d3tinpbeao0jsvr Query : use flama_phc
20250217@173623.1408 mt6teglr345d3tinpbeao0jsvr Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -9010
20250217@173623.1440 mt6teglr345d3tinpbeao0jsvr Query : insert into wserrorlog (errornumber, errormsg,requesttable,initialdata,finaldata) values (-9010,?,'ft',?,?)
20250217@173623.1880 mt6teglr345d3tinpbeao0jsvr Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5397';
20250217@173623.2615 mt6teglr345d3tinpbeao0jsvr Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5397';

20250217@195332.1554 pt4pfa7dpfm5apbebd8s9v34tm Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5398';
20250217@195332.1644 pt4pfa7dpfm5apbebd8s9v34tm Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5398';
20250217@195332.1692 pt4pfa7dpfm5apbebd8s9v34tm Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5398';
20250217@195359.8625 99oit3u6g3c761gp7q4vpreovl Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250217@195359.8676 99oit3u6g3c761gp7q4vpreovl Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250217@195359.8955 99oit3u6g3c761gp7q4vpreovl Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5399';
20250217@195359.9041 99oit3u6g3c761gp7q4vpreovl Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5399';
20250217@195359.9118 99oit3u6g3c761gp7q4vpreovl Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5399';
20250217@195359.9163 99oit3u6g3c761gp7q4vpreovl Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5399';
20250217@195359.9540 887f7osf8v7hn6rtgl21u5aj1f Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250217@195359.9552 887f7osf8v7hn6rtgl21u5aj1f Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250217@195359.9650 887f7osf8v7hn6rtgl21u5aj1f Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5400';
20250217@195359.9764 887f7osf8v7hn6rtgl21u5aj1f Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5400';
20250217@195359.9848 887f7osf8v7hn6rtgl21u5aj1f Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5400';
20250217@195359.9914 887f7osf8v7hn6rtgl21u5aj1f Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5400';

20250218@120604.5369 25jsvc7n4iu1il6nuv549e7laq Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5401';
20250218@120604.5465 25jsvc7n4iu1il6nuv549e7laq Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5401';
20250218@120604.5510 25jsvc7n4iu1il6nuv549e7laq Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5401';
20250218@120604.5568 25jsvc7n4iu1il6nuv549e7laq Query : use flama_phc
20250218@120604.5571 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250218@120604.5686 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2062.00.1'
20250218@120604.5807 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =002 and bo.boano =2024 and bo.obrano = 2401110 and bi.ref ='324.2062.00.1' and bi.lordem =130000
20250218@120604.6137 25jsvc7n4iu1il6nuv549e7laq Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'cps24092052828,738000008 ' 
20250218@120604.6442 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2053.00.1'
20250218@120604.6567 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =002 and bo.boano =2024 and bo.obrano = 2401110 and bi.ref ='324.2053.00.1' and bi.lordem =110000
20250218@120604.6898 25jsvc7n4iu1il6nuv549e7laq Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'cps24092052828,468000007 ' 
20250218@120604.7216 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2042.00.1'
20250218@120604.7330 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =002 and bo.boano =2024 and bo.obrano = 2401110 and bi.ref ='324.2042.00.1' and bi.lordem =50000
20250218@120604.7650 25jsvc7n4iu1il6nuv549e7laq Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'cps24092052827,492000004 ' 
20250218@120604.7955 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2036.00.1'
20250218@120604.8068 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =002 and bo.boano =2024 and bo.obrano = 2401110 and bi.ref ='324.2036.00.1' and bi.lordem =30000
20250218@120604.8383 25jsvc7n4iu1il6nuv549e7laq Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'cps24092052827,217000003 ' 
20250218@120604.8675 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2052.00.1'
20250218@120604.9977 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =002 and bo.boano =2024 and bo.obrano = 2401110 and bi.ref ='324.2052.00.1' and bi.lordem =90000
20250218@120605.3950 25jsvc7n4iu1il6nuv549e7laq Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'cps24092052828,076000006 ' 
20250218@120605.1008 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2032.00.1'
20250218@120605.1133 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =002 and bo.boano =2024 and bo.obrano = 2401110 and bi.ref ='324.2032.00.1' and bi.lordem =10000
20250218@120605.1669 25jsvc7n4iu1il6nuv549e7laq Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'cps24092052826,850000002 ' 
20250218@120605.2031 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2043.00.1'
20250218@120605.2154 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =002 and bo.boano =2024 and bo.obrano = 2401110 and bi.ref ='324.2043.00.1' and bi.lordem =70000
20250218@120605.2712 25jsvc7n4iu1il6nuv549e7laq Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'cps24092052827,766000005 ' 
20250218@120605.3221 25jsvc7n4iu1il6nuv549e7laq Query : use flama_phc
20250218@120605.3226 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 1 valor from ts where ts.ndos = 61
20250218@120605.3325 25jsvc7n4iu1il6nuv549e7laq Query : use flama_phc
20250218@120605.3329 25jsvc7n4iu1il6nuv549e7laq Query : select lower(descricao) descricao ,case when valor='s' then 1 else 0 end valor from para1 where descricao in ('st_lote','st_usalogifunc', 'st_grelha')
20250218@120605.3405 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 assinadoc issigned ,ts.stocks ,ts.bdempresas origin ,case when (cmstocks between 1 and 50 or cm2stocks between 1 and 50 ) then 1 else 0 end entrada ,case when cmstocks>50 or (cm2stocks>50 and trfa =1) then 1 else 0 end saida ,stneg validatestock ,tiposaft ,veserie useserialnumber ,foserie assetin ,ftserie assetout ,veserie assets ,trfarm assetstransfer ,grelha usegridfields from ts inner join ts2 on ts.tsstamp=ts2.ts2stamp where ts.ndos =61
20250218@120605.3568 25jsvc7n4iu1il6nuv549e7laq Query : use flama_phc
20250218@120605.3573 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 ~inactivo valor from fl where no = '202568' and estab = 00 order by inactivo desc
20250218@120605.3695 25jsvc7n4iu1il6nuv549e7laq Query : use flama_phc
20250218@120605.3699 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from ts where ndos = 61
20250218@120605.3772 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120605.4129 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20250218@120605.4202 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120605.4218 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20250218@120605.4228 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120605.4244 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20250218@120605.4255 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 ts2.manternumero, ts.tiposaft, ts.idserie,ts.nmdos,ts.bdempresas from ts inner join ts2 on ts.tsstamp=ts2.ts2stamp where ts.ndos = 61
20250218@120605.4381 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2025 order by obrano desc
20250218@120605.4522 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2025 order by obrano desc
20250218@120605.4542 25jsvc7n4iu1il6nuv549e7laq Query : use flama_phc
20250218@120605.4549 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202568' and estab=00
20250218@120605.4637 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120605.4654 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20250218@120605.4691 25jsvc7n4iu1il6nuv549e7laq Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b475295167b477ad6e',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20250218@120605.4765 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120605.4782 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20250218@120605.4796 25jsvc7n4iu1il6nuv549e7laq Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b475295167b477ad6e','--','bo',7.8940914158305462653 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20250218@120605.5001 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120605.5018 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20250218@120605.5032 25jsvc7n4iu1il6nuv549e7laq Query : insert into bo (bostamp, nmdos, dataobra, ndos, obrano, no, estab, nome, ncont, morada, local, codpost, moeda, boano, memissao,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b475295167b477ad6e','guia r. fornecedor','2025-02-18',61,2500627,?,?,?,?,?,?,?,?,2025, (select valor from para1 where descricao = 'ge_euro') ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20250218@120609.1250 25jsvc7n4iu1il6nuv549e7laq Query : use flama_phc
20250218@120609.1280 25jsvc7n4iu1il6nuv549e7laq Query : select st.usalote valor from st where st.ref = '324.2062.00.1'
20250218@120609.1519 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.2062.00.1'
20250218@120609.1733 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120609.1794 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20250218@120609.1820 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120609.1840 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20250218@120609.1850 25jsvc7n4iu1il6nuv549e7laq Query : select sestamp valor from se where ref ='324.2062.00.1' and lote = 'r2401110130a'
20250218@120609.1926 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120609.1945 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20250218@120609.1973 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120609.1996 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20250218@120609.2012 25jsvc7n4iu1il6nuv549e7laq Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b471863767b477b130',?,?,'20250218',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20250218@120609.4250 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250218@120609.4396 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120609.4475 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20250218@120609.4549 25jsvc7n4iu1il6nuv549e7laq Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b474192967b477b16b','aut67b475295167b477ad6e',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from bo bo where bo.bostamp = 'aut67b475295167b477ad6e'
20250218@120609.4826 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120609.4864 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20250218@120609.4919 25jsvc7n4iu1il6nuv549e7laq Query : insert into bi (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,obistamp ,stipo) select 'aut67b474192967b477b16b',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1300, 1300*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,10000 ,8.740714588335,8.740714588335*200.48,8.740714588335,8.740714588335*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,8.740714588335*1300,8.740714588335*1300*200.48 ,.000000,.000000*200.48 ,.000000,.000000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,8.740714588335,8.740714588335*200.48,8.740714588335*1300,8.740714588335*1300*200.48,'cps24092052828,738000008 ',69,69*1300,69,69*1300,?,?,?,4 from bo bo where bo.bostamp = 'aut67b475295167b477ad6e'
20250218@120639.1024 25jsvc7n4iu1il6nuv549e7laq Query : use flama_phc
20250218@120639.1031 25jsvc7n4iu1il6nuv549e7laq Query : select st.usalote valor from st where st.ref = '324.2053.00.1'
20250218@120639.1061 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.2053.00.1'
20250218@120639.1214 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120639.1233 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20250218@120639.1247 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120639.1264 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20250218@120639.1276 25jsvc7n4iu1il6nuv549e7laq Query : select sestamp valor from se where ref ='324.2053.00.1' and lote = 'r2401110110a'
20250218@120639.1294 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120639.1313 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20250218@120639.1323 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120639.1339 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20250218@120639.1355 25jsvc7n4iu1il6nuv549e7laq Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b478573467b477cf20',?,?,'20250218',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20250218@120639.1428 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250218@120639.1444 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120639.1462 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20250218@120639.1478 25jsvc7n4iu1il6nuv549e7laq Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b474442767b477cf23','aut67b475295167b477ad6e',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from bo bo where bo.bostamp = 'aut67b475295167b477ad6e'
20250218@120639.1641 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120639.1661 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20250218@120639.1681 25jsvc7n4iu1il6nuv549e7laq Query : insert into bi (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,obistamp ,stipo) select 'aut67b474442767b477cf23',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1200, 1200*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,20000 ,12.034317186838,12.034317186838*200.48,12.034317186838,12.034317186838*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,12.034317186838*1200,12.034317186838*1200*200.48 ,.000000,.000000*200.48 ,.000000,.000000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,12.034317186838,12.034317186838*200.48,12.034317186838*1200,12.034317186838*1200*200.48,'cps24092052828,468000007 ',95,95*1200,95,95*1200,?,?,?,4 from bo bo where bo.bostamp = 'aut67b475295167b477ad6e'
20250218@120640.2203 25jsvc7n4iu1il6nuv549e7laq Query : use flama_phc
20250218@120640.2217 25jsvc7n4iu1il6nuv549e7laq Query : select st.usalote valor from st where st.ref = '324.2042.00.1'
20250218@120640.2239 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.2042.00.1'
20250218@120640.2470 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.2487 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20250218@120640.2500 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.2515 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20250218@120640.2524 25jsvc7n4iu1il6nuv549e7laq Query : select sestamp valor from se where ref ='324.2042.00.1' and lote = 'r2401110500a'
20250218@120640.2538 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.2552 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20250218@120640.2561 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.2576 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20250218@120640.2588 25jsvc7n4iu1il6nuv549e7laq Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b474819667b477d03e',?,?,'20250218',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20250218@120640.2647 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250218@120640.2661 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.2676 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20250218@120640.2691 25jsvc7n4iu1il6nuv549e7laq Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b476422467b477d040','aut67b475295167b477ad6e',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from bo bo where bo.bostamp = 'aut67b475295167b477ad6e'
20250218@120640.2840 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.2857 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20250218@120640.2873 25jsvc7n4iu1il6nuv549e7laq Query : insert into bi (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,obistamp ,stipo) select 'aut67b476422467b477d040',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1500, 1500*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,30000 ,8.6140375653156,8.6140375653156*200.48,8.6140375653156,8.6140375653156*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,8.6140375653156*1500,8.6140375653156*1500*200.48 ,.000000,.000000*200.48 ,.000000,.000000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,8.6140375653156,8.6140375653156*200.48,8.6140375653156*1500,8.6140375653156*1500*200.48,'cps24092052827,492000004 ',68,68*1500,68,68*1500,?,?,?,4 from bo bo where bo.bostamp = 'aut67b475295167b477ad6e'
20250218@120640.3454 25jsvc7n4iu1il6nuv549e7laq Query : use flama_phc
20250218@120640.3459 25jsvc7n4iu1il6nuv549e7laq Query : select st.usalote valor from st where st.ref = '324.2036.00.1'
20250218@120640.3486 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.2036.00.1'
20250218@120640.3631 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.3647 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20250218@120640.3661 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.3703 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20250218@120640.3712 25jsvc7n4iu1il6nuv549e7laq Query : select sestamp valor from se where ref ='324.2036.00.1' and lote = 'r2401110300a'
20250218@120640.3725 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.3742 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20250218@120640.3751 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.3766 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20250218@120640.3779 25jsvc7n4iu1il6nuv549e7laq Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b479768967b477d05b',?,?,'20250218',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20250218@120640.3835 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250218@120640.3870 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.3886 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20250218@120640.3911 25jsvc7n4iu1il6nuv549e7laq Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b471106267b477d05e','aut67b475295167b477ad6e',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from bo bo where bo.bostamp = 'aut67b475295167b477ad6e'
20250218@120640.4067 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.4085 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20250218@120640.4101 25jsvc7n4iu1il6nuv549e7laq Query : insert into bi (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,obistamp ,stipo) select 'aut67b471106267b477d05e',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1300, 1300*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,40000 ,7.1699195028951,7.1699195028951*200.48,7.1699195028951,7.1699195028951*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,7.1699195028951*1300,7.1699195028951*1300*200.48 ,.000000,.000000*200.48 ,.000000,.000000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,7.1699195028951,7.1699195028951*200.48,7.1699195028951*1300,7.1699195028951*1300*200.48,'cps24092052827,217000003 ',56.6,56.6*1300,56.6,56.6*1300,?,?,?,4 from bo bo where bo.bostamp = 'aut67b475295167b477ad6e'
20250218@120640.4877 25jsvc7n4iu1il6nuv549e7laq Query : use flama_phc
20250218@120640.4882 25jsvc7n4iu1il6nuv549e7laq Query : select st.usalote valor from st where st.ref = '324.2052.00.1'
20250218@120640.4904 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.2052.00.1'
20250218@120640.5052 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.5068 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20250218@120640.5081 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.6205 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20250218@120640.6217 25jsvc7n4iu1il6nuv549e7laq Query : select sestamp valor from se where ref ='324.2052.00.1' and lote = 'r2401110900a'
20250218@120640.6233 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.6252 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20250218@120640.6261 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.6277 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20250218@120640.6316 25jsvc7n4iu1il6nuv549e7laq Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b479824967b477d098',?,?,'20250218',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20250218@120640.6376 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250218@120640.6389 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.6404 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20250218@120640.6415 25jsvc7n4iu1il6nuv549e7laq Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b478223667b477d09b','aut67b475295167b477ad6e',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from bo bo where bo.bostamp = 'aut67b475295167b477ad6e'
20250218@120640.6580 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.6598 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20250218@120640.6615 25jsvc7n4iu1il6nuv549e7laq Query : insert into bi (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,obistamp ,stipo) select 'aut67b478223667b477d09b',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1200, 1200*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,50000 ,9.5007767264511,9.5007767264511*200.48,9.5007767264511,9.5007767264511*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,9.5007767264511*1200,9.5007767264511*1200*200.48 ,.000000,.000000*200.48 ,.000000,.000000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,9.5007767264511,9.5007767264511*200.48,9.5007767264511*1200,9.5007767264511*1200*200.48,'cps24092052828,076000006 ',75,75*1200,75,75*1200,?,?,?,4 from bo bo where bo.bostamp = 'aut67b475295167b477ad6e'
20250218@120640.7190 25jsvc7n4iu1il6nuv549e7laq Query : use flama_phc
20250218@120640.7194 25jsvc7n4iu1il6nuv549e7laq Query : select st.usalote valor from st where st.ref = '324.2032.00.1'
20250218@120640.7217 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.2032.00.1'
20250218@120640.7359 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.7375 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20250218@120640.7389 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.7403 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20250218@120640.7411 25jsvc7n4iu1il6nuv549e7laq Query : select sestamp valor from se where ref ='324.2032.00.1' and lote = 'r2401110100a'
20250218@120640.7424 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.7441 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20250218@120640.7451 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.7466 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20250218@120640.7478 25jsvc7n4iu1il6nuv549e7laq Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b476498067b477d0b5',?,?,'20250218',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20250218@120640.7534 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250218@120640.7547 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.7565 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20250218@120640.7579 25jsvc7n4iu1il6nuv549e7laq Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b477057767b477d0b8','aut67b475295167b477ad6e',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from bo bo where bo.bostamp = 'aut67b475295167b477ad6e'
20250218@120640.7824 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.7843 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20250218@120640.7862 25jsvc7n4iu1il6nuv549e7laq Query : insert into bi (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,obistamp ,stipo) select 'aut67b477057767b477d0b8',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 2200, 2200*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,60000 ,6.9165654568564,6.9165654568564*200.48,6.9165654568564,6.9165654568564*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,6.9165654568564*2200,6.9165654568564*2200*200.48 ,.000000,.000000*200.48 ,.000000,.000000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,6.9165654568564,6.9165654568564*200.48,6.9165654568564*2200,6.9165654568564*2200*200.48,'cps24092052826,850000002 ',54.6,54.6*2200,54.6,54.6*2200,?,?,?,4 from bo bo where bo.bostamp = 'aut67b475295167b477ad6e'
20250218@120640.8587 25jsvc7n4iu1il6nuv549e7laq Query : use flama_phc
20250218@120640.8592 25jsvc7n4iu1il6nuv549e7laq Query : select st.usalote valor from st where st.ref = '324.2043.00.1'
20250218@120640.8614 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.2043.00.1'
20250218@120640.8756 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.8774 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20250218@120640.8787 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.8806 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20250218@120640.8816 25jsvc7n4iu1il6nuv549e7laq Query : select sestamp valor from se where ref ='324.2043.00.1' and lote = 'r2401110700a'
20250218@120640.8830 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.8845 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20250218@120640.8856 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.8873 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20250218@120640.8886 25jsvc7n4iu1il6nuv549e7laq Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b470430967b477d0d8',?,?,'20250218',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20250218@120640.8940 25jsvc7n4iu1il6nuv549e7laq Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250218@120640.8955 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.8972 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20250218@120640.8984 25jsvc7n4iu1il6nuv549e7laq Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b476663167b477d0da','aut67b475295167b477ad6e',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from bo bo where bo.bostamp = 'aut67b475295167b477ad6e'
20250218@120640.9133 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@120640.9151 25jsvc7n4iu1il6nuv549e7laq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20250218@120640.9175 25jsvc7n4iu1il6nuv549e7laq Query : insert into bi (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,obistamp ,stipo) select 'aut67b476663167b477d0da',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1300, 1300*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,70000 ,8.97,8.97*200.48,8.97,8.97*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,8.97*1300,8.97*1300*200.48 ,.000000,.000000*200.48 ,.000000,.000000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,8.97,8.97*200.48,8.97*1300,8.97*1300*200.48,'cps24092052827,766000005 ',70.81,70.81*1300,70.81,70.81*1300,?,?,?,4 from bo bo where bo.bostamp = 'aut67b475295167b477ad6e'
20250218@120640.9834 25jsvc7n4iu1il6nuv549e7laq Query : use flama_phc
20250218@120640.9839 25jsvc7n4iu1il6nuv549e7laq Query : declare @bostamp varchar(25) = 'aut67b475295167b477ad6e' ,@bistamp varchar(25) = '' update bi set tecoval = qtt * ecoval ,etecoval = qtt * eecoval ,tecoval2 = qtt * ecoval2 ,etecoval2 = qtt * eecoval2 where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end -- se tiver classificação e não for normal, não calcula nada update bi set ttdeb = 0 ,ettdeb = 0 ,ttmoeda = 0 where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and bi.classifc <> '' and bi.classifc <> 'normal' -- no caso normal com moeda euro if exists ( select 1 from bo cross apply ( select valor moeda from para1 where descricao = 'ge_pteoueuro' ) par where bo.bostamp = @bostamp and bo.moeda = par.moeda ) begin -- sem ecovalores update bi set ettdeb = round(bi.qtt * ((bi.edebito * (1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100))), 6) ,ttdeb = round(bi.qtt * ((bi.debito * (1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100))), 6) ,ttmoeda = 0 from bi inner join bo on bi.bostamp = bo.bostamp where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and ( bi.classifc = '' or bi.classifc = 'normal' ) and bi.econotcalc = 1 -- com ecovalores update bi set ettdeb = round(bi.qtt * ( ( bi.edebito + ( iif(p.st_econotdesc = 1, - bi.eecoval2, bi.eecoval) * ( 1 + iif(bi.ivaincl = 1 and tiva.taxa <> 0, tiva.taxa / 100, 0) ) ) ) * (1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) ), 6) + ( bi.qtt * iif(p.st_econotdesc = 1, (bi.eecoval + bi.eecoval2) * ( 1 + iif(bi.ivaincl = 1 and tiva.taxa <> 0, tiva.taxa / 100, 0) ), 0) ) ,ttdeb = round(bi.qtt * ( ( bi.debito + ( iif(p.st_econotdesc = 1, - bi.ecoval2, bi.ecoval) * ( 1 + iif(bi.ivaincl = 1 and tiva.taxa <> 0, tiva.taxa / 100, 0) ) ) ) * (1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) ), 6) + ( bi.qtt * iif(p.st_econotdesc = 1, (bi.ecoval + bi.ecoval2) * ( 1 + iif(bi.ivaincl = 1 and tiva.taxa <> 0, tiva.taxa / 100, 0) ), 0) ) ,ttmoeda = 0 from bi inner join bo on bi.bostamp = bo.bostamp left join st on bi.ref = st.ref left join taxasiva tiva on bi.tabiva = tiva.codigo cross apply ( select max(valor) st_econotdesc from ( select case when valor = 's' then 1 else 0 end valor from para1 where descricao = 'st_econotdesc' union all select 0 ) a ) p where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and ( bi.classifc = '' or bi.classifc = 'normal' ) and bi.econotcalc = 0 --acrescenta os descontos em valor, caso existam: update bi set ettdeb = round(bi.ettdeb - (bi.qtt * bi.evaldesc), 2) ,ttdeb = round(bi.ttdeb - (bi.qtt * bi.valdesc), 2) ,ttmoeda = 0 from bi where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and ( bi.classifc = '' or bi.classifc = 'normal' ) and bi.valdesc <> 0 end else begin update bi set ttmoeda = round((1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) * bi.qtt * bi.vumoeda, 2) ,ettdeb = case when bo2.cambio <> 0 then round((round((1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) * bi.qtt * bi.vumoeda, 2)) / bo2.cambio, 2) else 0 end ,edebito = case when bi.qtt = 0 then 0 else round(abs(( case when bo2.cambio <> 0 then round((round((1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) * bi.qtt * bi.vumoeda, 2)) / bo2.cambio, 2) else 0 end ) / (1 - bi.desconto / 100) / (1 - bi.desc2 / 100) / (1 - bi.desc3 / 100) / (1 - bi.desc4 / 100) / (1 - bi.desc5 / 100) / (1 - bi.desc6 / 100) / bi.qtt), 2) end ,debito = case when bi.qtt = 0 then 0 else round(abs(( case when bo2.cambio <> 0 then round((round((1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) * bi.qtt * bi.vumoeda, 2)) / bo2.cambio, 2) else 0 end ) / (1 - bi.desconto / 100) / (1 - bi.desc2 / 100) / (1 - bi.desc3 / 100) / (1 - bi.desc4 / 100) / (1 - bi.desc5 / 100) / (1 - bi.desc6 / 100) / bi.qtt), 2) end * 200.482 from bi inner join bo2 on bi.bostamp = bo2.bo2stamp where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and ( bi.classifc = '' or bi.classifc = 'normal' ) update bi set ttdeb = round(bi.ttdeb - (bi.qtt * bi.valdesc), 2) ,ettdeb = round(bi.ettdeb - (bi.qtt * bi.evaldesc), 0) ,debito = round(bi.debito - (bi.qtt * bi.valdesc), 2) ,edebito = round(bi.edebito - (bi.qtt * bi.evaldesc), 2) where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and ( bi.classifc = '' or bi.classifc = 'normal' ) and bi.valdesc <> 0 end 
20250218@120648.9313 25jsvc7n4iu1il6nuv549e7laq Query : use flama_phc
20250218@120648.9316 25jsvc7n4iu1il6nuv549e7laq Query : select 1 valor from bo where bo.bostamp = 'aut67b475295167b477ad6e'
20250218@120648.9402 25jsvc7n4iu1il6nuv549e7laq Query : declare @errno int ,@errmsg varchar(255) ,@prod bit ,@nrdec numeric(10, 0) ,@totaldeb numeric(18, 5) ,@etotaldeb numeric(19, 6) ,@total numeric(18, 5) ,@etotal numeric(19, 6) ,@custo numeric(18, 5) ,@ecusto numeric(19, 6) ,@bo_1iliq numeric(19, 6) ,@bo_2iliq numeric(19, 6) ,@base1 numeric(19, 6) ,@base2 numeric(19, 6) ,@moetotal numeric(13, 3) ,@smoe1 numeric(13, 3) ,@smoe2 numeric(13, 3) ,@smoe3 numeric(13, 3) ,@smoe4 numeric(13, 3) ,@bo11_bins numeric(18, 5) ,@bo21_bins numeric(18, 5) ,@bo31_bins numeric(18, 5) ,@bo41_bins numeric(18, 5) ,@bo51_bins numeric(18, 5) ,@bo61_bins numeric(18, 5) ,@bo71_bins numeric(18, 5) ,@bo81_bins numeric(18, 5) ,@bo91_bins numeric(18, 5) ,@bo12_bins numeric(18, 5) ,@bo22_bins numeric(18, 5) ,@bo32_bins numeric(18, 5) ,@bo42_bins numeric(18, 5) ,@bo52_bins numeric(18, 5) ,@bo62_bins numeric(18, 5) ,@bo72_bins numeric(18, 5) ,@bo82_bins numeric(18, 5) ,@bo92_bins numeric(18, 5) ,@ebo11_bins numeric(19, 6) ,@ebo21_bins numeric(19, 6) ,@ebo31_bins numeric(19, 6) ,@ebo41_bins numeric(19, 6) ,@ebo51_bins numeric(19, 6) ,@ebo61_bins numeric(19, 6) ,@ebo71_bins numeric(18, 5) ,@ebo81_bins numeric(18, 5) ,@ebo91_bins numeric(18, 5) ,@ebo12_bins numeric(19, 6) ,@ebo22_bins numeric(19, 6) ,@ebo32_bins numeric(19, 6) ,@ebo42_bins numeric(19, 6) ,@ebo52_bins numeric(19, 6) ,@ebo62_bins numeric(19, 6) ,@ebo72_bins numeric(18, 5) ,@ebo82_bins numeric(18, 5) ,@ebo92_bins numeric(18, 5) ,@bo11_iva numeric(18, 5) ,@bo21_iva numeric(18, 5) ,@bo31_iva numeric(18, 5) ,@bo41_iva numeric(18, 5) ,@bo51_iva numeric(18, 5) ,@bo61_iva numeric(18, 5) ,@bo71_iva numeric(18, 5) ,@bo81_iva numeric(18, 5) ,@bo91_iva numeric(18, 5) ,@bo12_iva numeric(18, 5) ,@bo22_iva numeric(18, 5) ,@bo32_iva numeric(18, 5) ,@bo42_iva numeric(18, 5) ,@bo52_iva numeric(18, 5) ,@bo62_iva numeric(18, 5) ,@bo72_iva numeric(18, 5) ,@bo82_iva numeric(18, 5) ,@bo92_iva numeric(18, 5) ,@ebo11_iva numeric(19, 6) ,@ebo21_iva numeric(19, 6) ,@ebo31_iva numeric(19, 6) ,@ebo41_iva numeric(19, 6) ,@ebo51_iva numeric(19, 6) ,@ebo61_iva numeric(19, 6) ,@ebo71_iva numeric(18, 5) ,@ebo81_iva numeric(18, 5) ,@ebo91_iva numeric(18, 5) ,@ebo12_iva numeric(19, 6) ,@ebo22_iva numeric(19, 6) ,@ebo32_iva numeric(19, 6) ,@ebo42_iva numeric(19, 6) ,@ebo52_iva numeric(19, 6) ,@ebo62_iva numeric(19, 6) ,@ebo72_iva numeric(18, 5) ,@ebo82_iva numeric(18, 5) ,@ebo92_iva numeric(18, 5) ,@esdeb1 numeric(19, 6) ,@esdeb2 numeric(19, 6) ,@esdeb3 numeric(19, 6) ,@esdeb4 numeric(19, 6) ,@sdeb1 numeric(18, 5) ,@sdeb2 numeric(18, 5) ,@sdeb3 numeric(18, 5) ,@sdeb4 numeric(18, 5) ,@estot1 numeric(19, 6) ,@estot2 numeric(19, 6) ,@estot3 numeric(19, 6) ,@estot4 numeric(19, 6) ,@stot1 numeric(18, 5) ,@stot2 numeric(18, 5) ,@stot3 numeric(18, 5) ,@stot4 numeric(18, 5) ,@ebo_1tvall numeric(19, 6) ,@ebo_2tvall numeric(19, 6) ,@bo_1tvall numeric(18, 5) ,@bo_2tvall numeric(18, 5) ,@ebo_totp1 numeric(19, 6) ,@ebo_totp2 numeric(19, 6) ,@bo_totp1 numeric(18, 5) ,@bo_totp2 numeric(18, 5) ,@sqtt11 numeric(13, 3) ,@sqtt21 numeric(13, 3) ,@sqtt12 numeric(13, 3) ,@sqtt22 numeric(13, 3) ,@sqtt13 numeric(13, 3) ,@sqtt23 numeric(13, 3) ,@sqtt14 numeric(13, 3) ,@sqtt24 numeric(13, 3) ,@userinis varchar (30) ,@mybostamp char(25) = 'aut67b475295167b477ad6e' declare @totaisiva table ( bostamp varchar (25), codigo numeric(1), taxa numeric (5,2), ebaseinc numeric (19,6), baseinc numeric (18,5), evalor numeric (19,6), valor numeric (18,5) ) set @prod = ( select ts.producao from bo(nolock) inner join ts(nolock) on bo.ndos = ts.ndos and bo.bostamp = @mybostamp ) set @nrdec = ( select convert(numeric(10, 0), valor) from para1(nolock) where descricao = 'de_euro' ) --set @prod = 0 --set @nrdec = 2 select @ecusto = sum(bi.epcusto * bi.qtt) ,@custo = sum(bi.pcusto * bi.qtt) ,@bo11_bins = sum(case when bi.tabiva = 1 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo21_bins = sum(case when bi.tabiva = 2 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo31_bins = sum(case when bi.tabiva = 3 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo41_bins = sum(case when bi.tabiva = 4 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo51_bins = sum(case when bi.tabiva = 5 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo61_bins = sum(case when bi.tabiva = 6 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo71_bins = sum(case when bi.tabiva = 7 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo81_bins = sum(case when bi.tabiva = 8 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo91_bins = sum(case when bi.tabiva = 9 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo12_bins = sum(case when bi.tabiva = 1 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo22_bins = sum(case when bi.tabiva = 2 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo32_bins = sum(case when bi.tabiva = 3 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo42_bins = sum(case when bi.tabiva = 4 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo52_bins = sum(case when bi.tabiva = 5 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo62_bins = sum(case when bi.tabiva = 6 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo72_bins = sum(case when bi.tabiva = 7 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo82_bins = sum(case when bi.tabiva = 8 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo92_bins = sum(case when bi.tabiva = 9 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo11_bins = sum(case when bi.tabiva = 1 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo21_bins = sum(case when bi.tabiva = 2 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo31_bins = sum(case when bi.tabiva = 3 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo41_bins = sum(case when bi.tabiva = 4 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo51_bins = sum(case when bi.tabiva = 5 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo61_bins = sum(case when bi.tabiva = 6 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo71_bins = sum(case when bi.tabiva = 7 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo81_bins = sum(case when bi.tabiva = 8 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo91_bins = sum(case when bi.tabiva = 9 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo12_bins = sum(case when bi.tabiva = 1 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo22_bins = sum(case when bi.tabiva = 2 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo32_bins = sum(case when bi.tabiva = 3 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo42_bins = sum(case when bi.tabiva = 4 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo52_bins = sum(case when bi.tabiva = 5 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo62_bins = sum(case when bi.tabiva = 6 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo72_bins = sum(case when bi.tabiva = 7 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo82_bins = sum(case when bi.tabiva = 8 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo92_bins = sum(case when bi.tabiva = 9 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo_1iliq = round(sum(bi.qtt * bi.epu), @nrdec) ,@bo_2iliq = round(sum(bi.ettdeb), @nrdec) ,@bo11_iva = sum(case when bi.tabiva = 1 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo12_iva = sum(case when bi.tabiva = 1 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo21_iva = sum(case when bi.tabiva = 2 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo22_iva = sum(case when bi.tabiva = 2 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo31_iva = sum(case when bi.tabiva = 3 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo32_iva = sum(case when bi.tabiva = 3 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo41_iva = sum(case when bi.tabiva = 4 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo42_iva = sum(case when bi.tabiva = 4 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo51_iva = sum(case when bi.tabiva = 5 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo52_iva = sum(case when bi.tabiva = 5 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo61_iva = sum(case when bi.tabiva = 6 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo62_iva = sum(case when bi.tabiva = 6 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo71_iva = sum(case when bi.tabiva = 7 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo72_iva = sum(case when bi.tabiva = 7 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo81_iva = sum(case when bi.tabiva = 8 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo82_iva = sum(case when bi.tabiva = 8 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo91_iva = sum(case when bi.tabiva = 9 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo92_iva = sum(case when bi.tabiva = 9 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo11_iva = sum(case when bi.tabiva = 1 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo12_iva = sum(case when bi.tabiva = 1 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo21_iva = sum(case when bi.tabiva = 2 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo22_iva = sum(case when bi.tabiva = 2 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo31_iva = sum(case when bi.tabiva = 3 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo32_iva = sum(case when bi.tabiva = 3 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo41_iva = sum(case when bi.tabiva = 4 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo42_iva = sum(case when bi.tabiva = 4 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo51_iva = sum(case when bi.tabiva = 5 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo52_iva = sum(case when bi.tabiva = 5 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo61_iva = sum(case when bi.tabiva = 6 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo62_iva = sum(case when bi.tabiva = 6 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo71_iva = sum(case when bi.tabiva = 7 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo72_iva = sum(case when bi.tabiva = 7 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo81_iva = sum(case when bi.tabiva = 8 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo82_iva = sum(case when bi.tabiva = 8 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo91_iva = sum(case when bi.tabiva = 9 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else bi.ettdeb - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo92_iva = sum(case when bi.tabiva = 9 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@esdeb1 = sum(case when bi.stipo <= 1 then case when bi.ivaincl = 0 then bi.ettdeb else bi.ettdeb - round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@esdeb2 = sum(case when bi.stipo = 2 then case when bi.ivaincl = 0 then bi.ettdeb else bi.ettdeb - round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@esdeb3 = sum(case when bi.stipo = 3 then case when bi.ivaincl = 0 then bi.ettdeb else bi.ettdeb - round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@esdeb4 = sum(case when bi.stipo = 4 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) * bi.iva / 100, @nrdec) end else 0 end) ,@sdeb1 = sum(case when bi.stipo <= 1 then case when bi.ivaincl = 0 then bi.ttdeb else bi.ttdeb - round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@sdeb2 = sum(case when bi.stipo = 2 then case when bi.ivaincl = 0 then bi.ttdeb else bi.ttdeb - round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@sdeb3 = sum(case when bi.stipo = 3 then case when bi.ivaincl = 0 then bi.ttdeb else bi.ttdeb - round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@sdeb4 = sum(case when bi.stipo = 4 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) * bi.iva / 100, @nrdec) end else 0 end) ,@smoe1 = sum(case when bi.stipo <= 1 then case when bi.ivaincl = 0 then bi.ttmoeda else round(bi.ttmoeda / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@smoe2 = sum(case when bi.stipo = 2 then case when bi.ivaincl = 0 then bi.ttmoeda else round(bi.ttmoeda / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@smoe3 = sum(case when bi.stipo = 3 then case when bi.ivaincl = 0 then bi.ttmoeda else round(bi.ttmoeda / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@smoe4 = sum(case when bi.stipo = 4 then case when bi.ivaincl = 0 then bi.ttmoeda else round(bi.ttmoeda / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@estot1 = sum(case when bi.stipo <= 1 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@estot2 = sum(case when bi.stipo = 2 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@estot3 = sum(case when bi.stipo = 3 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@estot4 = sum(case when bi.stipo = 4 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@stot1 = sum(case when bi.stipo <= 1 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.pu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@stot2 = sum(case when bi.stipo = 2 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.pu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@stot3 = sum(case when bi.stipo = 3 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.pu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@stot4 = sum(case when bi.stipo = 4 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.pu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@total = @stot1 + @stot2 + @stot3 + @stot4 ,@etotal = @estot1 + @estot2 + @estot3 + @estot4 ,@totaldeb = @sdeb1 + @sdeb2 + @sdeb3 + @sdeb4 ,@etotaldeb = @esdeb1 + @esdeb2 + @esdeb3 + @esdeb4 ,@moetotal = @smoe1 + @smoe2 + @smoe3 + @smoe4 ,@ebo_1tvall = @ebo11_bins + @ebo21_bins + @ebo31_bins + @ebo41_bins + @ebo51_bins + @ebo61_bins + @ebo71_bins + @ebo81_bins + @ebo91_bins ,@ebo_2tvall = @ebo12_bins + @ebo22_bins + @ebo32_bins + @ebo42_bins + @ebo52_bins + @ebo62_bins + @ebo72_bins + @ebo82_bins + @ebo92_bins ,@bo_1tvall = @bo11_bins + @bo21_bins + @bo31_bins + @bo41_bins + @bo51_bins + @bo61_bins + @bo71_bins + @bo81_bins + @bo91_bins ,@bo_2tvall = @bo12_bins + @bo22_bins + @bo32_bins + @bo42_bins + @bo52_bins + @bo62_bins + @bo72_bins + @bo82_bins + @bo92_bins ,@ebo_totp1 = sum(case when bi.ivaincl = 0 then (bi.epu * bi.qtt) else round((bi.epu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end) ,@ebo_totp2 = sum(case when bi.ivaincl = 0 then (bi.edebito * bi.qtt) else round((bi.edebito * bi.qtt) / (1 + bi.iva / 100), @nrdec) end) ,@bo_totp1 = sum(case when bi.ivaincl = 0 then (bi.pu * bi.qtt) else round((bi.pu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end) ,@bo_totp2 = sum(case when bi.ivaincl = 0 then (bi.debito * bi.qtt) else round((bi.debito * bi.qtt) / (1 + bi.iva / 100), @nrdec) end) ,@sqtt11 = sum(case when bi.stipo = 1 then bi.qtt else 0 end) ,@sqtt21 = sum(case when bi.stipo = 1 then bi.qtt else 0 end) ,@sqtt12 = sum(case when bi.stipo = 2 then bi.qtt else 0 end) ,@sqtt22 = sum(case when bi.stipo = 2 then bi.qtt else 0 end) ,@sqtt13 = sum(case when bi.stipo = 3 then bi.qtt else 0 end) ,@sqtt23 = sum(case when bi.stipo = 3 then bi.qtt else 0 end) ,@sqtt14 = sum(case when bi.stipo = 4 then bi.qtt else 0 end) ,@sqtt24 = sum(case when bi.stipo = 5 then bi.qtt else 0 end) from bi(nolock) where bi.bostamp = @mybostamp and bi.producao = case when @prod = 1 then 1 else bi.producao end and bi.composto = 0 and bi.qtt <> 0 update bo set bo.totaldeb = isnull(@totaldeb, 0) ,bo.total = isnull(@total, 0) ,bo.etotaldeb = isnull(@etotaldeb, 0) ,bo.moetotal = isnull(@moetotal, 0) ,bo.etotal = isnull(@etotal, 0) ,bo.ecusto = isnull(@ecusto, 0) ,bo.custo = isnull(@custo, 0) ,bo.bo11_bins = isnull(@bo11_bins, 0) ,bo.bo12_bins = isnull(@bo12_bins, 0) ,bo.bo21_bins = isnull(@bo21_bins, 0) ,bo.bo22_bins = isnull(@bo22_bins, 0) ,bo.bo31_bins = isnull(@bo31_bins, 0) ,bo.bo32_bins = isnull(@bo32_bins, 0) ,bo.bo41_bins = isnull(@bo41_bins, 0) ,bo.bo42_bins = isnull(@bo42_bins, 0) ,bo.bo51_bins = isnull(@bo51_bins, 0) ,bo.bo52_bins = isnull(@bo52_bins, 0) ,bo.bo61_bins = isnull(@bo61_bins, 0) ,bo.bo62_bins = isnull(@bo62_bins, 0) ,bo.ebo11_bins = isnull(@ebo11_bins, 0) ,bo.ebo12_bins = isnull(@ebo12_bins, 0) ,bo.ebo21_bins = isnull(@ebo21_bins, 0) ,bo.ebo22_bins = isnull(@ebo22_bins, 0) ,bo.ebo31_bins = isnull(@ebo31_bins, 0) ,bo.ebo32_bins = isnull(@ebo32_bins, 0) ,bo.ebo41_bins = isnull(@ebo41_bins, 0) ,bo.ebo42_bins = isnull(@ebo42_bins, 0) ,bo.ebo51_bins = isnull(@ebo51_bins, 0) ,bo.ebo52_bins = isnull(@ebo52_bins, 0) ,bo.ebo61_bins = isnull(@ebo61_bins, 0) ,bo.ebo62_bins = isnull(@ebo62_bins, 0) ,bo.bo11_iva = isnull(@bo11_iva, 0) ,bo.bo12_iva = isnull(@bo12_iva, 0) ,bo.bo21_iva = isnull(@bo21_iva, 0) ,bo.bo22_iva = isnull(@bo22_iva, 0) ,bo.bo31_iva = isnull(@bo31_iva, 0) ,bo.bo32_iva = isnull(@bo32_iva, 0) ,bo.bo41_iva = isnull(@bo41_iva, 0) ,bo.bo42_iva = isnull(@bo42_iva, 0) ,bo.bo51_iva = isnull(@bo51_iva, 0) ,bo.bo52_iva = isnull(@bo52_iva, 0) ,bo.bo61_iva = isnull(@bo61_iva, 0) ,bo.bo62_iva = isnull(@bo62_iva, 0) ,bo.ebo11_iva = isnull(@ebo11_iva, 0) ,bo.ebo12_iva = isnull(@ebo12_iva, 0) ,bo.ebo21_iva = isnull(@ebo21_iva, 0) ,bo.ebo22_iva = isnull(@ebo22_iva, 0) ,bo.ebo31_iva = isnull(@ebo31_iva, 0) ,bo.ebo32_iva = isnull(@ebo32_iva, 0) ,bo.ebo41_iva = isnull(@ebo41_iva, 0) ,bo.ebo42_iva = isnull(@ebo42_iva, 0) ,bo.ebo51_iva = isnull(@ebo51_iva, 0) ,bo.ebo52_iva = isnull(@ebo52_iva, 0) ,bo.ebo61_iva = isnull(@ebo61_iva, 0) ,bo.ebo62_iva = isnull(@ebo62_iva, 0) ,bo.esdeb1 = isnull(@esdeb1, 0) ,bo.esdeb2 = isnull(@esdeb2, 0) ,bo.esdeb3 = isnull(@esdeb3, 0) ,bo.esdeb4 = isnull(@esdeb4, 0) ,bo.sdeb1 = isnull(@sdeb1, 0) ,bo.sdeb2 = isnull(@sdeb2, 0) ,bo.sdeb3 = isnull(@sdeb3, 0) ,bo.sdeb4 = isnull(@sdeb4, 0) ,bo.smoe1 = isnull(@smoe1, 0) ,bo.smoe2 = isnull(@smoe2, 0) ,bo.smoe3 = isnull(@smoe3, 0) ,bo.smoe4 = isnull(@smoe4, 0) ,bo.estot1 = isnull(@estot1, 0) ,bo.estot2 = isnull(@estot2, 0) ,bo.estot3 = isnull(@estot3, 0) ,bo.estot4 = isnull(@estot4, 0) ,bo.stot1 = isnull(@stot1, 0) ,bo.stot2 = isnull(@stot2, 0) ,bo.stot3 = isnull(@stot3, 0) ,bo.stot4 = isnull(@stot4, 0) ,bo.ebo_1tvall = isnull(@ebo_1tvall, 0) ,bo.ebo_2tvall = isnull(@ebo_2tvall, 0) ,bo.bo_1tvall = isnull(@bo_1tvall, 0) ,bo.bo_2tvall = isnull(@bo_2tvall, 0) ,bo.ebo_totp1 = isnull(@ebo_totp1, 0) ,bo.ebo_totp2 = isnull(@ebo_totp2, 0) ,bo.bo_totp1 = isnull(@bo_totp1, 0) ,bo.bo_totp2 = isnull(@bo_totp2, 0) ,bo.sqtt11 = isnull(@sqtt11, 0) ,bo.sqtt21 = isnull(@sqtt21, 0) ,bo.sqtt12 = isnull(@sqtt12, 0) ,bo.sqtt22 = isnull(@sqtt22, 0) ,bo.sqtt13 = isnull(@sqtt13, 0) ,bo.sqtt23 = isnull(@sqtt23, 0) ,bo.sqtt14 = isnull(@sqtt14, 0) ,bo.sqtt24 = isnull(@sqtt24, 0) where bostamp = @mybostamp update bo2 set bo2.bo71_bins = isnull(@bo71_bins, 0) ,bo2.bo72_bins = isnull(@bo72_bins, 0) ,bo2.bo81_bins = isnull(@bo81_bins, 0) ,bo2.bo82_bins = isnull(@bo82_bins, 0) ,bo2.bo91_bins = isnull(@bo91_bins, 0) ,bo2.bo92_bins = isnull(@bo92_bins, 0) ,bo2.ebo71_bins = isnull(@ebo71_bins, 0) ,bo2.ebo72_bins = isnull(@ebo72_bins, 0) ,bo2.ebo81_bins = isnull(@ebo81_bins, 0) ,bo2.ebo82_bins = isnull(@ebo82_bins, 0) ,bo2.ebo91_bins = isnull(@ebo91_bins, 0) ,bo2.ebo92_bins = isnull(@ebo92_bins, 0) ,bo2.bo71_iva = isnull(@bo71_iva, 0) ,bo2.bo72_iva = isnull(@bo72_iva, 0) ,bo2.bo81_iva = isnull(@bo81_iva, 0) ,bo2.bo82_iva = isnull(@bo82_iva, 0) ,bo2.bo91_iva = isnull(@bo91_iva, 0) ,bo2.bo92_iva = isnull(@bo92_iva, 0) ,bo2.ebo71_iva = isnull(@ebo71_iva, 0) ,bo2.ebo72_iva = isnull(@ebo72_iva, 0) ,bo2.ebo81_iva = isnull(@ebo81_iva, 0) ,bo2.ebo82_iva = isnull(@ebo82_iva, 0) ,bo2.ebo91_iva = isnull(@ebo91_iva, 0) ,bo2.ebo92_iva = isnull(@ebo92_iva, 0) ,bo2.etotalciva = isnull(@etotaldeb, 0) + isnull(@ebo12_iva, 0) +isnull(@ebo22_iva, 0) +isnull(@ebo32_iva, 0) +isnull(@ebo42_iva, 0) +isnull(@ebo52_iva, 0) +isnull(@ebo62_iva, 0) +isnull(@ebo72_iva, 0) +isnull(@ebo82_iva, 0) +isnull(@ebo92_iva, 0) --,bo2.mtotalciva =isnull(@moetotal, 0) where bo2stamp = @mybostamp -- trata os bot select @userinis = usrinis from bo where bo.bostamp=@mybostamp insert into @totaisiva ( bostamp, codigo, taxa, ebaseinc, baseinc, evalor, valor ) select @mybostamp,codigo,taxa ,case when (@ebo11_bins <>0) then @ebo11_bins else @ebo12_bins end ,case when (@ebo11_bins <>0) then @bo11_bins else @bo12_bins end ,case when (@ebo11_bins <>0) then @ebo11_iva else @ebo12_iva end ,case when (@ebo11_bins <>0) then @bo11_iva else @bo12_iva end from taxasiva where codigo = 1 union all select @mybostamp,codigo,taxa ,case when (@ebo21_bins <>0) then @ebo21_bins else @ebo22_bins end ,case when (@ebo21_bins <>0) then @bo21_bins else @bo22_bins end ,case when (@ebo21_bins <>0) then @ebo21_iva else @ebo22_iva end ,case when (@ebo21_bins <>0) then @bo21_iva else @bo22_iva end from taxasiva where codigo = 2 union all select @mybostamp,codigo,taxa ,case when (@ebo31_bins <>0) then @ebo31_bins else @ebo32_bins end ,case when (@ebo31_bins <>0) then @bo31_bins else @bo32_bins end ,case when (@ebo31_bins <>0) then @ebo31_iva else @ebo32_iva end ,case when (@ebo31_bins <>0) then @bo31_iva else @bo32_iva end from taxasiva where codigo = 3 union all select @mybostamp,codigo,taxa ,case when (@ebo41_bins <>0) then @ebo41_bins else @ebo42_bins end ,case when (@ebo41_bins <>0) then @bo41_bins else @bo42_bins end ,case when (@ebo41_bins <>0) then @ebo41_iva else @ebo42_iva end ,case when (@ebo41_bins <>0) then @bo41_iva else @bo42_iva end from taxasiva where codigo = 4 union all select @mybostamp,codigo,taxa ,case when (@ebo51_bins <>0) then @ebo51_bins else @ebo52_bins end ,case when (@ebo51_bins <>0) then @bo51_bins else @bo52_bins end ,case when (@ebo51_bins <>0) then @ebo51_iva else @ebo52_iva end ,case when (@ebo51_bins <>0) then @bo51_iva else @bo52_iva end from taxasiva where codigo = 5 union all select @mybostamp,codigo,taxa ,case when (@ebo61_bins <>0) then @ebo61_bins else @ebo62_bins end ,case when (@ebo61_bins <>0) then @bo61_bins else @bo62_bins end ,case when (@ebo61_bins <>0) then @ebo61_iva else @ebo62_iva end ,case when (@ebo61_bins <>0) then @bo61_iva else @bo62_iva end from taxasiva where codigo = 6 union all select @mybostamp,codigo,taxa ,case when (@ebo71_bins <>0) then @ebo71_bins else @ebo72_bins end ,case when (@ebo71_bins <>0) then @bo71_bins else @bo72_bins end ,case when (@ebo71_bins <>0) then @ebo71_iva else @ebo72_iva end ,case when (@ebo71_bins <>0) then @bo71_iva else @bo72_iva end from taxasiva where codigo = 7 union all select @mybostamp,codigo,taxa ,case when (@ebo81_bins <>0) then @ebo81_bins else @ebo82_bins end ,case when (@ebo81_bins <>0) then @bo81_bins else @bo82_bins end ,case when (@ebo81_bins <>0) then @ebo81_iva else @ebo82_iva end ,case when (@ebo81_bins <>0) then @bo81_iva else @bo82_iva end from taxasiva where codigo = 8 union all select @mybostamp,codigo,taxa ,case when (@ebo91_bins <>0) then @ebo91_bins else @ebo92_bins end ,case when (@ebo91_bins <>0) then @bo91_bins else @bo92_bins end ,case when (@ebo91_bins <>0) then @ebo91_iva else @ebo92_iva end ,case when (@ebo91_bins <>0) then @bo91_iva else @bo92_iva end from taxasiva where codigo = 9 update bot set ebaseinc = totiva.ebaseinc, baseinc = totiva.baseinc, evalor = totiva.evalor, valor = totiva.valor, usrinis = @userinis, usrdata = convert (date,getdate()), usrhora = convert (time,getdate()) from @totaisiva totiva inner join bot on totiva.bostamp = bot.bostamp and totiva.codigo = bot.codigo insert into bot ( botstamp ,bostamp ,codigo ,taxa ,ebaseinc ,baseinc ,evalor ,valor ,ousrinis ,ousrdata ,ousrhora ,usrinis ,usrdata ,usrhora ) select ( left(@userinis,3) + 'tt' + left(newid(),5) + right(newid(),5) + left(newid(),5) + right(newid(),5)) stamp ,@mybostamp stampbo ,totiva.codigo ,totiva.taxa ,totiva.ebaseinc ,totiva.baseinc ,totiva.evalor ,totiva.valor ,@userinis ,convert (date,getdate()) ,convert (time,getdate()) ,@userinis ,convert (date,getdate()) ,convert (time,getdate()) from @totaisiva totiva left join bot on totiva.bostamp = bot.bostamp and totiva.codigo = bot.codigo where bot.botstamp is null -- atualiza os campo bi.series e bi.series2, caso tenha equipamentos update bi set series = s1, series2=s2 from bi inner join ( select distinct bistamp,ser.s1, ser.s2 from boma cross apply (select stuff ( ( select ',' + rtrim(serie) from boma myboma where myboma.bistamp = boma.bistamp order by serie for xml path('') ), 1, 1, '' ) s1 , stuff ( ( select ',' + rtrim(serie2) from boma myboma where myboma.bistamp = boma.bistamp order by serie for xml path('') ), 1, 1, '' ) s2 ) ser where boma.bostamp = @mybostamp ) myboma on bi.bistamp = myboma.bistamp where bi.bostamp = @mybostamp 
20250218@120651.3003 25jsvc7n4iu1il6nuv549e7laq Query : use flama_phc
20250218@120651.3006 25jsvc7n4iu1il6nuv549e7laq Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20250218@120651.3055 25jsvc7n4iu1il6nuv549e7laq Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5401';
20250218@120651.3117 25jsvc7n4iu1il6nuv549e7laq Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5401';

20250218@131024.5570 hg9au2cn42elq18m4n6h3flarg Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5402';
20250218@131024.5696 hg9au2cn42elq18m4n6h3flarg Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5402';
20250218@131024.5751 hg9au2cn42elq18m4n6h3flarg Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5402';
20250218@131024.6628 s73dird859grma79nhvm30kdeg Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250218@131024.6673 s73dird859grma79nhvm30kdeg Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250218@131024.7889 s73dird859grma79nhvm30kdeg Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5403';
20250218@131024.7963 s73dird859grma79nhvm30kdeg Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5403';
20250218@131024.8040 s73dird859grma79nhvm30kdeg Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5403';
20250218@131024.8077 s73dird859grma79nhvm30kdeg Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5403';
20250218@131024.8127 s73dird859grma79nhvm30kdeg Query : use flama_phc
20250218@131024.8139 s73dird859grma79nhvm30kdeg Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250218@131024.8203 s73dird859grma79nhvm30kdeg Query : select no, estab,szadrsdesc from szadrs where u_coddest=00000001
20250218@131024.8348 s73dird859grma79nhvm30kdeg Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2042.00.1'
20250218@131024.8371 s73dird859grma79nhvm30kdeg Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2043.00.1'
20250218@131024.8390 s73dird859grma79nhvm30kdeg Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2053.00.1'
20250218@131024.8410 s73dird859grma79nhvm30kdeg Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2052.00.1'
20250218@131024.8431 s73dird859grma79nhvm30kdeg Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2032.00.1'
20250218@131024.8450 s73dird859grma79nhvm30kdeg Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2062.00.1'
20250218@131024.8471 s73dird859grma79nhvm30kdeg Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2062.00.1'
20250218@131024.8490 s73dird859grma79nhvm30kdeg Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2062.00.1'
20250218@131024.8509 s73dird859grma79nhvm30kdeg Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2036.00.1'
20250218@131024.8533 s73dird859grma79nhvm30kdeg Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2036.00.1'
20250218@131024.8551 s73dird859grma79nhvm30kdeg Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2036.00.1'
20250218@131024.8580 s73dird859grma79nhvm30kdeg Query : use flama_phc
20250218@131024.8582 s73dird859grma79nhvm30kdeg Query : select top 1 1 valor from ts where ts.ndos = 5
20250218@131024.8677 s73dird859grma79nhvm30kdeg Query : use flama_phc
20250218@131024.8681 s73dird859grma79nhvm30kdeg Query : select lower(descricao) descricao ,case when valor='s' then 1 else 0 end valor from para1 where descricao in ('st_lote','st_usalogifunc', 'st_grelha')
20250218@131024.8720 s73dird859grma79nhvm30kdeg Query : select top 1 assinadoc issigned ,ts.stocks ,ts.bdempresas origin ,case when (cmstocks between 1 and 50 or cm2stocks between 1 and 50 ) then 1 else 0 end entrada ,case when cmstocks>50 or (cm2stocks>50 and trfa =1) then 1 else 0 end saida ,stneg validatestock ,tiposaft ,veserie useserialnumber ,foserie assetin ,ftserie assetout ,veserie assets ,trfarm assetstransfer ,grelha usegridfields from ts inner join ts2 on ts.tsstamp=ts2.ts2stamp where ts.ndos =5
20250218@131024.8880 s73dird859grma79nhvm30kdeg Query : use flama_phc
20250218@131024.8883 s73dird859grma79nhvm30kdeg Query : select top 1 ~inactivo valor from fl where no = '102245' and estab = 0 order by inactivo desc
20250218@131024.9004 s73dird859grma79nhvm30kdeg Query : use flama_phc
20250218@131024.9007 s73dird859grma79nhvm30kdeg Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -230
20250218@131024.9126 s73dird859grma79nhvm30kdeg Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5403';
20250218@131024.9174 s73dird859grma79nhvm30kdeg Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5403';

20250218@153055.7020 apsp54coqvtbsh3889ri9atjlh Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5404';
20250218@153055.7790 apsp54coqvtbsh3889ri9atjlh Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5404';
20250218@153055.8530 apsp54coqvtbsh3889ri9atjlh Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5404';
20250218@153055.9270 apsp54coqvtbsh3889ri9atjlh Query : use flama_phc
20250218@153055.9300 apsp54coqvtbsh3889ri9atjlh Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250218@153055.1042 apsp54coqvtbsh3889ri9atjlh Query : use flama_phc
20250218@153055.1045 apsp54coqvtbsh3889ri9atjlh Query : select no, estab,szadrsdesc from szadrs where u_coddest=2448
20250218@153055.1183 apsp54coqvtbsh3889ri9atjlh Query : select bi.bistamp ,bi.ref code ,bi.qtt quantity ,bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.bostamp ,st.u_uncxcl from bi inner join bo on bo.bostamp=bi.bostamp inner join st on st.ref = bi.ref where bo.ndos = 250 and bo.boano = 2012 and bo.obrano = 2501251 
20250218@153055.1941 apsp54coqvtbsh3889ri9atjlh Query : use flama_phc
20250218@153055.1986 apsp54coqvtbsh3889ri9atjlh Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250218@153055.2276 apsp54coqvtbsh3889ri9atjlh Query : use flama_phc
20250218@153055.2280 apsp54coqvtbsh3889ri9atjlh Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -9010
20250218@153055.4096 apsp54coqvtbsh3889ri9atjlh Query : insert into wserrorlog (errornumber, errormsg,requesttable,initialdata,finaldata) values (-9010,?,'ft',?,?)
20250218@153055.4522 apsp54coqvtbsh3889ri9atjlh Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5404';
20250218@153055.4571 apsp54coqvtbsh3889ri9atjlh Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5404';
20250218@153055.5144 d29ari4o1km6327296o2b84oho Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250218@153055.5156 d29ari4o1km6327296o2b84oho Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250218@153055.5272 d29ari4o1km6327296o2b84oho Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5405';
20250218@153055.5385 d29ari4o1km6327296o2b84oho Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5405';
20250218@153055.5459 d29ari4o1km6327296o2b84oho Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5405';
20250218@153055.5548 d29ari4o1km6327296o2b84oho Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5405';
20250218@153055.5686 d29ari4o1km6327296o2b84oho Query : use flama_phc
20250218@153055.5690 d29ari4o1km6327296o2b84oho Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250218@153055.5806 d29ari4o1km6327296o2b84oho Query : use flama_phc
20250218@153055.5810 d29ari4o1km6327296o2b84oho Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20250218@153055.5957 d29ari4o1km6327296o2b84oho Query : select bi.bistamp ,bi.ref code ,bi.qtt quantity ,bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.bostamp ,st.u_uncxcl from bi inner join bo on bo.bostamp=bi.bostamp inner join st on st.ref = bi.ref where bo.ndos = 250 and bo.boano = 2012 and bo.obrano = 2501252 
20250218@153055.6457 d29ari4o1km6327296o2b84oho Query : use flama_phc
20250218@153055.6460 d29ari4o1km6327296o2b84oho Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250218@153055.6528 d29ari4o1km6327296o2b84oho Query : use flama_phc
20250218@153055.6531 d29ari4o1km6327296o2b84oho Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -9010
20250218@153055.6549 d29ari4o1km6327296o2b84oho Query : insert into wserrorlog (errornumber, errormsg,requesttable,initialdata,finaldata) values (-9010,?,'ft',?,?)
20250218@153055.6571 d29ari4o1km6327296o2b84oho Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5405';
20250218@153055.6615 d29ari4o1km6327296o2b84oho Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5405';
20250218@153055.7239 je1avlo18bdaddv0pr4q7h4gqa Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250218@153055.7319 je1avlo18bdaddv0pr4q7h4gqa Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250218@153055.7427 je1avlo18bdaddv0pr4q7h4gqa Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5406';
20250218@153055.7503 je1avlo18bdaddv0pr4q7h4gqa Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5406';
20250218@153055.7586 je1avlo18bdaddv0pr4q7h4gqa Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5406';
20250218@153055.7630 je1avlo18bdaddv0pr4q7h4gqa Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5406';
20250218@153055.7705 je1avlo18bdaddv0pr4q7h4gqa Query : use flama_phc
20250218@153055.7709 je1avlo18bdaddv0pr4q7h4gqa Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250218@153055.7784 je1avlo18bdaddv0pr4q7h4gqa Query : use flama_phc
20250218@153055.7788 je1avlo18bdaddv0pr4q7h4gqa Query : select no, estab,szadrsdesc from szadrs where u_coddest=1059
20250218@153055.7885 je1avlo18bdaddv0pr4q7h4gqa Query : select bi.bistamp ,bi.ref code ,bi.qtt quantity ,bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.bostamp ,st.u_uncxcl from bi inner join bo on bo.bostamp=bi.bostamp inner join st on st.ref = bi.ref where bo.ndos = 250 and bo.boano = 2012 and bo.obrano = 2501253 
20250218@153055.8283 je1avlo18bdaddv0pr4q7h4gqa Query : use flama_phc
20250218@153055.8286 je1avlo18bdaddv0pr4q7h4gqa Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250218@153055.8320 je1avlo18bdaddv0pr4q7h4gqa Query : use flama_phc
20250218@153055.8323 je1avlo18bdaddv0pr4q7h4gqa Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -9010
20250218@153055.8340 je1avlo18bdaddv0pr4q7h4gqa Query : insert into wserrorlog (errornumber, errormsg,requesttable,initialdata,finaldata) values (-9010,?,'ft',?,?)
20250218@153055.8373 je1avlo18bdaddv0pr4q7h4gqa Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5406';
20250218@153055.8419 je1avlo18bdaddv0pr4q7h4gqa Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5406';
20250218@153055.8933 601t22cboe84nljl211e1r92u7 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250218@153055.8945 601t22cboe84nljl211e1r92u7 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250218@153055.9058 601t22cboe84nljl211e1r92u7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5407';
20250218@153055.9160 601t22cboe84nljl211e1r92u7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5407';
20250218@153055.9478 601t22cboe84nljl211e1r92u7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5407';
20250218@153055.9855 601t22cboe84nljl211e1r92u7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5407';
20250218@153056.4320 601t22cboe84nljl211e1r92u7 Query : use flama_phc
20250218@153056.5060 601t22cboe84nljl211e1r92u7 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250218@153056.1217 601t22cboe84nljl211e1r92u7 Query : use flama_phc
20250218@153056.1255 601t22cboe84nljl211e1r92u7 Query : select no, estab,szadrsdesc from szadrs where u_coddest=6917
20250218@153056.1371 601t22cboe84nljl211e1r92u7 Query : select bi.bistamp ,bi.ref code ,bi.qtt quantity ,bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.bostamp ,st.u_uncxcl from bi inner join bo on bo.bostamp=bi.bostamp inner join st on st.ref = bi.ref where bo.ndos = 250 and bo.boano = 2012 and bo.obrano = 2501254 
20250218@153056.2055 601t22cboe84nljl211e1r92u7 Query : use flama_phc
20250218@153056.2058 601t22cboe84nljl211e1r92u7 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250218@153056.2161 601t22cboe84nljl211e1r92u7 Query : use flama_phc
20250218@153056.2168 601t22cboe84nljl211e1r92u7 Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -9010
20250218@153056.2201 601t22cboe84nljl211e1r92u7 Query : insert into wserrorlog (errornumber, errormsg,requesttable,initialdata,finaldata) values (-9010,?,'ft',?,?)
20250218@153056.2243 601t22cboe84nljl211e1r92u7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5407';
20250218@153056.2327 601t22cboe84nljl211e1r92u7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5407';
20250218@153056.3250 hjoij99rkhc7c8alnb35e7jufh Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250218@153056.3261 hjoij99rkhc7c8alnb35e7jufh Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250218@153056.3388 hjoij99rkhc7c8alnb35e7jufh Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5408';
20250218@153056.3494 hjoij99rkhc7c8alnb35e7jufh Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5408';
20250218@153056.3569 hjoij99rkhc7c8alnb35e7jufh Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5408';
20250218@153056.3663 hjoij99rkhc7c8alnb35e7jufh Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5408';
20250218@153056.3791 hjoij99rkhc7c8alnb35e7jufh Query : use flama_phc
20250218@153056.3794 hjoij99rkhc7c8alnb35e7jufh Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250218@153056.3861 hjoij99rkhc7c8alnb35e7jufh Query : use flama_phc
20250218@153056.3864 hjoij99rkhc7c8alnb35e7jufh Query : select no, estab,szadrsdesc from szadrs where u_coddest=829
20250218@153056.3998 hjoij99rkhc7c8alnb35e7jufh Query : select bi.bistamp ,bi.ref code ,bi.qtt quantity ,bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.bostamp ,st.u_uncxcl from bi inner join bo on bo.bostamp=bi.bostamp inner join st on st.ref = bi.ref where bo.ndos = 250 and bo.boano = 2012 and bo.obrano = 2501255 
20250218@153056.4551 hjoij99rkhc7c8alnb35e7jufh Query : use flama_phc
20250218@153056.4554 hjoij99rkhc7c8alnb35e7jufh Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250218@153056.4585 hjoij99rkhc7c8alnb35e7jufh Query : use flama_phc
20250218@153056.4588 hjoij99rkhc7c8alnb35e7jufh Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -9010
20250218@153056.4604 hjoij99rkhc7c8alnb35e7jufh Query : insert into wserrorlog (errornumber, errormsg,requesttable,initialdata,finaldata) values (-9010,?,'ft',?,?)
20250218@153056.4670 hjoij99rkhc7c8alnb35e7jufh Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5408';
20250218@153056.4715 hjoij99rkhc7c8alnb35e7jufh Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5408';
20250218@153056.5322 q63vdkddi53vitc0d8r8d8p892 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250218@153056.5369 q63vdkddi53vitc0d8r8d8p892 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250218@153056.5442 q63vdkddi53vitc0d8r8d8p892 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5409';
20250218@153056.5542 q63vdkddi53vitc0d8r8d8p892 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5409';
20250218@153056.5662 q63vdkddi53vitc0d8r8d8p892 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5409';
20250218@153056.5710 q63vdkddi53vitc0d8r8d8p892 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5409';
20250218@153056.5835 q63vdkddi53vitc0d8r8d8p892 Query : use flama_phc
20250218@153056.5839 q63vdkddi53vitc0d8r8d8p892 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250218@153056.5954 q63vdkddi53vitc0d8r8d8p892 Query : use flama_phc
20250218@153056.5957 q63vdkddi53vitc0d8r8d8p892 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20250218@153056.6005 q63vdkddi53vitc0d8r8d8p892 Query : select bi.bistamp ,bi.ref code ,bi.qtt quantity ,bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.bostamp ,st.u_uncxcl from bi inner join bo on bo.bostamp=bi.bostamp inner join st on st.ref = bi.ref where bo.ndos = 250 and bo.boano = 2012 and bo.obrano = 2501256 
20250218@153056.6510 q63vdkddi53vitc0d8r8d8p892 Query : use flama_phc
20250218@153056.6513 q63vdkddi53vitc0d8r8d8p892 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250218@153056.6544 q63vdkddi53vitc0d8r8d8p892 Query : use flama_phc
20250218@153056.6547 q63vdkddi53vitc0d8r8d8p892 Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -9010
20250218@153056.6563 q63vdkddi53vitc0d8r8d8p892 Query : insert into wserrorlog (errornumber, errormsg,requesttable,initialdata,finaldata) values (-9010,?,'ft',?,?)
20250218@153056.6622 q63vdkddi53vitc0d8r8d8p892 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5409';
20250218@153056.6669 q63vdkddi53vitc0d8r8d8p892 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5409';
20250218@153056.7213 nlv10ou1c2nbbvl0cij2flur7r Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250218@153056.7227 nlv10ou1c2nbbvl0cij2flur7r Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250218@153056.7300 nlv10ou1c2nbbvl0cij2flur7r Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5410';
20250218@153056.7375 nlv10ou1c2nbbvl0cij2flur7r Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5410';
20250218@153056.7454 nlv10ou1c2nbbvl0cij2flur7r Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5410';
20250218@153056.7533 nlv10ou1c2nbbvl0cij2flur7r Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5410';
20250218@153056.7604 nlv10ou1c2nbbvl0cij2flur7r Query : use flama_phc
20250218@153056.7608 nlv10ou1c2nbbvl0cij2flur7r Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250218@153056.7804 nlv10ou1c2nbbvl0cij2flur7r Query : use flama_phc
20250218@153056.7807 nlv10ou1c2nbbvl0cij2flur7r Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20250218@153056.7859 nlv10ou1c2nbbvl0cij2flur7r Query : select bi.bistamp ,bi.ref code ,bi.qtt quantity ,bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.bostamp ,st.u_uncxcl from bi inner join bo on bo.bostamp=bi.bostamp inner join st on st.ref = bi.ref where bo.ndos = 250 and bo.boano = 2012 and bo.obrano = 2501258 
20250218@153056.8390 nlv10ou1c2nbbvl0cij2flur7r Query : use flama_phc
20250218@153056.8393 nlv10ou1c2nbbvl0cij2flur7r Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250218@153056.8424 nlv10ou1c2nbbvl0cij2flur7r Query : use flama_phc
20250218@153056.8450 nlv10ou1c2nbbvl0cij2flur7r Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -9010
20250218@153056.8472 nlv10ou1c2nbbvl0cij2flur7r Query : insert into wserrorlog (errornumber, errormsg,requesttable,initialdata,finaldata) values (-9010,?,'ft',?,?)
20250218@153056.8498 nlv10ou1c2nbbvl0cij2flur7r Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5410';
20250218@153056.8547 nlv10ou1c2nbbvl0cij2flur7r Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5410';
20250218@153056.9106 i42l7andlorqdpgukv25hbk5a2 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250218@153056.9116 i42l7andlorqdpgukv25hbk5a2 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250218@153056.9194 i42l7andlorqdpgukv25hbk5a2 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5411';
20250218@153056.9271 i42l7andlorqdpgukv25hbk5a2 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5411';
20250218@153056.9346 i42l7andlorqdpgukv25hbk5a2 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5411';
20250218@153056.9390 i42l7andlorqdpgukv25hbk5a2 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5411';
20250218@153056.9456 i42l7andlorqdpgukv25hbk5a2 Query : use flama_phc
20250218@153056.9459 i42l7andlorqdpgukv25hbk5a2 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250218@153056.9521 i42l7andlorqdpgukv25hbk5a2 Query : use flama_phc
20250218@153056.9524 i42l7andlorqdpgukv25hbk5a2 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20250218@153056.9572 i42l7andlorqdpgukv25hbk5a2 Query : select bi.bistamp ,bi.ref code ,bi.qtt quantity ,bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.bostamp ,st.u_uncxcl from bi inner join bo on bo.bostamp=bi.bostamp inner join st on st.ref = bi.ref where bo.ndos = 250 and bo.boano = 2012 and bo.obrano = 2501260 
20250218@153056.9979 i42l7andlorqdpgukv25hbk5a2 Query : use flama_phc
20250218@153056.9982 i42l7andlorqdpgukv25hbk5a2 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250218@153057.1300 i42l7andlorqdpgukv25hbk5a2 Query : use flama_phc
20250218@153057.1500 i42l7andlorqdpgukv25hbk5a2 Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -9010
20250218@153057.3200 i42l7andlorqdpgukv25hbk5a2 Query : insert into wserrorlog (errornumber, errormsg,requesttable,initialdata,finaldata) values (-9010,?,'ft',?,?)
20250218@153057.6000 i42l7andlorqdpgukv25hbk5a2 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5411';
20250218@153057.1060 i42l7andlorqdpgukv25hbk5a2 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5411';
20250218@153057.2474 vc3kdcekpkck3o1405l1fskcue Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250218@153057.2493 vc3kdcekpkck3o1405l1fskcue Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250218@153057.2632 vc3kdcekpkck3o1405l1fskcue Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5412';
20250218@153057.2714 vc3kdcekpkck3o1405l1fskcue Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5412';
20250218@153057.2785 vc3kdcekpkck3o1405l1fskcue Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5412';
20250218@153057.2837 vc3kdcekpkck3o1405l1fskcue Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5412';
20250218@153057.2932 vc3kdcekpkck3o1405l1fskcue Query : use flama_phc
20250218@153057.2936 vc3kdcekpkck3o1405l1fskcue Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250218@153057.3002 vc3kdcekpkck3o1405l1fskcue Query : use flama_phc
20250218@153057.3005 vc3kdcekpkck3o1405l1fskcue Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20250218@153057.3059 vc3kdcekpkck3o1405l1fskcue Query : select bi.bistamp ,bi.ref code ,bi.qtt quantity ,bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.bostamp ,st.u_uncxcl from bi inner join bo on bo.bostamp=bi.bostamp inner join st on st.ref = bi.ref where bo.ndos = 250 and bo.boano = 2012 and bo.obrano = 2501261 
20250218@153057.3457 vc3kdcekpkck3o1405l1fskcue Query : use flama_phc
20250218@153057.3460 vc3kdcekpkck3o1405l1fskcue Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250218@153057.3492 vc3kdcekpkck3o1405l1fskcue Query : use flama_phc
20250218@153057.3495 vc3kdcekpkck3o1405l1fskcue Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -9010
20250218@153057.3512 vc3kdcekpkck3o1405l1fskcue Query : insert into wserrorlog (errornumber, errormsg,requesttable,initialdata,finaldata) values (-9010,?,'ft',?,?)
20250218@153057.3535 vc3kdcekpkck3o1405l1fskcue Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5412';
20250218@153057.3580 vc3kdcekpkck3o1405l1fskcue Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5412';
20250218@153057.4130 h2sejk9bgdqph1hatrp2dehuuc Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250218@153057.4177 h2sejk9bgdqph1hatrp2dehuuc Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250218@153057.4258 h2sejk9bgdqph1hatrp2dehuuc Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5413';
20250218@153057.4361 h2sejk9bgdqph1hatrp2dehuuc Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5413';
20250218@153057.4621 h2sejk9bgdqph1hatrp2dehuuc Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5413';
20250218@153057.4749 h2sejk9bgdqph1hatrp2dehuuc Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5413';
20250218@153057.4819 h2sejk9bgdqph1hatrp2dehuuc Query : use flama_phc
20250218@153057.4823 h2sejk9bgdqph1hatrp2dehuuc Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250218@153057.4939 h2sejk9bgdqph1hatrp2dehuuc Query : use flama_phc
20250218@153057.4943 h2sejk9bgdqph1hatrp2dehuuc Query : select no, estab,szadrsdesc from szadrs where u_coddest=805
20250218@153057.5086 h2sejk9bgdqph1hatrp2dehuuc Query : select bi.bistamp ,bi.ref code ,bi.qtt quantity ,bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.bostamp ,st.u_uncxcl from bi inner join bo on bo.bostamp=bi.bostamp inner join st on st.ref = bi.ref where bo.ndos = 250 and bo.boano = 2012 and bo.obrano = 2501262 
20250218@153057.5614 h2sejk9bgdqph1hatrp2dehuuc Query : use flama_phc
20250218@153057.5617 h2sejk9bgdqph1hatrp2dehuuc Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250218@153057.5648 h2sejk9bgdqph1hatrp2dehuuc Query : use flama_phc
20250218@153057.5651 h2sejk9bgdqph1hatrp2dehuuc Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -9010
20250218@153057.5669 h2sejk9bgdqph1hatrp2dehuuc Query : insert into wserrorlog (errornumber, errormsg,requesttable,initialdata,finaldata) values (-9010,?,'ft',?,?)
20250218@153057.5725 h2sejk9bgdqph1hatrp2dehuuc Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5413';
20250218@153057.5771 h2sejk9bgdqph1hatrp2dehuuc Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5413';
20250218@153057.6285 te0o6c2fgghpdccka17824787s Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250218@153057.6296 te0o6c2fgghpdccka17824787s Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250218@153057.6373 te0o6c2fgghpdccka17824787s Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5414';
20250218@153057.6440 te0o6c2fgghpdccka17824787s Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5414';
20250218@153057.6509 te0o6c2fgghpdccka17824787s Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5414';
20250218@153057.6548 te0o6c2fgghpdccka17824787s Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5414';
20250218@153057.6628 te0o6c2fgghpdccka17824787s Query : use flama_phc
20250218@153057.6631 te0o6c2fgghpdccka17824787s Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250218@153057.6701 te0o6c2fgghpdccka17824787s Query : use flama_phc
20250218@153057.6704 te0o6c2fgghpdccka17824787s Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20250218@153057.6751 te0o6c2fgghpdccka17824787s Query : select bi.bistamp ,bi.ref code ,bi.qtt quantity ,bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.bostamp ,st.u_uncxcl from bi inner join bo on bo.bostamp=bi.bostamp inner join st on st.ref = bi.ref where bo.ndos = 250 and bo.boano = 2012 and bo.obrano = 2501263 
20250218@153057.7160 te0o6c2fgghpdccka17824787s Query : use flama_phc
20250218@153057.7163 te0o6c2fgghpdccka17824787s Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250218@153057.7236 te0o6c2fgghpdccka17824787s Query : use flama_phc
20250218@153057.7240 te0o6c2fgghpdccka17824787s Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -9010
20250218@153057.7273 te0o6c2fgghpdccka17824787s Query : insert into wserrorlog (errornumber, errormsg,requesttable,initialdata,finaldata) values (-9010,?,'ft',?,?)
20250218@153057.7295 te0o6c2fgghpdccka17824787s Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5414';
20250218@153057.7343 te0o6c2fgghpdccka17824787s Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5414';
20250218@153057.7893 1gvkfeudk344f95ell9jvvqv02 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250218@153057.7903 1gvkfeudk344f95ell9jvvqv02 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250218@153057.8025 1gvkfeudk344f95ell9jvvqv02 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5415';
20250218@153057.8129 1gvkfeudk344f95ell9jvvqv02 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5415';
20250218@153057.8205 1gvkfeudk344f95ell9jvvqv02 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5415';
20250218@153057.8293 1gvkfeudk344f95ell9jvvqv02 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5415';
20250218@153057.8375 1gvkfeudk344f95ell9jvvqv02 Query : use flama_phc
20250218@153057.8378 1gvkfeudk344f95ell9jvvqv02 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250218@153057.8461 1gvkfeudk344f95ell9jvvqv02 Query : use flama_phc
20250218@153057.8464 1gvkfeudk344f95ell9jvvqv02 Query : select no, estab,szadrsdesc from szadrs where u_coddest=6737
20250218@153057.8603 1gvkfeudk344f95ell9jvvqv02 Query : select bi.bistamp ,bi.ref code ,bi.qtt quantity ,bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.bostamp ,st.u_uncxcl from bi inner join bo on bo.bostamp=bi.bostamp inner join st on st.ref = bi.ref where bo.ndos = 250 and bo.boano = 2012 and bo.obrano = 2501264 
20250218@153057.9261 1gvkfeudk344f95ell9jvvqv02 Query : use flama_phc
20250218@153057.9263 1gvkfeudk344f95ell9jvvqv02 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250218@153057.9304 1gvkfeudk344f95ell9jvvqv02 Query : use flama_phc
20250218@153057.9306 1gvkfeudk344f95ell9jvvqv02 Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -9010
20250218@153057.9323 1gvkfeudk344f95ell9jvvqv02 Query : insert into wserrorlog (errornumber, errormsg,requesttable,initialdata,finaldata) values (-9010,?,'ft',?,?)
20250218@153057.9391 1gvkfeudk344f95ell9jvvqv02 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5415';
20250218@153057.9437 1gvkfeudk344f95ell9jvvqv02 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5415';
20250218@153058.3300 eea2icotjv6t4g5vncc1ir77js Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250218@153058.4500 eea2icotjv6t4g5vncc1ir77js Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250218@153058.1680 eea2icotjv6t4g5vncc1ir77js Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5416';
20250218@153058.2800 eea2icotjv6t4g5vncc1ir77js Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5416';
20250218@153058.3550 eea2icotjv6t4g5vncc1ir77js Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5416';
20250218@153058.4570 eea2icotjv6t4g5vncc1ir77js Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5416';
20250218@153058.5940 eea2icotjv6t4g5vncc1ir77js Query : use flama_phc
20250218@153058.5970 eea2icotjv6t4g5vncc1ir77js Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250218@153058.8510 eea2icotjv6t4g5vncc1ir77js Query : use flama_phc
20250218@153058.8550 eea2icotjv6t4g5vncc1ir77js Query : select no, estab,szadrsdesc from szadrs where u_coddest=9159
20250218@153058.9520 eea2icotjv6t4g5vncc1ir77js Query : select bi.bistamp ,bi.ref code ,bi.qtt quantity ,bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.bostamp ,st.u_uncxcl from bi inner join bo on bo.bostamp=bi.bostamp inner join st on st.ref = bi.ref where bo.ndos = 250 and bo.boano = 2012 and bo.obrano = 2501265 
20250218@153058.1356 eea2icotjv6t4g5vncc1ir77js Query : use flama_phc
20250218@153058.1360 eea2icotjv6t4g5vncc1ir77js Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250218@153058.1392 eea2icotjv6t4g5vncc1ir77js Query : use flama_phc
20250218@153058.1395 eea2icotjv6t4g5vncc1ir77js Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -9010
20250218@153058.1411 eea2icotjv6t4g5vncc1ir77js Query : insert into wserrorlog (errornumber, errormsg,requesttable,initialdata,finaldata) values (-9010,?,'ft',?,?)
20250218@153058.1443 eea2icotjv6t4g5vncc1ir77js Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5416';
20250218@153058.1558 eea2icotjv6t4g5vncc1ir77js Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5416';
20250218@153058.2139 hte4o6nve8up6p9e61acvo6iu9 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250218@153058.2151 hte4o6nve8up6p9e61acvo6iu9 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250218@153058.2258 hte4o6nve8up6p9e61acvo6iu9 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5417';
20250218@153058.2530 hte4o6nve8up6p9e61acvo6iu9 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5417';
20250218@153058.2640 hte4o6nve8up6p9e61acvo6iu9 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5417';
20250218@153058.2684 hte4o6nve8up6p9e61acvo6iu9 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5417';
20250218@153058.2831 hte4o6nve8up6p9e61acvo6iu9 Query : use flama_phc
20250218@153058.2835 hte4o6nve8up6p9e61acvo6iu9 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250218@153058.2950 hte4o6nve8up6p9e61acvo6iu9 Query : use flama_phc
20250218@153058.2954 hte4o6nve8up6p9e61acvo6iu9 Query : select no, estab,szadrsdesc from szadrs where u_coddest=6917
20250218@153058.3018 hte4o6nve8up6p9e61acvo6iu9 Query : select bi.bistamp ,bi.ref code ,bi.qtt quantity ,bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.bostamp ,st.u_uncxcl from bi inner join bo on bo.bostamp=bi.bostamp inner join st on st.ref = bi.ref where bo.ndos = 250 and bo.boano = 2012 and bo.obrano = 2501267 
20250218@153058.3535 hte4o6nve8up6p9e61acvo6iu9 Query : use flama_phc
20250218@153058.3539 hte4o6nve8up6p9e61acvo6iu9 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250218@153058.3574 hte4o6nve8up6p9e61acvo6iu9 Query : use flama_phc
20250218@153058.3577 hte4o6nve8up6p9e61acvo6iu9 Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -9010
20250218@153058.3595 hte4o6nve8up6p9e61acvo6iu9 Query : insert into wserrorlog (errornumber, errormsg,requesttable,initialdata,finaldata) values (-9010,?,'ft',?,?)
20250218@153058.3680 hte4o6nve8up6p9e61acvo6iu9 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5417';
20250218@153058.3728 hte4o6nve8up6p9e61acvo6iu9 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5417';
20250218@153058.5472 gpcttshclnrtd47ko0qlh2fnrh Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250218@153058.5506 gpcttshclnrtd47ko0qlh2fnrh Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250218@153058.5695 gpcttshclnrtd47ko0qlh2fnrh Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5418';
20250218@153058.5826 gpcttshclnrtd47ko0qlh2fnrh Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5418';
20250218@153058.5918 gpcttshclnrtd47ko0qlh2fnrh Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5418';
20250218@153058.5964 gpcttshclnrtd47ko0qlh2fnrh Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5418';
20250218@153058.6058 gpcttshclnrtd47ko0qlh2fnrh Query : use flama_phc
20250218@153058.6061 gpcttshclnrtd47ko0qlh2fnrh Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250218@153058.6135 gpcttshclnrtd47ko0qlh2fnrh Query : use flama_phc
20250218@153058.6178 gpcttshclnrtd47ko0qlh2fnrh Query : select no, estab,szadrsdesc from szadrs where u_coddest=692
20250218@153058.6276 gpcttshclnrtd47ko0qlh2fnrh Query : select bi.bistamp ,bi.ref code ,bi.qtt quantity ,bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.bostamp ,st.u_uncxcl from bi inner join bo on bo.bostamp=bi.bostamp inner join st on st.ref = bi.ref where bo.ndos = 250 and bo.boano = 2012 and bo.obrano = 2501268 
20250218@153058.6711 gpcttshclnrtd47ko0qlh2fnrh Query : use flama_phc
20250218@153058.6714 gpcttshclnrtd47ko0qlh2fnrh Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20250218@153058.6747 gpcttshclnrtd47ko0qlh2fnrh Query : use flama_phc
20250218@153058.6749 gpcttshclnrtd47ko0qlh2fnrh Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -9010
20250218@153058.6778 gpcttshclnrtd47ko0qlh2fnrh Query : insert into wserrorlog (errornumber, errormsg,requesttable,initialdata,finaldata) values (-9010,?,'ft',?,?)
20250218@153058.6801 gpcttshclnrtd47ko0qlh2fnrh Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5418';
20250218@153058.6859 gpcttshclnrtd47ko0qlh2fnrh Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5418';

20250218@154059.9117 rv8lk4uud6n2jrp6vdhi2u47lp Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5419';
20250218@154100.3180 rv8lk4uud6n2jrp6vdhi2u47lp Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5419';
20250218@154100.3700 rv8lk4uud6n2jrp6vdhi2u47lp Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5419';
20250218@154100.4340 rv8lk4uud6n2jrp6vdhi2u47lp Query : use flama_phc
20250218@154100.4380 rv8lk4uud6n2jrp6vdhi2u47lp Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250218@154100.5130 rv8lk4uud6n2jrp6vdhi2u47lp Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.657.00.01'
20250218@154100.6300 rv8lk4uud6n2jrp6vdhi2u47lp Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =002 and bo.boano =2024 and bo.obrano = 2401263 and bi.ref ='324.657.00.01' and bi.lordem =20000
20250218@154100.1151 rv8lk4uud6n2jrp6vdhi2u47lp Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'cps24110178640,907000002 ' 
20250218@154100.1546 rv8lk4uud6n2jrp6vdhi2u47lp Query : use flama_phc
20250218@154100.1550 rv8lk4uud6n2jrp6vdhi2u47lp Query : select top 1 1 valor from ts where ts.ndos = 61
20250218@154100.1593 rv8lk4uud6n2jrp6vdhi2u47lp Query : use flama_phc
20250218@154100.1596 rv8lk4uud6n2jrp6vdhi2u47lp Query : select lower(descricao) descricao ,case when valor='s' then 1 else 0 end valor from para1 where descricao in ('st_lote','st_usalogifunc', 'st_grelha')
20250218@154100.1658 rv8lk4uud6n2jrp6vdhi2u47lp Query : select top 1 assinadoc issigned ,ts.stocks ,ts.bdempresas origin ,case when (cmstocks between 1 and 50 or cm2stocks between 1 and 50 ) then 1 else 0 end entrada ,case when cmstocks>50 or (cm2stocks>50 and trfa =1) then 1 else 0 end saida ,stneg validatestock ,tiposaft ,veserie useserialnumber ,foserie assetin ,ftserie assetout ,veserie assets ,trfarm assetstransfer ,grelha usegridfields from ts inner join ts2 on ts.tsstamp=ts2.ts2stamp where ts.ndos =61
20250218@154100.1703 rv8lk4uud6n2jrp6vdhi2u47lp Query : use flama_phc
20250218@154100.1708 rv8lk4uud6n2jrp6vdhi2u47lp Query : select top 1 ~inactivo valor from fl where no = '202090' and estab = 00 order by inactivo desc
20250218@154100.1931 rv8lk4uud6n2jrp6vdhi2u47lp Query : use flama_phc
20250218@154100.1935 rv8lk4uud6n2jrp6vdhi2u47lp Query : select 1 valor from ts where ndos = 61
20250218@154100.1957 rv8lk4uud6n2jrp6vdhi2u47lp Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154100.1989 rv8lk4uud6n2jrp6vdhi2u47lp Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20250218@154100.2040 rv8lk4uud6n2jrp6vdhi2u47lp Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154100.2064 rv8lk4uud6n2jrp6vdhi2u47lp Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20250218@154100.2074 rv8lk4uud6n2jrp6vdhi2u47lp Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154100.2093 rv8lk4uud6n2jrp6vdhi2u47lp Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20250218@154100.2103 rv8lk4uud6n2jrp6vdhi2u47lp Query : select top 1 ts2.manternumero, ts.tiposaft, ts.idserie,ts.nmdos,ts.bdempresas from ts inner join ts2 on ts.tsstamp=ts2.ts2stamp where ts.ndos = 61
20250218@154100.2125 rv8lk4uud6n2jrp6vdhi2u47lp Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2025 order by obrano desc
20250218@154100.2177 rv8lk4uud6n2jrp6vdhi2u47lp Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2025 order by obrano desc
20250218@154100.2202 rv8lk4uud6n2jrp6vdhi2u47lp Query : use flama_phc
20250218@154100.2212 rv8lk4uud6n2jrp6vdhi2u47lp Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202090' and estab=00
20250218@154100.2312 rv8lk4uud6n2jrp6vdhi2u47lp Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154100.2334 rv8lk4uud6n2jrp6vdhi2u47lp Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20250218@154100.2366 rv8lk4uud6n2jrp6vdhi2u47lp Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b4a3150467b4aa0c35',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20250218@154100.2385 rv8lk4uud6n2jrp6vdhi2u47lp Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154100.2405 rv8lk4uud6n2jrp6vdhi2u47lp Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20250218@154100.2420 rv8lk4uud6n2jrp6vdhi2u47lp Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b4a3150467b4aa0c35','--','bo',7.8581250000000000000 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20250218@154100.2441 rv8lk4uud6n2jrp6vdhi2u47lp Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154100.2458 rv8lk4uud6n2jrp6vdhi2u47lp Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20250218@154100.2470 rv8lk4uud6n2jrp6vdhi2u47lp Query : insert into bo (bostamp, nmdos, dataobra, ndos, obrano, no, estab, nome, ncont, morada, local, codpost, moeda, boano, memissao,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b4a3150467b4aa0c35','guia r. fornecedor','2025-02-18',61,2500630,?,?,?,?,?,?,?,?,2025, (select valor from para1 where descricao = 'ge_euro') ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20250218@154100.3349 rv8lk4uud6n2jrp6vdhi2u47lp Query : use flama_phc
20250218@154100.3353 rv8lk4uud6n2jrp6vdhi2u47lp Query : select st.usalote valor from st where st.ref = '324.657.00.01'
20250218@154100.3392 rv8lk4uud6n2jrp6vdhi2u47lp Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.657.00.01'
20250218@154100.3584 rv8lk4uud6n2jrp6vdhi2u47lp Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154100.3627 rv8lk4uud6n2jrp6vdhi2u47lp Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20250218@154100.3647 rv8lk4uud6n2jrp6vdhi2u47lp Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154100.3668 rv8lk4uud6n2jrp6vdhi2u47lp Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20250218@154100.3680 rv8lk4uud6n2jrp6vdhi2u47lp Query : select sestamp valor from se where ref ='324.657.00.01' and lote = 'r2401263200a'
20250218@154100.3697 rv8lk4uud6n2jrp6vdhi2u47lp Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154100.3717 rv8lk4uud6n2jrp6vdhi2u47lp Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20250218@154100.3729 rv8lk4uud6n2jrp6vdhi2u47lp Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154100.3754 rv8lk4uud6n2jrp6vdhi2u47lp Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20250218@154100.3973 rv8lk4uud6n2jrp6vdhi2u47lp Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b4a2129067b4aa0c5b',?,?,'20250218',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20250218@154100.5403 rv8lk4uud6n2jrp6vdhi2u47lp Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250218@154100.5432 rv8lk4uud6n2jrp6vdhi2u47lp Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154100.5450 rv8lk4uud6n2jrp6vdhi2u47lp Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20250218@154100.5466 rv8lk4uud6n2jrp6vdhi2u47lp Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b4a9433967b4aa0c84','aut67b4a3150467b4aa0c35',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from bo bo where bo.bostamp = 'aut67b4a3150467b4aa0c35'
20250218@154100.5652 rv8lk4uud6n2jrp6vdhi2u47lp Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154100.5673 rv8lk4uud6n2jrp6vdhi2u47lp Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20250218@154100.5691 rv8lk4uud6n2jrp6vdhi2u47lp Query : insert into bi (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,obistamp ,stipo) select 'aut67b4a9433967b4aa0c84',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1428, 1428*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,10000 ,16,16*200.48,16,16*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,16*1428,16*1428*200.48 ,17.428000,17.428000*200.48 ,17.428000,17.428000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,16,16*200.48,16*1428,16*1428*200.48,'cps24110178640,907000002 ',125.73,125.73*1428,125.73,125.73*1428,?,?,?,4 from bo bo where bo.bostamp = 'aut67b4a3150467b4aa0c35'
20250218@154120.7565 rv8lk4uud6n2jrp6vdhi2u47lp Query : use flama_phc
20250218@154120.7603 rv8lk4uud6n2jrp6vdhi2u47lp Query : declare @bostamp varchar(25) = 'aut67b4a3150467b4aa0c35' ,@bistamp varchar(25) = '' update bi set tecoval = qtt * ecoval ,etecoval = qtt * eecoval ,tecoval2 = qtt * ecoval2 ,etecoval2 = qtt * eecoval2 where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end -- se tiver classificação e não for normal, não calcula nada update bi set ttdeb = 0 ,ettdeb = 0 ,ttmoeda = 0 where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and bi.classifc <> '' and bi.classifc <> 'normal' -- no caso normal com moeda euro if exists ( select 1 from bo cross apply ( select valor moeda from para1 where descricao = 'ge_pteoueuro' ) par where bo.bostamp = @bostamp and bo.moeda = par.moeda ) begin -- sem ecovalores update bi set ettdeb = round(bi.qtt * ((bi.edebito * (1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100))), 6) ,ttdeb = round(bi.qtt * ((bi.debito * (1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100))), 6) ,ttmoeda = 0 from bi inner join bo on bi.bostamp = bo.bostamp where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and ( bi.classifc = '' or bi.classifc = 'normal' ) and bi.econotcalc = 1 -- com ecovalores update bi set ettdeb = round(bi.qtt * ( ( bi.edebito + ( iif(p.st_econotdesc = 1, - bi.eecoval2, bi.eecoval) * ( 1 + iif(bi.ivaincl = 1 and tiva.taxa <> 0, tiva.taxa / 100, 0) ) ) ) * (1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) ), 6) + ( bi.qtt * iif(p.st_econotdesc = 1, (bi.eecoval + bi.eecoval2) * ( 1 + iif(bi.ivaincl = 1 and tiva.taxa <> 0, tiva.taxa / 100, 0) ), 0) ) ,ttdeb = round(bi.qtt * ( ( bi.debito + ( iif(p.st_econotdesc = 1, - bi.ecoval2, bi.ecoval) * ( 1 + iif(bi.ivaincl = 1 and tiva.taxa <> 0, tiva.taxa / 100, 0) ) ) ) * (1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) ), 6) + ( bi.qtt * iif(p.st_econotdesc = 1, (bi.ecoval + bi.ecoval2) * ( 1 + iif(bi.ivaincl = 1 and tiva.taxa <> 0, tiva.taxa / 100, 0) ), 0) ) ,ttmoeda = 0 from bi inner join bo on bi.bostamp = bo.bostamp left join st on bi.ref = st.ref left join taxasiva tiva on bi.tabiva = tiva.codigo cross apply ( select max(valor) st_econotdesc from ( select case when valor = 's' then 1 else 0 end valor from para1 where descricao = 'st_econotdesc' union all select 0 ) a ) p where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and ( bi.classifc = '' or bi.classifc = 'normal' ) and bi.econotcalc = 0 --acrescenta os descontos em valor, caso existam: update bi set ettdeb = round(bi.ettdeb - (bi.qtt * bi.evaldesc), 2) ,ttdeb = round(bi.ttdeb - (bi.qtt * bi.valdesc), 2) ,ttmoeda = 0 from bi where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and ( bi.classifc = '' or bi.classifc = 'normal' ) and bi.valdesc <> 0 end else begin update bi set ttmoeda = round((1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) * bi.qtt * bi.vumoeda, 2) ,ettdeb = case when bo2.cambio <> 0 then round((round((1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) * bi.qtt * bi.vumoeda, 2)) / bo2.cambio, 2) else 0 end ,edebito = case when bi.qtt = 0 then 0 else round(abs(( case when bo2.cambio <> 0 then round((round((1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) * bi.qtt * bi.vumoeda, 2)) / bo2.cambio, 2) else 0 end ) / (1 - bi.desconto / 100) / (1 - bi.desc2 / 100) / (1 - bi.desc3 / 100) / (1 - bi.desc4 / 100) / (1 - bi.desc5 / 100) / (1 - bi.desc6 / 100) / bi.qtt), 2) end ,debito = case when bi.qtt = 0 then 0 else round(abs(( case when bo2.cambio <> 0 then round((round((1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) * bi.qtt * bi.vumoeda, 2)) / bo2.cambio, 2) else 0 end ) / (1 - bi.desconto / 100) / (1 - bi.desc2 / 100) / (1 - bi.desc3 / 100) / (1 - bi.desc4 / 100) / (1 - bi.desc5 / 100) / (1 - bi.desc6 / 100) / bi.qtt), 2) end * 200.482 from bi inner join bo2 on bi.bostamp = bo2.bo2stamp where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and ( bi.classifc = '' or bi.classifc = 'normal' ) update bi set ttdeb = round(bi.ttdeb - (bi.qtt * bi.valdesc), 2) ,ettdeb = round(bi.ettdeb - (bi.qtt * bi.evaldesc), 0) ,debito = round(bi.debito - (bi.qtt * bi.valdesc), 2) ,edebito = round(bi.edebito - (bi.qtt * bi.evaldesc), 2) where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and ( bi.classifc = '' or bi.classifc = 'normal' ) and bi.valdesc <> 0 end 
20250218@154138.7210 rv8lk4uud6n2jrp6vdhi2u47lp Query : use flama_phc
20250218@154138.7214 rv8lk4uud6n2jrp6vdhi2u47lp Query : select 1 valor from bo where bo.bostamp = 'aut67b4a3150467b4aa0c35'
20250218@154138.7237 rv8lk4uud6n2jrp6vdhi2u47lp Query : declare @errno int ,@errmsg varchar(255) ,@prod bit ,@nrdec numeric(10, 0) ,@totaldeb numeric(18, 5) ,@etotaldeb numeric(19, 6) ,@total numeric(18, 5) ,@etotal numeric(19, 6) ,@custo numeric(18, 5) ,@ecusto numeric(19, 6) ,@bo_1iliq numeric(19, 6) ,@bo_2iliq numeric(19, 6) ,@base1 numeric(19, 6) ,@base2 numeric(19, 6) ,@moetotal numeric(13, 3) ,@smoe1 numeric(13, 3) ,@smoe2 numeric(13, 3) ,@smoe3 numeric(13, 3) ,@smoe4 numeric(13, 3) ,@bo11_bins numeric(18, 5) ,@bo21_bins numeric(18, 5) ,@bo31_bins numeric(18, 5) ,@bo41_bins numeric(18, 5) ,@bo51_bins numeric(18, 5) ,@bo61_bins numeric(18, 5) ,@bo71_bins numeric(18, 5) ,@bo81_bins numeric(18, 5) ,@bo91_bins numeric(18, 5) ,@bo12_bins numeric(18, 5) ,@bo22_bins numeric(18, 5) ,@bo32_bins numeric(18, 5) ,@bo42_bins numeric(18, 5) ,@bo52_bins numeric(18, 5) ,@bo62_bins numeric(18, 5) ,@bo72_bins numeric(18, 5) ,@bo82_bins numeric(18, 5) ,@bo92_bins numeric(18, 5) ,@ebo11_bins numeric(19, 6) ,@ebo21_bins numeric(19, 6) ,@ebo31_bins numeric(19, 6) ,@ebo41_bins numeric(19, 6) ,@ebo51_bins numeric(19, 6) ,@ebo61_bins numeric(19, 6) ,@ebo71_bins numeric(18, 5) ,@ebo81_bins numeric(18, 5) ,@ebo91_bins numeric(18, 5) ,@ebo12_bins numeric(19, 6) ,@ebo22_bins numeric(19, 6) ,@ebo32_bins numeric(19, 6) ,@ebo42_bins numeric(19, 6) ,@ebo52_bins numeric(19, 6) ,@ebo62_bins numeric(19, 6) ,@ebo72_bins numeric(18, 5) ,@ebo82_bins numeric(18, 5) ,@ebo92_bins numeric(18, 5) ,@bo11_iva numeric(18, 5) ,@bo21_iva numeric(18, 5) ,@bo31_iva numeric(18, 5) ,@bo41_iva numeric(18, 5) ,@bo51_iva numeric(18, 5) ,@bo61_iva numeric(18, 5) ,@bo71_iva numeric(18, 5) ,@bo81_iva numeric(18, 5) ,@bo91_iva numeric(18, 5) ,@bo12_iva numeric(18, 5) ,@bo22_iva numeric(18, 5) ,@bo32_iva numeric(18, 5) ,@bo42_iva numeric(18, 5) ,@bo52_iva numeric(18, 5) ,@bo62_iva numeric(18, 5) ,@bo72_iva numeric(18, 5) ,@bo82_iva numeric(18, 5) ,@bo92_iva numeric(18, 5) ,@ebo11_iva numeric(19, 6) ,@ebo21_iva numeric(19, 6) ,@ebo31_iva numeric(19, 6) ,@ebo41_iva numeric(19, 6) ,@ebo51_iva numeric(19, 6) ,@ebo61_iva numeric(19, 6) ,@ebo71_iva numeric(18, 5) ,@ebo81_iva numeric(18, 5) ,@ebo91_iva numeric(18, 5) ,@ebo12_iva numeric(19, 6) ,@ebo22_iva numeric(19, 6) ,@ebo32_iva numeric(19, 6) ,@ebo42_iva numeric(19, 6) ,@ebo52_iva numeric(19, 6) ,@ebo62_iva numeric(19, 6) ,@ebo72_iva numeric(18, 5) ,@ebo82_iva numeric(18, 5) ,@ebo92_iva numeric(18, 5) ,@esdeb1 numeric(19, 6) ,@esdeb2 numeric(19, 6) ,@esdeb3 numeric(19, 6) ,@esdeb4 numeric(19, 6) ,@sdeb1 numeric(18, 5) ,@sdeb2 numeric(18, 5) ,@sdeb3 numeric(18, 5) ,@sdeb4 numeric(18, 5) ,@estot1 numeric(19, 6) ,@estot2 numeric(19, 6) ,@estot3 numeric(19, 6) ,@estot4 numeric(19, 6) ,@stot1 numeric(18, 5) ,@stot2 numeric(18, 5) ,@stot3 numeric(18, 5) ,@stot4 numeric(18, 5) ,@ebo_1tvall numeric(19, 6) ,@ebo_2tvall numeric(19, 6) ,@bo_1tvall numeric(18, 5) ,@bo_2tvall numeric(18, 5) ,@ebo_totp1 numeric(19, 6) ,@ebo_totp2 numeric(19, 6) ,@bo_totp1 numeric(18, 5) ,@bo_totp2 numeric(18, 5) ,@sqtt11 numeric(13, 3) ,@sqtt21 numeric(13, 3) ,@sqtt12 numeric(13, 3) ,@sqtt22 numeric(13, 3) ,@sqtt13 numeric(13, 3) ,@sqtt23 numeric(13, 3) ,@sqtt14 numeric(13, 3) ,@sqtt24 numeric(13, 3) ,@userinis varchar (30) ,@mybostamp char(25) = 'aut67b4a3150467b4aa0c35' declare @totaisiva table ( bostamp varchar (25), codigo numeric(1), taxa numeric (5,2), ebaseinc numeric (19,6), baseinc numeric (18,5), evalor numeric (19,6), valor numeric (18,5) ) set @prod = ( select ts.producao from bo(nolock) inner join ts(nolock) on bo.ndos = ts.ndos and bo.bostamp = @mybostamp ) set @nrdec = ( select convert(numeric(10, 0), valor) from para1(nolock) where descricao = 'de_euro' ) --set @prod = 0 --set @nrdec = 2 select @ecusto = sum(bi.epcusto * bi.qtt) ,@custo = sum(bi.pcusto * bi.qtt) ,@bo11_bins = sum(case when bi.tabiva = 1 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo21_bins = sum(case when bi.tabiva = 2 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo31_bins = sum(case when bi.tabiva = 3 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo41_bins = sum(case when bi.tabiva = 4 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo51_bins = sum(case when bi.tabiva = 5 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo61_bins = sum(case when bi.tabiva = 6 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo71_bins = sum(case when bi.tabiva = 7 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo81_bins = sum(case when bi.tabiva = 8 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo91_bins = sum(case when bi.tabiva = 9 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo12_bins = sum(case when bi.tabiva = 1 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo22_bins = sum(case when bi.tabiva = 2 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo32_bins = sum(case when bi.tabiva = 3 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo42_bins = sum(case when bi.tabiva = 4 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo52_bins = sum(case when bi.tabiva = 5 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo62_bins = sum(case when bi.tabiva = 6 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo72_bins = sum(case when bi.tabiva = 7 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo82_bins = sum(case when bi.tabiva = 8 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo92_bins = sum(case when bi.tabiva = 9 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo11_bins = sum(case when bi.tabiva = 1 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo21_bins = sum(case when bi.tabiva = 2 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo31_bins = sum(case when bi.tabiva = 3 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo41_bins = sum(case when bi.tabiva = 4 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo51_bins = sum(case when bi.tabiva = 5 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo61_bins = sum(case when bi.tabiva = 6 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo71_bins = sum(case when bi.tabiva = 7 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo81_bins = sum(case when bi.tabiva = 8 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo91_bins = sum(case when bi.tabiva = 9 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo12_bins = sum(case when bi.tabiva = 1 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo22_bins = sum(case when bi.tabiva = 2 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo32_bins = sum(case when bi.tabiva = 3 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo42_bins = sum(case when bi.tabiva = 4 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo52_bins = sum(case when bi.tabiva = 5 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo62_bins = sum(case when bi.tabiva = 6 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo72_bins = sum(case when bi.tabiva = 7 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo82_bins = sum(case when bi.tabiva = 8 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo92_bins = sum(case when bi.tabiva = 9 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo_1iliq = round(sum(bi.qtt * bi.epu), @nrdec) ,@bo_2iliq = round(sum(bi.ettdeb), @nrdec) ,@bo11_iva = sum(case when bi.tabiva = 1 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo12_iva = sum(case when bi.tabiva = 1 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo21_iva = sum(case when bi.tabiva = 2 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo22_iva = sum(case when bi.tabiva = 2 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo31_iva = sum(case when bi.tabiva = 3 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo32_iva = sum(case when bi.tabiva = 3 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo41_iva = sum(case when bi.tabiva = 4 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo42_iva = sum(case when bi.tabiva = 4 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo51_iva = sum(case when bi.tabiva = 5 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo52_iva = sum(case when bi.tabiva = 5 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo61_iva = sum(case when bi.tabiva = 6 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo62_iva = sum(case when bi.tabiva = 6 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo71_iva = sum(case when bi.tabiva = 7 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo72_iva = sum(case when bi.tabiva = 7 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo81_iva = sum(case when bi.tabiva = 8 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo82_iva = sum(case when bi.tabiva = 8 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo91_iva = sum(case when bi.tabiva = 9 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo92_iva = sum(case when bi.tabiva = 9 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo11_iva = sum(case when bi.tabiva = 1 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo12_iva = sum(case when bi.tabiva = 1 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo21_iva = sum(case when bi.tabiva = 2 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo22_iva = sum(case when bi.tabiva = 2 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo31_iva = sum(case when bi.tabiva = 3 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo32_iva = sum(case when bi.tabiva = 3 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo41_iva = sum(case when bi.tabiva = 4 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo42_iva = sum(case when bi.tabiva = 4 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo51_iva = sum(case when bi.tabiva = 5 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo52_iva = sum(case when bi.tabiva = 5 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo61_iva = sum(case when bi.tabiva = 6 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo62_iva = sum(case when bi.tabiva = 6 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo71_iva = sum(case when bi.tabiva = 7 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo72_iva = sum(case when bi.tabiva = 7 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo81_iva = sum(case when bi.tabiva = 8 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo82_iva = sum(case when bi.tabiva = 8 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo91_iva = sum(case when bi.tabiva = 9 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else bi.ettdeb - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo92_iva = sum(case when bi.tabiva = 9 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@esdeb1 = sum(case when bi.stipo <= 1 then case when bi.ivaincl = 0 then bi.ettdeb else bi.ettdeb - round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@esdeb2 = sum(case when bi.stipo = 2 then case when bi.ivaincl = 0 then bi.ettdeb else bi.ettdeb - round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@esdeb3 = sum(case when bi.stipo = 3 then case when bi.ivaincl = 0 then bi.ettdeb else bi.ettdeb - round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@esdeb4 = sum(case when bi.stipo = 4 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) * bi.iva / 100, @nrdec) end else 0 end) ,@sdeb1 = sum(case when bi.stipo <= 1 then case when bi.ivaincl = 0 then bi.ttdeb else bi.ttdeb - round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@sdeb2 = sum(case when bi.stipo = 2 then case when bi.ivaincl = 0 then bi.ttdeb else bi.ttdeb - round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@sdeb3 = sum(case when bi.stipo = 3 then case when bi.ivaincl = 0 then bi.ttdeb else bi.ttdeb - round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@sdeb4 = sum(case when bi.stipo = 4 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) * bi.iva / 100, @nrdec) end else 0 end) ,@smoe1 = sum(case when bi.stipo <= 1 then case when bi.ivaincl = 0 then bi.ttmoeda else round(bi.ttmoeda / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@smoe2 = sum(case when bi.stipo = 2 then case when bi.ivaincl = 0 then bi.ttmoeda else round(bi.ttmoeda / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@smoe3 = sum(case when bi.stipo = 3 then case when bi.ivaincl = 0 then bi.ttmoeda else round(bi.ttmoeda / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@smoe4 = sum(case when bi.stipo = 4 then case when bi.ivaincl = 0 then bi.ttmoeda else round(bi.ttmoeda / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@estot1 = sum(case when bi.stipo <= 1 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@estot2 = sum(case when bi.stipo = 2 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@estot3 = sum(case when bi.stipo = 3 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@estot4 = sum(case when bi.stipo = 4 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@stot1 = sum(case when bi.stipo <= 1 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.pu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@stot2 = sum(case when bi.stipo = 2 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.pu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@stot3 = sum(case when bi.stipo = 3 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.pu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@stot4 = sum(case when bi.stipo = 4 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.pu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@total = @stot1 + @stot2 + @stot3 + @stot4 ,@etotal = @estot1 + @estot2 + @estot3 + @estot4 ,@totaldeb = @sdeb1 + @sdeb2 + @sdeb3 + @sdeb4 ,@etotaldeb = @esdeb1 + @esdeb2 + @esdeb3 + @esdeb4 ,@moetotal = @smoe1 + @smoe2 + @smoe3 + @smoe4 ,@ebo_1tvall = @ebo11_bins + @ebo21_bins + @ebo31_bins + @ebo41_bins + @ebo51_bins + @ebo61_bins + @ebo71_bins + @ebo81_bins + @ebo91_bins ,@ebo_2tvall = @ebo12_bins + @ebo22_bins + @ebo32_bins + @ebo42_bins + @ebo52_bins + @ebo62_bins + @ebo72_bins + @ebo82_bins + @ebo92_bins ,@bo_1tvall = @bo11_bins + @bo21_bins + @bo31_bins + @bo41_bins + @bo51_bins + @bo61_bins + @bo71_bins + @bo81_bins + @bo91_bins ,@bo_2tvall = @bo12_bins + @bo22_bins + @bo32_bins + @bo42_bins + @bo52_bins + @bo62_bins + @bo72_bins + @bo82_bins + @bo92_bins ,@ebo_totp1 = sum(case when bi.ivaincl = 0 then (bi.epu * bi.qtt) else round((bi.epu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end) ,@ebo_totp2 = sum(case when bi.ivaincl = 0 then (bi.edebito * bi.qtt) else round((bi.edebito * bi.qtt) / (1 + bi.iva / 100), @nrdec) end) ,@bo_totp1 = sum(case when bi.ivaincl = 0 then (bi.pu * bi.qtt) else round((bi.pu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end) ,@bo_totp2 = sum(case when bi.ivaincl = 0 then (bi.debito * bi.qtt) else round((bi.debito * bi.qtt) / (1 + bi.iva / 100), @nrdec) end) ,@sqtt11 = sum(case when bi.stipo = 1 then bi.qtt else 0 end) ,@sqtt21 = sum(case when bi.stipo = 1 then bi.qtt else 0 end) ,@sqtt12 = sum(case when bi.stipo = 2 then bi.qtt else 0 end) ,@sqtt22 = sum(case when bi.stipo = 2 then bi.qtt else 0 end) ,@sqtt13 = sum(case when bi.stipo = 3 then bi.qtt else 0 end) ,@sqtt23 = sum(case when bi.stipo = 3 then bi.qtt else 0 end) ,@sqtt14 = sum(case when bi.stipo = 4 then bi.qtt else 0 end) ,@sqtt24 = sum(case when bi.stipo = 5 then bi.qtt else 0 end) from bi(nolock) where bi.bostamp = @mybostamp and bi.producao = case when @prod = 1 then 1 else bi.producao end and bi.composto = 0 and bi.qtt <> 0 update bo set bo.totaldeb = isnull(@totaldeb, 0) ,bo.total = isnull(@total, 0) ,bo.etotaldeb = isnull(@etotaldeb, 0) ,bo.moetotal = isnull(@moetotal, 0) ,bo.etotal = isnull(@etotal, 0) ,bo.ecusto = isnull(@ecusto, 0) ,bo.custo = isnull(@custo, 0) ,bo.bo11_bins = isnull(@bo11_bins, 0) ,bo.bo12_bins = isnull(@bo12_bins, 0) ,bo.bo21_bins = isnull(@bo21_bins, 0) ,bo.bo22_bins = isnull(@bo22_bins, 0) ,bo.bo31_bins = isnull(@bo31_bins, 0) ,bo.bo32_bins = isnull(@bo32_bins, 0) ,bo.bo41_bins = isnull(@bo41_bins, 0) ,bo.bo42_bins = isnull(@bo42_bins, 0) ,bo.bo51_bins = isnull(@bo51_bins, 0) ,bo.bo52_bins = isnull(@bo52_bins, 0) ,bo.bo61_bins = isnull(@bo61_bins, 0) ,bo.bo62_bins = isnull(@bo62_bins, 0) ,bo.ebo11_bins = isnull(@ebo11_bins, 0) ,bo.ebo12_bins = isnull(@ebo12_bins, 0) ,bo.ebo21_bins = isnull(@ebo21_bins, 0) ,bo.ebo22_bins = isnull(@ebo22_bins, 0) ,bo.ebo31_bins = isnull(@ebo31_bins, 0) ,bo.ebo32_bins = isnull(@ebo32_bins, 0) ,bo.ebo41_bins = isnull(@ebo41_bins, 0) ,bo.ebo42_bins = isnull(@ebo42_bins, 0) ,bo.ebo51_bins = isnull(@ebo51_bins, 0) ,bo.ebo52_bins = isnull(@ebo52_bins, 0) ,bo.ebo61_bins = isnull(@ebo61_bins, 0) ,bo.ebo62_bins = isnull(@ebo62_bins, 0) ,bo.bo11_iva = isnull(@bo11_iva, 0) ,bo.bo12_iva = isnull(@bo12_iva, 0) ,bo.bo21_iva = isnull(@bo21_iva, 0) ,bo.bo22_iva = isnull(@bo22_iva, 0) ,bo.bo31_iva = isnull(@bo31_iva, 0) ,bo.bo32_iva = isnull(@bo32_iva, 0) ,bo.bo41_iva = isnull(@bo41_iva, 0) ,bo.bo42_iva = isnull(@bo42_iva, 0) ,bo.bo51_iva = isnull(@bo51_iva, 0) ,bo.bo52_iva = isnull(@bo52_iva, 0) ,bo.bo61_iva = isnull(@bo61_iva, 0) ,bo.bo62_iva = isnull(@bo62_iva, 0) ,bo.ebo11_iva = isnull(@ebo11_iva, 0) ,bo.ebo12_iva = isnull(@ebo12_iva, 0) ,bo.ebo21_iva = isnull(@ebo21_iva, 0) ,bo.ebo22_iva = isnull(@ebo22_iva, 0) ,bo.ebo31_iva = isnull(@ebo31_iva, 0) ,bo.ebo32_iva = isnull(@ebo32_iva, 0) ,bo.ebo41_iva = isnull(@ebo41_iva, 0) ,bo.ebo42_iva = isnull(@ebo42_iva, 0) ,bo.ebo51_iva = isnull(@ebo51_iva, 0) ,bo.ebo52_iva = isnull(@ebo52_iva, 0) ,bo.ebo61_iva = isnull(@ebo61_iva, 0) ,bo.ebo62_iva = isnull(@ebo62_iva, 0) ,bo.esdeb1 = isnull(@esdeb1, 0) ,bo.esdeb2 = isnull(@esdeb2, 0) ,bo.esdeb3 = isnull(@esdeb3, 0) ,bo.esdeb4 = isnull(@esdeb4, 0) ,bo.sdeb1 = isnull(@sdeb1, 0) ,bo.sdeb2 = isnull(@sdeb2, 0) ,bo.sdeb3 = isnull(@sdeb3, 0) ,bo.sdeb4 = isnull(@sdeb4, 0) ,bo.smoe1 = isnull(@smoe1, 0) ,bo.smoe2 = isnull(@smoe2, 0) ,bo.smoe3 = isnull(@smoe3, 0) ,bo.smoe4 = isnull(@smoe4, 0) ,bo.estot1 = isnull(@estot1, 0) ,bo.estot2 = isnull(@estot2, 0) ,bo.estot3 = isnull(@estot3, 0) ,bo.estot4 = isnull(@estot4, 0) ,bo.stot1 = isnull(@stot1, 0) ,bo.stot2 = isnull(@stot2, 0) ,bo.stot3 = isnull(@stot3, 0) ,bo.stot4 = isnull(@stot4, 0) ,bo.ebo_1tvall = isnull(@ebo_1tvall, 0) ,bo.ebo_2tvall = isnull(@ebo_2tvall, 0) ,bo.bo_1tvall = isnull(@bo_1tvall, 0) ,bo.bo_2tvall = isnull(@bo_2tvall, 0) ,bo.ebo_totp1 = isnull(@ebo_totp1, 0) ,bo.ebo_totp2 = isnull(@ebo_totp2, 0) ,bo.bo_totp1 = isnull(@bo_totp1, 0) ,bo.bo_totp2 = isnull(@bo_totp2, 0) ,bo.sqtt11 = isnull(@sqtt11, 0) ,bo.sqtt21 = isnull(@sqtt21, 0) ,bo.sqtt12 = isnull(@sqtt12, 0) ,bo.sqtt22 = isnull(@sqtt22, 0) ,bo.sqtt13 = isnull(@sqtt13, 0) ,bo.sqtt23 = isnull(@sqtt23, 0) ,bo.sqtt14 = isnull(@sqtt14, 0) ,bo.sqtt24 = isnull(@sqtt24, 0) where bostamp = @mybostamp update bo2 set bo2.bo71_bins = isnull(@bo71_bins, 0) ,bo2.bo72_bins = isnull(@bo72_bins, 0) ,bo2.bo81_bins = isnull(@bo81_bins, 0) ,bo2.bo82_bins = isnull(@bo82_bins, 0) ,bo2.bo91_bins = isnull(@bo91_bins, 0) ,bo2.bo92_bins = isnull(@bo92_bins, 0) ,bo2.ebo71_bins = isnull(@ebo71_bins, 0) ,bo2.ebo72_bins = isnull(@ebo72_bins, 0) ,bo2.ebo81_bins = isnull(@ebo81_bins, 0) ,bo2.ebo82_bins = isnull(@ebo82_bins, 0) ,bo2.ebo91_bins = isnull(@ebo91_bins, 0) ,bo2.ebo92_bins = isnull(@ebo92_bins, 0) ,bo2.bo71_iva = isnull(@bo71_iva, 0) ,bo2.bo72_iva = isnull(@bo72_iva, 0) ,bo2.bo81_iva = isnull(@bo81_iva, 0) ,bo2.bo82_iva = isnull(@bo82_iva, 0) ,bo2.bo91_iva = isnull(@bo91_iva, 0) ,bo2.bo92_iva = isnull(@bo92_iva, 0) ,bo2.ebo71_iva = isnull(@ebo71_iva, 0) ,bo2.ebo72_iva = isnull(@ebo72_iva, 0) ,bo2.ebo81_iva = isnull(@ebo81_iva, 0) ,bo2.ebo82_iva = isnull(@ebo82_iva, 0) ,bo2.ebo91_iva = isnull(@ebo91_iva, 0) ,bo2.ebo92_iva = isnull(@ebo92_iva, 0) ,bo2.etotalciva = isnull(@etotaldeb, 0) + isnull(@ebo12_iva, 0) +isnull(@ebo22_iva, 0) +isnull(@ebo32_iva, 0) +isnull(@ebo42_iva, 0) +isnull(@ebo52_iva, 0) +isnull(@ebo62_iva, 0) +isnull(@ebo72_iva, 0) +isnull(@ebo82_iva, 0) +isnull(@ebo92_iva, 0) --,bo2.mtotalciva =isnull(@moetotal, 0) where bo2stamp = @mybostamp -- trata os bot select @userinis = usrinis from bo where bo.bostamp=@mybostamp insert into @totaisiva ( bostamp, codigo, taxa, ebaseinc, baseinc, evalor, valor ) select @mybostamp,codigo,taxa ,case when (@ebo11_bins <>0) then @ebo11_bins else @ebo12_bins end ,case when (@ebo11_bins <>0) then @bo11_bins else @bo12_bins end ,case when (@ebo11_bins <>0) then @ebo11_iva else @ebo12_iva end ,case when (@ebo11_bins <>0) then @bo11_iva else @bo12_iva end from taxasiva where codigo = 1 union all select @mybostamp,codigo,taxa ,case when (@ebo21_bins <>0) then @ebo21_bins else @ebo22_bins end ,case when (@ebo21_bins <>0) then @bo21_bins else @bo22_bins end ,case when (@ebo21_bins <>0) then @ebo21_iva else @ebo22_iva end ,case when (@ebo21_bins <>0) then @bo21_iva else @bo22_iva end from taxasiva where codigo = 2 union all select @mybostamp,codigo,taxa ,case when (@ebo31_bins <>0) then @ebo31_bins else @ebo32_bins end ,case when (@ebo31_bins <>0) then @bo31_bins else @bo32_bins end ,case when (@ebo31_bins <>0) then @ebo31_iva else @ebo32_iva end ,case when (@ebo31_bins <>0) then @bo31_iva else @bo32_iva end from taxasiva where codigo = 3 union all select @mybostamp,codigo,taxa ,case when (@ebo41_bins <>0) then @ebo41_bins else @ebo42_bins end ,case when (@ebo41_bins <>0) then @bo41_bins else @bo42_bins end ,case when (@ebo41_bins <>0) then @ebo41_iva else @ebo42_iva end ,case when (@ebo41_bins <>0) then @bo41_iva else @bo42_iva end from taxasiva where codigo = 4 union all select @mybostamp,codigo,taxa ,case when (@ebo51_bins <>0) then @ebo51_bins else @ebo52_bins end ,case when (@ebo51_bins <>0) then @bo51_bins else @bo52_bins end ,case when (@ebo51_bins <>0) then @ebo51_iva else @ebo52_iva end ,case when (@ebo51_bins <>0) then @bo51_iva else @bo52_iva end from taxasiva where codigo = 5 union all select @mybostamp,codigo,taxa ,case when (@ebo61_bins <>0) then @ebo61_bins else @ebo62_bins end ,case when (@ebo61_bins <>0) then @bo61_bins else @bo62_bins end ,case when (@ebo61_bins <>0) then @ebo61_iva else @ebo62_iva end ,case when (@ebo61_bins <>0) then @bo61_iva else @bo62_iva end from taxasiva where codigo = 6 union all select @mybostamp,codigo,taxa ,case when (@ebo71_bins <>0) then @ebo71_bins else @ebo72_bins end ,case when (@ebo71_bins <>0) then @bo71_bins else @bo72_bins end ,case when (@ebo71_bins <>0) then @ebo71_iva else @ebo72_iva end ,case when (@ebo71_bins <>0) then @bo71_iva else @bo72_iva end from taxasiva where codigo = 7 union all select @mybostamp,codigo,taxa ,case when (@ebo81_bins <>0) then @ebo81_bins else @ebo82_bins end ,case when (@ebo81_bins <>0) then @bo81_bins else @bo82_bins end ,case when (@ebo81_bins <>0) then @ebo81_iva else @ebo82_iva end ,case when (@ebo81_bins <>0) then @bo81_iva else @bo82_iva end from taxasiva where codigo = 8 union all select @mybostamp,codigo,taxa ,case when (@ebo91_bins <>0) then @ebo91_bins else @ebo92_bins end ,case when (@ebo91_bins <>0) then @bo91_bins else @bo92_bins end ,case when (@ebo91_bins <>0) then @ebo91_iva else @ebo92_iva end ,case when (@ebo91_bins <>0) then @bo91_iva else @bo92_iva end from taxasiva where codigo = 9 update bot set ebaseinc = totiva.ebaseinc, baseinc = totiva.baseinc, evalor = totiva.evalor, valor = totiva.valor, usrinis = @userinis, usrdata = convert (date,getdate()), usrhora = convert (time,getdate()) from @totaisiva totiva inner join bot on totiva.bostamp = bot.bostamp and totiva.codigo = bot.codigo insert into bot ( botstamp ,bostamp ,codigo ,taxa ,ebaseinc ,baseinc ,evalor ,valor ,ousrinis ,ousrdata ,ousrhora ,usrinis ,usrdata ,usrhora ) select ( left(@userinis,3) + 'tt' + left(newid(),5) + right(newid(),5) + left(newid(),5) + right(newid(),5)) stamp ,@mybostamp stampbo ,totiva.codigo ,totiva.taxa ,totiva.ebaseinc ,totiva.baseinc ,totiva.evalor ,totiva.valor ,@userinis ,convert (date,getdate()) ,convert (time,getdate()) ,@userinis ,convert (date,getdate()) ,convert (time,getdate()) from @totaisiva totiva left join bot on totiva.bostamp = bot.bostamp and totiva.codigo = bot.codigo where bot.botstamp is null -- atualiza os campo bi.series e bi.series2, caso tenha equipamentos update bi set series = s1, series2=s2 from bi inner join ( select distinct bistamp,ser.s1, ser.s2 from boma cross apply (select stuff ( ( select ',' + rtrim(serie) from boma myboma where myboma.bistamp = boma.bistamp order by serie for xml path('') ), 1, 1, '' ) s1 , stuff ( ( select ',' + rtrim(serie2) from boma myboma where myboma.bistamp = boma.bistamp order by serie for xml path('') ), 1, 1, '' ) s2 ) ser where boma.bostamp = @mybostamp ) myboma on bi.bistamp = myboma.bistamp where bi.bostamp = @mybostamp 
20250218@154141.6216 rv8lk4uud6n2jrp6vdhi2u47lp Query : use flama_phc
20250218@154141.6220 rv8lk4uud6n2jrp6vdhi2u47lp Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20250218@154141.6295 rv8lk4uud6n2jrp6vdhi2u47lp Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5419';
20250218@154141.6343 rv8lk4uud6n2jrp6vdhi2u47lp Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5419';
20250218@154141.6924 14js5lu163mfgja32lrm8un6ip Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20250218@154141.6935 14js5lu163mfgja32lrm8un6ip Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20250218@154141.7008 14js5lu163mfgja32lrm8un6ip Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5420';
20250218@154141.7080 14js5lu163mfgja32lrm8un6ip Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5420';
20250218@154141.7149 14js5lu163mfgja32lrm8un6ip Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='5420';
20250218@154141.7190 14js5lu163mfgja32lrm8un6ip Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='5420';
20250218@154141.7250 14js5lu163mfgja32lrm8un6ip Query : use flama_phc
20250218@154141.7253 14js5lu163mfgja32lrm8un6ip Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20250218@154141.7373 14js5lu163mfgja32lrm8un6ip Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.5501.00.1'
20250218@154141.7488 14js5lu163mfgja32lrm8un6ip Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =002 and bo.boano =2024 and bo.obrano = 2401101 and bi.ref ='324.5501.00.1' and bi.lordem =10000
20250218@154141.7803 14js5lu163mfgja32lrm8un6ip Query : select bi.edebito ,bi.desconto ,bi.desc2 ,bi.desc3 ,bi.desc4 ,bi.obranome ,bi.bostamp ,bo.moeda ,bi.vumoeda ,isnull(bi.vumoeda/nullif(bi.edebito,0),1) cambio ,bi.tabiva from bi inner join bo on bi.bostamp = bo.bostamp where bi.bistamp = 'cps24091843768,162000004 ' 
20250218@154141.8107 14js5lu163mfgja32lrm8un6ip Query : use flama_phc
20250218@154141.8110 14js5lu163mfgja32lrm8un6ip Query : select top 1 1 valor from ts where ts.ndos = 61
20250218@154141.8143 14js5lu163mfgja32lrm8un6ip Query : use flama_phc
20250218@154141.8151 14js5lu163mfgja32lrm8un6ip Query : select lower(descricao) descricao ,case when valor='s' then 1 else 0 end valor from para1 where descricao in ('st_lote','st_usalogifunc', 'st_grelha')
20250218@154141.8180 14js5lu163mfgja32lrm8un6ip Query : select top 1 assinadoc issigned ,ts.stocks ,ts.bdempresas origin ,case when (cmstocks between 1 and 50 or cm2stocks between 1 and 50 ) then 1 else 0 end entrada ,case when cmstocks>50 or (cm2stocks>50 and trfa =1) then 1 else 0 end saida ,stneg validatestock ,tiposaft ,veserie useserialnumber ,foserie assetin ,ftserie assetout ,veserie assets ,trfarm assetstransfer ,grelha usegridfields from ts inner join ts2 on ts.tsstamp=ts2.ts2stamp where ts.ndos =61
20250218@154141.8215 14js5lu163mfgja32lrm8un6ip Query : use flama_phc
20250218@154141.8218 14js5lu163mfgja32lrm8un6ip Query : select top 1 ~inactivo valor from fl where no = '202515' and estab = 00 order by inactivo desc
20250218@154141.8341 14js5lu163mfgja32lrm8un6ip Query : use flama_phc
20250218@154141.8344 14js5lu163mfgja32lrm8un6ip Query : select 1 valor from ts where ndos = 61
20250218@154141.8361 14js5lu163mfgja32lrm8un6ip Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154141.8378 14js5lu163mfgja32lrm8un6ip Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20250218@154141.8387 14js5lu163mfgja32lrm8un6ip Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154141.8401 14js5lu163mfgja32lrm8un6ip Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20250218@154141.8410 14js5lu163mfgja32lrm8un6ip Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154141.8425 14js5lu163mfgja32lrm8un6ip Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20250218@154141.8434 14js5lu163mfgja32lrm8un6ip Query : select top 1 ts2.manternumero, ts.tiposaft, ts.idserie,ts.nmdos,ts.bdempresas from ts inner join ts2 on ts.tsstamp=ts2.ts2stamp where ts.ndos = 61
20250218@154141.8448 14js5lu163mfgja32lrm8un6ip Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2025 order by obrano desc
20250218@154141.8469 14js5lu163mfgja32lrm8un6ip Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2025 order by obrano desc
20250218@154141.8490 14js5lu163mfgja32lrm8un6ip Query : use flama_phc
20250218@154141.8496 14js5lu163mfgja32lrm8un6ip Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202515' and estab=00
20250218@154141.8597 14js5lu163mfgja32lrm8un6ip Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154141.8612 14js5lu163mfgja32lrm8un6ip Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20250218@154141.8630 14js5lu163mfgja32lrm8un6ip Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b4a3856167b4aa35cf',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20250218@154141.8634 14js5lu163mfgja32lrm8un6ip Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154141.8648 14js5lu163mfgja32lrm8un6ip Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20250218@154141.8661 14js5lu163mfgja32lrm8un6ip Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b4a3856167b4aa35cf','--','bo',1.0700808625336927223 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20250218@154141.8666 14js5lu163mfgja32lrm8un6ip Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154141.8680 14js5lu163mfgja32lrm8un6ip Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20250218@154141.8691 14js5lu163mfgja32lrm8un6ip Query : insert into bo (bostamp, nmdos, dataobra, ndos, obrano, no, estab, nome, ncont, morada, local, codpost, moeda, boano, memissao,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b4a3856167b4aa35cf','guia r. fornecedor','2025-02-18',61,2500631,?,?,?,?,?,?,?,?,2025, (select valor from para1 where descricao = 'ge_euro') ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20250218@154144.8423 14js5lu163mfgja32lrm8un6ip Query : use flama_phc
20250218@154144.8428 14js5lu163mfgja32lrm8un6ip Query : select st.usalote valor from st where st.ref = '324.5501.00.1'
20250218@154144.8461 14js5lu163mfgja32lrm8un6ip Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.5501.00.1'
20250218@154144.8654 14js5lu163mfgja32lrm8un6ip Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154144.8677 14js5lu163mfgja32lrm8un6ip Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20250218@154144.8696 14js5lu163mfgja32lrm8un6ip Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154144.8718 14js5lu163mfgja32lrm8un6ip Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20250218@154144.8732 14js5lu163mfgja32lrm8un6ip Query : select sestamp valor from se where ref ='324.5501.00.1' and lote = 'r2401101100a'
20250218@154144.8750 14js5lu163mfgja32lrm8un6ip Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154144.8773 14js5lu163mfgja32lrm8un6ip Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20250218@154144.8786 14js5lu163mfgja32lrm8un6ip Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154144.8807 14js5lu163mfgja32lrm8un6ip Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20250218@154144.8840 14js5lu163mfgja32lrm8un6ip Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67b4a9062567b4aa38d6',?,?,'20250218',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20250218@154144.9442 14js5lu163mfgja32lrm8un6ip Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20250218@154144.9458 14js5lu163mfgja32lrm8un6ip Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154144.9476 14js5lu163mfgja32lrm8un6ip Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20250218@154144.9490 14js5lu163mfgja32lrm8un6ip Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67b4a6096867b4aa38e6','aut67b4a3856167b4aa35cf',bo.morada, bo.local,bo.codpost ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut' from bo bo where bo.bostamp = 'aut67b4a3856167b4aa35cf'
20250218@154144.9649 14js5lu163mfgja32lrm8un6ip Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20250218@154144.9667 14js5lu163mfgja32lrm8un6ip Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20250218@154144.9684 14js5lu163mfgja32lrm8un6ip Query : insert into bi (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,desconto,desc2,desc3,desc4,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,obistamp ,stipo) select 'aut67b4a6096867b4aa38e6',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1020, 1020*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,10000 ,18.55,18.55*200.48,18.55,18.55*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,18.55*1020,18.55*1020*200.48 ,18.137000,18.137000*200.48 ,18.137000,18.137000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,18.55,18.55*200.48,18.55*1020,18.55*1020*200.48,'cps24091843768,162000004 ',19.85,19.85*1020,19.85,19.85*1020,?,?,?,4 from bo bo where bo.bostamp = 'aut67b4a3856167b4aa35cf'
20250218@154145.1287 14js5lu163mfgja32lrm8un6ip Query : use flama_phc
20250218@154145.1293 14js5lu163mfgja32lrm8un6ip Query : declare @bostamp varchar(25) = 'aut67b4a3856167b4aa35cf' ,@bistamp varchar(25) = '' update bi set tecoval = qtt * ecoval ,etecoval = qtt * eecoval ,tecoval2 = qtt * ecoval2 ,etecoval2 = qtt * eecoval2 where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end -- se tiver classificação e não for normal, não calcula nada update bi set ttdeb = 0 ,ettdeb = 0 ,ttmoeda = 0 where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and bi.classifc <> '' and bi.classifc <> 'normal' -- no caso normal com moeda euro if exists ( select 1 from bo cross apply ( select valor moeda from para1 where descricao = 'ge_pteoueuro' ) par where bo.bostamp = @bostamp and bo.moeda = par.moeda ) begin -- sem ecovalores update bi set ettdeb = round(bi.qtt * ((bi.edebito * (1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100))), 6) ,ttdeb = round(bi.qtt * ((bi.debito * (1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100))), 6) ,ttmoeda = 0 from bi inner join bo on bi.bostamp = bo.bostamp where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and ( bi.classifc = '' or bi.classifc = 'normal' ) and bi.econotcalc = 1 -- com ecovalores update bi set ettdeb = round(bi.qtt * ( ( bi.edebito + ( iif(p.st_econotdesc = 1, - bi.eecoval2, bi.eecoval) * ( 1 + iif(bi.ivaincl = 1 and tiva.taxa <> 0, tiva.taxa / 100, 0) ) ) ) * (1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) ), 6) + ( bi.qtt * iif(p.st_econotdesc = 1, (bi.eecoval + bi.eecoval2) * ( 1 + iif(bi.ivaincl = 1 and tiva.taxa <> 0, tiva.taxa / 100, 0) ), 0) ) ,ttdeb = round(bi.qtt * ( ( bi.debito + ( iif(p.st_econotdesc = 1, - bi.ecoval2, bi.ecoval) * ( 1 + iif(bi.ivaincl = 1 and tiva.taxa <> 0, tiva.taxa / 100, 0) ) ) ) * (1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) ), 6) + ( bi.qtt * iif(p.st_econotdesc = 1, (bi.ecoval + bi.ecoval2) * ( 1 + iif(bi.ivaincl = 1 and tiva.taxa <> 0, tiva.taxa / 100, 0) ), 0) ) ,ttmoeda = 0 from bi inner join bo on bi.bostamp = bo.bostamp left join st on bi.ref = st.ref left join taxasiva tiva on bi.tabiva = tiva.codigo cross apply ( select max(valor) st_econotdesc from ( select case when valor = 's' then 1 else 0 end valor from para1 where descricao = 'st_econotdesc' union all select 0 ) a ) p where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and ( bi.classifc = '' or bi.classifc = 'normal' ) and bi.econotcalc = 0 --acrescenta os descontos em valor, caso existam: update bi set ettdeb = round(bi.ettdeb - (bi.qtt * bi.evaldesc), 2) ,ttdeb = round(bi.ttdeb - (bi.qtt * bi.valdesc), 2) ,ttmoeda = 0 from bi where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and ( bi.classifc = '' or bi.classifc = 'normal' ) and bi.valdesc <> 0 end else begin update bi set ttmoeda = round((1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) * bi.qtt * bi.vumoeda, 2) ,ettdeb = case when bo2.cambio <> 0 then round((round((1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) * bi.qtt * bi.vumoeda, 2)) / bo2.cambio, 2) else 0 end ,edebito = case when bi.qtt = 0 then 0 else round(abs(( case when bo2.cambio <> 0 then round((round((1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) * bi.qtt * bi.vumoeda, 2)) / bo2.cambio, 2) else 0 end ) / (1 - bi.desconto / 100) / (1 - bi.desc2 / 100) / (1 - bi.desc3 / 100) / (1 - bi.desc4 / 100) / (1 - bi.desc5 / 100) / (1 - bi.desc6 / 100) / bi.qtt), 2) end ,debito = case when bi.qtt = 0 then 0 else round(abs(( case when bo2.cambio <> 0 then round((round((1 - bi.desconto / 100) * (1 - bi.desc2 / 100) * (1 - bi.desc3 / 100) * (1 - bi.desc4 / 100) * (1 - bi.desc5 / 100) * (1 - bi.desc6 / 100) * bi.qtt * bi.vumoeda, 2)) / bo2.cambio, 2) else 0 end ) / (1 - bi.desconto / 100) / (1 - bi.desc2 / 100) / (1 - bi.desc3 / 100) / (1 - bi.desc4 / 100) / (1 - bi.desc5 / 100) / (1 - bi.desc6 / 100) / bi.qtt), 2) end * 200.482 from bi inner join bo2 on bi.bostamp = bo2.bo2stamp where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and ( bi.classifc = '' or bi.classifc = 'normal' ) update bi set ttdeb = round(bi.ttdeb - (bi.qtt * bi.valdesc), 2) ,ettdeb = round(bi.ettdeb - (bi.qtt * bi.evaldesc), 0) ,debito = round(bi.debito - (bi.qtt * bi.valdesc), 2) ,edebito = round(bi.edebito - (bi.qtt * bi.evaldesc), 2) where bi.bostamp = @bostamp and bi.bistamp = case when @bistamp <> '' then @bistamp else bi.bistamp end and ( bi.classifc = '' or bi.classifc = 'normal' ) and bi.valdesc <> 0 end 
20250218@154145.2787 14js5lu163mfgja32lrm8un6ip Query : use flama_phc
20250218@154145.2791 14js5lu163mfgja32lrm8un6ip Query : select 1 valor from bo where bo.bostamp = 'aut67b4a3856167b4aa35cf'
20250218@154145.2809 14js5lu163mfgja32lrm8un6ip Query : declare @errno int ,@errmsg varchar(255) ,@prod bit ,@nrdec numeric(10, 0) ,@totaldeb numeric(18, 5) ,@etotaldeb numeric(19, 6) ,@total numeric(18, 5) ,@etotal numeric(19, 6) ,@custo numeric(18, 5) ,@ecusto numeric(19, 6) ,@bo_1iliq numeric(19, 6) ,@bo_2iliq numeric(19, 6) ,@base1 numeric(19, 6) ,@base2 numeric(19, 6) ,@moetotal numeric(13, 3) ,@smoe1 numeric(13, 3) ,@smoe2 numeric(13, 3) ,@smoe3 numeric(13, 3) ,@smoe4 numeric(13, 3) ,@bo11_bins numeric(18, 5) ,@bo21_bins numeric(18, 5) ,@bo31_bins numeric(18, 5) ,@bo41_bins numeric(18, 5) ,@bo51_bins numeric(18, 5) ,@bo61_bins numeric(18, 5) ,@bo71_bins numeric(18, 5) ,@bo81_bins numeric(18, 5) ,@bo91_bins numeric(18, 5) ,@bo12_bins numeric(18, 5) ,@bo22_bins numeric(18, 5) ,@bo32_bins numeric(18, 5) ,@bo42_bins numeric(18, 5) ,@bo52_bins numeric(18, 5) ,@bo62_bins numeric(18, 5) ,@bo72_bins numeric(18, 5) ,@bo82_bins numeric(18, 5) ,@bo92_bins numeric(18, 5) ,@ebo11_bins numeric(19, 6) ,@ebo21_bins numeric(19, 6) ,@ebo31_bins numeric(19, 6) ,@ebo41_bins numeric(19, 6) ,@ebo51_bins numeric(19, 6) ,@ebo61_bins numeric(19, 6) ,@ebo71_bins numeric(18, 5) ,@ebo81_bins numeric(18, 5) ,@ebo91_bins numeric(18, 5) ,@ebo12_bins numeric(19, 6) ,@ebo22_bins numeric(19, 6) ,@ebo32_bins numeric(19, 6) ,@ebo42_bins numeric(19, 6) ,@ebo52_bins numeric(19, 6) ,@ebo62_bins numeric(19, 6) ,@ebo72_bins numeric(18, 5) ,@ebo82_bins numeric(18, 5) ,@ebo92_bins numeric(18, 5) ,@bo11_iva numeric(18, 5) ,@bo21_iva numeric(18, 5) ,@bo31_iva numeric(18, 5) ,@bo41_iva numeric(18, 5) ,@bo51_iva numeric(18, 5) ,@bo61_iva numeric(18, 5) ,@bo71_iva numeric(18, 5) ,@bo81_iva numeric(18, 5) ,@bo91_iva numeric(18, 5) ,@bo12_iva numeric(18, 5) ,@bo22_iva numeric(18, 5) ,@bo32_iva numeric(18, 5) ,@bo42_iva numeric(18, 5) ,@bo52_iva numeric(18, 5) ,@bo62_iva numeric(18, 5) ,@bo72_iva numeric(18, 5) ,@bo82_iva numeric(18, 5) ,@bo92_iva numeric(18, 5) ,@ebo11_iva numeric(19, 6) ,@ebo21_iva numeric(19, 6) ,@ebo31_iva numeric(19, 6) ,@ebo41_iva numeric(19, 6) ,@ebo51_iva numeric(19, 6) ,@ebo61_iva numeric(19, 6) ,@ebo71_iva numeric(18, 5) ,@ebo81_iva numeric(18, 5) ,@ebo91_iva numeric(18, 5) ,@ebo12_iva numeric(19, 6) ,@ebo22_iva numeric(19, 6) ,@ebo32_iva numeric(19, 6) ,@ebo42_iva numeric(19, 6) ,@ebo52_iva numeric(19, 6) ,@ebo62_iva numeric(19, 6) ,@ebo72_iva numeric(18, 5) ,@ebo82_iva numeric(18, 5) ,@ebo92_iva numeric(18, 5) ,@esdeb1 numeric(19, 6) ,@esdeb2 numeric(19, 6) ,@esdeb3 numeric(19, 6) ,@esdeb4 numeric(19, 6) ,@sdeb1 numeric(18, 5) ,@sdeb2 numeric(18, 5) ,@sdeb3 numeric(18, 5) ,@sdeb4 numeric(18, 5) ,@estot1 numeric(19, 6) ,@estot2 numeric(19, 6) ,@estot3 numeric(19, 6) ,@estot4 numeric(19, 6) ,@stot1 numeric(18, 5) ,@stot2 numeric(18, 5) ,@stot3 numeric(18, 5) ,@stot4 numeric(18, 5) ,@ebo_1tvall numeric(19, 6) ,@ebo_2tvall numeric(19, 6) ,@bo_1tvall numeric(18, 5) ,@bo_2tvall numeric(18, 5) ,@ebo_totp1 numeric(19, 6) ,@ebo_totp2 numeric(19, 6) ,@bo_totp1 numeric(18, 5) ,@bo_totp2 numeric(18, 5) ,@sqtt11 numeric(13, 3) ,@sqtt21 numeric(13, 3) ,@sqtt12 numeric(13, 3) ,@sqtt22 numeric(13, 3) ,@sqtt13 numeric(13, 3) ,@sqtt23 numeric(13, 3) ,@sqtt14 numeric(13, 3) ,@sqtt24 numeric(13, 3) ,@userinis varchar (30) ,@mybostamp char(25) = 'aut67b4a3856167b4aa35cf' declare @totaisiva table ( bostamp varchar (25), codigo numeric(1), taxa numeric (5,2), ebaseinc numeric (19,6), baseinc numeric (18,5), evalor numeric (19,6), valor numeric (18,5) ) set @prod = ( select ts.producao from bo(nolock) inner join ts(nolock) on bo.ndos = ts.ndos and bo.bostamp = @mybostamp ) set @nrdec = ( select convert(numeric(10, 0), valor) from para1(nolock) where descricao = 'de_euro' ) --set @prod = 0 --set @nrdec = 2 select @ecusto = sum(bi.epcusto * bi.qtt) ,@custo = sum(bi.pcusto * bi.qtt) ,@bo11_bins = sum(case when bi.tabiva = 1 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo21_bins = sum(case when bi.tabiva = 2 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo31_bins = sum(case when bi.tabiva = 3 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo41_bins = sum(case when bi.tabiva = 4 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo51_bins = sum(case when bi.tabiva = 5 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo61_bins = sum(case when bi.tabiva = 6 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo71_bins = sum(case when bi.tabiva = 7 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo81_bins = sum(case when bi.tabiva = 8 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo91_bins = sum(case when bi.tabiva = 9 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.qtt * bi.pu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo12_bins = sum(case when bi.tabiva = 1 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo22_bins = sum(case when bi.tabiva = 2 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo32_bins = sum(case when bi.tabiva = 3 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo42_bins = sum(case when bi.tabiva = 4 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo52_bins = sum(case when bi.tabiva = 5 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo62_bins = sum(case when bi.tabiva = 6 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo72_bins = sum(case when bi.tabiva = 7 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo82_bins = sum(case when bi.tabiva = 8 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo92_bins = sum(case when bi.tabiva = 9 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo11_bins = sum(case when bi.tabiva = 1 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo21_bins = sum(case when bi.tabiva = 2 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo31_bins = sum(case when bi.tabiva = 3 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo41_bins = sum(case when bi.tabiva = 4 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo51_bins = sum(case when bi.tabiva = 5 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo61_bins = sum(case when bi.tabiva = 6 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo71_bins = sum(case when bi.tabiva = 7 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo81_bins = sum(case when bi.tabiva = 8 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo91_bins = sum(case when bi.tabiva = 9 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo12_bins = sum(case when bi.tabiva = 1 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo22_bins = sum(case when bi.tabiva = 2 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo32_bins = sum(case when bi.tabiva = 3 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo42_bins = sum(case when bi.tabiva = 4 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo52_bins = sum(case when bi.tabiva = 5 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo62_bins = sum(case when bi.tabiva = 6 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo72_bins = sum(case when bi.tabiva = 7 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo82_bins = sum(case when bi.tabiva = 8 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@ebo92_bins = sum(case when bi.tabiva = 9 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@bo_1iliq = round(sum(bi.qtt * bi.epu), @nrdec) ,@bo_2iliq = round(sum(bi.ettdeb), @nrdec) ,@bo11_iva = sum(case when bi.tabiva = 1 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo12_iva = sum(case when bi.tabiva = 1 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo21_iva = sum(case when bi.tabiva = 2 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo22_iva = sum(case when bi.tabiva = 2 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo31_iva = sum(case when bi.tabiva = 3 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo32_iva = sum(case when bi.tabiva = 3 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo41_iva = sum(case when bi.tabiva = 4 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo42_iva = sum(case when bi.tabiva = 4 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo51_iva = sum(case when bi.tabiva = 5 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo52_iva = sum(case when bi.tabiva = 5 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo61_iva = sum(case when bi.tabiva = 6 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo62_iva = sum(case when bi.tabiva = 6 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo71_iva = sum(case when bi.tabiva = 7 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo72_iva = sum(case when bi.tabiva = 7 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo81_iva = sum(case when bi.tabiva = 8 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo82_iva = sum(case when bi.tabiva = 8 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo91_iva = sum(case when bi.tabiva = 9 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.pu) * (bi.iva / 100) else (bi.qtt * bi.pu) - ((bi.qtt * bi.pu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@bo92_iva = sum(case when bi.tabiva = 9 then round(case when bi.ivaincl = 0 then bi.ttdeb * (bi.iva / 100) else bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo11_iva = sum(case when bi.tabiva = 1 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo12_iva = sum(case when bi.tabiva = 1 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo21_iva = sum(case when bi.tabiva = 2 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo22_iva = sum(case when bi.tabiva = 2 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo31_iva = sum(case when bi.tabiva = 3 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo32_iva = sum(case when bi.tabiva = 3 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo41_iva = sum(case when bi.tabiva = 4 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo42_iva = sum(case when bi.tabiva = 4 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo51_iva = sum(case when bi.tabiva = 5 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo52_iva = sum(case when bi.tabiva = 5 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo61_iva = sum(case when bi.tabiva = 6 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo62_iva = sum(case when bi.tabiva = 6 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo71_iva = sum(case when bi.tabiva = 7 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo72_iva = sum(case when bi.tabiva = 7 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo81_iva = sum(case when bi.tabiva = 8 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else (bi.qtt * bi.epu) - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo82_iva = sum(case when bi.tabiva = 8 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo91_iva = sum(case when bi.tabiva = 9 then round(case when bi.ivaincl = 0 then (bi.qtt * bi.epu) * (bi.iva / 100) else bi.ettdeb - ((bi.qtt * bi.epu) / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@ebo92_iva = sum(case when bi.tabiva = 9 then round(case when bi.ivaincl = 0 then bi.ettdeb * (bi.iva / 100) else bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) end, @nrdec) else 0 end) ,@esdeb1 = sum(case when bi.stipo <= 1 then case when bi.ivaincl = 0 then bi.ettdeb else bi.ettdeb - round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@esdeb2 = sum(case when bi.stipo = 2 then case when bi.ivaincl = 0 then bi.ettdeb else bi.ettdeb - round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@esdeb3 = sum(case when bi.stipo = 3 then case when bi.ivaincl = 0 then bi.ettdeb else bi.ettdeb - round(bi.ettdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@esdeb4 = sum(case when bi.stipo = 4 then case when bi.ivaincl = 0 then bi.ettdeb else round(bi.ettdeb - (bi.ettdeb / (1 + bi.iva / 100)) * bi.iva / 100, @nrdec) end else 0 end) ,@sdeb1 = sum(case when bi.stipo <= 1 then case when bi.ivaincl = 0 then bi.ttdeb else bi.ttdeb - round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@sdeb2 = sum(case when bi.stipo = 2 then case when bi.ivaincl = 0 then bi.ttdeb else bi.ttdeb - round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@sdeb3 = sum(case when bi.stipo = 3 then case when bi.ivaincl = 0 then bi.ttdeb else bi.ttdeb - round(bi.ttdeb / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@sdeb4 = sum(case when bi.stipo = 4 then case when bi.ivaincl = 0 then bi.ttdeb else round(bi.ttdeb - (bi.ttdeb / (1 + bi.iva / 100)) * bi.iva / 100, @nrdec) end else 0 end) ,@smoe1 = sum(case when bi.stipo <= 1 then case when bi.ivaincl = 0 then bi.ttmoeda else round(bi.ttmoeda / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@smoe2 = sum(case when bi.stipo = 2 then case when bi.ivaincl = 0 then bi.ttmoeda else round(bi.ttmoeda / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@smoe3 = sum(case when bi.stipo = 3 then case when bi.ivaincl = 0 then bi.ttmoeda else round(bi.ttmoeda / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@smoe4 = sum(case when bi.stipo = 4 then case when bi.ivaincl = 0 then bi.ttmoeda else round(bi.ttmoeda / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@estot1 = sum(case when bi.stipo <= 1 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@estot2 = sum(case when bi.stipo = 2 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@estot3 = sum(case when bi.stipo = 3 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@estot4 = sum(case when bi.stipo = 4 then case when bi.ivaincl = 0 then bi.qtt * bi.epu else round((bi.qtt * bi.epu) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@stot1 = sum(case when bi.stipo <= 1 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.pu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@stot2 = sum(case when bi.stipo = 2 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.pu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@stot3 = sum(case when bi.stipo = 3 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.pu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@stot4 = sum(case when bi.stipo = 4 then case when bi.ivaincl = 0 then bi.qtt * bi.pu else round((bi.pu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end else 0 end) ,@total = @stot1 + @stot2 + @stot3 + @stot4 ,@etotal = @estot1 + @estot2 + @estot3 + @estot4 ,@totaldeb = @sdeb1 + @sdeb2 + @sdeb3 + @sdeb4 ,@etotaldeb = @esdeb1 + @esdeb2 + @esdeb3 + @esdeb4 ,@moetotal = @smoe1 + @smoe2 + @smoe3 + @smoe4 ,@ebo_1tvall = @ebo11_bins + @ebo21_bins + @ebo31_bins + @ebo41_bins + @ebo51_bins + @ebo61_bins + @ebo71_bins + @ebo81_bins + @ebo91_bins ,@ebo_2tvall = @ebo12_bins + @ebo22_bins + @ebo32_bins + @ebo42_bins + @ebo52_bins + @ebo62_bins + @ebo72_bins + @ebo82_bins + @ebo92_bins ,@bo_1tvall = @bo11_bins + @bo21_bins + @bo31_bins + @bo41_bins + @bo51_bins + @bo61_bins + @bo71_bins + @bo81_bins + @bo91_bins ,@bo_2tvall = @bo12_bins + @bo22_bins + @bo32_bins + @bo42_bins + @bo52_bins + @bo62_bins + @bo72_bins + @bo82_bins + @bo92_bins ,@ebo_totp1 = sum(case when bi.ivaincl = 0 then (bi.epu * bi.qtt) else round((bi.epu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end) ,@ebo_totp2 = sum(case when bi.ivaincl = 0 then (bi.edebito * bi.qtt) else round((bi.edebito * bi.qtt) / (1 + bi.iva / 100), @nrdec) end) ,@bo_totp1 = sum(case when bi.ivaincl = 0 then (bi.pu * bi.qtt) else round((bi.pu * bi.qtt) / (1 + bi.iva / 100), @nrdec) end) ,@bo_totp2 = sum(case when bi.ivaincl = 0 then (bi.debito * bi.qtt) else round((bi.debito * bi.qtt) / (1 + bi.iva / 100), @nrdec) end) ,@sqtt11 = sum(case when bi.stipo = 1 then bi.qtt else 0 end) ,@sqtt21 = sum(case when bi.stipo = 1 then bi.qtt else 0 end) ,@sqtt12 = sum(case when bi.stipo = 2 then bi.qtt else 0 end) ,@sqtt22 = sum(case when bi.stipo = 2 then bi.qtt else 0 end) ,@sqtt13 = sum(case when bi.stipo = 3 then bi.qtt else 0 end) ,@sqtt23 = sum(case when bi.stipo = 3 then bi.qtt else 0 end) ,@sqtt14 = sum(case when bi.stipo = 4 then bi.qtt else 0 end) ,@sqtt24 = sum(case when bi.stipo = 5 then bi.qtt else 0 end) from bi(nolock) where bi.bostamp = @mybostamp and bi.producao = case when @prod = 1 then 1 else bi.producao end and bi.composto = 0 and bi.qtt <> 0 update bo set bo.totaldeb = isnull(@totaldeb, 0) ,bo.total = isnull(@total, 0) ,bo.etotaldeb = isnull(@etotaldeb, 0) ,bo.moetotal = isnull(@moetotal, 0) ,bo.etotal = isnull(@etotal, 0) ,bo.ecusto = isnull(@ecusto, 0) ,bo.custo = isnull(@custo, 0) ,bo.bo11_bins = isnull(@bo11_bins, 0) ,bo.bo12_bins = isnull(@bo12_bins, 0) ,bo.bo21_bins = isnull(@bo21_bins, 0) ,bo.bo22_bins = isnull(@bo22_bins, 0) ,bo.bo31_bins = isnull(@bo31_bins, 0) ,bo.bo32_bins = isnull(@bo32_bins, 0) ,bo.bo41_bins = isnull(@bo41_bins, 0) ,bo.bo42_bins = isnull(@bo42_bins, 0) ,bo.bo51_bins = isnull(@bo51_bins, 0) ,bo.bo52_bins = isnull(@bo52_bins, 0) ,bo.bo61_bins = isnull(@bo61_bins, 0) ,bo.bo62_bins = isnull(@bo62_bins, 0) ,bo.ebo11_bins = isnull(@ebo11_bins, 0) ,bo.ebo12_bins = isnull(@ebo12_bins, 0) ,bo.ebo21_bins = isnull(@ebo21_bins, 0) ,bo.ebo22_bins = isnull(@ebo22_bins, 0) ,bo.ebo31_bins = isnull(@ebo31_bins, 0) ,bo.ebo32_bins = isnull(@ebo32_bins, 0) ,bo.ebo41_bins = isnull(@ebo41_bins, 0) ,bo.ebo42_bins = isnull(@ebo42_bins, 0) ,bo.ebo51_bins = isnull(@ebo51_bins, 0) ,bo.ebo52_bins = isnull(@ebo52_bins, 0) ,bo.ebo61_bins = isnull(@ebo61_bins, 0) ,bo.ebo62_bins = isnull(@ebo62_bins, 0) ,bo.bo11_iva = isnull(@bo11_iva, 0) ,bo.bo12_iva = isnull(@bo12_iva, 0) ,bo.bo21_iva = isnull(@bo21_iva, 0) ,bo.bo22_iva = isnull(@bo22_iva, 0) ,bo.bo31_iva = isnull(@bo31_iva, 0) ,bo.bo32_iva = isnull(@bo32_iva, 0) ,bo.bo41_iva = isnull(@bo41_iva, 0) ,bo.bo42_iva = isnull(@bo42_iva, 0) ,bo.bo51_iva = isnull(@bo51_iva, 0) ,bo.bo52_iva = isnull(@bo52_iva, 0) ,bo.bo61_iva = isnull(@bo61_iva, 0) ,bo.bo62_iva = isnull(@bo62_iva, 0) ,bo.ebo11_iva = isnull(@ebo11_iva, 0) ,bo.ebo12_iva = isnull(@ebo12_iva, 0) ,bo.ebo21_iva = isnull(@ebo21_iva, 0) ,bo.ebo22_iva = isnull(@ebo22_iva, 0) ,bo.ebo31_iva = isnull(@ebo31_iva, 0) ,bo.ebo32_iva = isnull(@ebo32_iva, 0) ,bo.ebo41_iva = isnull(@ebo41_iva, 0) ,bo.ebo42_iva = isnull(@ebo42_iva, 0) ,bo.ebo51_iva = isnull(@ebo51_iva, 0) ,bo.ebo52_iva = isnull(@ebo52_iva, 0) ,bo.ebo61_iva = isnull(@ebo61_iva, 0) ,bo.ebo62_iva = isnull(@ebo62_iva, 0) ,bo.esdeb1 = isnull(@esdeb1, 0) ,bo.esdeb2 = isnull(@esdeb2, 0) ,bo.esdeb3 = isnull(@esdeb3, 0) ,bo.esdeb4 = isnull(@esdeb4, 0) ,bo.sdeb1 = isnull(@sdeb1, 0) ,bo.sdeb2 = isnull(@sdeb2, 0) ,bo.sdeb3 = isnull(@sdeb3, 0) ,bo.sdeb4 = isnull(@sdeb4, 0) ,bo.smoe1 = isnull(@smoe1, 0) ,bo.smoe2 = isnull(@smoe2, 0) ,bo.smoe3 = isnull(@smoe3, 0) ,bo.smoe4 = isnull(@smoe4, 0) ,bo.estot1 = isnull(@estot1, 0) ,bo.estot2 = isnull(@estot2, 0) ,bo.estot3 = isnull(@estot3, 0) ,bo.estot4 = isnull(@estot4, 0) ,bo.stot1 = isnull(@stot1, 0) ,bo.stot2 = isnull(@stot2, 0) ,bo.stot3 = isnull(@stot3, 0) ,bo.stot4 = isnull(@stot4, 0) ,bo.ebo_1tvall = isnull(@ebo_1tvall, 0) ,bo.ebo_2tvall = isnull(@ebo_2tvall, 0) ,bo.bo_1tvall = isnull(@bo_1tvall, 0) ,bo.bo_2tvall = isnull(@bo_2tvall, 0) ,bo.ebo_totp1 = isnull(@ebo_totp1, 0) ,bo.ebo_totp2 = isnull(@ebo_totp2, 0) ,bo.bo_totp1 = isnull(@bo_totp1, 0) ,bo.bo_totp2 = isnull(@bo_totp2, 0) ,bo.sqtt11 = isnull(@sqtt11, 0) ,bo.sqtt21 = isnull(@sqtt21, 0) ,bo.sqtt12 = isnull(@sqtt12, 0) ,bo.sqtt22 = isnull(@sqtt22, 0) ,bo.sqtt13 = isnull(@sqtt13, 0) ,bo.sqtt23 = isnull(@sqtt23, 0) ,bo.sqtt14 = isnull(@sqtt14, 0) ,bo.sqtt24 = isnull(@sqtt24, 0) where bostamp = @mybostamp update bo2 set bo2.bo71_bins = isnull(@bo71_bins, 0) ,bo2.bo72_bins = isnull(@bo72_bins, 0) ,bo2.bo81_bins = isnull(@bo81_bins, 0) ,bo2.bo82_bins = isnull(@bo82_bins, 0) ,bo2.bo91_bins = isnull(@bo91_bins, 0) ,bo2.bo92_bins = isnull(@bo92_bins, 0) ,bo2.ebo71_bins = isnull(@ebo71_bins, 0) ,bo2.ebo72_bins = isnull(@ebo72_bins, 0) ,bo2.ebo81_bins = isnull(@ebo81_bins, 0) ,bo2.ebo82_bins = isnull(@ebo82_bins, 0) ,bo2.ebo91_bins = isnull(@ebo91_bins, 0) ,bo2.ebo92_bins = isnull(@ebo92_bins, 0) ,bo2.bo71_iva = isnull(@bo71_iva, 0) ,bo2.bo72_iva = isnull(@bo72_iva, 0) ,bo2.bo81_iva = isnull(@bo81_iva, 0) ,bo2.bo82_iva = isnull(@bo82_iva, 0) ,bo2.bo91_iva = isnull(@bo91_iva, 0) ,bo2.bo92_iva = isnull(@bo92_iva, 0) ,bo2.ebo71_iva = isnull(@ebo71_iva, 0) ,bo2.ebo72_iva = isnull(@ebo72_iva, 0) ,bo2.ebo81_iva = isnull(@ebo81_iva, 0) ,bo2.ebo82_iva = isnull(@ebo82_iva, 0) ,bo2.ebo91_iva = isnull(@ebo91_iva, 0) ,bo2.ebo92_iva = isnull(@ebo92_iva, 0) ,bo2.etotalciva = isnull(@etotaldeb, 0) + isnull(@ebo12_iva, 0) +isnull(@ebo22_iva, 0) +isnull(@ebo32_iva, 0) +isnull(@ebo42_iva, 0) +isnull(@ebo52_iva, 0) +isnull(@ebo62_iva, 0) +isnull(@ebo72_iva, 0) +isnull(@ebo82_iva, 0) +isnull(@ebo92_iva, 0) --,bo2.mtotalciva =isnull(@moetotal, 0) where bo2stamp = @mybostamp -- trata os bot select @userinis = usrinis from bo where bo.bostamp=@mybostamp insert into @totaisiva ( bostamp, codigo, taxa, ebaseinc, baseinc, evalor, valor ) select @mybostamp,codigo,taxa ,case when (@ebo11_bins <>0) then @ebo11_bins else @ebo12_bins end ,case when (@ebo11_bins <>0) then @bo11_bins else @bo12_bins end ,case when (@ebo11_bins <>0) then @ebo11_iva else @ebo12_iva end ,case when (@ebo11_bins <>0) then @bo11_iva else @bo12_iva end from taxasiva where codigo = 1 union all select @mybostamp,codigo,taxa ,case when (@ebo21_bins <>0) then @ebo21_bins else @ebo22_bins end ,case when (@ebo21_bins <>0) then @bo21_bins else @bo22_bins end ,case when (@ebo21_bins <>0) then @ebo21_iva else @ebo22_iva end ,case when (@ebo21_bins <>0) then @bo21_iva else @bo22_iva end from taxasiva where codigo = 2 union all select @mybostamp,codigo,taxa ,case when (@ebo31_bins <>0) then @ebo31_bins else @ebo32_bins end ,case when (@ebo31_bins <>0) then @bo31_bins else @bo32_bins end ,case when (@ebo31_bins <>0) then @ebo31_iva else @ebo32_iva end ,case when (@ebo31_bins <>0) then @bo31_iva else @bo32_iva end from taxasiva where codigo = 3 union all select @mybostamp,codigo,taxa ,case when (@ebo41_bins <>0) then @ebo41_bins else @ebo42_bins end ,case when (@ebo41_bins <>0) then @bo41_bins else @bo42_bins end ,case when (@ebo41_bins <>0) then @ebo41_iva else @ebo42_iva end ,case when (@ebo41_bins <>0) then @bo41_iva else @bo42_iva end from taxasiva where codigo = 4 union all select @mybostamp,codigo,taxa ,case when (@ebo51_bins <>0) then @ebo51_bins else @ebo52_bins end ,case when (@ebo51_bins <>0) then @bo51_bins else @bo52_bins end ,case when (@ebo51_bins <>0) then @ebo51_iva else @ebo52_iva end ,case when (@ebo51_bins <>0) then @bo51_iva else @bo52_iva end from taxasiva where codigo = 5 union all select @mybostamp,codigo,taxa ,case when (@ebo61_bins <>0) then @ebo61_bins else @ebo62_bins end ,case when (@ebo61_bins <>0) then @bo61_bins else @bo62_bins end ,case when (@ebo61_bins <>0) then @ebo61_iva else @ebo62_iva end ,case when (@ebo61_bins <>0) then @bo61_iva else @bo62_iva end from taxasiva where codigo = 6 union all select @mybostamp,codigo,taxa ,case when (@ebo71_bins <>0) then @ebo71_bins else @ebo72_bins end ,case when (@ebo71_bins <>0) then @bo71_bins else @bo72_bins end ,case when (@ebo71_bins <>0) then @ebo71_iva else @ebo72_iva end ,case when (@ebo71_bins <>0) then @bo71_iva else @bo72_iva end from taxasiva where codigo = 7 union all select @mybostamp,codigo,taxa ,case when (@ebo81_bins <>0) then @ebo81_bins else @ebo82_bins end ,case when (@ebo81_bins <>0) then @bo81_bins else @bo82_bins end ,case when (@ebo81_bins <>0) then @ebo81_iva else @ebo82_iva end ,case when (@ebo81_bins <>0) then @bo81_iva else @bo82_iva end from taxasiva where codigo = 8 union all select @mybostamp,codigo,taxa ,case when (@ebo91_bins <>0) then @ebo91_bins else @ebo92_bins end ,case when (@ebo91_bins <>0) then @bo91_bins else @bo92_bins end ,case when (@ebo91_bins <>0) then @ebo91_iva else @ebo92_iva end ,case when (@ebo91_bins <>0) then @bo91_iva else @bo92_iva end from taxasiva where codigo = 9 update bot set ebaseinc = totiva.ebaseinc, baseinc = totiva.baseinc, evalor = totiva.evalor, valor = totiva.valor, usrinis = @userinis, usrdata = convert (date,getdate()), usrhora = convert (time,getdate()) from @totaisiva totiva inner join bot on totiva.bostamp = bot.bostamp and totiva.codigo = bot.codigo insert into bot ( botstamp ,bostamp ,codigo ,taxa ,ebaseinc ,baseinc ,evalor ,valor ,ousrinis ,ousrdata ,ousrhora ,usrinis ,usrdata ,usrhora ) select ( left(@userinis,3) + 'tt' + left(newid(),5) + right(newid(),5) + left(newid(),5) + right(newid(),5)) stamp ,@mybostamp stampbo ,totiva.codigo ,totiva.taxa ,totiva.ebaseinc ,totiva.baseinc ,totiva.evalor ,totiva.valor ,@userinis ,convert (date,getdate()) ,convert (time,getdate()) ,@userinis ,convert (date,getdate()) ,convert (time,getdate()) from @totaisiva totiva left join bot on totiva.bostamp = bot.bostamp and totiva.codigo = bot.codigo where bot.botstamp is null -- atualiza os campo bi.series e bi.series2, caso tenha equipamentos update bi set series = s1, series2=s2 from bi inner join ( select distinct bistamp,ser.s1, ser.s2 from boma cross apply (select stuff ( ( select ',' + rtrim(serie) from boma myboma where myboma.bistamp = boma.bistamp order by serie for xml path('') ), 1, 1, '' ) s1 , stuff ( ( select ',' + rtrim(serie2) from boma myboma where myboma.bistamp = boma.bistamp order by serie for xml path('') ), 1, 1, '' ) s2 ) ser where boma.bostamp = @mybostamp ) myboma on bi.bistamp = myboma.bistamp where bi.bostamp = @mybostamp 
