20241011@140447.6545 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140447.6801 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140447.6968 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140447.7228 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140447.7480 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140447.7737 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140447.8018 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67092939306709226fb6','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140447.8064 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140447.8451 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140447.9273 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut67092939306709226fb6',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,40000,?,?,?,?)
20241011@140447.9932 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140448.1600 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140448.3890 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140448.6400 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140448.8940 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140448.1902 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140448.2163 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140448.2404 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140448.2805 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140448.3122 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140448.3376 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140448.3599 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6709249059670922704c','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140448.3661 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140448.4159 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140448.5029 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut6709249059670922704c',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,50000,?,?,?,?)
20241011@140448.5524 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140448.5565 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140448.5921 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140448.6185 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140448.6480 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140448.7096 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140448.7370 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140448.7576 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140448.7864 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140448.8127 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140448.8399 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140448.8733 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut670928983867092270c6','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140448.8816 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140448.9060 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140448.9090 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut670928983867092270c6',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,60000,?,?,?,?)
20241011@140448.9361 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140448.9364 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140448.9682 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140448.9700 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140448.9717 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140448.9747 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140448.9764 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140448.9773 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140448.9787 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140448.9799 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140448.9815 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140448.9827 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut670922396567092270ef','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140448.9831 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140448.9846 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140448.9877 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut670922396567092270ef',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,70000,?,?,?,?)
20241011@140449.1040 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140449.1070 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140449.1280 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140449.1420 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140449.1620 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140449.1900 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140449.2060 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140449.2390 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140449.2590 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140449.2770 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140449.3000 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140449.3160 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67092972896709227106','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140449.3210 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140449.3390 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140449.3760 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut67092972896709227106',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,80000,?,?,?,?)
20241011@140449.6340 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140449.6760 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140449.1080 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140449.1335 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140449.1441 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140449.2139 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140449.2398 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140449.3596 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140449.3845 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140449.4089 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140449.4381 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140449.4748 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67092867606709227163','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140449.4792 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140449.5043 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140449.5598 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut67092867606709227163',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,90000,?,?,?,?)
20241011@140449.6060 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140449.6102 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140449.6433 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140449.6682 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140449.6943 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140449.7513 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140449.7767 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140449.7932 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140449.8191 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140449.8361 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140449.8382 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140449.8395 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut670921506867092271cc','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140449.8400 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140449.8417 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140449.8940 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut670921506867092271cc',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,100000,?,?,?,?)
20241011@140449.9703 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140449.9783 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140450.1160 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140450.5600 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140450.8130 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140450.1397 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140450.1649 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140450.1815 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140450.2125 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140450.2526 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140450.2778 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140450.2989 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6709249429670922723d','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140450.3033 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140450.3251 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140450.3854 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut6709249429670922723d',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,110000,?,?,?,?)
20241011@140450.4577 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140450.4627 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140450.4962 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140450.4995 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140450.5013 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140450.5198 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140450.5572 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140450.5710 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140450.5840 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140450.6092 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140450.6195 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140450.6406 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67092929266709227294','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140450.6449 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140450.6660 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140450.7091 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut67092929266709227294',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,120000,?,?,?,?)
20241011@140450.7545 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140450.7587 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140450.7921 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140450.8170 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140450.8313 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140450.8342 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140450.8397 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140450.8406 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140450.8418 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140450.8432 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140450.8451 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140450.8466 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut670926211167092272cd','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140450.8631 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140450.9215 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140450.9698 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut670926211167092272cd',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,130000,?,?,?,?)
20241011@140450.9965 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140450.9969 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140450.9992 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140451.6000 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.2300 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.5200 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.6800 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.7700 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140451.9100 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140451.1040 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.1190 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.1330 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67092683656709227302','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140451.1370 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.1520 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.4480 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut67092683656709227302',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,140000,?,?,?,?)
20241011@140451.6670 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140451.6700 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140451.6910 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140451.7710 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.7880 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.8170 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.8320 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.8410 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140451.8550 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140451.8680 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.8830 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.8950 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67092065466709227315','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140451.9000 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.9140 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.1209 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut67092065466709227315',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,150000,?,?,?,?)
20241011@140451.1422 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140451.1426 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140451.1445 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140451.1460 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.1477 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.1507 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.1523 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.1597 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140451.1609 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140451.1622 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.1637 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.1648 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67092470186709227327','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140451.1653 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.1667 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.1697 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut67092470186709227327',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,160000,?,?,?,?)
20241011@140451.1907 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140451.1910 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140451.1930 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140451.1945 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.1961 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.1987 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.2001 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.2010 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140451.2022 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140451.2034 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.2049 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.2060 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67092422066709227331','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140451.2064 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.2079 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.2108 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut67092422066709227331',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,170000,?,?,?,?)
20241011@140451.2319 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140451.2322 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140451.2343 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140451.2356 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.2372 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.2398 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.2413 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.2421 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140451.2433 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140451.2484 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.2604 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.2615 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6709293878670922733c','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140451.2620 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.2636 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.2664 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut6709293878670922733c',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,180000,?,?,?,?)
20241011@140451.2873 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140451.2876 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140451.2923 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140451.2937 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.2977 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.3004 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.3048 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.3056 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140451.3068 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140451.3080 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.3095 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.3106 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6709240805670922734b','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140451.3110 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.3125 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.3152 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut6709240805670922734b',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,190000,?,?,?,?)
20241011@140451.3363 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140451.3366 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140451.3385 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140451.3398 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.3413 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.3442 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.3457 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.3466 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140451.3479 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140451.3492 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.3507 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.3518 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67092411626709227355','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140451.3522 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.3537 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.3565 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut67092411626709227355',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,200000,?,?,?,?)
20241011@140451.3773 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140451.3776 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140451.3796 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140451.3809 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.3825 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.3853 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.3867 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.3876 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140451.3888 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140451.3900 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.3914 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.3926 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6709217943670922735f','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140451.3930 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.3945 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.3974 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut6709217943670922735f',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,210000,?,?,?,?)
20241011@140451.4180 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140451.4183 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140451.4202 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140451.4215 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.4230 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.4254 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.4268 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.4282 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140451.4294 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140451.4307 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.4321 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.4332 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67092487966709227369','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140451.4336 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.4350 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.4379 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut67092487966709227369',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,220000,?,?,?,?)
20241011@140451.4580 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140451.4583 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140451.4601 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140451.4615 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.4631 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.4656 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.4671 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.4679 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140451.4693 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140451.4704 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.4719 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.4731 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67092465646709227372','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140451.4735 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.4750 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.4777 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut67092465646709227372',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,230000,?,?,?,?)
20241011@140451.4984 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140451.4987 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140451.5007 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140451.5021 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.5036 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.5073 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.5088 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.5097 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140451.5108 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140451.5119 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.5134 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.5145 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6709262203670922737c','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140451.5149 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.5163 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.5193 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut6709262203670922737c',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,240000,?,?,?,?)
20241011@140451.5412 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140451.5415 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140451.5435 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140451.5448 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.5464 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.5493 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.5507 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.5515 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140451.5529 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140451.5540 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.5554 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.5565 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67092135436709227387','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140451.5569 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.5583 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.5610 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut67092135436709227387',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,250000,?,?,?,?)
20241011@140451.6030 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140451.6033 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140451.6053 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140451.6070 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.6136 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.6163 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.6222 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.6230 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140451.6244 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140451.6336 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.6560 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.6574 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6709240505670922739a','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140451.6578 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.6593 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.6620 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut6709240505670922739a',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,260000,?,?,?,?)
20241011@140451.6834 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140451.6837 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140451.6857 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140451.6872 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.6889 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.6915 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.6930 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.6938 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140451.6950 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140451.6963 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.6977 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.6988 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut670927012267092273a9','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140451.6992 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.7007 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.7035 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut670927012267092273a9',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,270000,?,?,?,?)
20241011@140451.7486 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140451.7492 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140451.7619 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140451.7633 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.7735 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.7825 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.7842 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.7850 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140451.7863 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140451.7875 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.7890 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.7901 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut670929827967092273c0','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140451.7905 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.7919 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.7947 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut670929827967092273c0',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,280000,?,?,?,?)
20241011@140451.8427 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140451.8430 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140451.8454 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140451.8480 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.8498 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.8532 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.8548 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.8563 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140451.8575 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140451.8588 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.8610 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.8622 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut670920843367092273d1','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140451.8626 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.8705 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.9069 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut670920843367092273d1',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,290000,?,?,?,?)
20241011@140451.9289 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140451.9293 5dsf7vmdl4g7fofo9csotsj401 Query : select st.usalote valor from st where st.ref = '324.2387.00.1'
20241011@140451.9322 5dsf7vmdl4g7fofo9csotsj401 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.2387.00.1'
20241011@140451.9337 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.9353 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.9381 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.9397 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.9405 5dsf7vmdl4g7fofo9csotsj401 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@140451.9417 5dsf7vmdl4g7fofo9csotsj401 Query : select sestamp valor from se where ref ='324.2387.00.1' and lote = 'r2400490200a'
20241011@140451.9431 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.9447 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20241011@140451.9460 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut670921772867092273e6','aut67092687216709226d28' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20241011@140451.9464 5dsf7vmdl4g7fofo9csotsj401 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@140451.9481 5dsf7vmdl4g7fofo9csotsj401 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20241011@140451.9516 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem) values ('aut670921772867092273e6',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',40.000 ,'aut67092687216709226d28' ,0,0 ,2,23.00,300000,?,?,?,?)
20241011@140451.9732 5dsf7vmdl4g7fofo9csotsj401 Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut67092687216709226d28','2406692','wait',39,'adm09112754980.682000002')
20241011@140451.9832 5dsf7vmdl4g7fofo9csotsj401 Query : use flama_phc
20241011@140451.9836 5dsf7vmdl4g7fofo9csotsj401 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20241011@140451.9881 5dsf7vmdl4g7fofo9csotsj401 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2567';
20241011@140451.9916 5dsf7vmdl4g7fofo9csotsj401 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2567';
20241011@140451.9960 5dsf7vmdl4g7fofo9csotsj401 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2567';
20241011@140451.9988 5dsf7vmdl4g7fofo9csotsj401 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2567';

