20240812@180204.1205 9ea6cn2llbf8rrur0fn15n6ffb Query : use flama_phc
20240812@180204.1208 9ea6cn2llbf8rrur0fn15n6ffb Query : select st.usalote valor from st where st.ref = '324.1884.00.1'
20240812@180204.1231 9ea6cn2llbf8rrur0fn15n6ffb 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.1884.00.1'
20240812@180204.1387 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.1416 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180204.1443 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.1458 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180204.1466 9ea6cn2llbf8rrur0fn15n6ffb Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180204.1479 9ea6cn2llbf8rrur0fn15n6ffb Query : select sestamp valor from se where ref ='324.1884.00.1' and lote = 'r2301208100a'
20240812@180204.1493 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.1508 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180204.1520 9ea6cn2llbf8rrur0fn15n6ffb Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba43083566ba400c24','aut66ba49224366ba400bbf' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180204.1525 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.1541 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180204.1583 9ea6cn2llbf8rrur0fn15n6ffb Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba43083566ba400c24',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',5.000 ,'aut66ba49224366ba400bbf' ,0,0 ,2,23.00,40000,?,?,?,?)
20240812@180204.1884 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.1901 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180204.1968 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.2220 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180204.2272 9ea6cn2llbf8rrur0fn15n6ffb Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180204.2285 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.2318 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180204.2331 9ea6cn2llbf8rrur0fn15n6ffb Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba40339566ba400c37','aut66ba49224366ba400bbf' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180204.2335 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.2351 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180204.2380 9ea6cn2llbf8rrur0fn15n6ffb Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66ba40339566ba400c37',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66ba49224366ba400bbf' ,0,0 ,2,23.00,50000,?,?,?)
20240812@180204.2654 9ea6cn2llbf8rrur0fn15n6ffb Query : use flama_phc
20240812@180204.2657 9ea6cn2llbf8rrur0fn15n6ffb Query : select st.usalote valor from st where st.ref = '324.1803.00.1'
20240812@180204.2678 9ea6cn2llbf8rrur0fn15n6ffb 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.1803.00.1'
20240812@180204.2694 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.2721 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180204.2748 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.2763 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180204.2771 9ea6cn2llbf8rrur0fn15n6ffb Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180204.2783 9ea6cn2llbf8rrur0fn15n6ffb Query : select sestamp valor from se where ref ='324.1803.00.1' and lote = 'r2301274200a'
20240812@180204.2796 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.2813 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180204.2826 9ea6cn2llbf8rrur0fn15n6ffb Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba40603466ba400c44','aut66ba49224366ba400bbf' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180204.2831 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.2846 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180204.2876 9ea6cn2llbf8rrur0fn15n6ffb Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba40603466ba400c44',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',5.000 ,'aut66ba49224366ba400bbf' ,0,0 ,2,23.00,70000,?,?,?,?)
20240812@180204.3163 9ea6cn2llbf8rrur0fn15n6ffb Query : use flama_phc
20240812@180204.3166 9ea6cn2llbf8rrur0fn15n6ffb Query : select st.usalote valor from st where st.ref = '324.1834.00.1'
20240812@180204.3186 9ea6cn2llbf8rrur0fn15n6ffb 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.1834.00.1'
20240812@180204.3201 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.3219 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180204.3257 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.3272 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180204.3281 9ea6cn2llbf8rrur0fn15n6ffb Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180204.3293 9ea6cn2llbf8rrur0fn15n6ffb Query : select sestamp valor from se where ref ='324.1834.00.1' and lote = 'r2301209100a'
20240812@180204.3453 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.3472 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180204.3485 9ea6cn2llbf8rrur0fn15n6ffb Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba46379066ba400c54','aut66ba49224366ba400bbf' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180204.3490 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.3505 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180204.3546 9ea6cn2llbf8rrur0fn15n6ffb Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba46379066ba400c54',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',5.000 ,'aut66ba49224366ba400bbf' ,0,0 ,2,23.00,80000,?,?,?,?)
20240812@180204.3824 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.3840 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180204.3868 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.3906 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180204.3915 9ea6cn2llbf8rrur0fn15n6ffb Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180204.3928 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.3944 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180204.3956 9ea6cn2llbf8rrur0fn15n6ffb Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba44058466ba400c5f','aut66ba49224366ba400bbf' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180204.3961 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.3977 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180204.4006 9ea6cn2llbf8rrur0fn15n6ffb Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66ba44058466ba400c5f',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66ba49224366ba400bbf' ,0,0 ,2,23.00,90000,?,?,?)
20240812@180204.4306 9ea6cn2llbf8rrur0fn15n6ffb Query : use flama_phc
20240812@180204.4309 9ea6cn2llbf8rrur0fn15n6ffb Query : select st.usalote valor from st where st.ref = '324.1879.00.1'
20240812@180204.4330 9ea6cn2llbf8rrur0fn15n6ffb 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.1879.00.1'
20240812@180204.4345 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.4362 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180204.4393 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.4408 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180204.4431 9ea6cn2llbf8rrur0fn15n6ffb Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180204.4443 9ea6cn2llbf8rrur0fn15n6ffb Query : select sestamp valor from se where ref ='324.1879.00.1' and lote = 'r2300643200a'
20240812@180204.4457 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.4471 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180204.4483 9ea6cn2llbf8rrur0fn15n6ffb Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba41661166ba400c6c','aut66ba49224366ba400bbf' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180204.4488 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.4502 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180204.4532 9ea6cn2llbf8rrur0fn15n6ffb Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba41661166ba400c6c',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',5.000 ,'aut66ba49224366ba400bbf' ,0,0 ,2,23.00,110000,?,?,?,?)
20240812@180204.4832 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.4849 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180204.4878 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.4893 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180204.4901 9ea6cn2llbf8rrur0fn15n6ffb Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180204.4916 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.6845 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180204.6858 9ea6cn2llbf8rrur0fn15n6ffb Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba40948966ba400c78','aut66ba49224366ba400bbf' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180204.6863 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.6880 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180204.6910 9ea6cn2llbf8rrur0fn15n6ffb Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66ba40948966ba400c78',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66ba49224366ba400bbf' ,0,0 ,2,23.00,120000,?,?,?)
20240812@180204.7199 9ea6cn2llbf8rrur0fn15n6ffb Query : use flama_phc
20240812@180204.7202 9ea6cn2llbf8rrur0fn15n6ffb Query : select st.usalote valor from st where st.ref = '324.1462.00.1'
20240812@180204.7223 9ea6cn2llbf8rrur0fn15n6ffb 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.1462.00.1'
20240812@180204.7468 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.7548 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180204.7576 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.7592 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180204.7601 9ea6cn2llbf8rrur0fn15n6ffb Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180204.7614 9ea6cn2llbf8rrur0fn15n6ffb Query : select sestamp valor from se where ref ='324.1462.00.1' and lote = 'r2101096200a'
20240812@180204.7642 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.7657 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180204.7669 9ea6cn2llbf8rrur0fn15n6ffb Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba42341266ba400cba','aut66ba49224366ba400bbf' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180204.7674 9ea6cn2llbf8rrur0fn15n6ffb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180204.7688 9ea6cn2llbf8rrur0fn15n6ffb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180204.7733 9ea6cn2llbf8rrur0fn15n6ffb Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba42341266ba400cba',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',2.000 ,'aut66ba49224366ba400bbf' ,0,0 ,2,23.00,140000,?,?,?,?)
20240812@180204.8005 9ea6cn2llbf8rrur0fn15n6ffb Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66ba49224366ba400bbf','2405363','wait',39,'adm09112754980.682000002')
20240812@180204.8110 9ea6cn2llbf8rrur0fn15n6ffb Query : use flama_phc
20240812@180204.8360 9ea6cn2llbf8rrur0fn15n6ffb Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240812@180204.9236 9ea6cn2llbf8rrur0fn15n6ffb Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1506';
20240812@180204.9263 9ea6cn2llbf8rrur0fn15n6ffb Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1506';
20240812@180204.9303 9ea6cn2llbf8rrur0fn15n6ffb Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1506';
20240812@180204.9330 9ea6cn2llbf8rrur0fn15n6ffb Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1506';
20240812@180204.9943 75i3fom59pl3pnmc2i4f32h80d Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240812@180204.9954 75i3fom59pl3pnmc2i4f32h80d Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240812@180205.8000 75i3fom59pl3pnmc2i4f32h80d Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1507';
20240812@180205.6600 75i3fom59pl3pnmc2i4f32h80d Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1507';
20240812@180205.1180 75i3fom59pl3pnmc2i4f32h80d Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1507';
20240812@180205.1420 75i3fom59pl3pnmc2i4f32h80d Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1507';
20240812@180205.2010 75i3fom59pl3pnmc2i4f32h80d Query : use flama_phc
20240812@180205.2040 75i3fom59pl3pnmc2i4f32h80d Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240812@180205.2810 75i3fom59pl3pnmc2i4f32h80d Query : use flama_phc
20240812@180205.2840 75i3fom59pl3pnmc2i4f32h80d Query : select no, estab,szadrsdesc from szadrs where u_coddest=832
20240812@180205.3810 75i3fom59pl3pnmc2i4f32h80d Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4906.00.1'
20240812@180205.5520 75i3fom59pl3pnmc2i4f32h80d Query : use flama_phc
20240812@180205.5550 75i3fom59pl3pnmc2i4f32h80d Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240812@180205.6140 75i3fom59pl3pnmc2i4f32h80d Query : use flama_phc
20240812@180205.6170 75i3fom59pl3pnmc2i4f32h80d Query : select top 1 1 valor from td where td.ndoc = 39
20240812@180205.6500 75i3fom59pl3pnmc2i4f32h80d Query : use flama_phc
20240812@180205.6530 75i3fom59pl3pnmc2i4f32h80d 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')
20240812@180205.6970 75i3fom59pl3pnmc2i4f32h80d Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240812@180205.7330 75i3fom59pl3pnmc2i4f32h80d Query : use flama_phc
20240812@180205.7360 75i3fom59pl3pnmc2i4f32h80d Query : select top 1 ~inactivo valor from cl where no = '101726' and estab = 0 order by inactivo desc
20240812@180205.8710 75i3fom59pl3pnmc2i4f32h80d Query : use flama_phc
20240812@180205.8740 75i3fom59pl3pnmc2i4f32h80d Query : select top 1 tipodoc,regrd from td where ndoc = 39
20240812@180205.9050 75i3fom59pl3pnmc2i4f32h80d Query : use flama_phc
20240812@180205.9080 75i3fom59pl3pnmc2i4f32h80d Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240812@180205.9550 75i3fom59pl3pnmc2i4f32h80d Query : use flama_phc
20240812@180205.9580 75i3fom59pl3pnmc2i4f32h80d Query : select szadrsstamp valor from szadrs where szadrsdesc='rick & mark - a mobiladora de padronelo,lda'
20240812@180205.1004 75i3fom59pl3pnmc2i4f32h80d Query : use flama_phc
20240812@180205.1007 75i3fom59pl3pnmc2i4f32h80d Query : select 1 valor from td where ndoc = 39
20240812@180205.1019 75i3fom59pl3pnmc2i4f32h80d Query : select top 1 manternumero, tiposaft, nmdos,td.assinadoc from td where td.ndoc = 39
20240812@180205.1034 75i3fom59pl3pnmc2i4f32h80d Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.1051 75i3fom59pl3pnmc2i4f32h80d Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft' and documentnumber = 39
20240812@180205.1071 75i3fom59pl3pnmc2i4f32h80d Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.1280 75i3fom59pl3pnmc2i4f32h80d Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft2' and documentnumber = 39
20240812@180205.1311 75i3fom59pl3pnmc2i4f32h80d Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.1338 75i3fom59pl3pnmc2i4f32h80d Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft3' and documentnumber = 39
20240812@180205.1351 75i3fom59pl3pnmc2i4f32h80d Query : select top 1 ft.fno valor from ft ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240812@180205.1422 75i3fom59pl3pnmc2i4f32h80d Query : select top 1 ft.fno valor from wsftdata ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240812@180205.1436 75i3fom59pl3pnmc2i4f32h80d Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.1453 75i3fom59pl3pnmc2i4f32h80d Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft3' and documentnumber = 39
20240812@180205.1471 75i3fom59pl3pnmc2i4f32h80d Query : insert into wsft3data (ft3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,taxpointdt ) values ('aut66ba45024666ba400d20' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?)
20240812@180205.1675 75i3fom59pl3pnmc2i4f32h80d Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.1693 75i3fom59pl3pnmc2i4f32h80d Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft2' and documentnumber = 39
20240812@180205.1730 75i3fom59pl3pnmc2i4f32h80d Query : select top 1 bo.u_nomeenv valor from bo where bo.bostamp=''
20240812@180205.1742 75i3fom59pl3pnmc2i4f32h80d Query : select top 1 bo.u_moradaen valor from bo where bo.bostamp=''
20240812@180205.1754 75i3fom59pl3pnmc2i4f32h80d Query : select top 1 bo.u_codposen valor from bo where bo.bostamp=''
20240812@180205.1766 75i3fom59pl3pnmc2i4f32h80d Query : select top 1 bo.u_localenv valor from bo where bo.bostamp=''
20240812@180205.1778 75i3fom59pl3pnmc2i4f32h80d Query : select top 1 bo.trab5 valor from bo where bo.bostamp=''
20240812@180205.1790 75i3fom59pl3pnmc2i4f32h80d Query : select top 1 bo.serie valor from bo where bo.bostamp=''
20240812@180205.1801 75i3fom59pl3pnmc2i4f32h80d Query : insert into wsft2data (ft2stamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,u_nomeenv ,u_moradaen ,u_codposen ,u_localenv ,u_coddest ,u_codby ) values ('aut66ba45024666ba400d20',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?,?,?,?,?,?)
20240812@180205.2355 75i3fom59pl3pnmc2i4f32h80d Query : select top 1 fno valor from wsftdata order by fno desc
20240812@180205.2411 75i3fom59pl3pnmc2i4f32h80d Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.2427 75i3fom59pl3pnmc2i4f32h80d Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft' and documentnumber = 39
20240812@180205.2449 75i3fom59pl3pnmc2i4f32h80d Query : select 'normal' from dummy
20240812@180205.2467 75i3fom59pl3pnmc2i4f32h80d Query : insert into wsftdata (ftstamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,fno,no,estab,fdata,ndoc,moeda,cambio,cambiofixo,ftano,site ,classe ) values ('aut66ba45024666ba400d20',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',325,101726,0,'2024-08-12',39,'euro',0,0,2024 ,?,?)
20240812@180205.2793 75i3fom59pl3pnmc2i4f32h80d Query : use flama_phc
20240812@180205.2796 75i3fom59pl3pnmc2i4f32h80d Query : select st.usalote valor from st where st.ref = '324.4906.00.1'
20240812@180205.2821 75i3fom59pl3pnmc2i4f32h80d 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.4906.00.1'
20240812@180205.2986 75i3fom59pl3pnmc2i4f32h80d Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.3002 75i3fom59pl3pnmc2i4f32h80d Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180205.3027 75i3fom59pl3pnmc2i4f32h80d Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.3042 75i3fom59pl3pnmc2i4f32h80d Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180205.3050 75i3fom59pl3pnmc2i4f32h80d Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180205.3064 75i3fom59pl3pnmc2i4f32h80d Query : select sestamp valor from se where ref ='324.4906.00.1' and lote = 'r2300207200a'
20240812@180205.3086 75i3fom59pl3pnmc2i4f32h80d Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.3101 75i3fom59pl3pnmc2i4f32h80d Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180205.3123 75i3fom59pl3pnmc2i4f32h80d Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba41107566ba400d4b','aut66ba45024666ba400d20' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180205.3127 75i3fom59pl3pnmc2i4f32h80d Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.3142 75i3fom59pl3pnmc2i4f32h80d Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180205.3169 75i3fom59pl3pnmc2i4f32h80d Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba41107566ba400d4b',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',16.000 ,'aut66ba45024666ba400d20' ,0,0 ,2,23.00,10000,?,?,?,?)
20240812@180205.3448 75i3fom59pl3pnmc2i4f32h80d Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.3627 75i3fom59pl3pnmc2i4f32h80d Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180205.3731 75i3fom59pl3pnmc2i4f32h80d Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.3749 75i3fom59pl3pnmc2i4f32h80d Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180205.3760 75i3fom59pl3pnmc2i4f32h80d Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180205.3774 75i3fom59pl3pnmc2i4f32h80d Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.3788 75i3fom59pl3pnmc2i4f32h80d Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180205.3802 75i3fom59pl3pnmc2i4f32h80d Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba43147266ba400d5c','aut66ba45024666ba400d20' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180205.3807 75i3fom59pl3pnmc2i4f32h80d Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.3824 75i3fom59pl3pnmc2i4f32h80d Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180205.3936 75i3fom59pl3pnmc2i4f32h80d Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66ba43147266ba400d5c',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66ba45024666ba400d20' ,0,0 ,2,23.00,20000,?,?,?)
20240812@180205.4218 75i3fom59pl3pnmc2i4f32h80d Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66ba45024666ba400d20','2405364','wait',39,'adm09112754980.682000002')
20240812@180205.4305 75i3fom59pl3pnmc2i4f32h80d Query : use flama_phc
20240812@180205.4308 75i3fom59pl3pnmc2i4f32h80d Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240812@180205.4356 75i3fom59pl3pnmc2i4f32h80d Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1507';
20240812@180205.4384 75i3fom59pl3pnmc2i4f32h80d Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1507';
20240812@180205.4466 75i3fom59pl3pnmc2i4f32h80d Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1507';
20240812@180205.4491 75i3fom59pl3pnmc2i4f32h80d Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1507';
20240812@180205.5164 iom8knruuv1dv90ogiqo28kmjs Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240812@180205.5174 iom8knruuv1dv90ogiqo28kmjs Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240812@180205.5231 iom8knruuv1dv90ogiqo28kmjs Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1508';
20240812@180205.5284 iom8knruuv1dv90ogiqo28kmjs Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1508';
20240812@180205.5333 iom8knruuv1dv90ogiqo28kmjs Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1508';
20240812@180205.5366 iom8knruuv1dv90ogiqo28kmjs Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1508';
20240812@180205.5428 iom8knruuv1dv90ogiqo28kmjs Query : use flama_phc
20240812@180205.5431 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240812@180205.5497 iom8knruuv1dv90ogiqo28kmjs Query : use flama_phc
20240812@180205.5500 iom8knruuv1dv90ogiqo28kmjs Query : select no, estab,szadrsdesc from szadrs where u_coddest=8960
20240812@180205.5583 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1805.00.1'
20240812@180205.5753 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1805.00.1'
20240812@180205.5772 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1824.00.1'
20240812@180205.5936 iom8knruuv1dv90ogiqo28kmjs Query : use flama_phc
20240812@180205.5939 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240812@180205.5973 iom8knruuv1dv90ogiqo28kmjs Query : use flama_phc
20240812@180205.5976 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 1 valor from td where td.ndoc = 39
20240812@180205.6012 iom8knruuv1dv90ogiqo28kmjs Query : use flama_phc
20240812@180205.6015 iom8knruuv1dv90ogiqo28kmjs 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')
20240812@180205.6042 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240812@180205.6087 iom8knruuv1dv90ogiqo28kmjs Query : use flama_phc
20240812@180205.6090 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 ~inactivo valor from cl where no = '200500' and estab = 0 order by inactivo desc
20240812@180205.6211 iom8knruuv1dv90ogiqo28kmjs Query : use flama_phc
20240812@180205.6214 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 tipodoc,regrd from td where ndoc = 39
20240812@180205.6246 iom8knruuv1dv90ogiqo28kmjs Query : use flama_phc
20240812@180205.6249 iom8knruuv1dv90ogiqo28kmjs Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240812@180205.6292 iom8knruuv1dv90ogiqo28kmjs Query : use flama_phc
20240812@180205.6295 iom8knruuv1dv90ogiqo28kmjs Query : select szadrsstamp valor from szadrs where szadrsdesc='electrocalatayud, s.l.'
20240812@180205.6339 iom8knruuv1dv90ogiqo28kmjs Query : use flama_phc
20240812@180205.6343 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from td where ndoc = 39
20240812@180205.6356 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 manternumero, tiposaft, nmdos,td.assinadoc from td where td.ndoc = 39
20240812@180205.6369 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.6508 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft' and documentnumber = 39
20240812@180205.6528 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.6544 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft2' and documentnumber = 39
20240812@180205.6577 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.6593 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft3' and documentnumber = 39
20240812@180205.6606 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 ft.fno valor from ft ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240812@180205.6679 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 ft.fno valor from wsftdata ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240812@180205.6692 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.6708 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft3' and documentnumber = 39
20240812@180205.6768 iom8knruuv1dv90ogiqo28kmjs Query : insert into wsft3data (ft3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,taxpointdt ) values ('aut66ba46223766ba400da1' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?)
20240812@180205.7015 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.7154 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft2' and documentnumber = 39
20240812@180205.7311 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 bo.u_nomeenv valor from bo where bo.bostamp=''
20240812@180205.7323 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 bo.u_moradaen valor from bo where bo.bostamp=''
20240812@180205.7340 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 bo.u_codposen valor from bo where bo.bostamp=''
20240812@180205.7352 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 bo.u_localenv valor from bo where bo.bostamp=''
20240812@180205.7363 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 bo.trab5 valor from bo where bo.bostamp=''
20240812@180205.7376 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 bo.serie valor from bo where bo.bostamp=''
20240812@180205.7387 iom8knruuv1dv90ogiqo28kmjs Query : insert into wsft2data (ft2stamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,u_nomeenv ,u_moradaen ,u_codposen ,u_localenv ,u_coddest ,u_codby ) values ('aut66ba46223766ba400da1',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?,?,?,?,?,?)
20240812@180205.7669 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 fno valor from wsftdata order by fno desc
20240812@180205.7687 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.7705 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft' and documentnumber = 39
20240812@180205.7731 iom8knruuv1dv90ogiqo28kmjs Query : select 'normal' from dummy
20240812@180205.7750 iom8knruuv1dv90ogiqo28kmjs Query : insert into wsftdata (ftstamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,fno,no,estab,fdata,ndoc,moeda,cambio,cambiofixo,ftano,site ,classe ) values ('aut66ba46223766ba400da1',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',326,200500,0,'2024-08-12',39,'euro',0,0,2024 ,?,?)
20240812@180205.8065 iom8knruuv1dv90ogiqo28kmjs Query : use flama_phc
20240812@180205.8068 iom8knruuv1dv90ogiqo28kmjs Query : select st.usalote valor from st where st.ref = '324.1805.00.1'
20240812@180205.8091 iom8knruuv1dv90ogiqo28kmjs 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.1805.00.1'
20240812@180205.8414 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.8454 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180205.8481 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.8496 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180205.8505 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180205.8517 iom8knruuv1dv90ogiqo28kmjs Query : select sestamp valor from se where ref ='324.1805.00.1' and lote = 'r2300831200a'
20240812@180205.8540 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.8557 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180205.8569 iom8knruuv1dv90ogiqo28kmjs Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba47777466ba400dd0','aut66ba46223766ba400da1' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180205.8573 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.8588 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180205.8632 iom8knruuv1dv90ogiqo28kmjs Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba47777466ba400dd0',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',1.000 ,'aut66ba46223766ba400da1' ,0,0 ,2,23.00,10000,?,?,?,?)
20240812@180205.8904 iom8knruuv1dv90ogiqo28kmjs Query : use flama_phc
20240812@180205.8907 iom8knruuv1dv90ogiqo28kmjs Query : select st.usalote valor from st where st.ref = '324.1805.00.1'
20240812@180205.8926 iom8knruuv1dv90ogiqo28kmjs 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.1805.00.1'
20240812@180205.8942 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.8960 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180205.8987 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.9005 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180205.9014 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180205.9026 iom8knruuv1dv90ogiqo28kmjs Query : select sestamp valor from se where ref ='324.1805.00.1' and lote = 'r2400290200a'
20240812@180205.9040 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.9055 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180205.9069 iom8knruuv1dv90ogiqo28kmjs Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba41920766ba400ddc','aut66ba46223766ba400da1' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180205.9073 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.9088 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180205.9131 iom8knruuv1dv90ogiqo28kmjs Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba41920766ba400ddc',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',3.000 ,'aut66ba46223766ba400da1' ,0,0 ,2,23.00,20000,?,?,?,?)
20240812@180205.9387 iom8knruuv1dv90ogiqo28kmjs Query : use flama_phc
20240812@180205.9391 iom8knruuv1dv90ogiqo28kmjs Query : select st.usalote valor from st where st.ref = '324.1824.00.1'
20240812@180205.9412 iom8knruuv1dv90ogiqo28kmjs 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.1824.00.1'
20240812@180205.9577 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.9594 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180205.9621 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.9636 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180205.9644 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180205.9657 iom8knruuv1dv90ogiqo28kmjs Query : select sestamp valor from se where ref ='324.1824.00.1' and lote = 'r2301210200a'
20240812@180205.9673 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.9689 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180205.9701 iom8knruuv1dv90ogiqo28kmjs Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba44542766ba400dec','aut66ba46223766ba400da1' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180205.9705 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180205.9720 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180205.9761 iom8knruuv1dv90ogiqo28kmjs Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba44542766ba400dec',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',16.000 ,'aut66ba46223766ba400da1' ,0,0 ,2,23.00,30000,?,?,?,?)
20240812@180206.4400 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.6200 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.8800 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.1020 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.1130 iom8knruuv1dv90ogiqo28kmjs Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180206.1250 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.1400 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.1640 iom8knruuv1dv90ogiqo28kmjs Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba46769766ba400e03','aut66ba46223766ba400da1' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180206.1680 iom8knruuv1dv90ogiqo28kmjs Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.1830 iom8knruuv1dv90ogiqo28kmjs Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.2100 iom8knruuv1dv90ogiqo28kmjs Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66ba46769766ba400e03',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66ba46223766ba400da1' ,0,0 ,2,23.00,40000,?,?,?)
20240812@180206.4830 iom8knruuv1dv90ogiqo28kmjs Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66ba46223766ba400da1','2405365','wait',39,'adm09112754980.682000002')
20240812@180206.5700 iom8knruuv1dv90ogiqo28kmjs Query : use flama_phc
20240812@180206.5730 iom8knruuv1dv90ogiqo28kmjs Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240812@180206.6030 iom8knruuv1dv90ogiqo28kmjs Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1508';
20240812@180206.6600 iom8knruuv1dv90ogiqo28kmjs Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1508';
20240812@180206.7110 iom8knruuv1dv90ogiqo28kmjs Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1508';
20240812@180206.7480 iom8knruuv1dv90ogiqo28kmjs Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1508';
20240812@180206.1314 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240812@180206.1324 9ulrgme63usdpm8g06tv9tb0j7 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240812@180206.1372 9ulrgme63usdpm8g06tv9tb0j7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1509';
20240812@180206.1426 9ulrgme63usdpm8g06tv9tb0j7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1509';
20240812@180206.1481 9ulrgme63usdpm8g06tv9tb0j7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1509';
20240812@180206.1503 9ulrgme63usdpm8g06tv9tb0j7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1509';
20240812@180206.1546 9ulrgme63usdpm8g06tv9tb0j7 Query : use flama_phc
20240812@180206.1549 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240812@180206.1613 9ulrgme63usdpm8g06tv9tb0j7 Query : use flama_phc
20240812@180206.1616 9ulrgme63usdpm8g06tv9tb0j7 Query : select no, estab,szadrsdesc from szadrs where u_coddest=2364
20240812@180206.1712 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1879.00.1'
20240812@180206.1731 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1879.00.1'
20240812@180206.1749 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1879.00.1'
20240812@180206.1767 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1824.00.1'
20240812@180206.1791 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1824.00.1'
20240812@180206.1809 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1824.00.1'
20240812@180206.1828 9ulrgme63usdpm8g06tv9tb0j7 Query : use flama_phc
20240812@180206.1831 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240812@180206.1861 9ulrgme63usdpm8g06tv9tb0j7 Query : use flama_phc
20240812@180206.1863 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 1 valor from td where td.ndoc = 39
20240812@180206.1903 9ulrgme63usdpm8g06tv9tb0j7 Query : use flama_phc
20240812@180206.1906 9ulrgme63usdpm8g06tv9tb0j7 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')
20240812@180206.1933 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240812@180206.1966 9ulrgme63usdpm8g06tv9tb0j7 Query : use flama_phc
20240812@180206.1969 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 ~inactivo valor from cl where no = '102296' and estab = 0 order by inactivo desc
20240812@180206.2101 9ulrgme63usdpm8g06tv9tb0j7 Query : use flama_phc
20240812@180206.2104 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 tipodoc,regrd from td where ndoc = 39
20240812@180206.2140 9ulrgme63usdpm8g06tv9tb0j7 Query : use flama_phc
20240812@180206.2143 9ulrgme63usdpm8g06tv9tb0j7 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240812@180206.2183 9ulrgme63usdpm8g06tv9tb0j7 Query : use flama_phc
20240812@180206.2186 9ulrgme63usdpm8g06tv9tb0j7 Query : select szadrsstamp valor from szadrs where szadrsdesc='electro sacavÉm de antÓnio a maio, lda.'
20240812@180206.2231 9ulrgme63usdpm8g06tv9tb0j7 Query : use flama_phc
20240812@180206.2234 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from td where ndoc = 39
20240812@180206.2246 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 manternumero, tiposaft, nmdos,td.assinadoc from td where td.ndoc = 39
20240812@180206.2270 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.2286 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft' and documentnumber = 39
20240812@180206.2306 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.2320 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft2' and documentnumber = 39
20240812@180206.2362 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.2377 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft3' and documentnumber = 39
20240812@180206.2389 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 ft.fno valor from ft ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240812@180206.2459 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 ft.fno valor from wsftdata ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240812@180206.2473 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.2490 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft3' and documentnumber = 39
20240812@180206.2506 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsft3data (ft3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,taxpointdt ) values ('aut66ba45958466ba400e3a' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?)
20240812@180206.2864 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.3042 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft2' and documentnumber = 39
20240812@180206.3075 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 bo.u_nomeenv valor from bo where bo.bostamp=''
20240812@180206.3103 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 bo.u_moradaen valor from bo where bo.bostamp=''
20240812@180206.3116 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 bo.u_codposen valor from bo where bo.bostamp=''
20240812@180206.3128 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 bo.u_localenv valor from bo where bo.bostamp=''
20240812@180206.3140 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 bo.trab5 valor from bo where bo.bostamp=''
20240812@180206.3152 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 bo.serie valor from bo where bo.bostamp=''
20240812@180206.3164 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsft2data (ft2stamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,u_nomeenv ,u_moradaen ,u_codposen ,u_localenv ,u_coddest ,u_codby ) values ('aut66ba45958466ba400e3a',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?,?,?,?,?,?)
20240812@180206.3423 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 fno valor from wsftdata order by fno desc
20240812@180206.3441 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.3460 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft' and documentnumber = 39
20240812@180206.3499 9ulrgme63usdpm8g06tv9tb0j7 Query : select 'normal' from dummy
20240812@180206.3515 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsftdata (ftstamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,fno,no,estab,fdata,ndoc,moeda,cambio,cambiofixo,ftano,site ,classe ) values ('aut66ba45958466ba400e3a',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',327,102296,0,'2024-08-12',39,'euro',0,0,2024 ,?,?)
20240812@180206.3967 9ulrgme63usdpm8g06tv9tb0j7 Query : use flama_phc
20240812@180206.3971 9ulrgme63usdpm8g06tv9tb0j7 Query : select st.usalote valor from st where st.ref = '324.1879.00.1'
20240812@180206.3995 9ulrgme63usdpm8g06tv9tb0j7 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.1879.00.1'
20240812@180206.4009 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.4033 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.4078 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.4093 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.4102 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180206.4115 9ulrgme63usdpm8g06tv9tb0j7 Query : select sestamp valor from se where ref ='324.1879.00.1' and lote = 'r2300643200a'
20240812@180206.4128 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.4143 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.4156 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba42426566ba400e64','aut66ba45958466ba400e3a' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180206.4160 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.4176 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.4207 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba42426566ba400e64',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',6.000 ,'aut66ba45958466ba400e3a' ,0,0 ,2,23.00,10000,?,?,?,?)
20240812@180206.4533 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.4550 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.4578 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.4593 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.4601 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180206.4614 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.4629 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.4642 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba40287966ba400e70','aut66ba45958466ba400e3a' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180206.4647 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.4664 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.4706 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66ba40287966ba400e70',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66ba45958466ba400e3a' ,0,0 ,2,23.00,20000,?,?,?)
20240812@180206.4976 9ulrgme63usdpm8g06tv9tb0j7 Query : use flama_phc
20240812@180206.4979 9ulrgme63usdpm8g06tv9tb0j7 Query : select st.usalote valor from st where st.ref = '324.1879.00.1'
20240812@180206.4998 9ulrgme63usdpm8g06tv9tb0j7 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.1879.00.1'
20240812@180206.5013 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.5608 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.6266 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.6283 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.6292 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180206.6307 9ulrgme63usdpm8g06tv9tb0j7 Query : select sestamp valor from se where ref ='324.1879.00.1' and lote = 'r2300643200a'
20240812@180206.6319 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.6334 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.6346 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba46569566ba400e9a','aut66ba45958466ba400e3a' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180206.6350 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.6364 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.6392 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba46569566ba400e9a',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',1.000 ,'aut66ba45958466ba400e3a' ,0,0 ,2,23.00,40000,?,?,?,?)
20240812@180206.6721 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.6738 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.6768 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.6784 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.6795 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180206.6808 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.6823 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.6835 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba43882466ba400ea6','aut66ba45958466ba400e3a' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180206.6839 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.6854 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.6897 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66ba43882466ba400ea6',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66ba45958466ba400e3a' ,0,0 ,2,23.00,50000,?,?,?)
20240812@180206.7158 9ulrgme63usdpm8g06tv9tb0j7 Query : use flama_phc
20240812@180206.7162 9ulrgme63usdpm8g06tv9tb0j7 Query : select st.usalote valor from st where st.ref = '324.1879.00.1'
20240812@180206.7181 9ulrgme63usdpm8g06tv9tb0j7 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.1879.00.1'
20240812@180206.7198 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.7214 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.7240 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.7256 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.7278 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180206.7290 9ulrgme63usdpm8g06tv9tb0j7 Query : select sestamp valor from se where ref ='324.1879.00.1' and lote = 'r2300643200a'
20240812@180206.7303 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.7318 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.7330 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba44392266ba400eb2','aut66ba45958466ba400e3a' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180206.7334 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.7348 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.7377 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba44392266ba400eb2',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',1.000 ,'aut66ba45958466ba400e3a' ,0,0 ,2,23.00,70000,?,?,?,?)
20240812@180206.7649 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.7666 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.7693 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.7708 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.7717 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180206.7729 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.7744 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.7756 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba45479166ba400ebc','aut66ba45958466ba400e3a' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180206.7760 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.7774 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.7820 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66ba45479166ba400ebc',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66ba45958466ba400e3a' ,0,0 ,2,23.00,80000,?,?,?)
20240812@180206.8082 9ulrgme63usdpm8g06tv9tb0j7 Query : use flama_phc
20240812@180206.8085 9ulrgme63usdpm8g06tv9tb0j7 Query : select st.usalote valor from st where st.ref = '324.1824.00.1'
20240812@180206.8104 9ulrgme63usdpm8g06tv9tb0j7 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.1824.00.1'
20240812@180206.8119 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.8138 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.8165 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.8180 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.8189 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180206.8201 9ulrgme63usdpm8g06tv9tb0j7 Query : select sestamp valor from se where ref ='324.1824.00.1' and lote = 'r2301210200a'
20240812@180206.8214 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.8229 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.8241 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba49414066ba400ec8','aut66ba45958466ba400e3a' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180206.8245 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.8273 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.8303 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba49414066ba400ec8',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',2.000 ,'aut66ba45958466ba400e3a' ,0,0 ,2,23.00,100000,?,?,?,?)
20240812@180206.8587 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.8608 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.8653 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.8669 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.8681 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180206.8696 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.8712 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.8725 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba45767966ba400ed4','aut66ba45958466ba400e3a' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180206.8730 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.8747 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.8782 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66ba45767966ba400ed4',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66ba45958466ba400e3a' ,0,0 ,2,23.00,110000,?,?,?)
20240812@180206.9154 9ulrgme63usdpm8g06tv9tb0j7 Query : use flama_phc
20240812@180206.9157 9ulrgme63usdpm8g06tv9tb0j7 Query : select st.usalote valor from st where st.ref = '324.1824.00.1'
20240812@180206.9180 9ulrgme63usdpm8g06tv9tb0j7 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.1824.00.1'
20240812@180206.9196 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.9217 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.9247 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.9263 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.9272 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180206.9285 9ulrgme63usdpm8g06tv9tb0j7 Query : select sestamp valor from se where ref ='324.1824.00.1' and lote = 'r2301210200a'
20240812@180206.9302 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.9317 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.9329 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba41808166ba400ee3','aut66ba45958466ba400e3a' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180206.9341 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.9370 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.9400 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba41808166ba400ee3',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',5.000 ,'aut66ba45958466ba400e3a' ,0,0 ,2,23.00,130000,?,?,?,?)
20240812@180206.9672 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.9689 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.9718 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.9734 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.9743 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180206.9756 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.9772 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180206.9798 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba41464766ba400eee','aut66ba45958466ba400e3a' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180206.9802 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180206.9817 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180206.9848 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66ba41464766ba400eee',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66ba45958466ba400e3a' ,0,0 ,2,23.00,140000,?,?,?)
20240812@180207.1110 9ulrgme63usdpm8g06tv9tb0j7 Query : use flama_phc
20240812@180207.1140 9ulrgme63usdpm8g06tv9tb0j7 Query : select st.usalote valor from st where st.ref = '324.1824.00.1'
20240812@180207.1350 9ulrgme63usdpm8g06tv9tb0j7 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.1824.00.1'
20240812@180207.1500 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180207.1660 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180207.1920 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180207.2060 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180207.2140 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180207.2270 9ulrgme63usdpm8g06tv9tb0j7 Query : select sestamp valor from se where ref ='324.1824.00.1' and lote = 'r2301210200a'
20240812@180207.2550 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180207.2690 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180207.2810 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba44524866ba400f06','aut66ba45958466ba400e3a' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180207.2850 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180207.2990 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180207.3300 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba44524866ba400f06',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',1.000 ,'aut66ba45958466ba400e3a' ,0,0 ,2,23.00,160000,?,?,?,?)
20240812@180207.6080 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180207.6240 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180207.6740 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180207.6890 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180207.6980 9ulrgme63usdpm8g06tv9tb0j7 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180207.7140 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180207.7290 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180207.7430 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba43812166ba400f11','aut66ba45958466ba400e3a' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180207.7470 9ulrgme63usdpm8g06tv9tb0j7 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180207.7620 9ulrgme63usdpm8g06tv9tb0j7 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180207.7910 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66ba43812166ba400f11',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66ba45958466ba400e3a' ,0,0 ,2,23.00,170000,?,?,?)
20240812@180207.1077 9ulrgme63usdpm8g06tv9tb0j7 Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66ba45958466ba400e3a','2405366','wait',39,'adm09112754980.682000002')
20240812@180207.1153 9ulrgme63usdpm8g06tv9tb0j7 Query : use flama_phc
20240812@180207.1157 9ulrgme63usdpm8g06tv9tb0j7 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240812@180207.1189 9ulrgme63usdpm8g06tv9tb0j7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1509';
20240812@180207.1218 9ulrgme63usdpm8g06tv9tb0j7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1509';
20240812@180207.1255 9ulrgme63usdpm8g06tv9tb0j7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1509';
20240812@180207.1281 9ulrgme63usdpm8g06tv9tb0j7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1509';
20240812@180207.3906 fl214d9tgi6g14lcpre6l8kvj8 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240812@180207.3917 fl214d9tgi6g14lcpre6l8kvj8 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240812@180207.4022 fl214d9tgi6g14lcpre6l8kvj8 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1510';
20240812@180207.4317 fl214d9tgi6g14lcpre6l8kvj8 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1510';
20240812@180207.4366 fl214d9tgi6g14lcpre6l8kvj8 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1510';
20240812@180207.4393 fl214d9tgi6g14lcpre6l8kvj8 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1510';
20240812@180207.4448 fl214d9tgi6g14lcpre6l8kvj8 Query : use flama_phc
20240812@180207.4451 fl214d9tgi6g14lcpre6l8kvj8 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240812@180207.4511 fl214d9tgi6g14lcpre6l8kvj8 Query : use flama_phc
20240812@180207.4514 fl214d9tgi6g14lcpre6l8kvj8 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4743
20240812@180207.4598 fl214d9tgi6g14lcpre6l8kvj8 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1646.00.1'
20240812@180207.4767 fl214d9tgi6g14lcpre6l8kvj8 Query : use flama_phc
20240812@180207.4770 fl214d9tgi6g14lcpre6l8kvj8 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240812@180207.4803 fl214d9tgi6g14lcpre6l8kvj8 Query : use flama_phc
20240812@180207.4805 fl214d9tgi6g14lcpre6l8kvj8 Query : select top 1 1 valor from td where td.ndoc = 39
20240812@180207.4837 fl214d9tgi6g14lcpre6l8kvj8 Query : use flama_phc
20240812@180207.4840 fl214d9tgi6g14lcpre6l8kvj8 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')
20240812@180207.4883 fl214d9tgi6g14lcpre6l8kvj8 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240812@180207.4919 fl214d9tgi6g14lcpre6l8kvj8 Query : use flama_phc
20240812@180207.4923 fl214d9tgi6g14lcpre6l8kvj8 Query : select top 1 ~inactivo valor from cl where no = '101597' and estab = 0 order by inactivo desc
20240812@180207.5043 fl214d9tgi6g14lcpre6l8kvj8 Query : use flama_phc
20240812@180207.5047 fl214d9tgi6g14lcpre6l8kvj8 Query : select top 1 tipodoc,regrd from td where ndoc = 39
20240812@180207.5077 fl214d9tgi6g14lcpre6l8kvj8 Query : use flama_phc
20240812@180207.5080 fl214d9tgi6g14lcpre6l8kvj8 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240812@180207.5123 fl214d9tgi6g14lcpre6l8kvj8 Query : use flama_phc
20240812@180207.5127 fl214d9tgi6g14lcpre6l8kvj8 Query : select szadrsstamp valor from szadrs where szadrsdesc='101597 - auchan retail portugal , sa'
20240812@180207.5180 fl214d9tgi6g14lcpre6l8kvj8 Query : use flama_phc
20240812@180207.5182 fl214d9tgi6g14lcpre6l8kvj8 Query : select 1 valor from td where ndoc = 39
20240812@180207.5195 fl214d9tgi6g14lcpre6l8kvj8 Query : select top 1 manternumero, tiposaft, nmdos,td.assinadoc from td where td.ndoc = 39
20240812@180207.5208 fl214d9tgi6g14lcpre6l8kvj8 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180207.5225 fl214d9tgi6g14lcpre6l8kvj8 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft' and documentnumber = 39
20240812@180207.5243 fl214d9tgi6g14lcpre6l8kvj8 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180207.5262 fl214d9tgi6g14lcpre6l8kvj8 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft2' and documentnumber = 39
20240812@180207.5296 fl214d9tgi6g14lcpre6l8kvj8 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180207.5332 fl214d9tgi6g14lcpre6l8kvj8 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft3' and documentnumber = 39
20240812@180207.5378 fl214d9tgi6g14lcpre6l8kvj8 Query : select top 1 ft.fno valor from ft ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240812@180207.5450 fl214d9tgi6g14lcpre6l8kvj8 Query : select top 1 ft.fno valor from wsftdata ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240812@180207.5464 fl214d9tgi6g14lcpre6l8kvj8 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180207.5481 fl214d9tgi6g14lcpre6l8kvj8 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft3' and documentnumber = 39
20240812@180207.5498 fl214d9tgi6g14lcpre6l8kvj8 Query : insert into wsft3data (ft3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,taxpointdt ) values ('aut66ba49649566ba400f83' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?)
20240812@180207.5684 fl214d9tgi6g14lcpre6l8kvj8 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180207.5703 fl214d9tgi6g14lcpre6l8kvj8 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft2' and documentnumber = 39
20240812@180207.5738 fl214d9tgi6g14lcpre6l8kvj8 Query : select top 1 bo.u_nomeenv valor from bo where bo.bostamp=''
20240812@180207.5752 fl214d9tgi6g14lcpre6l8kvj8 Query : select top 1 bo.u_moradaen valor from bo where bo.bostamp=''
20240812@180207.5763 fl214d9tgi6g14lcpre6l8kvj8 Query : select top 1 bo.u_codposen valor from bo where bo.bostamp=''
20240812@180207.5776 fl214d9tgi6g14lcpre6l8kvj8 Query : select top 1 bo.u_localenv valor from bo where bo.bostamp=''
20240812@180207.5788 fl214d9tgi6g14lcpre6l8kvj8 Query : select top 1 bo.trab5 valor from bo where bo.bostamp=''
20240812@180207.5799 fl214d9tgi6g14lcpre6l8kvj8 Query : select top 1 bo.serie valor from bo where bo.bostamp=''
20240812@180207.5810 fl214d9tgi6g14lcpre6l8kvj8 Query : insert into wsft2data (ft2stamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,u_nomeenv ,u_moradaen ,u_codposen ,u_localenv ,u_coddest ,u_codby ) values ('aut66ba49649566ba400f83',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?,?,?,?,?,?)
20240812@180207.6107 fl214d9tgi6g14lcpre6l8kvj8 Query : select top 1 fno valor from wsftdata order by fno desc
20240812@180207.6129 fl214d9tgi6g14lcpre6l8kvj8 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180207.6146 fl214d9tgi6g14lcpre6l8kvj8 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft' and documentnumber = 39
20240812@180207.6167 fl214d9tgi6g14lcpre6l8kvj8 Query : select 'normal' from dummy
20240812@180207.6184 fl214d9tgi6g14lcpre6l8kvj8 Query : insert into wsftdata (ftstamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,fno,no,estab,fdata,ndoc,moeda,cambio,cambiofixo,ftano,site ,classe ) values ('aut66ba49649566ba400f83',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',328,101597,0,'2024-08-12',39,'euro',0,0,2024 ,?,?)
20240812@180207.6510 fl214d9tgi6g14lcpre6l8kvj8 Query : use flama_phc
20240812@180207.6513 fl214d9tgi6g14lcpre6l8kvj8 Query : select st.usalote valor from st where st.ref = '324.1646.00.1'
20240812@180207.6550 fl214d9tgi6g14lcpre6l8kvj8 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.1646.00.1'
20240812@180207.6711 fl214d9tgi6g14lcpre6l8kvj8 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180207.6730 fl214d9tgi6g14lcpre6l8kvj8 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180207.6757 fl214d9tgi6g14lcpre6l8kvj8 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180207.6772 fl214d9tgi6g14lcpre6l8kvj8 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180207.6781 fl214d9tgi6g14lcpre6l8kvj8 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180207.6806 fl214d9tgi6g14lcpre6l8kvj8 Query : select sestamp valor from se where ref ='324.1646.00.1' and lote = 'r2100904100a'
20240812@180207.6833 fl214d9tgi6g14lcpre6l8kvj8 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180207.6847 fl214d9tgi6g14lcpre6l8kvj8 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180207.6859 fl214d9tgi6g14lcpre6l8kvj8 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba44720566ba400fa6','aut66ba49649566ba400f83' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180207.6863 fl214d9tgi6g14lcpre6l8kvj8 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180207.6878 fl214d9tgi6g14lcpre6l8kvj8 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180207.6908 fl214d9tgi6g14lcpre6l8kvj8 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba44720566ba400fa6',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',2.000 ,'aut66ba49649566ba400f83' ,0,0 ,2,23.00,10000,?,?,?,?)
20240812@180207.7186 fl214d9tgi6g14lcpre6l8kvj8 Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66ba49649566ba400f83','2405367','wait',39,'adm09112754980.682000002')
20240812@180207.7253 fl214d9tgi6g14lcpre6l8kvj8 Query : use flama_phc
20240812@180207.7256 fl214d9tgi6g14lcpre6l8kvj8 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240812@180207.7289 fl214d9tgi6g14lcpre6l8kvj8 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1510';
20240812@180207.7317 fl214d9tgi6g14lcpre6l8kvj8 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1510';
20240812@180207.7356 fl214d9tgi6g14lcpre6l8kvj8 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1510';
20240812@180207.7380 fl214d9tgi6g14lcpre6l8kvj8 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1510';
20240812@180207.7950 o56a544598oj5fb98ru10a5e7i Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240812@180207.7961 o56a544598oj5fb98ru10a5e7i Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240812@180207.8026 o56a544598oj5fb98ru10a5e7i Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1511';
20240812@180207.8081 o56a544598oj5fb98ru10a5e7i Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1511';
20240812@180207.8127 o56a544598oj5fb98ru10a5e7i Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1511';
20240812@180207.8197 o56a544598oj5fb98ru10a5e7i Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1511';
20240812@180207.8246 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180207.8249 o56a544598oj5fb98ru10a5e7i Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240812@180207.8324 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180207.8327 o56a544598oj5fb98ru10a5e7i Query : select no, estab,szadrsdesc from szadrs where u_coddest=829
20240812@180207.8417 o56a544598oj5fb98ru10a5e7i Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.5347.00.1'
20240812@180207.8597 o56a544598oj5fb98ru10a5e7i Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.4320.00.1'
20240812@180207.8617 o56a544598oj5fb98ru10a5e7i Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4521.00.1'
20240812@180207.8804 o56a544598oj5fb98ru10a5e7i Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2907.00.1'
20240812@180207.8825 o56a544598oj5fb98ru10a5e7i Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.966.00.01'
20240812@180207.9007 o56a544598oj5fb98ru10a5e7i Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.969.00.01'
20240812@180207.9497 o56a544598oj5fb98ru10a5e7i Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.948.00.01'
20240812@180207.9676 o56a544598oj5fb98ru10a5e7i Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1834.00.1'
20240812@180207.9712 o56a544598oj5fb98ru10a5e7i Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1834.00.1'
20240812@180207.9731 o56a544598oj5fb98ru10a5e7i Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240812@180207.9895 o56a544598oj5fb98ru10a5e7i Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.681.00.01'
20240812@180208.4400 o56a544598oj5fb98ru10a5e7i Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.691.00.01'
20240812@180208.2000 o56a544598oj5fb98ru10a5e7i Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.658.00.01'
20240812@180208.3350 o56a544598oj5fb98ru10a5e7i Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1643.00.1'
20240812@180208.4670 o56a544598oj5fb98ru10a5e7i Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4980.00.1'
20240812@180208.4870 o56a544598oj5fb98ru10a5e7i Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.5365.00.1'
20240812@180208.6450 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180208.6480 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240812@180208.6790 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180208.6820 o56a544598oj5fb98ru10a5e7i Query : select top 1 1 valor from td where td.ndoc = 39
20240812@180208.7110 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180208.7140 o56a544598oj5fb98ru10a5e7i 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')
20240812@180208.7420 o56a544598oj5fb98ru10a5e7i Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240812@180208.7830 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180208.7860 o56a544598oj5fb98ru10a5e7i Query : select top 1 ~inactivo valor from cl where no = '101684' and estab = 0 order by inactivo desc
20240812@180208.9070 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180208.9100 o56a544598oj5fb98ru10a5e7i Query : select top 1 tipodoc,regrd from td where ndoc = 39
20240812@180208.9390 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180208.9430 o56a544598oj5fb98ru10a5e7i Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240812@180208.9820 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180208.9850 o56a544598oj5fb98ru10a5e7i Query : select szadrsstamp valor from szadrs where szadrsdesc='martins & correia,lda'
20240812@180208.1039 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180208.1042 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from td where ndoc = 39
20240812@180208.1054 o56a544598oj5fb98ru10a5e7i Query : select top 1 manternumero, tiposaft, nmdos,td.assinadoc from td where td.ndoc = 39
20240812@180208.1067 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.1084 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft' and documentnumber = 39
20240812@180208.1102 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.1116 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft2' and documentnumber = 39
20240812@180208.1145 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.1159 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft3' and documentnumber = 39
20240812@180208.1172 o56a544598oj5fb98ru10a5e7i Query : select top 1 ft.fno valor from ft ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240812@180208.1251 o56a544598oj5fb98ru10a5e7i Query : select top 1 ft.fno valor from wsftdata ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240812@180208.1263 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.1277 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft3' and documentnumber = 39
20240812@180208.1292 o56a544598oj5fb98ru10a5e7i Query : insert into wsft3data (ft3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,taxpointdt ) values ('aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?)
20240812@180208.1474 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.1492 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft2' and documentnumber = 39
20240812@180208.1525 o56a544598oj5fb98ru10a5e7i Query : select top 1 bo.u_nomeenv valor from bo where bo.bostamp=''
20240812@180208.1536 o56a544598oj5fb98ru10a5e7i Query : select top 1 bo.u_moradaen valor from bo where bo.bostamp=''
20240812@180208.1561 o56a544598oj5fb98ru10a5e7i Query : select top 1 bo.u_codposen valor from bo where bo.bostamp=''
20240812@180208.1573 o56a544598oj5fb98ru10a5e7i Query : select top 1 bo.u_localenv valor from bo where bo.bostamp=''
20240812@180208.1584 o56a544598oj5fb98ru10a5e7i Query : select top 1 bo.trab5 valor from bo where bo.bostamp=''
20240812@180208.1596 o56a544598oj5fb98ru10a5e7i Query : select top 1 bo.serie valor from bo where bo.bostamp=''
20240812@180208.1607 o56a544598oj5fb98ru10a5e7i Query : insert into wsft2data (ft2stamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,u_nomeenv ,u_moradaen ,u_codposen ,u_localenv ,u_coddest ,u_codby ) values ('aut66ba40674066ba40101c',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?,?,?,?,?,?)
20240812@180208.1860 o56a544598oj5fb98ru10a5e7i Query : select top 1 fno valor from wsftdata order by fno desc
20240812@180208.1879 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.1897 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft' and documentnumber = 39
20240812@180208.1918 o56a544598oj5fb98ru10a5e7i Query : select 'normal' from dummy
20240812@180208.1946 o56a544598oj5fb98ru10a5e7i Query : insert into wsftdata (ftstamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,fno,no,estab,fdata,ndoc,moeda,cambio,cambiofixo,ftano,site ,classe ) values ('aut66ba40674066ba40101c',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',329,101684,0,'2024-08-12',39,'euro',0,0,2024 ,?,?)
20240812@180208.2248 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180208.2251 o56a544598oj5fb98ru10a5e7i Query : select st.usalote valor from st where st.ref = '324.5347.00.1'
20240812@180208.2274 o56a544598oj5fb98ru10a5e7i 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.5347.00.1'
20240812@180208.2441 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.2457 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180208.2485 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.2500 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.2509 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180208.2521 o56a544598oj5fb98ru10a5e7i Query : select sestamp valor from se where ref ='324.5347.00.1' and lote = 'r2300915100a'
20240812@180208.2536 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.2550 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.2562 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba48680466ba40103d','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180208.2566 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.2583 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180208.2609 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba48680466ba40103d',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',6.000 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,10000,?,?,?,?)
20240812@180208.2984 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.3000 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180208.3026 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.3041 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.3050 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180208.3063 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.3077 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.3089 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba46091566ba40104a','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180208.3093 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.3108 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180208.3137 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66ba46091566ba40104a',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,20000,?,?,?)
20240812@180208.3412 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180208.3415 o56a544598oj5fb98ru10a5e7i Query : select st.usalote valor from st where st.ref = '304.4320.00.1'
20240812@180208.3434 o56a544598oj5fb98ru10a5e7i 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 = '304.4320.00.1'
20240812@180208.3448 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.3463 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180208.3490 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.3504 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.3512 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180208.3523 o56a544598oj5fb98ru10a5e7i Query : select sestamp valor from se where ref ='304.4320.00.1' and lote = '240897'
20240812@180208.3536 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.3550 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.3562 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba40816866ba401056','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180208.3566 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.3581 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180208.3621 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba40816866ba401056',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',4.000 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,40000,?,?,?,?)
20240812@180208.3891 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180208.3894 o56a544598oj5fb98ru10a5e7i Query : select st.usalote valor from st where st.ref = '324.4521.00.1'
20240812@180208.3915 o56a544598oj5fb98ru10a5e7i 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.4521.00.1'
20240812@180208.4084 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.4114 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180208.4141 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.4155 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.4163 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180208.4175 o56a544598oj5fb98ru10a5e7i Query : select sestamp valor from se where ref ='324.4521.00.1' and lote = 'r2400052200a'
20240812@180208.4189 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.4206 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.4219 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba44832866ba401066','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180208.4223 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.4238 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180208.4779 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba44832866ba401066',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',4.000 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,50000,?,?,?,?)
20240812@180208.5053 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180208.5056 o56a544598oj5fb98ru10a5e7i Query : select st.usalote valor from st where st.ref = '324.2907.00.1'
20240812@180208.5076 o56a544598oj5fb98ru10a5e7i 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.2907.00.1'
20240812@180208.5091 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.5107 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180208.5136 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.5151 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.5159 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180208.5172 o56a544598oj5fb98ru10a5e7i Query : select sestamp valor from se where ref ='324.2907.00.1' and lote = 'r2400091200a'
20240812@180208.5185 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.5200 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.5212 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba43050666ba40107e','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180208.5216 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.5231 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180208.5266 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba43050666ba40107e',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',4.000 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,60000,?,?,?,?)
20240812@180208.5654 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180208.5657 o56a544598oj5fb98ru10a5e7i Query : select st.usalote valor from st where st.ref = '324.966.00.01'
20240812@180208.5678 o56a544598oj5fb98ru10a5e7i 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.966.00.01'
20240812@180208.5830 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.5846 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180208.5872 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.5888 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.5896 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180208.5908 o56a544598oj5fb98ru10a5e7i Query : select sestamp valor from se where ref ='324.966.00.01' and lote = 'r2301193200a'
20240812@180208.5931 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.5945 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.5957 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba40757066ba401090','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180208.5961 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.5975 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180208.6005 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba40757066ba401090',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',4.000 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,70000,?,?,?,?)
20240812@180208.6280 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180208.6284 o56a544598oj5fb98ru10a5e7i Query : select st.usalote valor from st where st.ref = '324.969.00.01'
20240812@180208.6304 o56a544598oj5fb98ru10a5e7i 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.969.00.01'
20240812@180208.6456 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.6473 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180208.6499 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.6515 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.6524 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180208.6535 o56a544598oj5fb98ru10a5e7i Query : select sestamp valor from se where ref ='324.969.00.01' and lote = 'r2100601100a'
20240812@180208.6554 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.6570 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.6582 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba46789466ba4010a0','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180208.6588 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.6602 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180208.6633 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba46789466ba4010a0',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',4.000 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,80000,?,?,?,?)
20240812@180208.6918 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180208.6921 o56a544598oj5fb98ru10a5e7i Query : select st.usalote valor from st where st.ref = '324.948.00.01'
20240812@180208.8148 o56a544598oj5fb98ru10a5e7i 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.948.00.01'
20240812@180208.8323 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.8339 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180208.8366 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.8381 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.8389 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180208.8401 o56a544598oj5fb98ru10a5e7i Query : select sestamp valor from se where ref ='324.948.00.01' and lote = 'r2301091200a'
20240812@180208.8416 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.8430 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.8445 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba40815366ba4010cd','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180208.8449 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.8465 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180208.8506 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba40815366ba4010cd',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',4.000 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,90000,?,?,?,?)
20240812@180208.8779 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180208.8782 o56a544598oj5fb98ru10a5e7i Query : select st.usalote valor from st where st.ref = '324.1834.00.1'
20240812@180208.8801 o56a544598oj5fb98ru10a5e7i 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.1834.00.1'
20240812@180208.8816 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.8832 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180208.8872 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.8887 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.8895 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180208.8907 o56a544598oj5fb98ru10a5e7i Query : select sestamp valor from se where ref ='324.1834.00.1' and lote = 'r2301209100a'
20240812@180208.8919 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.8933 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.8945 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba49093866ba4010d9','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180208.8949 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.8963 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180208.8997 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba49093866ba4010d9',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',1.000 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,100000,?,?,?,?)
20240812@180208.9294 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.9310 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180208.9337 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.9351 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.9360 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180208.9373 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.9388 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.9399 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba48117166ba4010e4','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180208.9403 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.9419 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180208.9447 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66ba48117166ba4010e4',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,110000,?,?,?)
20240812@180208.9810 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180208.9813 o56a544598oj5fb98ru10a5e7i Query : select st.usalote valor from st where st.ref = '324.1834.00.1'
20240812@180208.9834 o56a544598oj5fb98ru10a5e7i 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.1834.00.1'
20240812@180208.9848 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.9867 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180208.9899 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.9913 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.9922 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180208.9934 o56a544598oj5fb98ru10a5e7i Query : select sestamp valor from se where ref ='324.1834.00.1' and lote = 'r2301209100a'
20240812@180208.9947 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180208.9976 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180208.9987 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba43595966ba4010f2','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180208.9992 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.6000 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.3400 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba43595966ba4010f2',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',2.000 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,130000,?,?,?,?)
20240812@180209.3260 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.3430 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.3880 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.4290 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.4430 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180209.4590 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.4880 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.4990 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba46650066ba40110b','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180209.5070 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.5210 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.5650 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66ba46650066ba40110b',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,140000,?,?,?)
20240812@180209.8780 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180209.8810 o56a544598oj5fb98ru10a5e7i Query : select st.usalote valor from st where st.ref = '324.1816.00.1'
20240812@180209.9020 o56a544598oj5fb98ru10a5e7i 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.1816.00.1'
20240812@180209.1066 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.1106 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.1132 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.1156 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.1164 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180209.1221 o56a544598oj5fb98ru10a5e7i Query : select sestamp valor from se where ref ='324.1816.00.1' and lote = 'r2400198200a'
20240812@180209.1242 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.1256 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.1267 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba45924466ba40111e','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180209.1283 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.1297 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.1323 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba45924466ba40111e',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',2.000 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,160000,?,?,?,?)
20240812@180209.1620 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.1637 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.1661 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.1689 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.1697 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180209.1708 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.1722 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.1736 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba48555266ba401129','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180209.1741 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.1755 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.1814 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66ba48555266ba401129',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,170000,?,?,?)
20240812@180209.2104 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180209.2107 o56a544598oj5fb98ru10a5e7i Query : select st.usalote valor from st where st.ref = '324.681.00.01'
20240812@180209.2129 o56a544598oj5fb98ru10a5e7i 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.681.00.01'
20240812@180209.2297 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.2318 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.2372 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.2386 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.2394 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180209.2406 o56a544598oj5fb98ru10a5e7i Query : select sestamp valor from se where ref ='324.681.00.01' and lote = 'r2400058200a'
20240812@180209.2419 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.2432 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.2443 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba45190466ba40113b','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180209.2448 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.2464 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.2491 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba45190466ba40113b',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',3.000 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,190000,?,?,?,?)
20240812@180209.2788 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.2804 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.2831 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.2861 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.2869 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180209.2882 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.2896 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.2907 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba42377466ba401146','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180209.2911 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.2931 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.2961 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66ba42377466ba401146',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,200000,?,?,?)
20240812@180209.3307 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180209.3310 o56a544598oj5fb98ru10a5e7i Query : select st.usalote valor from st where st.ref = '324.691.00.01'
20240812@180209.3330 o56a544598oj5fb98ru10a5e7i 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.691.00.01'
20240812@180209.3486 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.3502 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.3529 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.3544 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.3552 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180209.3564 o56a544598oj5fb98ru10a5e7i Query : select sestamp valor from se where ref ='324.691.00.01' and lote = 'r2400209200a'
20240812@180209.3591 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.3606 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.3618 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba43456466ba401157','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180209.3622 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.3636 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.3663 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba43456466ba401157',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',3.000 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,220000,?,?,?,?)
20240812@180209.3942 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.3958 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.3986 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.4001 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.4009 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180209.4022 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.4036 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.4047 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba42175566ba401162','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180209.4051 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.4082 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.4110 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66ba42175566ba401162',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,230000,?,?,?)
20240812@180209.4388 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180209.4391 o56a544598oj5fb98ru10a5e7i Query : select st.usalote valor from st where st.ref = '324.658.00.01'
20240812@180209.4412 o56a544598oj5fb98ru10a5e7i 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.658.00.01'
20240812@180209.4728 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.4744 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.4770 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.4785 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.4794 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180209.4806 o56a544598oj5fb98ru10a5e7i Query : select sestamp valor from se where ref ='324.658.00.01' and lote = 'r2300819200a'
20240812@180209.4820 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.4834 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.4846 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba49358866ba401175','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180209.4851 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.4866 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.4898 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba49358866ba401175',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',2.000 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,250000,?,?,?,?)
20240812@180209.5196 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.5212 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.5238 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.5257 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.5265 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180209.5387 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.5404 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.5417 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba47291166ba401183','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180209.5421 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.5436 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.5479 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66ba47291166ba401183',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,260000,?,?,?)
20240812@180209.5756 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180209.5759 o56a544598oj5fb98ru10a5e7i Query : select st.usalote valor from st where st.ref = '324.1643.00.1'
20240812@180209.5779 o56a544598oj5fb98ru10a5e7i 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.1643.00.1'
20240812@180209.5947 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.5963 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.5990 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.6004 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.6013 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180209.6025 o56a544598oj5fb98ru10a5e7i Query : select sestamp valor from se where ref ='324.1643.00.1' and lote = 'r2101218200a'
20240812@180209.6046 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.6060 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.6072 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba47706166ba401193','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180209.6076 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.6090 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.6120 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba47706166ba401193',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',2.000 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,280000,?,?,?,?)
20240812@180209.6418 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180209.6421 o56a544598oj5fb98ru10a5e7i Query : select st.usalote valor from st where st.ref = '324.4980.00.1'
20240812@180209.6440 o56a544598oj5fb98ru10a5e7i 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.4980.00.1'
20240812@180209.6453 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.6469 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.6494 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.6509 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.6517 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180209.6530 o56a544598oj5fb98ru10a5e7i Query : select sestamp valor from se where ref ='324.4980.00.1' and lote = 'r2301092100a'
20240812@180209.6542 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.6557 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.6573 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba43146366ba40119f','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180209.6577 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.6591 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.6622 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba43146366ba40119f',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',4.000 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,290000,?,?,?,?)
20240812@180209.6906 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180209.6910 o56a544598oj5fb98ru10a5e7i Query : select st.usalote valor from st where st.ref = '324.5365.00.1'
20240812@180209.6932 o56a544598oj5fb98ru10a5e7i 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.5365.00.1'
20240812@180209.7086 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.7102 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.7129 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.7144 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.7152 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180209.7180 o56a544598oj5fb98ru10a5e7i Query : select sestamp valor from se where ref ='324.5365.00.1' and lote = 'r2300840100a'
20240812@180209.7193 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.7208 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.7219 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba46206066ba4011af','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180209.7223 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.7238 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.7266 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66ba46206066ba4011af',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',6.000 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,300000,?,?,?,?)
20240812@180209.7543 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.7559 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.7585 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.7599 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.7607 o56a544598oj5fb98ru10a5e7i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@180209.7623 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.7637 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240812@180209.7649 o56a544598oj5fb98ru10a5e7i Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba41048766ba4011ba','aut66ba40674066ba40101c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240812@180209.7667 o56a544598oj5fb98ru10a5e7i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@180209.7682 o56a544598oj5fb98ru10a5e7i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240812@180209.7710 o56a544598oj5fb98ru10a5e7i Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66ba41048766ba4011ba',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66ba40674066ba40101c' ,0,0 ,2,23.00,310000,?,?,?)
20240812@180209.7971 o56a544598oj5fb98ru10a5e7i Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66ba40674066ba40101c','2405368','wait',39,'adm09112754980.682000002')
20240812@180209.8060 o56a544598oj5fb98ru10a5e7i Query : use flama_phc
20240812@180209.8063 o56a544598oj5fb98ru10a5e7i Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240812@180209.8095 o56a544598oj5fb98ru10a5e7i Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1511';
20240812@180209.8122 o56a544598oj5fb98ru10a5e7i Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1511';
20240812@180209.8162 o56a544598oj5fb98ru10a5e7i Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1511';
20240812@180209.8229 o56a544598oj5fb98ru10a5e7i Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1511';

20240812@183119.6207 gftrmgc5q3bo5slc2uthsik12s Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1512';
20240812@183119.6270 gftrmgc5q3bo5slc2uthsik12s Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1512';
20240812@183119.6298 gftrmgc5q3bo5slc2uthsik12s Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1512';
20240812@183119.6349 gftrmgc5q3bo5slc2uthsik12s Query : use flama_phc
20240812@183119.6352 gftrmgc5q3bo5slc2uthsik12s Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240812@183119.6428 gftrmgc5q3bo5slc2uthsik12s Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1824.00.1'
20240812@183119.6920 gftrmgc5q3bo5slc2uthsik12s 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 = 2400217 and bi.ref ='324.1824.00.1' and bi.lordem =20000
20240812@183119.7515 gftrmgc5q3bo5slc2uthsik12s 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 = 'cps24022744331,795000002 ' 
20240812@183119.8464 gftrmgc5q3bo5slc2uthsik12s Query : use flama_phc
20240812@183119.8470 gftrmgc5q3bo5slc2uthsik12s Query : select top 1 1 valor from ts where ts.ndos = 61
20240812@183119.8591 gftrmgc5q3bo5slc2uthsik12s Query : use flama_phc
20240812@183119.8594 gftrmgc5q3bo5slc2uthsik12s 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')
20240812@183119.8626 gftrmgc5q3bo5slc2uthsik12s 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
20240812@183119.8803 gftrmgc5q3bo5slc2uthsik12s Query : use flama_phc
20240812@183119.8808 gftrmgc5q3bo5slc2uthsik12s Query : select top 1 ~inactivo valor from fl where no = '202241' and estab = 00 order by inactivo desc
20240812@183119.8940 gftrmgc5q3bo5slc2uthsik12s Query : use flama_phc
20240812@183119.8944 gftrmgc5q3bo5slc2uthsik12s Query : select 1 valor from ts where ndos = 61
20240812@183119.9030 gftrmgc5q3bo5slc2uthsik12s Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@183119.9048 gftrmgc5q3bo5slc2uthsik12s Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240812@183119.9060 gftrmgc5q3bo5slc2uthsik12s Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@183119.9080 gftrmgc5q3bo5slc2uthsik12s Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240812@183119.9093 gftrmgc5q3bo5slc2uthsik12s Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@183119.9110 gftrmgc5q3bo5slc2uthsik12s Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240812@183119.9122 gftrmgc5q3bo5slc2uthsik12s 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
20240812@183119.9571 gftrmgc5q3bo5slc2uthsik12s Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240812@183119.9749 gftrmgc5q3bo5slc2uthsik12s Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240812@183119.9772 gftrmgc5q3bo5slc2uthsik12s Query : use flama_phc
20240812@183119.9780 gftrmgc5q3bo5slc2uthsik12s Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202241' and estab=00
20240812@183119.9883 gftrmgc5q3bo5slc2uthsik12s Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@183119.9900 gftrmgc5q3bo5slc2uthsik12s Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240812@183119.9916 gftrmgc5q3bo5slc2uthsik12s Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba48569766ba46e7ee',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240812@183119.9986 gftrmgc5q3bo5slc2uthsik12s Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@183120.4000 gftrmgc5q3bo5slc2uthsik12s Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240812@183120.1800 gftrmgc5q3bo5slc2uthsik12s Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba48569766ba46e7ee','--','bo',7.7919750681729645500 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240812@183120.2540 gftrmgc5q3bo5slc2uthsik12s Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@183120.2750 gftrmgc5q3bo5slc2uthsik12s Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240812@183120.2910 gftrmgc5q3bo5slc2uthsik12s 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 ('aut66ba48569766ba46e7ee','guia r. fornecedor','2024-08-12',61,2402304,?,?,?,?,?,?,?,?,2024, (select valor from para1 where descricao = 'ge_euro') ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240812@183120.9100 gftrmgc5q3bo5slc2uthsik12s Query : use flama_phc
20240812@183120.9140 gftrmgc5q3bo5slc2uthsik12s Query : select st.usalote valor from st where st.ref = '324.1824.00.1'
20240812@183120.9450 gftrmgc5q3bo5slc2uthsik12s 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.1824.00.1'
20240812@183120.9600 gftrmgc5q3bo5slc2uthsik12s Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@183120.9790 gftrmgc5q3bo5slc2uthsik12s Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240812@183120.9950 gftrmgc5q3bo5slc2uthsik12s Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@183120.1012 gftrmgc5q3bo5slc2uthsik12s Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240812@183120.1023 gftrmgc5q3bo5slc2uthsik12s Query : select sestamp valor from se where ref ='324.1824.00.1' and lote = 'r2400217200a'
20240812@183120.1039 gftrmgc5q3bo5slc2uthsik12s Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@183120.1057 gftrmgc5q3bo5slc2uthsik12s Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240812@183120.1068 gftrmgc5q3bo5slc2uthsik12s Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@183120.1084 gftrmgc5q3bo5slc2uthsik12s Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240812@183120.1100 gftrmgc5q3bo5slc2uthsik12s Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66ba45720766ba46e81a',?,?,'20240812',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240812@183120.1776 gftrmgc5q3bo5slc2uthsik12s Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240812@183120.1793 gftrmgc5q3bo5slc2uthsik12s Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@183120.1813 gftrmgc5q3bo5slc2uthsik12s Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240812@183120.1832 gftrmgc5q3bo5slc2uthsik12s Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut66ba43476466ba46e82b','aut66ba48569766ba46e7ee',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 = 'aut66ba48569766ba46e7ee'
20240812@183120.2043 gftrmgc5q3bo5slc2uthsik12s Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240812@183120.2064 gftrmgc5q3bo5slc2uthsik12s Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240812@183120.2087 gftrmgc5q3bo5slc2uthsik12s 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 'aut66ba43476466ba46e82b',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1470, 1470*.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 ,25.67,25.67*200.48,25.67,25.67*200.48 ,0,0,'un',' ' ,bo.marcada,1 ,25.67*1470,25.67*1470*200.48 ,27.277000,27.277000*200.48 ,27.277000,27.277000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,25.67,25.67*200.48,25.67*1470,25.67*1470*200.48,'cps24022744331,795000002 ',200.02,200.02*1470,200.02,200.02*1470,?,?,?,4 from bo bo where bo.bostamp = 'aut66ba48569766ba46e7ee'
20240812@183128.2691 gftrmgc5q3bo5slc2uthsik12s Query : use flama_phc
20240812@183128.2698 gftrmgc5q3bo5slc2uthsik12s Query : declare @bostamp varchar(25) = 'aut66ba48569766ba46e7ee' ,@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 
20240812@183136.1671 gftrmgc5q3bo5slc2uthsik12s Query : use flama_phc
20240812@183136.1681 gftrmgc5q3bo5slc2uthsik12s Query : select 1 valor from bo where bo.bostamp = 'aut66ba48569766ba46e7ee'
20240812@183136.2106 gftrmgc5q3bo5slc2uthsik12s 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) = 'aut66ba48569766ba46e7ee' 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 
20240812@183136.5330 gftrmgc5q3bo5slc2uthsik12s Query : use flama_phc
20240812@183136.5336 gftrmgc5q3bo5slc2uthsik12s Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240812@183136.5394 gftrmgc5q3bo5slc2uthsik12s Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1512';
20240812@183136.5438 gftrmgc5q3bo5slc2uthsik12s Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1512';