20241011@143344.4510 dmlp7k02cjt1dbi2vnkt464crv Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2568';
20241011@143344.4569 dmlp7k02cjt1dbi2vnkt464crv Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2568';
20241011@143344.4594 dmlp7k02cjt1dbi2vnkt464crv Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2568';
20241011@143344.4634 dmlp7k02cjt1dbi2vnkt464crv Query : use flama_phc
20241011@143344.4637 dmlp7k02cjt1dbi2vnkt464crv Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20241011@143344.4705 dmlp7k02cjt1dbi2vnkt464crv Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1817.00.1'
20241011@143344.4808 dmlp7k02cjt1dbi2vnkt464crv 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 = 2400484 and bi.ref ='324.1817.00.1' and bi.lordem =20000
20241011@143344.5118 dmlp7k02cjt1dbi2vnkt464crv 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 = 'cps24050652635,571000002 ' 
20241011@143344.5399 dmlp7k02cjt1dbi2vnkt464crv Query : use flama_phc
20241011@143344.5402 dmlp7k02cjt1dbi2vnkt464crv Query : select top 1 1 valor from ts where ts.ndos = 61
20241011@143344.5438 dmlp7k02cjt1dbi2vnkt464crv Query : use flama_phc
20241011@143344.5441 dmlp7k02cjt1dbi2vnkt464crv 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')
20241011@143344.5488 dmlp7k02cjt1dbi2vnkt464crv 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
20241011@143344.5525 dmlp7k02cjt1dbi2vnkt464crv Query : use flama_phc
20241011@143344.5528 dmlp7k02cjt1dbi2vnkt464crv Query : select top 1 ~inactivo valor from fl where no = '202241' and estab = 00 order by inactivo desc
20241011@143344.5620 dmlp7k02cjt1dbi2vnkt464crv Query : use flama_phc
20241011@143344.5623 dmlp7k02cjt1dbi2vnkt464crv Query : select 1 valor from ts where ndos = 61
20241011@143344.5635 dmlp7k02cjt1dbi2vnkt464crv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@143344.5651 dmlp7k02cjt1dbi2vnkt464crv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20241011@143344.5660 dmlp7k02cjt1dbi2vnkt464crv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@143344.5675 dmlp7k02cjt1dbi2vnkt464crv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20241011@143344.5683 dmlp7k02cjt1dbi2vnkt464crv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@143344.5698 dmlp7k02cjt1dbi2vnkt464crv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20241011@143344.5707 dmlp7k02cjt1dbi2vnkt464crv 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
20241011@143344.5729 dmlp7k02cjt1dbi2vnkt464crv Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20241011@143344.5752 dmlp7k02cjt1dbi2vnkt464crv Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20241011@143344.5771 dmlp7k02cjt1dbi2vnkt464crv Query : use flama_phc
20241011@143344.5778 dmlp7k02cjt1dbi2vnkt464crv Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202241' and estab=00
20241011@143344.5848 dmlp7k02cjt1dbi2vnkt464crv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@143344.5864 dmlp7k02cjt1dbi2vnkt464crv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20241011@143344.5876 dmlp7k02cjt1dbi2vnkt464crv Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6709286389670929388c',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20241011@143344.5888 dmlp7k02cjt1dbi2vnkt464crv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@143344.5903 dmlp7k02cjt1dbi2vnkt464crv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20241011@143344.5923 dmlp7k02cjt1dbi2vnkt464crv Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6709286389670929388c','--','bo',7.8661087866108786610 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20241011@143344.5927 dmlp7k02cjt1dbi2vnkt464crv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@143344.5942 dmlp7k02cjt1dbi2vnkt464crv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20241011@143344.5954 dmlp7k02cjt1dbi2vnkt464crv 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 ('aut6709286389670929388c','guia r. fornecedor','2024-10-11',61,2403026,?,?,?,?,?,?,?,?,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')
20241011@143347.3152 dmlp7k02cjt1dbi2vnkt464crv Query : use flama_phc
20241011@143347.3156 dmlp7k02cjt1dbi2vnkt464crv Query : select st.usalote valor from st where st.ref = '324.1817.00.1'
20241011@143347.3186 dmlp7k02cjt1dbi2vnkt464crv Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1817.00.1'
20241011@143347.3311 dmlp7k02cjt1dbi2vnkt464crv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@143347.3329 dmlp7k02cjt1dbi2vnkt464crv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20241011@143347.3342 dmlp7k02cjt1dbi2vnkt464crv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@143347.3357 dmlp7k02cjt1dbi2vnkt464crv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20241011@143347.3367 dmlp7k02cjt1dbi2vnkt464crv Query : select sestamp valor from se where ref ='324.1817.00.1' and lote = 'r2400484200a'
20241011@143347.3381 dmlp7k02cjt1dbi2vnkt464crv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@143347.3397 dmlp7k02cjt1dbi2vnkt464crv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20241011@143347.3406 dmlp7k02cjt1dbi2vnkt464crv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@143347.3423 dmlp7k02cjt1dbi2vnkt464crv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20241011@143347.3435 dmlp7k02cjt1dbi2vnkt464crv Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut67092547646709293b53',?,?,'20241011',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20241011@143347.4203 dmlp7k02cjt1dbi2vnkt464crv Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20241011@143347.4221 dmlp7k02cjt1dbi2vnkt464crv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@143347.4239 dmlp7k02cjt1dbi2vnkt464crv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20241011@143347.4252 dmlp7k02cjt1dbi2vnkt464crv Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut67092974206709293b67','aut6709286389670929388c',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 = 'aut6709286389670929388c'
20241011@143347.4389 dmlp7k02cjt1dbi2vnkt464crv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20241011@143347.4410 dmlp7k02cjt1dbi2vnkt464crv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20241011@143347.4428 dmlp7k02cjt1dbi2vnkt464crv 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 'aut67092974206709293b67',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 ,23.9,23.9*200.48,23.9,23.9*200.48 ,0,0,'un',' ' ,bo.marcada,1 ,23.9*1470,23.9*1470*200.48 ,25.529000,25.529000*200.48 ,25.529000,25.529000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,23.9,23.9*200.48,23.9*1470,23.9*1470*200.48,'cps24050652635,571000002 ',188,188*1470,188,188*1470,?,?,?,4 from bo bo where bo.bostamp = 'aut6709286389670929388c'
20241011@143400.4338 dmlp7k02cjt1dbi2vnkt464crv Query : use flama_phc
20241011@143400.4343 dmlp7k02cjt1dbi2vnkt464crv Query : declare @bostamp varchar(25) = 'aut6709286389670929388c' ,@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 
20241011@143410.8642 dmlp7k02cjt1dbi2vnkt464crv Query : use flama_phc
20241011@143410.8645 dmlp7k02cjt1dbi2vnkt464crv Query : select 1 valor from bo where bo.bostamp = 'aut6709286389670929388c'
20241011@143410.8665 dmlp7k02cjt1dbi2vnkt464crv 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) = 'aut6709286389670929388c' 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 