20240813@120051.1430 firm34tnklb335ah8c118ub7h1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1513';
20240813@120051.1490 firm34tnklb335ah8c118ub7h1 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1513';
20240813@120051.1519 firm34tnklb335ah8c118ub7h1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1513';
20240813@120051.1573 firm34tnklb335ah8c118ub7h1 Query : use flama_phc
20240813@120051.1577 firm34tnklb335ah8c118ub7h1 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240813@120051.1649 firm34tnklb335ah8c118ub7h1 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1847.00.1'
20240813@120051.1790 firm34tnklb335ah8c118ub7h1 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 = 2400463 and bi.ref ='324.1847.00.1' and bi.lordem =20000
20240813@120051.2160 firm34tnklb335ah8c118ub7h1 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 = 'cps24042441259,738000002 ' 
20240813@120051.2527 firm34tnklb335ah8c118ub7h1 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1847.00.1'
20240813@120051.2552 firm34tnklb335ah8c118ub7h1 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 = 2400463 and bi.ref ='324.1847.00.1' and bi.lordem =20000
20240813@120051.2579 firm34tnklb335ah8c118ub7h1 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 = 'cps24042441259,738000002 ' 
20240813@120051.2614 firm34tnklb335ah8c118ub7h1 Query : use flama_phc
20240813@120051.2657 firm34tnklb335ah8c118ub7h1 Query : select top 1 1 valor from ts where ts.ndos = 61
20240813@120051.4109 firm34tnklb335ah8c118ub7h1 Query : use flama_phc
20240813@120051.4114 firm34tnklb335ah8c118ub7h1 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')
20240813@120051.4161 firm34tnklb335ah8c118ub7h1 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
20240813@120051.4209 firm34tnklb335ah8c118ub7h1 Query : use flama_phc
20240813@120051.4214 firm34tnklb335ah8c118ub7h1 Query : select top 1 ~inactivo valor from fl where no = '202241' and estab = 00 order by inactivo desc
20240813@120051.4421 firm34tnklb335ah8c118ub7h1 Query : use flama_phc
20240813@120051.4425 firm34tnklb335ah8c118ub7h1 Query : select 1 valor from ts where ndos = 61
20240813@120051.4455 firm34tnklb335ah8c118ub7h1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@120051.4481 firm34tnklb335ah8c118ub7h1 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240813@120051.4493 firm34tnklb335ah8c118ub7h1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@120051.4512 firm34tnklb335ah8c118ub7h1 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240813@120051.4522 firm34tnklb335ah8c118ub7h1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@120051.4542 firm34tnklb335ah8c118ub7h1 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240813@120051.4553 firm34tnklb335ah8c118ub7h1 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
20240813@120051.4573 firm34tnklb335ah8c118ub7h1 Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240813@120051.4602 firm34tnklb335ah8c118ub7h1 Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240813@120051.4625 firm34tnklb335ah8c118ub7h1 Query : use flama_phc
20240813@120051.4632 firm34tnklb335ah8c118ub7h1 Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202241' and estab=00
20240813@120051.4660 firm34tnklb335ah8c118ub7h1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@120051.4677 firm34tnklb335ah8c118ub7h1 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240813@120051.4691 firm34tnklb335ah8c118ub7h1 Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66bb34686866bb3ce370',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240813@120051.4696 firm34tnklb335ah8c118ub7h1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@120051.4719 firm34tnklb335ah8c118ub7h1 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240813@120051.4732 firm34tnklb335ah8c118ub7h1 Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66bb34686866bb3ce370','--','bo',7.8676122931442080378 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240813@120051.4738 firm34tnklb335ah8c118ub7h1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@120051.4755 firm34tnklb335ah8c118ub7h1 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240813@120051.4770 firm34tnklb335ah8c118ub7h1 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 ('aut66bb34686866bb3ce370','guia r. fornecedor','2024-08-13',61,2402305,?,?,?,?,?,?,?,?,2024, (select valor from para1 where descricao = 'ge_euro') ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240813@120051.5254 firm34tnklb335ah8c118ub7h1 Query : use flama_phc
20240813@120051.5258 firm34tnklb335ah8c118ub7h1 Query : select st.usalote valor from st where st.ref = '324.1847.00.1'
20240813@120051.5287 firm34tnklb335ah8c118ub7h1 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.1847.00.1'
20240813@120051.5313 firm34tnklb335ah8c118ub7h1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@120051.5333 firm34tnklb335ah8c118ub7h1 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240813@120051.5350 firm34tnklb335ah8c118ub7h1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@120051.5368 firm34tnklb335ah8c118ub7h1 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240813@120051.5379 firm34tnklb335ah8c118ub7h1 Query : select sestamp valor from se where ref ='324.1847.00.1' and lote = 'r2400463200a'
20240813@120051.5402 firm34tnklb335ah8c118ub7h1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@120051.5421 firm34tnklb335ah8c118ub7h1 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240813@120051.5432 firm34tnklb335ah8c118ub7h1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@120051.5448 firm34tnklb335ah8c118ub7h1 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240813@120051.5462 firm34tnklb335ah8c118ub7h1 Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66bb32035066bb3ce384',?,?,'20240813',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240813@120051.5618 firm34tnklb335ah8c118ub7h1 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240813@120051.5637 firm34tnklb335ah8c118ub7h1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@120051.5655 firm34tnklb335ah8c118ub7h1 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240813@120051.5669 firm34tnklb335ah8c118ub7h1 Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut66bb34403466bb3ce389','aut66bb34686866bb3ce370',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 = 'aut66bb34686866bb3ce370'
20240813@120051.5846 firm34tnklb335ah8c118ub7h1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@120051.5867 firm34tnklb335ah8c118ub7h1 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240813@120051.5888 firm34tnklb335ah8c118ub7h1 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 'aut66bb34403466bb3ce389',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 3, 3*.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 ,25.38,25.38*200.48,25.38,25.38*200.48 ,0,0,'un ','' ,bo.marcada,1 ,25.38*3,25.38*3*200.48 ,27.159000,27.159000*200.48 ,27.159000,27.159000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,25.38,25.38*200.48,25.38*3,25.38*3*200.48,'cps24042441259,738000002 ',199.68,199.68*3,199.68,199.68*3,?,?,?,4 from bo bo where bo.bostamp = 'aut66bb34686866bb3ce370'
20240813@120058.4531 firm34tnklb335ah8c118ub7h1 Query : use flama_phc
20240813@120058.4537 firm34tnklb335ah8c118ub7h1 Query : select st.usalote valor from st where st.ref = '324.1847.00.1'
20240813@120058.4566 firm34tnklb335ah8c118ub7h1 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.1847.00.1'
20240813@120058.4584 firm34tnklb335ah8c118ub7h1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@120058.4605 firm34tnklb335ah8c118ub7h1 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240813@120058.4620 firm34tnklb335ah8c118ub7h1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@120058.4638 firm34tnklb335ah8c118ub7h1 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240813@120058.4648 firm34tnklb335ah8c118ub7h1 Query : select sestamp valor from se where ref ='324.1847.00.1' and lote = 'r2400463200a'
20240813@120058.4665 firm34tnklb335ah8c118ub7h1 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240813@120058.4681 firm34tnklb335ah8c118ub7h1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@120058.4700 firm34tnklb335ah8c118ub7h1 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240813@120058.4717 firm34tnklb335ah8c118ub7h1 Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut66bb36523166bb3cea72','aut66bb34686866bb3ce370',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 = 'aut66bb34686866bb3ce370'
20240813@120058.4908 firm34tnklb335ah8c118ub7h1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@120058.4930 firm34tnklb335ah8c118ub7h1 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240813@120058.4950 firm34tnklb335ah8c118ub7h1 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 'aut66bb36523166bb3cea72',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1333, 1333*.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 ,25.38,25.38*200.48,25.38,25.38*200.48 ,0,0,'un ','' ,bo.marcada,1 ,25.38*1333,25.38*1333*200.48 ,27.153000,27.153000*200.48 ,27.153000,27.153000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,25.38,25.38*200.48,25.38*1333,25.38*1333*200.48,'cps24042441259,738000002 ',199.68,199.68*1333,199.68,199.68*1333,?,?,?,4 from bo bo where bo.bostamp = 'aut66bb34686866bb3ce370'
20240813@120058.5570 firm34tnklb335ah8c118ub7h1 Query : use flama_phc
20240813@120058.5576 firm34tnklb335ah8c118ub7h1 Query : declare @bostamp varchar(25) = 'aut66bb34686866bb3ce370' ,@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 
20240813@120058.7425 firm34tnklb335ah8c118ub7h1 Query : use flama_phc
20240813@120058.7429 firm34tnklb335ah8c118ub7h1 Query : select 1 valor from bo where bo.bostamp = 'aut66bb34686866bb3ce370'
20240813@120058.7448 firm34tnklb335ah8c118ub7h1 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) = 'aut66bb34686866bb3ce370' 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 
20240813@120059.6040 firm34tnklb335ah8c118ub7h1 Query : use flama_phc
20240813@120059.6080 firm34tnklb335ah8c118ub7h1 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240813@120059.6680 firm34tnklb335ah8c118ub7h1 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1513';
20240813@120059.6980 firm34tnklb335ah8c118ub7h1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1513';

20240813@142130.1423 8ksptiddl00kiivj8has27a4ch Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1514';
20240813@142130.1478 8ksptiddl00kiivj8has27a4ch Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1514';
20240813@142130.1505 8ksptiddl00kiivj8has27a4ch Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1514';
20240813@142130.1559 8ksptiddl00kiivj8has27a4ch Query : use flama_phc
20240813@142130.1564 8ksptiddl00kiivj8has27a4ch Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240813@142130.1645 8ksptiddl00kiivj8has27a4ch Query : use flama_phc
20240813@142130.1649 8ksptiddl00kiivj8has27a4ch Query : select no, estab,szadrsdesc from szadrs where u_coddest=4790
20240813@142130.1742 8ksptiddl00kiivj8has27a4ch Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4961.00.1'
20240813@142130.1925 8ksptiddl00kiivj8has27a4ch Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4961.00.1'
20240813@142130.1949 8ksptiddl00kiivj8has27a4ch Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4964.00.1'
20240813@142130.2123 8ksptiddl00kiivj8has27a4ch Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4962.00.1'
20240813@142130.2294 8ksptiddl00kiivj8has27a4ch Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4962.00.1'
20240813@142130.2319 8ksptiddl00kiivj8has27a4ch Query : use flama_phc
20240813@142130.2323 8ksptiddl00kiivj8has27a4ch Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240813@142130.2366 8ksptiddl00kiivj8has27a4ch Query : use flama_phc
20240813@142130.2370 8ksptiddl00kiivj8has27a4ch Query : select top 1 1 valor from td where td.ndoc = 39
20240813@142130.2414 8ksptiddl00kiivj8has27a4ch Query : use flama_phc
20240813@142130.2418 8ksptiddl00kiivj8has27a4ch 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')
20240813@142130.2462 8ksptiddl00kiivj8has27a4ch Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240813@142130.2519 8ksptiddl00kiivj8has27a4ch Query : use flama_phc
20240813@142130.2522 8ksptiddl00kiivj8has27a4ch Query : select top 1 ~inactivo valor from cl where no = '199510' and estab = 0 order by inactivo desc
20240813@142130.2673 8ksptiddl00kiivj8has27a4ch Query : use flama_phc
20240813@142130.2677 8ksptiddl00kiivj8has27a4ch Query : select top 1 tipodoc,regrd from td where ndoc = 39
20240813@142130.2717 8ksptiddl00kiivj8has27a4ch Query : use flama_phc
20240813@142130.2721 8ksptiddl00kiivj8has27a4ch Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240813@142130.2772 8ksptiddl00kiivj8has27a4ch Query : use flama_phc
20240813@142130.2776 8ksptiddl00kiivj8has27a4ch Query : select szadrsstamp valor from szadrs where szadrsdesc='199510 - cdnogueira regedoura'
20240813@142130.2834 8ksptiddl00kiivj8has27a4ch Query : use flama_phc
20240813@142130.2839 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from td where ndoc = 39
20240813@142130.2866 8ksptiddl00kiivj8has27a4ch Query : select top 1 manternumero, tiposaft, nmdos,td.assinadoc from td where td.ndoc = 39
20240813@142130.2890 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.2912 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft' and documentnumber = 39
20240813@142130.2934 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.2952 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft2' and documentnumber = 39
20240813@142130.2996 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.3020 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft3' and documentnumber = 39
20240813@142130.3050 8ksptiddl00kiivj8has27a4ch Query : select top 1 ft.fno valor from ft ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240813@142130.3149 8ksptiddl00kiivj8has27a4ch Query : select top 1 ft.fno valor from wsftdata ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240813@142130.3184 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.3206 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft3' and documentnumber = 39
20240813@142130.3229 8ksptiddl00kiivj8has27a4ch Query : insert into wsft3data (ft3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,taxpointdt ) values ('aut66bb58091966bb5dda4a' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?)
20240813@142130.3584 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.3606 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft2' and documentnumber = 39
20240813@142130.3647 8ksptiddl00kiivj8has27a4ch Query : select top 1 bo.u_nomeenv valor from bo where bo.bostamp=''
20240813@142130.3667 8ksptiddl00kiivj8has27a4ch Query : select top 1 bo.u_moradaen valor from bo where bo.bostamp=''
20240813@142130.3684 8ksptiddl00kiivj8has27a4ch Query : select top 1 bo.u_codposen valor from bo where bo.bostamp=''
20240813@142130.3698 8ksptiddl00kiivj8has27a4ch Query : select top 1 bo.u_localenv valor from bo where bo.bostamp=''
20240813@142130.3712 8ksptiddl00kiivj8has27a4ch Query : select top 1 bo.trab5 valor from bo where bo.bostamp=''
20240813@142130.3729 8ksptiddl00kiivj8has27a4ch Query : select top 1 bo.serie valor from bo where bo.bostamp=''
20240813@142130.3743 8ksptiddl00kiivj8has27a4ch Query : insert into wsft2data (ft2stamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,u_nomeenv ,u_moradaen ,u_codposen ,u_localenv ,u_coddest ,u_codby ) values ('aut66bb58091966bb5dda4a',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?,?,?,?,?,?)
20240813@142130.4172 8ksptiddl00kiivj8has27a4ch Query : select top 1 fno valor from wsftdata order by fno desc
20240813@142130.4194 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.4214 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft' and documentnumber = 39
20240813@142130.4245 8ksptiddl00kiivj8has27a4ch Query : select 'normal' from dummy
20240813@142130.4265 8ksptiddl00kiivj8has27a4ch Query : insert into wsftdata (ftstamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,fno,no,estab,fdata,ndoc,moeda,cambio,cambiofixo,ftano,site ,classe ) values ('aut66bb58091966bb5dda4a',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',330,199510,0,'2024-08-13',39,'euro',0,0,2024 ,?,?)
20240813@142130.5685 8ksptiddl00kiivj8has27a4ch Query : use flama_phc
20240813@142130.5690 8ksptiddl00kiivj8has27a4ch Query : select st.usalote valor from st where st.ref = '324.4961.00.1'
20240813@142130.5720 8ksptiddl00kiivj8has27a4ch 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.4961.00.1'
20240813@142130.5900 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.5920 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@142130.5951 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.5968 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@142130.5979 8ksptiddl00kiivj8has27a4ch Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240813@142130.5993 8ksptiddl00kiivj8has27a4ch Query : select sestamp valor from se where ref ='324.4961.00.1' and lote = 'r2101092200a'
20240813@142130.6015 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.6033 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@142130.6047 8ksptiddl00kiivj8has27a4ch Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66bb58193266bb5dda92','aut66bb58091966bb5dda4a' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240813@142130.6052 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.6068 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@142130.6102 8ksptiddl00kiivj8has27a4ch Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66bb58193266bb5dda92',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',60.000 ,'aut66bb58091966bb5dda4a' ,0,0 ,2,23.00,10000,?,?,?,?)
20240813@142130.6391 8ksptiddl00kiivj8has27a4ch Query : use flama_phc
20240813@142130.6395 8ksptiddl00kiivj8has27a4ch Query : select st.usalote valor from st where st.ref = '324.4961.00.1'
20240813@142130.6425 8ksptiddl00kiivj8has27a4ch 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.4961.00.1'
20240813@142130.6443 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.6462 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@142130.6492 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.6509 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@142130.6519 8ksptiddl00kiivj8has27a4ch Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240813@142130.6533 8ksptiddl00kiivj8has27a4ch Query : select sestamp valor from se where ref ='324.4961.00.1' and lote = 'r2101092200a'
20240813@142130.6548 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.6564 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@142130.6580 8ksptiddl00kiivj8has27a4ch Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66bb53409966bb5dda9f','aut66bb58091966bb5dda4a' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240813@142130.6586 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.6604 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@142130.6639 8ksptiddl00kiivj8has27a4ch Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66bb53409966bb5dda9f',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',24.000 ,'aut66bb58091966bb5dda4a' ,0,0 ,2,23.00,20000,?,?,?,?)
20240813@142130.6899 8ksptiddl00kiivj8has27a4ch Query : use flama_phc
20240813@142130.6904 8ksptiddl00kiivj8has27a4ch Query : select st.usalote valor from st where st.ref = '324.4964.00.1'
20240813@142130.6929 8ksptiddl00kiivj8has27a4ch 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.4964.00.1'
20240813@142130.7091 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.7111 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@142130.7141 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.7159 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@142130.7170 8ksptiddl00kiivj8has27a4ch Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240813@142130.7184 8ksptiddl00kiivj8has27a4ch Query : select sestamp valor from se where ref ='324.4964.00.1' and lote = 'r2300717100a'
20240813@142130.7206 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.7222 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@142130.7236 8ksptiddl00kiivj8has27a4ch Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66bb56853066bb5ddaaf','aut66bb58091966bb5dda4a' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240813@142130.7241 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.7257 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@142130.7291 8ksptiddl00kiivj8has27a4ch Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66bb56853066bb5ddaaf',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',20.000 ,'aut66bb58091966bb5dda4a' ,0,0 ,2,23.00,30000,?,?,?,?)
20240813@142130.7550 8ksptiddl00kiivj8has27a4ch Query : use flama_phc
20240813@142130.7554 8ksptiddl00kiivj8has27a4ch Query : select st.usalote valor from st where st.ref = '324.4962.00.1'
20240813@142130.7577 8ksptiddl00kiivj8has27a4ch 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.4962.00.1'
20240813@142130.7735 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.7753 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@142130.7785 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.7801 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@142130.7811 8ksptiddl00kiivj8has27a4ch Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240813@142130.7824 8ksptiddl00kiivj8has27a4ch Query : select sestamp valor from se where ref ='324.4962.00.1' and lote = 'r2101092100a'
20240813@142130.7842 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.7858 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@142130.7873 8ksptiddl00kiivj8has27a4ch Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66bb55826566bb5ddabf','aut66bb58091966bb5dda4a' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240813@142130.7879 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.7896 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@142130.7929 8ksptiddl00kiivj8has27a4ch Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66bb55826566bb5ddabf',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',88.000 ,'aut66bb58091966bb5dda4a' ,0,0 ,2,23.00,40000,?,?,?,?)
20240813@142130.8334 8ksptiddl00kiivj8has27a4ch Query : use flama_phc
20240813@142130.8377 8ksptiddl00kiivj8has27a4ch Query : select st.usalote valor from st where st.ref = '324.4962.00.1'
20240813@142130.8437 8ksptiddl00kiivj8has27a4ch 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.4962.00.1'
20240813@142130.8452 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.8472 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@142130.8504 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.8520 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@142130.8530 8ksptiddl00kiivj8has27a4ch Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240813@142130.8545 8ksptiddl00kiivj8has27a4ch Query : select sestamp valor from se where ref ='324.4962.00.1' and lote = 'r2101092100a'
20240813@142130.8560 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.8577 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@142130.8590 8ksptiddl00kiivj8has27a4ch Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66bb54857866bb5ddad0','aut66bb58091966bb5dda4a' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240813@142130.8596 8ksptiddl00kiivj8has27a4ch Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@142130.8613 8ksptiddl00kiivj8has27a4ch Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@142130.8648 8ksptiddl00kiivj8has27a4ch Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66bb54857866bb5ddad0',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',28.000 ,'aut66bb58091966bb5dda4a' ,0,0 ,2,23.00,50000,?,?,?,?)
20240813@142130.8912 8ksptiddl00kiivj8has27a4ch Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66bb58091966bb5dda4a','2405388','wait',39,'adm09112754980.682000002')
20240813@142130.9009 8ksptiddl00kiivj8has27a4ch Query : use flama_phc
20240813@142130.9014 8ksptiddl00kiivj8has27a4ch Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240813@142130.9047 8ksptiddl00kiivj8has27a4ch Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1514';
20240813@142130.9079 8ksptiddl00kiivj8has27a4ch Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1514';
20240813@142130.9120 8ksptiddl00kiivj8has27a4ch Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1514';
20240813@142130.9147 8ksptiddl00kiivj8has27a4ch Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1514';

20240813@155153.1254 b497aqumpp14tcirjs0dsqjcoq Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1515';
20240813@155153.1311 b497aqumpp14tcirjs0dsqjcoq Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1515';
20240813@155153.1338 b497aqumpp14tcirjs0dsqjcoq Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1515';
20240813@155153.1377 b497aqumpp14tcirjs0dsqjcoq Query : use flama_phc
20240813@155153.1381 b497aqumpp14tcirjs0dsqjcoq Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240813@155153.1489 b497aqumpp14tcirjs0dsqjcoq Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1805.00.1'
20240813@155153.1625 b497aqumpp14tcirjs0dsqjcoq 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 = 2400291 and bi.ref ='324.1805.00.1' and bi.lordem =20000
20240813@155153.1980 b497aqumpp14tcirjs0dsqjcoq 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 = 'cps24031443926,582000002 ' 
20240813@155153.2316 b497aqumpp14tcirjs0dsqjcoq Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1805.00.1'
20240813@155153.2340 b497aqumpp14tcirjs0dsqjcoq 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 = 2400291 and bi.ref ='324.1805.00.1' and bi.lordem =20000
20240813@155153.2366 b497aqumpp14tcirjs0dsqjcoq 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 = 'cps24031443926,582000002 ' 
20240813@155153.2404 b497aqumpp14tcirjs0dsqjcoq Query : use flama_phc
20240813@155153.2408 b497aqumpp14tcirjs0dsqjcoq Query : select top 1 1 valor from ts where ts.ndos = 61
20240813@155153.2536 b497aqumpp14tcirjs0dsqjcoq Query : use flama_phc
20240813@155153.2539 b497aqumpp14tcirjs0dsqjcoq 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')
20240813@155153.2611 b497aqumpp14tcirjs0dsqjcoq 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
20240813@155153.2793 b497aqumpp14tcirjs0dsqjcoq Query : use flama_phc
20240813@155153.2797 b497aqumpp14tcirjs0dsqjcoq Query : select top 1 ~inactivo valor from fl where no = '202241' and estab = 00 order by inactivo desc
20240813@155153.2935 b497aqumpp14tcirjs0dsqjcoq Query : use flama_phc
20240813@155153.2939 b497aqumpp14tcirjs0dsqjcoq Query : select 1 valor from ts where ndos = 61
20240813@155153.3030 b497aqumpp14tcirjs0dsqjcoq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@155153.3329 b497aqumpp14tcirjs0dsqjcoq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240813@155153.3391 b497aqumpp14tcirjs0dsqjcoq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@155153.3408 b497aqumpp14tcirjs0dsqjcoq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240813@155153.3419 b497aqumpp14tcirjs0dsqjcoq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@155153.3438 b497aqumpp14tcirjs0dsqjcoq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240813@155153.3451 b497aqumpp14tcirjs0dsqjcoq 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
20240813@155153.3617 b497aqumpp14tcirjs0dsqjcoq Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240813@155153.3784 b497aqumpp14tcirjs0dsqjcoq Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240813@155153.3809 b497aqumpp14tcirjs0dsqjcoq Query : use flama_phc
20240813@155153.3817 b497aqumpp14tcirjs0dsqjcoq Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202241' and estab=00
20240813@155153.3929 b497aqumpp14tcirjs0dsqjcoq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@155153.3950 b497aqumpp14tcirjs0dsqjcoq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240813@155153.3997 b497aqumpp14tcirjs0dsqjcoq Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66bb76569666bb73095c',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240813@155153.4074 b497aqumpp14tcirjs0dsqjcoq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@155153.4094 b497aqumpp14tcirjs0dsqjcoq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240813@155153.4110 b497aqumpp14tcirjs0dsqjcoq Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66bb76569666bb73095c','--','bo',7.8631578947368421052 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240813@155153.4401 b497aqumpp14tcirjs0dsqjcoq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@155153.4458 b497aqumpp14tcirjs0dsqjcoq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240813@155153.4477 b497aqumpp14tcirjs0dsqjcoq 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 ('aut66bb76569666bb73095c','guia r. fornecedor','2024-08-13',61,2402306,?,?,?,?,?,?,?,?,2024, (select valor from para1 where descricao = 'ge_euro') ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240813@155153.6840 b497aqumpp14tcirjs0dsqjcoq Query : use flama_phc
20240813@155153.6845 b497aqumpp14tcirjs0dsqjcoq Query : select st.usalote valor from st where st.ref = '324.1805.00.1'
20240813@155153.6881 b497aqumpp14tcirjs0dsqjcoq 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.1805.00.1'
20240813@155153.7050 b497aqumpp14tcirjs0dsqjcoq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@155153.7070 b497aqumpp14tcirjs0dsqjcoq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240813@155153.7089 b497aqumpp14tcirjs0dsqjcoq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@155153.7106 b497aqumpp14tcirjs0dsqjcoq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240813@155153.7117 b497aqumpp14tcirjs0dsqjcoq Query : select sestamp valor from se where ref ='324.1805.00.1' and lote = 'r2400291200a'
20240813@155153.7142 b497aqumpp14tcirjs0dsqjcoq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@155153.7158 b497aqumpp14tcirjs0dsqjcoq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240813@155153.7170 b497aqumpp14tcirjs0dsqjcoq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@155153.7187 b497aqumpp14tcirjs0dsqjcoq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240813@155153.7202 b497aqumpp14tcirjs0dsqjcoq Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66bb74000966bb7309af',?,?,'20240813',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240813@155153.7291 b497aqumpp14tcirjs0dsqjcoq Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240813@155153.7336 b497aqumpp14tcirjs0dsqjcoq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@155153.7375 b497aqumpp14tcirjs0dsqjcoq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240813@155153.7391 b497aqumpp14tcirjs0dsqjcoq Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut66bb71560466bb7309b3','aut66bb76569666bb73095c',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 = 'aut66bb76569666bb73095c'
20240813@155153.7568 b497aqumpp14tcirjs0dsqjcoq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@155153.7588 b497aqumpp14tcirjs0dsqjcoq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240813@155153.7609 b497aqumpp14tcirjs0dsqjcoq 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 'aut66bb71560466bb7309b3',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 3, 3*.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 ,29.45,29.45*200.48,29.45,29.45*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,29.45*3,29.45*3*200.48 ,32.070000,32.070000*200.48 ,32.070000,32.070000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,29.45,29.45*200.48,29.45*3,29.45*3*200.48,'cps24031443926,582000002 ',231.57,231.57*3,231.57,231.57*3,?,?,?,4 from bo bo where bo.bostamp = 'aut66bb76569666bb73095c'
20240813@155153.8365 b497aqumpp14tcirjs0dsqjcoq Query : use flama_phc
20240813@155153.8369 b497aqumpp14tcirjs0dsqjcoq Query : select st.usalote valor from st where st.ref = '324.1805.00.1'
20240813@155153.8394 b497aqumpp14tcirjs0dsqjcoq 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.1805.00.1'
20240813@155153.8410 b497aqumpp14tcirjs0dsqjcoq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@155153.8429 b497aqumpp14tcirjs0dsqjcoq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240813@155153.8445 b497aqumpp14tcirjs0dsqjcoq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@155153.8464 b497aqumpp14tcirjs0dsqjcoq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240813@155153.8474 b497aqumpp14tcirjs0dsqjcoq Query : select sestamp valor from se where ref ='324.1805.00.1' and lote = 'r2400291200a'
20240813@155153.8492 b497aqumpp14tcirjs0dsqjcoq Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240813@155153.8508 b497aqumpp14tcirjs0dsqjcoq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@155153.8526 b497aqumpp14tcirjs0dsqjcoq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240813@155153.8540 b497aqumpp14tcirjs0dsqjcoq Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut66bb75121966bb7309cf','aut66bb76569666bb73095c',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 = 'aut66bb76569666bb73095c'
20240813@155153.8734 b497aqumpp14tcirjs0dsqjcoq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@155153.8755 b497aqumpp14tcirjs0dsqjcoq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240813@155153.8777 b497aqumpp14tcirjs0dsqjcoq 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 'aut66bb75121966bb7309cf',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 915, 915*.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.45,29.45*200.48,29.45,29.45*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,29.45*915,29.45*915*200.48 ,32.063000,32.063000*200.48 ,32.063000,32.063000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,29.45,29.45*200.48,29.45*915,29.45*915*200.48,'cps24031443926,582000002 ',231.57,231.57*915,231.57,231.57*915,?,?,?,4 from bo bo where bo.bostamp = 'aut66bb76569666bb73095c'
20240813@155153.9339 b497aqumpp14tcirjs0dsqjcoq Query : use flama_phc
20240813@155153.9344 b497aqumpp14tcirjs0dsqjcoq Query : declare @bostamp varchar(25) = 'aut66bb76569666bb73095c' ,@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 
20240813@155154.1211 b497aqumpp14tcirjs0dsqjcoq Query : use flama_phc
20240813@155154.1215 b497aqumpp14tcirjs0dsqjcoq Query : select 1 valor from bo where bo.bostamp = 'aut66bb76569666bb73095c'
20240813@155154.1237 b497aqumpp14tcirjs0dsqjcoq 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) = 'aut66bb76569666bb73095c' 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 
20240813@155154.4247 b497aqumpp14tcirjs0dsqjcoq Query : use flama_phc
20240813@155154.4252 b497aqumpp14tcirjs0dsqjcoq Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240813@155154.4317 b497aqumpp14tcirjs0dsqjcoq Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1515';
20240813@155154.4351 b497aqumpp14tcirjs0dsqjcoq Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1515';
20240813@160653.6276 8ptd79aoh4a0q52jdbp8b1g9k1 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240813@160653.6291 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240813@160653.6347 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1516';
20240813@160653.6406 8ptd79aoh4a0q52jdbp8b1g9k1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1516';
20240813@160653.6458 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1516';
20240813@160653.6484 8ptd79aoh4a0q52jdbp8b1g9k1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1516';
20240813@160653.6522 8ptd79aoh4a0q52jdbp8b1g9k1 Query : use flama_phc
20240813@160653.6525 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240813@160653.6592 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.736.00.01'
20240813@160653.6728 8ptd79aoh4a0q52jdbp8b1g9k1 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 = 2400239 and bi.ref ='324.736.00.01' and bi.lordem =30000
20240813@160653.7070 8ptd79aoh4a0q52jdbp8b1g9k1 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 = 'cps24022944925,719000003 ' 
20240813@160653.7460 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.727.00.01'
20240813@160653.7594 8ptd79aoh4a0q52jdbp8b1g9k1 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 = 2400239 and bi.ref ='324.727.00.01' and bi.lordem =20000
20240813@160653.7949 8ptd79aoh4a0q52jdbp8b1g9k1 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 = 'cps24022944866,775000002 ' 
20240813@160653.8284 8ptd79aoh4a0q52jdbp8b1g9k1 Query : use flama_phc
20240813@160653.8288 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select top 1 1 valor from ts where ts.ndos = 61
20240813@160653.8322 8ptd79aoh4a0q52jdbp8b1g9k1 Query : use flama_phc
20240813@160653.8326 8ptd79aoh4a0q52jdbp8b1g9k1 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')
20240813@160653.8359 8ptd79aoh4a0q52jdbp8b1g9k1 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
20240813@160653.8409 8ptd79aoh4a0q52jdbp8b1g9k1 Query : use flama_phc
20240813@160653.8413 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select top 1 ~inactivo valor from fl where no = '202315' and estab = 00 order by inactivo desc
20240813@160653.8550 8ptd79aoh4a0q52jdbp8b1g9k1 Query : use flama_phc
20240813@160653.8554 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select 1 valor from ts where ndos = 61
20240813@160653.8570 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@160653.8591 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240813@160653.8602 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@160653.8618 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240813@160653.8629 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@160653.8659 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240813@160653.8670 8ptd79aoh4a0q52jdbp8b1g9k1 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
20240813@160653.8690 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240813@160653.8712 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240813@160653.8732 8ptd79aoh4a0q52jdbp8b1g9k1 Query : use flama_phc
20240813@160653.8739 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202315' and estab=00
20240813@160653.8842 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@160653.8859 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240813@160653.8874 8ptd79aoh4a0q52jdbp8b1g9k1 Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66bb71901566bb768dd5',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240813@160653.8880 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@160653.8897 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240813@160653.8911 8ptd79aoh4a0q52jdbp8b1g9k1 Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66bb71901566bb768dd5','--','bo',7.8173913043478260869 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240813@160653.8916 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@160653.8932 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240813@160653.8947 8ptd79aoh4a0q52jdbp8b1g9k1 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 ('aut66bb71901566bb768dd5','guia r. fornecedor','2024-08-13',61,2402307,?,?,?,?,?,?,?,?,2024, (select valor from para1 where descricao = 'ge_euro') ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240813@160653.9451 8ptd79aoh4a0q52jdbp8b1g9k1 Query : use flama_phc
20240813@160653.9456 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select st.usalote valor from st where st.ref = '324.736.00.01'
20240813@160653.9486 8ptd79aoh4a0q52jdbp8b1g9k1 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.736.00.01'
20240813@160653.9740 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@160653.9759 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240813@160653.9774 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@160653.9793 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240813@160653.9804 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select sestamp valor from se where ref ='324.736.00.01' and lote = 'r2400239300a'
20240813@160653.9827 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@160653.9843 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240813@160653.9854 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@160653.9871 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240813@160653.9888 8ptd79aoh4a0q52jdbp8b1g9k1 Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66bb71685066bb768df0',?,?,'20240813',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240813@160653.9953 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240813@160653.9969 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@160653.9988 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240813@160654.2000 8ptd79aoh4a0q52jdbp8b1g9k1 Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut66bb76120366bb768df3','aut66bb71901566bb768dd5',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 = 'aut66bb71901566bb768dd5'
20240813@160654.1810 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@160654.2070 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240813@160654.2300 8ptd79aoh4a0q52jdbp8b1g9k1 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 'aut66bb76120366bb768df3',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 3900, 3900*.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 ,7.892658509455,7.892658509455*200.48,7.892658509455,7.892658509455*200.48 ,0,0,'un',' ' ,bo.marcada,1 ,7.892658509455*3900,7.892658509455*3900*200.48 ,9.430000,9.430000*200.48 ,9.430000,9.430000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,7.892658509455,7.892658509455*200.48,7.892658509455*3900,7.892658509455*3900*200.48,'cps24022944925,719000003 ',61.7,61.7*3900,61.7,61.7*3900,?,?,?,4 from bo bo where bo.bostamp = 'aut66bb71901566bb768dd5'
20240813@160654.1066 8ptd79aoh4a0q52jdbp8b1g9k1 Query : use flama_phc
20240813@160654.1071 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select st.usalote valor from st where st.ref = '324.727.00.01'
20240813@160654.1097 8ptd79aoh4a0q52jdbp8b1g9k1 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.727.00.01'
20240813@160654.1271 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@160654.1295 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240813@160654.1311 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@160654.1329 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240813@160654.1342 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select sestamp valor from se where ref ='324.727.00.01' and lote = 'r2400239200a'
20240813@160654.1366 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@160654.1384 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240813@160654.1395 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@160654.1414 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240813@160654.1428 8ptd79aoh4a0q52jdbp8b1g9k1 Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66bb74998166bb768e22',?,?,'20240813',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240813@160654.1499 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240813@160654.1516 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@160654.1533 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240813@160654.1548 8ptd79aoh4a0q52jdbp8b1g9k1 Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut66bb77885466bb768e25','aut66bb71901566bb768dd5',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 = 'aut66bb71901566bb768dd5'
20240813@160654.1724 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@160654.1751 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240813@160654.1771 8ptd79aoh4a0q52jdbp8b1g9k1 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 'aut66bb77885466bb768e25',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 3100, 3100*.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 ,5.75,5.75*200.48,5.75,5.75*200.48 ,0,0,'un ','' ,bo.marcada,1 ,5.75*3100,5.75*3100*200.48 ,6.660000,6.660000*200.48 ,6.660000,6.660000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,5.75,5.75*200.48,5.75*3100,5.75*3100*200.48,'cps24022944866,775000002 ',44.95,44.95*3100,44.95,44.95*3100,?,?,?,4 from bo bo where bo.bostamp = 'aut66bb71901566bb768dd5'
20240813@160654.2459 8ptd79aoh4a0q52jdbp8b1g9k1 Query : use flama_phc
20240813@160654.2464 8ptd79aoh4a0q52jdbp8b1g9k1 Query : declare @bostamp varchar(25) = 'aut66bb71901566bb768dd5' ,@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 
20240813@160654.8655 8ptd79aoh4a0q52jdbp8b1g9k1 Query : use flama_phc
20240813@160654.8685 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select 1 valor from bo where bo.bostamp = 'aut66bb71901566bb768dd5'
20240813@160654.8954 8ptd79aoh4a0q52jdbp8b1g9k1 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) = 'aut66bb71901566bb768dd5' 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 
20240813@160655.6291 8ptd79aoh4a0q52jdbp8b1g9k1 Query : use flama_phc
20240813@160655.6296 8ptd79aoh4a0q52jdbp8b1g9k1 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240813@160655.6352 8ptd79aoh4a0q52jdbp8b1g9k1 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1516';
20240813@160655.6383 8ptd79aoh4a0q52jdbp8b1g9k1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1516';

20240813@174332.3526 lmjrq780ft6dic7c6kebbij9o0 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1517';
20240813@174332.3596 lmjrq780ft6dic7c6kebbij9o0 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1517';
20240813@174332.3628 lmjrq780ft6dic7c6kebbij9o0 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1517';
20240813@174332.3690 lmjrq780ft6dic7c6kebbij9o0 Query : use flama_phc
20240813@174332.3702 lmjrq780ft6dic7c6kebbij9o0 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240813@174332.3775 lmjrq780ft6dic7c6kebbij9o0 Query : use flama_phc
20240813@174332.3778 lmjrq780ft6dic7c6kebbij9o0 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240813@174332.3926 lmjrq780ft6dic7c6kebbij9o0 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.4860.00.1'
20240813@174332.4103 lmjrq780ft6dic7c6kebbij9o0 Query : use flama_phc
20240813@174332.4107 lmjrq780ft6dic7c6kebbij9o0 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240813@174332.4305 lmjrq780ft6dic7c6kebbij9o0 Query : use flama_phc
20240813@174332.4309 lmjrq780ft6dic7c6kebbij9o0 Query : select top 1 1 valor from td where td.ndoc = 39
20240813@174332.4413 lmjrq780ft6dic7c6kebbij9o0 Query : use flama_phc
20240813@174332.4417 lmjrq780ft6dic7c6kebbij9o0 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')
20240813@174332.4454 lmjrq780ft6dic7c6kebbij9o0 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240813@174332.4609 lmjrq780ft6dic7c6kebbij9o0 Query : use flama_phc
20240813@174332.4613 lmjrq780ft6dic7c6kebbij9o0 Query : select top 1 ~inactivo valor from cl where no = '100810' and estab = 0 order by inactivo desc
20240813@174332.4754 lmjrq780ft6dic7c6kebbij9o0 Query : use flama_phc
20240813@174332.4757 lmjrq780ft6dic7c6kebbij9o0 Query : select top 1 tipodoc,regrd from td where ndoc = 39
20240813@174332.4932 lmjrq780ft6dic7c6kebbij9o0 Query : use flama_phc
20240813@174332.4937 lmjrq780ft6dic7c6kebbij9o0 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240813@174332.4985 lmjrq780ft6dic7c6kebbij9o0 Query : use flama_phc
20240813@174332.4988 lmjrq780ft6dic7c6kebbij9o0 Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240813@174332.5039 lmjrq780ft6dic7c6kebbij9o0 Query : use flama_phc
20240813@174332.5042 lmjrq780ft6dic7c6kebbij9o0 Query : select 1 valor from td where ndoc = 39
20240813@174332.5133 lmjrq780ft6dic7c6kebbij9o0 Query : select top 1 manternumero, tiposaft, nmdos,td.assinadoc from td where td.ndoc = 39
20240813@174332.5203 lmjrq780ft6dic7c6kebbij9o0 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174332.5223 lmjrq780ft6dic7c6kebbij9o0 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft' and documentnumber = 39
20240813@174332.5248 lmjrq780ft6dic7c6kebbij9o0 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174332.5264 lmjrq780ft6dic7c6kebbij9o0 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft2' and documentnumber = 39
20240813@174332.5300 lmjrq780ft6dic7c6kebbij9o0 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174332.5320 lmjrq780ft6dic7c6kebbij9o0 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft3' and documentnumber = 39
20240813@174332.5337 lmjrq780ft6dic7c6kebbij9o0 Query : select top 1 ft.fno valor from ft ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240813@174332.5600 lmjrq780ft6dic7c6kebbij9o0 Query : select top 1 ft.fno valor from wsftdata ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240813@174332.5705 lmjrq780ft6dic7c6kebbij9o0 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174332.5728 lmjrq780ft6dic7c6kebbij9o0 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft3' and documentnumber = 39
20240813@174332.5750 lmjrq780ft6dic7c6kebbij9o0 Query : insert into wsft3data (ft3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,taxpointdt ) values ('aut66bb88369066bb8d3482' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?)
20240813@174332.5943 lmjrq780ft6dic7c6kebbij9o0 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174332.5965 lmjrq780ft6dic7c6kebbij9o0 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft2' and documentnumber = 39
20240813@174332.6006 lmjrq780ft6dic7c6kebbij9o0 Query : select top 1 bo.u_nomeenv valor from bo where bo.bostamp=''
20240813@174332.6113 lmjrq780ft6dic7c6kebbij9o0 Query : select top 1 bo.u_moradaen valor from bo where bo.bostamp=''
20240813@174332.6205 lmjrq780ft6dic7c6kebbij9o0 Query : select top 1 bo.u_codposen valor from bo where bo.bostamp=''
20240813@174332.6280 lmjrq780ft6dic7c6kebbij9o0 Query : select top 1 bo.u_localenv valor from bo where bo.bostamp=''
20240813@174332.6352 lmjrq780ft6dic7c6kebbij9o0 Query : select top 1 bo.trab5 valor from bo where bo.bostamp=''
20240813@174332.6433 lmjrq780ft6dic7c6kebbij9o0 Query : select top 1 bo.serie valor from bo where bo.bostamp=''
20240813@174332.6510 lmjrq780ft6dic7c6kebbij9o0 Query : insert into wsft2data (ft2stamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,u_nomeenv ,u_moradaen ,u_codposen ,u_localenv ,u_coddest ,u_codby ) values ('aut66bb88369066bb8d3482',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?,?,?,?,?,?)
20240813@174332.6762 lmjrq780ft6dic7c6kebbij9o0 Query : select top 1 fno valor from wsftdata order by fno desc
20240813@174332.6856 lmjrq780ft6dic7c6kebbij9o0 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174332.6876 lmjrq780ft6dic7c6kebbij9o0 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft' and documentnumber = 39
20240813@174332.6904 lmjrq780ft6dic7c6kebbij9o0 Query : select 'normal' from dummy
20240813@174332.6941 lmjrq780ft6dic7c6kebbij9o0 Query : insert into wsftdata (ftstamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,fno,no,estab,fdata,ndoc,moeda,cambio,cambiofixo,ftano,site ,classe ) values ('aut66bb88369066bb8d3482',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',331,100810,0,'2024-08-13',39,'euro',0,0,2024 ,?,?)
20240813@174332.8004 lmjrq780ft6dic7c6kebbij9o0 Query : use flama_phc
20240813@174332.8343 lmjrq780ft6dic7c6kebbij9o0 Query : select st.usalote valor from st where st.ref = '304.4860.00.1'
20240813@174332.8376 lmjrq780ft6dic7c6kebbij9o0 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 = '304.4860.00.1'
20240813@174332.8551 lmjrq780ft6dic7c6kebbij9o0 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174332.8580 lmjrq780ft6dic7c6kebbij9o0 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@174332.8610 lmjrq780ft6dic7c6kebbij9o0 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174332.8626 lmjrq780ft6dic7c6kebbij9o0 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@174332.8637 lmjrq780ft6dic7c6kebbij9o0 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240813@174332.8650 lmjrq780ft6dic7c6kebbij9o0 Query : select sestamp valor from se where ref ='304.4860.00.1' and lote = '241006'
20240813@174332.8709 lmjrq780ft6dic7c6kebbij9o0 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174332.8731 lmjrq780ft6dic7c6kebbij9o0 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@174332.8819 lmjrq780ft6dic7c6kebbij9o0 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66bb81603266bb8d34d4','aut66bb88369066bb8d3482' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240813@174332.8865 lmjrq780ft6dic7c6kebbij9o0 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174332.8883 lmjrq780ft6dic7c6kebbij9o0 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@174332.8919 lmjrq780ft6dic7c6kebbij9o0 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66bb81603266bb8d34d4',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',28.000 ,'aut66bb88369066bb8d3482' ,0,0 ,2,23.00,10000,?,?,?,?)
20240813@174332.9186 lmjrq780ft6dic7c6kebbij9o0 Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66bb88369066bb8d3482','2405370','wait',39,'adm09112754980.682000002')
20240813@174332.9282 lmjrq780ft6dic7c6kebbij9o0 Query : use flama_phc
20240813@174332.9286 lmjrq780ft6dic7c6kebbij9o0 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240813@174332.9318 lmjrq780ft6dic7c6kebbij9o0 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1517';
20240813@174332.9347 lmjrq780ft6dic7c6kebbij9o0 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1517';
20240813@174332.9388 lmjrq780ft6dic7c6kebbij9o0 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1517';
20240813@174332.9420 lmjrq780ft6dic7c6kebbij9o0 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1517';
20240813@174332.9986 rel5r6raeaih2jpi58al3kf5kl Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240813@174333.0000 rel5r6raeaih2jpi58al3kf5kl Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240813@174333.7000 rel5r6raeaih2jpi58al3kf5kl Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1518';
20240813@174333.1270 rel5r6raeaih2jpi58al3kf5kl Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1518';
20240813@174333.1830 rel5r6raeaih2jpi58al3kf5kl Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1518';
20240813@174333.2090 rel5r6raeaih2jpi58al3kf5kl Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1518';
20240813@174333.2640 rel5r6raeaih2jpi58al3kf5kl Query : use flama_phc
20240813@174333.2670 rel5r6raeaih2jpi58al3kf5kl Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240813@174333.3360 rel5r6raeaih2jpi58al3kf5kl Query : use flama_phc
20240813@174333.3400 rel5r6raeaih2jpi58al3kf5kl Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240813@174333.3830 rel5r6raeaih2jpi58al3kf5kl Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2221.00.1'
20240813@174333.5950 rel5r6raeaih2jpi58al3kf5kl Query : use flama_phc
20240813@174333.6000 rel5r6raeaih2jpi58al3kf5kl Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240813@174333.6450 rel5r6raeaih2jpi58al3kf5kl Query : use flama_phc
20240813@174333.6490 rel5r6raeaih2jpi58al3kf5kl Query : select top 1 1 valor from td where td.ndoc = 39
20240813@174333.6910 rel5r6raeaih2jpi58al3kf5kl Query : use flama_phc
20240813@174333.6950 rel5r6raeaih2jpi58al3kf5kl 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')
20240813@174333.7330 rel5r6raeaih2jpi58al3kf5kl Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240813@174333.7790 rel5r6raeaih2jpi58al3kf5kl Query : use flama_phc
20240813@174333.7840 rel5r6raeaih2jpi58al3kf5kl Query : select top 1 ~inactivo valor from cl where no = '100810' and estab = 0 order by inactivo desc
20240813@174333.8220 rel5r6raeaih2jpi58al3kf5kl Query : use flama_phc
20240813@174333.8260 rel5r6raeaih2jpi58al3kf5kl Query : select top 1 tipodoc,regrd from td where ndoc = 39
20240813@174333.8610 rel5r6raeaih2jpi58al3kf5kl Query : use flama_phc
20240813@174333.8650 rel5r6raeaih2jpi58al3kf5kl Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240813@174333.9190 rel5r6raeaih2jpi58al3kf5kl Query : use flama_phc
20240813@174333.9230 rel5r6raeaih2jpi58al3kf5kl Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240813@174333.9790 rel5r6raeaih2jpi58al3kf5kl Query : use flama_phc
20240813@174333.9830 rel5r6raeaih2jpi58al3kf5kl Query : select 1 valor from td where ndoc = 39
20240813@174333.1000 rel5r6raeaih2jpi58al3kf5kl Query : select top 1 manternumero, tiposaft, nmdos,td.assinadoc from td where td.ndoc = 39
20240813@174333.1020 rel5r6raeaih2jpi58al3kf5kl Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.1042 rel5r6raeaih2jpi58al3kf5kl Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft' and documentnumber = 39
20240813@174333.1070 rel5r6raeaih2jpi58al3kf5kl Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.1089 rel5r6raeaih2jpi58al3kf5kl Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft2' and documentnumber = 39
20240813@174333.1128 rel5r6raeaih2jpi58al3kf5kl Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.1148 rel5r6raeaih2jpi58al3kf5kl Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft3' and documentnumber = 39
20240813@174333.1165 rel5r6raeaih2jpi58al3kf5kl Query : select top 1 ft.fno valor from ft ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240813@174333.1246 rel5r6raeaih2jpi58al3kf5kl Query : select top 1 ft.fno valor from wsftdata ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240813@174333.1265 rel5r6raeaih2jpi58al3kf5kl Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.1287 rel5r6raeaih2jpi58al3kf5kl Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft3' and documentnumber = 39
20240813@174333.1309 rel5r6raeaih2jpi58al3kf5kl Query : insert into wsft3data (ft3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,taxpointdt ) values ('aut66bb83687066bb8d351c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?)
20240813@174333.1514 rel5r6raeaih2jpi58al3kf5kl Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.1813 rel5r6raeaih2jpi58al3kf5kl Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft2' and documentnumber = 39
20240813@174333.1943 rel5r6raeaih2jpi58al3kf5kl Query : select top 1 bo.u_nomeenv valor from bo where bo.bostamp=''
20240813@174333.1957 rel5r6raeaih2jpi58al3kf5kl Query : select top 1 bo.u_moradaen valor from bo where bo.bostamp=''
20240813@174333.1971 rel5r6raeaih2jpi58al3kf5kl Query : select top 1 bo.u_codposen valor from bo where bo.bostamp=''
20240813@174333.2046 rel5r6raeaih2jpi58al3kf5kl Query : select top 1 bo.u_localenv valor from bo where bo.bostamp=''
20240813@174333.2061 rel5r6raeaih2jpi58al3kf5kl Query : select top 1 bo.trab5 valor from bo where bo.bostamp=''
20240813@174333.2075 rel5r6raeaih2jpi58al3kf5kl Query : select top 1 bo.serie valor from bo where bo.bostamp=''
20240813@174333.2089 rel5r6raeaih2jpi58al3kf5kl Query : insert into wsft2data (ft2stamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,u_nomeenv ,u_moradaen ,u_codposen ,u_localenv ,u_coddest ,u_codby ) values ('aut66bb83687066bb8d351c',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?,?,?,?,?,?)
20240813@174333.2394 rel5r6raeaih2jpi58al3kf5kl Query : select top 1 fno valor from wsftdata order by fno desc
20240813@174333.2699 rel5r6raeaih2jpi58al3kf5kl Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.2716 rel5r6raeaih2jpi58al3kf5kl Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft' and documentnumber = 39
20240813@174333.2738 rel5r6raeaih2jpi58al3kf5kl Query : select 'normal' from dummy
20240813@174333.2753 rel5r6raeaih2jpi58al3kf5kl Query : insert into wsftdata (ftstamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,fno,no,estab,fdata,ndoc,moeda,cambio,cambiofixo,ftano,site ,classe ) values ('aut66bb83687066bb8d351c',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',332,100810,0,'2024-08-13',39,'euro',0,0,2024 ,?,?)
20240813@174333.3044 rel5r6raeaih2jpi58al3kf5kl Query : use flama_phc
20240813@174333.3047 rel5r6raeaih2jpi58al3kf5kl Query : select st.usalote valor from st where st.ref = '324.2221.00.1'
20240813@174333.3120 rel5r6raeaih2jpi58al3kf5kl 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.2221.00.1'
20240813@174333.3266 rel5r6raeaih2jpi58al3kf5kl Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.3282 rel5r6raeaih2jpi58al3kf5kl Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@174333.3307 rel5r6raeaih2jpi58al3kf5kl Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.3331 rel5r6raeaih2jpi58al3kf5kl Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@174333.3340 rel5r6raeaih2jpi58al3kf5kl Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240813@174333.3352 rel5r6raeaih2jpi58al3kf5kl Query : select sestamp valor from se where ref ='324.2221.00.1' and lote = 'r2301281300a'
20240813@174333.3365 rel5r6raeaih2jpi58al3kf5kl Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.3380 rel5r6raeaih2jpi58al3kf5kl Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@174333.3393 rel5r6raeaih2jpi58al3kf5kl Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66bb84919966bb8d3552','aut66bb83687066bb8d351c' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240813@174333.3397 rel5r6raeaih2jpi58al3kf5kl Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.3413 rel5r6raeaih2jpi58al3kf5kl Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@174333.3442 rel5r6raeaih2jpi58al3kf5kl Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66bb84919966bb8d3552',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',36.000 ,'aut66bb83687066bb8d351c' ,0,0 ,2,23.00,10000,?,?,?,?)
20240813@174333.3697 rel5r6raeaih2jpi58al3kf5kl Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66bb83687066bb8d351c','2405371','wait',39,'adm09112754980.682000002')
20240813@174333.3774 rel5r6raeaih2jpi58al3kf5kl Query : use flama_phc
20240813@174333.3778 rel5r6raeaih2jpi58al3kf5kl Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240813@174333.3810 rel5r6raeaih2jpi58al3kf5kl Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1518';
20240813@174333.3837 rel5r6raeaih2jpi58al3kf5kl Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1518';
20240813@174333.3881 rel5r6raeaih2jpi58al3kf5kl Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1518';
20240813@174333.3908 rel5r6raeaih2jpi58al3kf5kl Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1518';
20240813@174333.5836 o6videe41th3nfuaunhar3s8ii Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240813@174333.5849 o6videe41th3nfuaunhar3s8ii Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240813@174333.6107 o6videe41th3nfuaunhar3s8ii Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1519';
20240813@174333.6188 o6videe41th3nfuaunhar3s8ii Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1519';
20240813@174333.6254 o6videe41th3nfuaunhar3s8ii Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1519';
20240813@174333.6297 o6videe41th3nfuaunhar3s8ii Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1519';
20240813@174333.6363 o6videe41th3nfuaunhar3s8ii Query : use flama_phc
20240813@174333.6366 o6videe41th3nfuaunhar3s8ii Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240813@174333.6444 o6videe41th3nfuaunhar3s8ii Query : use flama_phc
20240813@174333.6448 o6videe41th3nfuaunhar3s8ii Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240813@174333.6489 o6videe41th3nfuaunhar3s8ii Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4161.00.1'
20240813@174333.6651 o6videe41th3nfuaunhar3s8ii Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4161.00.1'
20240813@174333.6673 o6videe41th3nfuaunhar3s8ii Query : use flama_phc
20240813@174333.6676 o6videe41th3nfuaunhar3s8ii Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240813@174333.6706 o6videe41th3nfuaunhar3s8ii Query : use flama_phc
20240813@174333.6710 o6videe41th3nfuaunhar3s8ii Query : select top 1 1 valor from td where td.ndoc = 39
20240813@174333.6739 o6videe41th3nfuaunhar3s8ii Query : use flama_phc
20240813@174333.6742 o6videe41th3nfuaunhar3s8ii 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')
20240813@174333.6768 o6videe41th3nfuaunhar3s8ii Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240813@174333.6801 o6videe41th3nfuaunhar3s8ii Query : use flama_phc
20240813@174333.6804 o6videe41th3nfuaunhar3s8ii Query : select top 1 ~inactivo valor from cl where no = '100810' and estab = 0 order by inactivo desc
20240813@174333.6833 o6videe41th3nfuaunhar3s8ii Query : use flama_phc
20240813@174333.6836 o6videe41th3nfuaunhar3s8ii Query : select top 1 tipodoc,regrd from td where ndoc = 39
20240813@174333.6864 o6videe41th3nfuaunhar3s8ii Query : use flama_phc
20240813@174333.6866 o6videe41th3nfuaunhar3s8ii Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240813@174333.6905 o6videe41th3nfuaunhar3s8ii Query : use flama_phc
20240813@174333.6907 o6videe41th3nfuaunhar3s8ii Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240813@174333.6973 o6videe41th3nfuaunhar3s8ii Query : use flama_phc
20240813@174333.6976 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from td where ndoc = 39
20240813@174333.6988 o6videe41th3nfuaunhar3s8ii Query : select top 1 manternumero, tiposaft, nmdos,td.assinadoc from td where td.ndoc = 39
20240813@174333.7001 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.7017 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft' and documentnumber = 39
20240813@174333.7048 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.7062 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft2' and documentnumber = 39
20240813@174333.7090 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.7103 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft3' and documentnumber = 39
20240813@174333.7115 o6videe41th3nfuaunhar3s8ii Query : select top 1 ft.fno valor from ft ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240813@174333.7184 o6videe41th3nfuaunhar3s8ii Query : select top 1 ft.fno valor from wsftdata ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240813@174333.7196 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.7214 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft3' and documentnumber = 39
20240813@174333.7229 o6videe41th3nfuaunhar3s8ii Query : insert into wsft3data (ft3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,taxpointdt ) values ('aut66bb83232966bb8d35ad' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?)
20240813@174333.7418 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.7434 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft2' and documentnumber = 39
20240813@174333.7465 o6videe41th3nfuaunhar3s8ii Query : select top 1 bo.u_nomeenv valor from bo where bo.bostamp=''
20240813@174333.7478 o6videe41th3nfuaunhar3s8ii Query : select top 1 bo.u_moradaen valor from bo where bo.bostamp=''
20240813@174333.7489 o6videe41th3nfuaunhar3s8ii Query : select top 1 bo.u_codposen valor from bo where bo.bostamp=''
20240813@174333.7501 o6videe41th3nfuaunhar3s8ii Query : select top 1 bo.u_localenv valor from bo where bo.bostamp=''
20240813@174333.7513 o6videe41th3nfuaunhar3s8ii Query : select top 1 bo.trab5 valor from bo where bo.bostamp=''
20240813@174333.7525 o6videe41th3nfuaunhar3s8ii Query : select top 1 bo.serie valor from bo where bo.bostamp=''
20240813@174333.7536 o6videe41th3nfuaunhar3s8ii Query : insert into wsft2data (ft2stamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,u_nomeenv ,u_moradaen ,u_codposen ,u_localenv ,u_coddest ,u_codby ) values ('aut66bb83232966bb8d35ad',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?,?,?,?,?,?)
20240813@174333.7780 o6videe41th3nfuaunhar3s8ii Query : select top 1 fno valor from wsftdata order by fno desc
20240813@174333.7805 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.7820 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft' and documentnumber = 39
20240813@174333.7842 o6videe41th3nfuaunhar3s8ii Query : select 'normal' from dummy
20240813@174333.7856 o6videe41th3nfuaunhar3s8ii Query : insert into wsftdata (ftstamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,fno,no,estab,fdata,ndoc,moeda,cambio,cambiofixo,ftano,site ,classe ) values ('aut66bb83232966bb8d35ad',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',333,100810,0,'2024-08-13',39,'euro',0,0,2024 ,?,?)
20240813@174333.8138 o6videe41th3nfuaunhar3s8ii Query : use flama_phc
20240813@174333.8141 o6videe41th3nfuaunhar3s8ii Query : select st.usalote valor from st where st.ref = '324.4161.00.1'
20240813@174333.8163 o6videe41th3nfuaunhar3s8ii 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.4161.00.1'
20240813@174333.8317 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.8334 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@174333.8360 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.8375 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@174333.8384 o6videe41th3nfuaunhar3s8ii Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240813@174333.8397 o6videe41th3nfuaunhar3s8ii Query : select sestamp valor from se where ref ='324.4161.00.1' and lote = 'r2100973100a'
20240813@174333.8417 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.8431 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@174333.8443 o6videe41th3nfuaunhar3s8ii Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66bb84195966bb8d35cd','aut66bb83232966bb8d35ad' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240813@174333.8447 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.8463 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@174333.8491 o6videe41th3nfuaunhar3s8ii Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66bb84195966bb8d35cd',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',9.000 ,'aut66bb83232966bb8d35ad' ,0,0 ,2,23.00,10000,?,?,?,?)
20240813@174333.8759 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.8775 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@174333.8809 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.8824 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@174333.8833 o6videe41th3nfuaunhar3s8ii Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240813@174333.8845 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.8859 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@174333.8871 o6videe41th3nfuaunhar3s8ii Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66bb81884466bb8d35d7','aut66bb83232966bb8d35ad' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240813@174333.8875 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.8889 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@174333.8920 o6videe41th3nfuaunhar3s8ii Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66bb81884466bb8d35d7',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66bb83232966bb8d35ad' ,0,0 ,2,23.00,20000,?,?,?)
20240813@174333.9200 o6videe41th3nfuaunhar3s8ii Query : use flama_phc
20240813@174333.9203 o6videe41th3nfuaunhar3s8ii Query : select st.usalote valor from st where st.ref = '324.4161.00.1'
20240813@174333.9222 o6videe41th3nfuaunhar3s8ii 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.4161.00.1'
20240813@174333.9236 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.9251 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@174333.9276 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.9291 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@174333.9300 o6videe41th3nfuaunhar3s8ii Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240813@174333.9311 o6videe41th3nfuaunhar3s8ii Query : select sestamp valor from se where ref ='324.4161.00.1' and lote = 'r2100973100a'
20240813@174333.9324 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.9337 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@174333.9349 o6videe41th3nfuaunhar3s8ii Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66bb85562566bb8d35e3','aut66bb83232966bb8d35ad' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240813@174333.9353 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.9368 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@174333.9395 o6videe41th3nfuaunhar3s8ii Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut66bb85562566bb8d35e3',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',12.000 ,'aut66bb83232966bb8d35ad' ,0,0 ,2,23.00,40000,?,?,?,?)
20240813@174333.9693 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.9710 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@174333.9738 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.9751 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@174333.9760 o6videe41th3nfuaunhar3s8ii Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240813@174333.9773 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.9787 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240813@174333.9798 o6videe41th3nfuaunhar3s8ii Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66bb88885066bb8d35ee','aut66bb83232966bb8d35ad' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240813@174333.9802 o6videe41th3nfuaunhar3s8ii Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240813@174333.9816 o6videe41th3nfuaunhar3s8ii Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240813@174333.9886 o6videe41th3nfuaunhar3s8ii Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66bb88885066bb8d35ee',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66bb83232966bb8d35ad' ,0,0 ,2,23.00,50000,?,?,?)
20240813@174334.1270 o6videe41th3nfuaunhar3s8ii Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66bb83232966bb8d35ad','2405372','wait',39,'adm09112754980.682000002')
20240813@174334.2060 o6videe41th3nfuaunhar3s8ii Query : use flama_phc
20240813@174334.2090 o6videe41th3nfuaunhar3s8ii Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240813@174334.2460 o6videe41th3nfuaunhar3s8ii Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1519';
20240813@174334.2720 o6videe41th3nfuaunhar3s8ii Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1519';
20240813@174334.3160 o6videe41th3nfuaunhar3s8ii Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1519';
20240813@174334.3380 o6videe41th3nfuaunhar3s8ii Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1519';
20240813@174334.8640 7oub0ev5lbqeb5rj7gerlgrded Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240813@174334.8750 7oub0ev5lbqeb5rj7gerlgrded Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240813@174334.9280 7oub0ev5lbqeb5rj7gerlgrded Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1520';
