20240916@142306.5632 4j5ojsu8f57siv961p4mj5m89v INICIO DE FICHEIRO DE LOG :: /var/www/webservices/logs/website.sql.log
20240916@142306.5631 4j5ojsu8f57siv961p4mj5m89v Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142306.5652 4j5ojsu8f57siv961p4mj5m89v Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142306.5684 4j5ojsu8f57siv961p4mj5m89v Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142306.5702 4j5ojsu8f57siv961p4mj5m89v Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142306.5713 4j5ojsu8f57siv961p4mj5m89v Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142306.5728 4j5ojsu8f57siv961p4mj5m89v Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142306.5746 4j5ojsu8f57siv961p4mj5m89v Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142306.5763 4j5ojsu8f57siv961p4mj5m89v Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e834226566e8313a8b','aut66e831068866e83139af' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142306.5768 4j5ojsu8f57siv961p4mj5m89v Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142306.5785 4j5ojsu8f57siv961p4mj5m89v Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142306.5824 4j5ojsu8f57siv961p4mj5m89v Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e834226566e8313a8b',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e831068866e83139af' ,0,0 ,2,23.00,120000,?,?,?)
20240916@142306.6075 4j5ojsu8f57siv961p4mj5m89v Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66e831068866e83139af','2405951','wait',39,'adm09112754980.682000002')
20240916@142306.6147 4j5ojsu8f57siv961p4mj5m89v Query : use flama_phc
20240916@142306.6150 4j5ojsu8f57siv961p4mj5m89v Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240916@142306.6180 4j5ojsu8f57siv961p4mj5m89v Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2027';
20240916@142306.6210 4j5ojsu8f57siv961p4mj5m89v Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2027';
20240916@142306.6251 4j5ojsu8f57siv961p4mj5m89v Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2027';
20240916@142306.6277 4j5ojsu8f57siv961p4mj5m89v Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2027';
20240916@142306.7881 eqidubkgocrd0dfjd31d7k3184 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240916@142306.7894 eqidubkgocrd0dfjd31d7k3184 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240916@142306.7945 eqidubkgocrd0dfjd31d7k3184 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2028';
20240916@142306.7998 eqidubkgocrd0dfjd31d7k3184 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2028';
20240916@142306.8046 eqidubkgocrd0dfjd31d7k3184 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2028';
20240916@142306.8069 eqidubkgocrd0dfjd31d7k3184 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2028';
20240916@142306.8114 eqidubkgocrd0dfjd31d7k3184 Query : use flama_phc
20240916@142306.8117 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240916@142306.8176 eqidubkgocrd0dfjd31d7k3184 Query : use flama_phc
20240916@142306.8179 eqidubkgocrd0dfjd31d7k3184 Query : select no, estab,szadrsdesc from szadrs where u_coddest=8748
20240916@142306.8294 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.4860.00.1'
20240916@142306.8319 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405953 and bi.ref ='304.4860.00.1' and bi.lordem =1
20240916@142306.8661 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4970.00.1'
20240916@142306.8829 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405953 and bi.ref ='324.4970.00.1' and bi.lordem =2
20240916@142306.9609 eqidubkgocrd0dfjd31d7k3184 Query : use flama_phc
20240916@142306.9613 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240916@142306.9645 eqidubkgocrd0dfjd31d7k3184 Query : use flama_phc
20240916@142306.9648 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 1 valor from td where td.ndoc = 39
20240916@142306.9676 eqidubkgocrd0dfjd31d7k3184 Query : use flama_phc
20240916@142306.9679 eqidubkgocrd0dfjd31d7k3184 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')
20240916@142306.9708 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240916@142306.9740 eqidubkgocrd0dfjd31d7k3184 Query : use flama_phc
20240916@142306.9743 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 ~inactivo valor from cl where no = '102253' and estab = 0 order by inactivo desc
20240916@142306.9866 eqidubkgocrd0dfjd31d7k3184 Query : use flama_phc
20240916@142306.9868 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 tipodoc,regrd from td where ndoc = 39
20240916@142306.9898 eqidubkgocrd0dfjd31d7k3184 Query : use flama_phc
20240916@142306.9901 eqidubkgocrd0dfjd31d7k3184 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240916@142306.9939 eqidubkgocrd0dfjd31d7k3184 Query : use flama_phc
20240916@142306.9942 eqidubkgocrd0dfjd31d7k3184 Query : select szadrsstamp valor from szadrs where szadrsdesc='fnac - entrega'
20240916@142306.9985 eqidubkgocrd0dfjd31d7k3184 Query : use flama_phc
20240916@142306.9988 eqidubkgocrd0dfjd31d7k3184 Query : select 1 valor from td where ndoc = 39
20240916@142307.0000 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 manternumero, tiposaft, nmdos,td.assinadoc from td where td.ndoc = 39
20240916@142307.1300 eqidubkgocrd0dfjd31d7k3184 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.2800 eqidubkgocrd0dfjd31d7k3184 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142307.4600 eqidubkgocrd0dfjd31d7k3184 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.6000 eqidubkgocrd0dfjd31d7k3184 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142307.8600 eqidubkgocrd0dfjd31d7k3184 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.1030 eqidubkgocrd0dfjd31d7k3184 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142307.1160 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 ft.fno valor from ft ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142307.1820 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 ft.fno valor from wsftdata ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142307.1940 eqidubkgocrd0dfjd31d7k3184 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.2070 eqidubkgocrd0dfjd31d7k3184 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142307.2210 eqidubkgocrd0dfjd31d7k3184 Query : insert into wsft3data (ft3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,taxpointdt ) values ('aut66e833502066e8313b02' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?)
20240916@142307.4040 eqidubkgocrd0dfjd31d7k3184 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.4210 eqidubkgocrd0dfjd31d7k3184 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142307.4530 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 bo.u_nomeenv valor from bo where bo.bostamp=''
20240916@142307.4650 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 bo.u_moradaen valor from bo where bo.bostamp=''
20240916@142307.4770 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 bo.u_codposen valor from bo where bo.bostamp=''
20240916@142307.4890 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 bo.u_localenv valor from bo where bo.bostamp=''
20240916@142307.5010 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 bo.trab5 valor from bo where bo.bostamp=''
20240916@142307.5140 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 bo.serie valor from bo where bo.bostamp=''
20240916@142307.5250 eqidubkgocrd0dfjd31d7k3184 Query : insert into wsft2data (ft2stamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,u_nomeenv ,u_moradaen ,u_codposen ,u_localenv ,u_coddest ,u_codby ) values ('aut66e833502066e8313b02',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?,?,?,?,?,?)
20240916@142307.8010 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 fno valor from wsftdata order by fno desc
20240916@142307.8220 eqidubkgocrd0dfjd31d7k3184 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.8380 eqidubkgocrd0dfjd31d7k3184 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142307.8620 eqidubkgocrd0dfjd31d7k3184 Query : select 'normal' from dummy
20240916@142307.8770 eqidubkgocrd0dfjd31d7k3184 Query : insert into wsftdata (ftstamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,fno,no,estab,fdata,ndoc,moeda,cambio,cambiofixo,ftano,site ,classe ) values ('aut66e833502066e8313b02',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',773,102253,0,'2024-09-16',39,'euro',0,0,2024 ,?,?)
20240916@142307.1191 eqidubkgocrd0dfjd31d7k3184 Query : use flama_phc
20240916@142307.1195 eqidubkgocrd0dfjd31d7k3184 Query : select st.usalote valor from st where st.ref = '304.4860.00.1'
20240916@142307.1223 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '304.4860.00.1'
20240916@142307.1250 eqidubkgocrd0dfjd31d7k3184 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.1267 eqidubkgocrd0dfjd31d7k3184 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142307.1296 eqidubkgocrd0dfjd31d7k3184 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.1310 eqidubkgocrd0dfjd31d7k3184 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142307.1319 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142307.1333 eqidubkgocrd0dfjd31d7k3184 Query : select sestamp valor from se where ref ='304.4860.00.1' and lote = '241006'
20240916@142307.1351 eqidubkgocrd0dfjd31d7k3184 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.1367 eqidubkgocrd0dfjd31d7k3184 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142307.1381 eqidubkgocrd0dfjd31d7k3184 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e833577266e8313b20','aut66e833502066e8313b02' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142307.1385 eqidubkgocrd0dfjd31d7k3184 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.1400 eqidubkgocrd0dfjd31d7k3184 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142307.1434 eqidubkgocrd0dfjd31d7k3184 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e833577266e8313b20',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',10.000 ,'aut66e833502066e8313b02' ,0,0 ,2,23.00,10000,?,?,?,?,?)
20240916@142307.1690 eqidubkgocrd0dfjd31d7k3184 Query : use flama_phc
20240916@142307.1693 eqidubkgocrd0dfjd31d7k3184 Query : select st.usalote valor from st where st.ref = '324.4970.00.1'
20240916@142307.1714 eqidubkgocrd0dfjd31d7k3184 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.4970.00.1'
20240916@142307.1863 eqidubkgocrd0dfjd31d7k3184 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.1878 eqidubkgocrd0dfjd31d7k3184 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142307.1905 eqidubkgocrd0dfjd31d7k3184 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.1920 eqidubkgocrd0dfjd31d7k3184 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142307.1928 eqidubkgocrd0dfjd31d7k3184 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142307.1941 eqidubkgocrd0dfjd31d7k3184 Query : select sestamp valor from se where ref ='324.4970.00.1' and lote = 'r2400205200a'
20240916@142307.1954 eqidubkgocrd0dfjd31d7k3184 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.1969 eqidubkgocrd0dfjd31d7k3184 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142307.1984 eqidubkgocrd0dfjd31d7k3184 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e833083266e8313b2f','aut66e833502066e8313b02' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142307.1988 eqidubkgocrd0dfjd31d7k3184 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.2006 eqidubkgocrd0dfjd31d7k3184 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142307.2034 eqidubkgocrd0dfjd31d7k3184 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e833083266e8313b2f',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',44.000 ,'aut66e833502066e8313b02' ,0,0 ,2,23.00,20000,?,?,?,?,?)
20240916@142307.2296 eqidubkgocrd0dfjd31d7k3184 Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66e833502066e8313b02','2405953','wait',39,'adm09112754980.682000002')
20240916@142307.3916 eqidubkgocrd0dfjd31d7k3184 Query : use flama_phc
20240916@142307.3951 eqidubkgocrd0dfjd31d7k3184 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240916@142307.4117 eqidubkgocrd0dfjd31d7k3184 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2028';
20240916@142307.4149 eqidubkgocrd0dfjd31d7k3184 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2028';
20240916@142307.4195 eqidubkgocrd0dfjd31d7k3184 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2028';
20240916@142307.4224 eqidubkgocrd0dfjd31d7k3184 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2028';
20240916@142307.4860 7f442enub7mfpej0sleenv3rbj Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240916@142307.4876 7f442enub7mfpej0sleenv3rbj Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240916@142307.5115 7f442enub7mfpej0sleenv3rbj Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2029';
20240916@142307.5361 7f442enub7mfpej0sleenv3rbj Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2029';
20240916@142307.5413 7f442enub7mfpej0sleenv3rbj Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2029';
20240916@142307.5439 7f442enub7mfpej0sleenv3rbj Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2029';
20240916@142307.5485 7f442enub7mfpej0sleenv3rbj Query : use flama_phc
20240916@142307.5488 7f442enub7mfpej0sleenv3rbj Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240916@142307.5550 7f442enub7mfpej0sleenv3rbj Query : use flama_phc
20240916@142307.5553 7f442enub7mfpej0sleenv3rbj Query : select no, estab,szadrsdesc from szadrs where u_coddest=2136
20240916@142307.5640 7f442enub7mfpej0sleenv3rbj Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1824.00.1'
20240916@142307.5796 7f442enub7mfpej0sleenv3rbj Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405964 and bi.ref ='324.1824.00.1' and bi.lordem =1
20240916@142307.6106 7f442enub7mfpej0sleenv3rbj Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1824.00.1'
20240916@142307.6128 7f442enub7mfpej0sleenv3rbj Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405964 and bi.ref ='324.1824.00.1' and bi.lordem =2
20240916@142307.6436 7f442enub7mfpej0sleenv3rbj Query : use flama_phc
20240916@142307.6440 7f442enub7mfpej0sleenv3rbj Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240916@142307.6477 7f442enub7mfpej0sleenv3rbj Query : use flama_phc
20240916@142307.6480 7f442enub7mfpej0sleenv3rbj Query : select top 1 1 valor from td where td.ndoc = 39
20240916@142307.6513 7f442enub7mfpej0sleenv3rbj Query : use flama_phc
20240916@142307.6516 7f442enub7mfpej0sleenv3rbj 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')
20240916@142307.6548 7f442enub7mfpej0sleenv3rbj Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240916@142307.6586 7f442enub7mfpej0sleenv3rbj Query : use flama_phc
20240916@142307.6589 7f442enub7mfpej0sleenv3rbj Query : select top 1 ~inactivo valor from cl where no = '102415' and estab = 0 order by inactivo desc
20240916@142307.6713 7f442enub7mfpej0sleenv3rbj Query : use flama_phc
20240916@142307.6717 7f442enub7mfpej0sleenv3rbj Query : select top 1 tipodoc,regrd from td where ndoc = 39
20240916@142307.6749 7f442enub7mfpej0sleenv3rbj Query : use flama_phc
20240916@142307.6752 7f442enub7mfpej0sleenv3rbj Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240916@142307.6791 7f442enub7mfpej0sleenv3rbj Query : use flama_phc
20240916@142307.6794 7f442enub7mfpej0sleenv3rbj Query : select szadrsstamp valor from szadrs where szadrsdesc='filipe ventura electrodomÉsticos unipessoal lda'
20240916@142307.6906 7f442enub7mfpej0sleenv3rbj Query : use flama_phc
20240916@142307.6909 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from td where ndoc = 39
20240916@142307.6923 7f442enub7mfpej0sleenv3rbj Query : select top 1 manternumero, tiposaft, nmdos,td.assinadoc from td where td.ndoc = 39
20240916@142307.6937 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.6955 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142307.6975 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.6990 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142307.7024 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.7042 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142307.7057 7f442enub7mfpej0sleenv3rbj Query : select top 1 ft.fno valor from ft ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142307.7174 7f442enub7mfpej0sleenv3rbj Query : select top 1 ft.fno valor from wsftdata ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142307.7191 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.7210 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142307.7228 7f442enub7mfpej0sleenv3rbj Query : insert into wsft3data (ft3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,taxpointdt ) values ('aut66e830145366e8313bac' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?)
20240916@142307.7402 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.7422 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142307.7460 7f442enub7mfpej0sleenv3rbj Query : select top 1 bo.u_nomeenv valor from bo where bo.bostamp=''
20240916@142307.7473 7f442enub7mfpej0sleenv3rbj Query : select top 1 bo.u_moradaen valor from bo where bo.bostamp=''
20240916@142307.7485 7f442enub7mfpej0sleenv3rbj Query : select top 1 bo.u_codposen valor from bo where bo.bostamp=''
20240916@142307.7498 7f442enub7mfpej0sleenv3rbj Query : select top 1 bo.u_localenv valor from bo where bo.bostamp=''
20240916@142307.7510 7f442enub7mfpej0sleenv3rbj Query : select top 1 bo.trab5 valor from bo where bo.bostamp=''
20240916@142307.7523 7f442enub7mfpej0sleenv3rbj Query : select top 1 bo.serie valor from bo where bo.bostamp=''
20240916@142307.7536 7f442enub7mfpej0sleenv3rbj Query : insert into wsft2data (ft2stamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,u_nomeenv ,u_moradaen ,u_codposen ,u_localenv ,u_coddest ,u_codby ) values ('aut66e830145366e8313bac',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?,?,?,?,?,?)
20240916@142307.7829 7f442enub7mfpej0sleenv3rbj Query : select top 1 fno valor from wsftdata order by fno desc
20240916@142307.7851 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.7868 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142307.7891 7f442enub7mfpej0sleenv3rbj Query : select 'normal' from dummy
20240916@142307.7909 7f442enub7mfpej0sleenv3rbj Query : insert into wsftdata (ftstamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,fno,no,estab,fdata,ndoc,moeda,cambio,cambiofixo,ftano,site ,classe ) values ('aut66e830145366e8313bac',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',774,102415,0,'2024-09-16',39,'euro',0,0,2024 ,?,?)
20240916@142307.8288 7f442enub7mfpej0sleenv3rbj Query : use flama_phc
20240916@142307.8291 7f442enub7mfpej0sleenv3rbj Query : select st.usalote valor from st where st.ref = '324.1824.00.1'
20240916@142307.8314 7f442enub7mfpej0sleenv3rbj Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1824.00.1'
20240916@142307.8474 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.8490 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142307.8517 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.8532 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142307.8542 7f442enub7mfpej0sleenv3rbj Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142307.8555 7f442enub7mfpej0sleenv3rbj Query : select sestamp valor from se where ref ='324.1824.00.1' and lote = 'r2301209200a'
20240916@142307.8577 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.8594 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142307.8607 7f442enub7mfpej0sleenv3rbj Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e833189466e8313bd1','aut66e830145366e8313bac' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142307.8612 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.8628 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142307.8663 7f442enub7mfpej0sleenv3rbj Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e833189466e8313bd1',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',7.000 ,'aut66e830145366e8313bac' ,0,0 ,2,23.00,10000,?,?,?,?,?)
20240916@142307.8927 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.8947 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142307.8979 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.8997 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142307.9008 7f442enub7mfpej0sleenv3rbj Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142307.9023 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.9040 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142307.9054 7f442enub7mfpej0sleenv3rbj Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e830003266e8313bdc','aut66e830145366e8313bac' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142307.9060 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.9077 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142307.9110 7f442enub7mfpej0sleenv3rbj Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e830003266e8313bdc',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e830145366e8313bac' ,0,0 ,2,23.00,20000,?,?,?)
20240916@142307.9679 7f442enub7mfpej0sleenv3rbj Query : use flama_phc
20240916@142307.9683 7f442enub7mfpej0sleenv3rbj Query : select st.usalote valor from st where st.ref = '324.1824.00.1'
20240916@142307.9704 7f442enub7mfpej0sleenv3rbj Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1824.00.1'
20240916@142307.9717 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.9734 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142307.9758 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.9772 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142307.9781 7f442enub7mfpej0sleenv3rbj Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142307.9792 7f442enub7mfpej0sleenv3rbj Query : select sestamp valor from se where ref ='324.1824.00.1' and lote = 'r2301209200a'
20240916@142307.9804 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.9818 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142307.9829 7f442enub7mfpej0sleenv3rbj Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e833557966e8313bef','aut66e830145366e8313bac' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142307.9833 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142307.9849 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142307.9875 7f442enub7mfpej0sleenv3rbj Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e833557966e8313bef',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',1.000 ,'aut66e830145366e8313bac' ,0,0 ,2,23.00,40000,?,?,?,?,?)
20240916@142308.1360 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.1520 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142308.1760 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.1900 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142308.1980 7f442enub7mfpej0sleenv3rbj Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142308.2090 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.2230 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142308.2340 7f442enub7mfpej0sleenv3rbj Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e839356166e8313c05','aut66e830145366e8313bac' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142308.2380 7f442enub7mfpej0sleenv3rbj Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.2520 7f442enub7mfpej0sleenv3rbj Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142308.2800 7f442enub7mfpej0sleenv3rbj Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e839356166e8313c05',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e830145366e8313bac' ,0,0 ,2,23.00,50000,?,?,?)
20240916@142308.6130 7f442enub7mfpej0sleenv3rbj Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66e830145366e8313bac','2405964','wait',39,'adm09112754980.682000002')
20240916@142308.6820 7f442enub7mfpej0sleenv3rbj Query : use flama_phc
20240916@142308.6850 7f442enub7mfpej0sleenv3rbj Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240916@142308.7200 7f442enub7mfpej0sleenv3rbj Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2029';
20240916@142308.7510 7f442enub7mfpej0sleenv3rbj Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2029';
20240916@142308.7910 7f442enub7mfpej0sleenv3rbj Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2029';
20240916@142308.8140 7f442enub7mfpej0sleenv3rbj Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2029';
20240916@142308.1450 iqo173tt742uslh2g7dco74suk Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240916@142308.1461 iqo173tt742uslh2g7dco74suk Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240916@142308.1556 iqo173tt742uslh2g7dco74suk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2030';
20240916@142308.1614 iqo173tt742uslh2g7dco74suk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2030';
20240916@142308.1664 iqo173tt742uslh2g7dco74suk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2030';
20240916@142308.1689 iqo173tt742uslh2g7dco74suk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2030';
20240916@142308.1735 iqo173tt742uslh2g7dco74suk Query : use flama_phc
20240916@142308.1739 iqo173tt742uslh2g7dco74suk Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240916@142308.1801 iqo173tt742uslh2g7dco74suk Query : use flama_phc
20240916@142308.1804 iqo173tt742uslh2g7dco74suk Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240916@142308.1845 iqo173tt742uslh2g7dco74suk Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1832.00.2'
20240916@142308.2002 iqo173tt742uslh2g7dco74suk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405965 and bi.ref ='324.1832.00.2' and bi.lordem =1
20240916@142308.2349 iqo173tt742uslh2g7dco74suk Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1832.00.2'
20240916@142308.2369 iqo173tt742uslh2g7dco74suk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405965 and bi.ref ='324.1832.00.2' and bi.lordem =2
20240916@142308.2724 iqo173tt742uslh2g7dco74suk Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1832.00.2'
20240916@142308.2748 iqo173tt742uslh2g7dco74suk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405965 and bi.ref ='324.1832.00.2' and bi.lordem =2
20240916@142308.2766 iqo173tt742uslh2g7dco74suk Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1832.00.2'
20240916@142308.2789 iqo173tt742uslh2g7dco74suk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405965 and bi.ref ='324.1832.00.2' and bi.lordem =2
20240916@142308.2809 iqo173tt742uslh2g7dco74suk Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1832.00.2'
20240916@142308.2829 iqo173tt742uslh2g7dco74suk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405965 and bi.ref ='324.1832.00.2' and bi.lordem =2
20240916@142308.2849 iqo173tt742uslh2g7dco74suk Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1832.00.2'
20240916@142308.2870 iqo173tt742uslh2g7dco74suk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405965 and bi.ref ='324.1832.00.2' and bi.lordem =2
20240916@142308.2888 iqo173tt742uslh2g7dco74suk Query : use flama_phc
20240916@142308.2892 iqo173tt742uslh2g7dco74suk Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240916@142308.2925 iqo173tt742uslh2g7dco74suk Query : use flama_phc
20240916@142308.2928 iqo173tt742uslh2g7dco74suk Query : select top 1 1 valor from td where td.ndoc = 39
20240916@142308.2957 iqo173tt742uslh2g7dco74suk Query : use flama_phc
20240916@142308.2961 iqo173tt742uslh2g7dco74suk 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')
20240916@142308.2991 iqo173tt742uslh2g7dco74suk Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240916@142308.3025 iqo173tt742uslh2g7dco74suk Query : use flama_phc
20240916@142308.3028 iqo173tt742uslh2g7dco74suk Query : select top 1 ~inactivo valor from cl where no = '100810' and estab = 0 order by inactivo desc
20240916@142308.3058 iqo173tt742uslh2g7dco74suk Query : use flama_phc
20240916@142308.3061 iqo173tt742uslh2g7dco74suk Query : select top 1 tipodoc,regrd from td where ndoc = 39
20240916@142308.3089 iqo173tt742uslh2g7dco74suk Query : use flama_phc
20240916@142308.3093 iqo173tt742uslh2g7dco74suk Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240916@142308.3133 iqo173tt742uslh2g7dco74suk Query : use flama_phc
20240916@142308.3135 iqo173tt742uslh2g7dco74suk Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240916@142308.3179 iqo173tt742uslh2g7dco74suk Query : use flama_phc
20240916@142308.3182 iqo173tt742uslh2g7dco74suk Query : select 1 valor from td where ndoc = 39
20240916@142308.3195 iqo173tt742uslh2g7dco74suk Query : select top 1 manternumero, tiposaft, nmdos,td.assinadoc from td where td.ndoc = 39
20240916@142308.3211 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.3229 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142308.3254 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.3271 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142308.3305 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.3322 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142308.3356 iqo173tt742uslh2g7dco74suk Query : select top 1 ft.fno valor from ft ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142308.3443 iqo173tt742uslh2g7dco74suk Query : select top 1 ft.fno valor from wsftdata ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142308.3458 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.3474 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142308.3499 iqo173tt742uslh2g7dco74suk Query : insert into wsft3data (ft3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,taxpointdt ) values ('aut66e838644966e8313c51' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?)
20240916@142308.3732 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.3761 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142308.3797 iqo173tt742uslh2g7dco74suk Query : select top 1 bo.u_nomeenv valor from bo where bo.bostamp=''
20240916@142308.3809 iqo173tt742uslh2g7dco74suk Query : select top 1 bo.u_moradaen valor from bo where bo.bostamp=''
20240916@142308.3822 iqo173tt742uslh2g7dco74suk Query : select top 1 bo.u_codposen valor from bo where bo.bostamp=''
20240916@142308.3834 iqo173tt742uslh2g7dco74suk Query : select top 1 bo.u_localenv valor from bo where bo.bostamp=''
20240916@142308.3846 iqo173tt742uslh2g7dco74suk Query : select top 1 bo.trab5 valor from bo where bo.bostamp=''
20240916@142308.3857 iqo173tt742uslh2g7dco74suk Query : select top 1 bo.serie valor from bo where bo.bostamp=''
20240916@142308.3868 iqo173tt742uslh2g7dco74suk Query : insert into wsft2data (ft2stamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,u_nomeenv ,u_moradaen ,u_codposen ,u_localenv ,u_coddest ,u_codby ) values ('aut66e838644966e8313c51',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?,?,?,?,?,?)
20240916@142308.4115 iqo173tt742uslh2g7dco74suk Query : select top 1 fno valor from wsftdata order by fno desc
20240916@142308.4140 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.4157 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142308.4179 iqo173tt742uslh2g7dco74suk Query : select 'normal' from dummy
20240916@142308.4195 iqo173tt742uslh2g7dco74suk Query : insert into wsftdata (ftstamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,fno,no,estab,fdata,ndoc,moeda,cambio,cambiofixo,ftano,site ,classe ) values ('aut66e838644966e8313c51',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',775,100810,0,'2024-09-16',39,'euro',0,0,2024 ,?,?)
20240916@142308.4494 iqo173tt742uslh2g7dco74suk Query : use flama_phc
20240916@142308.4500 iqo173tt742uslh2g7dco74suk Query : select st.usalote valor from st where st.ref = '324.1832.00.2'
20240916@142308.4522 iqo173tt742uslh2g7dco74suk Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1832.00.2'
20240916@142308.4799 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.4815 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142308.4841 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.4855 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142308.4863 iqo173tt742uslh2g7dco74suk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142308.4875 iqo173tt742uslh2g7dco74suk Query : select sestamp valor from se where ref ='324.1832.00.2' and lote = 'r2301271100a'
20240916@142308.4889 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.4903 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142308.4915 iqo173tt742uslh2g7dco74suk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e836752366e8313c77','aut66e838644966e8313c51' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142308.4919 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.4933 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142308.4962 iqo173tt742uslh2g7dco74suk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e836752366e8313c77',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',10.000 ,'aut66e838644966e8313c51' ,0,0 ,2,23.00,10000,?,?,?,?,?)
20240916@142308.5216 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.5232 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142308.5258 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.5273 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142308.5282 iqo173tt742uslh2g7dco74suk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142308.5296 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.5312 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142308.5324 iqo173tt742uslh2g7dco74suk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e833818166e8313c81','aut66e838644966e8313c51' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142308.5328 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.5344 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142308.5371 iqo173tt742uslh2g7dco74suk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e833818166e8313c81',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e838644966e8313c51' ,0,0 ,2,23.00,20000,?,?,?)
20240916@142308.5619 iqo173tt742uslh2g7dco74suk Query : use flama_phc
20240916@142308.5623 iqo173tt742uslh2g7dco74suk Query : select st.usalote valor from st where st.ref = '324.1832.00.2'
20240916@142308.5645 iqo173tt742uslh2g7dco74suk Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1832.00.2'
20240916@142308.5661 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.5679 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142308.5707 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.5722 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142308.5730 iqo173tt742uslh2g7dco74suk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142308.5741 iqo173tt742uslh2g7dco74suk Query : select sestamp valor from se where ref ='324.1832.00.2' and lote = 'r2301271100a'
20240916@142308.5755 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.5769 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142308.5780 iqo173tt742uslh2g7dco74suk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e831873166e8313c8c','aut66e838644966e8313c51' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142308.5784 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.5800 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142308.5828 iqo173tt742uslh2g7dco74suk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e831873166e8313c8c',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',8.000 ,'aut66e838644966e8313c51' ,0,0 ,2,23.00,40000,?,?,?,?,?)
20240916@142308.6087 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.6104 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142308.6142 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.6158 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142308.6167 iqo173tt742uslh2g7dco74suk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142308.6180 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.6195 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142308.6207 iqo173tt742uslh2g7dco74suk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e833140566e8313c96','aut66e838644966e8313c51' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142308.6211 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.6233 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142308.6260 iqo173tt742uslh2g7dco74suk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e833140566e8313c96',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e838644966e8313c51' ,0,0 ,2,23.00,50000,?,?,?)
20240916@142308.6519 iqo173tt742uslh2g7dco74suk Query : use flama_phc
20240916@142308.6522 iqo173tt742uslh2g7dco74suk Query : select st.usalote valor from st where st.ref = '324.1832.00.2'
20240916@142308.6543 iqo173tt742uslh2g7dco74suk Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1832.00.2'
20240916@142308.6567 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.6582 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142308.6608 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.6624 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142308.6634 iqo173tt742uslh2g7dco74suk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142308.6648 iqo173tt742uslh2g7dco74suk Query : select sestamp valor from se where ref ='324.1832.00.2' and lote = 'r2301257100a'
20240916@142308.6664 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.6681 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142308.6694 iqo173tt742uslh2g7dco74suk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e839736466e8313ca2','aut66e838644966e8313c51' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142308.6698 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.6712 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142308.6746 iqo173tt742uslh2g7dco74suk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e839736466e8313ca2',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',2.000 ,'aut66e838644966e8313c51' ,0,0 ,2,23.00,70000,?,?,?,?,?)
20240916@142308.7083 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.7106 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142308.7140 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.7156 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142308.7165 iqo173tt742uslh2g7dco74suk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142308.7179 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.7196 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142308.7209 iqo173tt742uslh2g7dco74suk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e836611566e8313caf','aut66e838644966e8313c51' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142308.7213 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.7228 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142308.7259 iqo173tt742uslh2g7dco74suk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e836611566e8313caf',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e838644966e8313c51' ,0,0 ,2,23.00,80000,?,?,?)
20240916@142308.7525 iqo173tt742uslh2g7dco74suk Query : use flama_phc
20240916@142308.7529 iqo173tt742uslh2g7dco74suk Query : select st.usalote valor from st where st.ref = '324.1832.00.2'
20240916@142308.7553 iqo173tt742uslh2g7dco74suk Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1832.00.2'
20240916@142308.7569 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.7587 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142308.7616 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.7633 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142308.7643 iqo173tt742uslh2g7dco74suk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142308.7658 iqo173tt742uslh2g7dco74suk Query : select sestamp valor from se where ref ='324.1832.00.2' and lote = 'r2301271100a'
20240916@142308.7672 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.7687 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142308.7700 iqo173tt742uslh2g7dco74suk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e836960866e8313cbb','aut66e838644966e8313c51' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142308.7705 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.7719 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142308.7750 iqo173tt742uslh2g7dco74suk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e836960866e8313cbb',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',20.000 ,'aut66e838644966e8313c51' ,0,0 ,2,23.00,100000,?,?,?,?,?)
20240916@142308.8028 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.8046 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142308.8074 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.8091 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142308.8099 iqo173tt742uslh2g7dco74suk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142308.8111 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.8125 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142308.8136 iqo173tt742uslh2g7dco74suk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e834172566e8313cc6','aut66e838644966e8313c51' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142308.8142 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.8158 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142308.8185 iqo173tt742uslh2g7dco74suk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e834172566e8313cc6',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e838644966e8313c51' ,0,0 ,2,23.00,110000,?,?,?)
20240916@142308.8454 iqo173tt742uslh2g7dco74suk Query : use flama_phc
20240916@142308.8457 iqo173tt742uslh2g7dco74suk Query : select st.usalote valor from st where st.ref = '324.1832.00.2'
20240916@142308.8476 iqo173tt742uslh2g7dco74suk Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1832.00.2'
20240916@142308.8495 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.8515 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142308.8543 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.8572 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142308.8583 iqo173tt742uslh2g7dco74suk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142308.8597 iqo173tt742uslh2g7dco74suk Query : select sestamp valor from se where ref ='324.1832.00.2' and lote = 'r2301271100a'
20240916@142308.8611 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.8626 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142308.8638 iqo173tt742uslh2g7dco74suk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e832479766e8313cd2','aut66e838644966e8313c51' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142308.8643 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.8667 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142308.8699 iqo173tt742uslh2g7dco74suk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e832479766e8313cd2',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',20.000 ,'aut66e838644966e8313c51' ,0,0 ,2,23.00,130000,?,?,?,?,?)
20240916@142308.9592 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142308.9748 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142309.9000 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.2370 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142309.3350 iqo173tt742uslh2g7dco74suk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142309.4750 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.4950 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142309.5080 iqo173tt742uslh2g7dco74suk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e834020566e8313d0b','aut66e838644966e8313c51' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142309.5130 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.5310 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142309.5630 iqo173tt742uslh2g7dco74suk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e834020566e8313d0b',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e838644966e8313c51' ,0,0 ,2,23.00,140000,?,?,?)
20240916@142309.8250 iqo173tt742uslh2g7dco74suk Query : use flama_phc
20240916@142309.8290 iqo173tt742uslh2g7dco74suk Query : select st.usalote valor from st where st.ref = '324.1832.00.2'
20240916@142309.8890 iqo173tt742uslh2g7dco74suk Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1832.00.2'
20240916@142309.1167 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.1183 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142309.1209 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.1223 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142309.1231 iqo173tt742uslh2g7dco74suk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142309.1243 iqo173tt742uslh2g7dco74suk Query : select sestamp valor from se where ref ='324.1832.00.2' and lote = 'r2301257100a'
20240916@142309.1256 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.1270 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142309.1282 iqo173tt742uslh2g7dco74suk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e839671366e8313d1e','aut66e838644966e8313c51' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142309.1287 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.1304 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142309.1338 iqo173tt742uslh2g7dco74suk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e839671366e8313d1e',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',20.000 ,'aut66e838644966e8313c51' ,0,0 ,2,23.00,160000,?,?,?,?,?)
20240916@142309.1601 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.1617 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142309.1643 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.1665 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142309.1674 iqo173tt742uslh2g7dco74suk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142309.1686 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.1700 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142309.1711 iqo173tt742uslh2g7dco74suk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e839235966e8313d29','aut66e838644966e8313c51' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142309.1715 iqo173tt742uslh2g7dco74suk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.1730 iqo173tt742uslh2g7dco74suk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142309.1757 iqo173tt742uslh2g7dco74suk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e839235966e8313d29',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e838644966e8313c51' ,0,0 ,2,23.00,170000,?,?,?)
20240916@142309.2017 iqo173tt742uslh2g7dco74suk Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66e838644966e8313c51','2405965','wait',39,'adm09112754980.682000002')
20240916@142309.2094 iqo173tt742uslh2g7dco74suk Query : use flama_phc
20240916@142309.2097 iqo173tt742uslh2g7dco74suk Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240916@142309.2129 iqo173tt742uslh2g7dco74suk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2030';
20240916@142309.2169 iqo173tt742uslh2g7dco74suk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2030';
20240916@142309.2212 iqo173tt742uslh2g7dco74suk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2030';
20240916@142309.2243 iqo173tt742uslh2g7dco74suk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2030';
20240916@142309.3000 orqt4rrbtvt29nkunupm1jknqr Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240916@142309.3011 orqt4rrbtvt29nkunupm1jknqr Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240916@142309.3063 orqt4rrbtvt29nkunupm1jknqr Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2031';
20240916@142309.3118 orqt4rrbtvt29nkunupm1jknqr Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2031';
20240916@142309.3167 orqt4rrbtvt29nkunupm1jknqr Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2031';
20240916@142309.3194 orqt4rrbtvt29nkunupm1jknqr Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2031';
20240916@142309.3251 orqt4rrbtvt29nkunupm1jknqr Query : use flama_phc
20240916@142309.3254 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240916@142309.3324 orqt4rrbtvt29nkunupm1jknqr Query : use flama_phc
20240916@142309.3327 orqt4rrbtvt29nkunupm1jknqr Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240916@142309.3369 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1834.00.1'
20240916@142309.3544 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405966 and bi.ref ='324.1834.00.1' and bi.lordem =1
20240916@142309.3900 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1834.00.1'
20240916@142309.3920 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405966 and bi.ref ='324.1834.00.1' and bi.lordem =1
20240916@142309.3935 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1834.00.1'
20240916@142309.3954 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405966 and bi.ref ='324.1834.00.1' and bi.lordem =2
20240916@142309.4287 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1834.00.1'
20240916@142309.4307 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405966 and bi.ref ='324.1834.00.1' and bi.lordem =2
20240916@142309.4323 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1834.00.1'
20240916@142309.4342 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405966 and bi.ref ='324.1834.00.1' and bi.lordem =2
20240916@142309.4359 orqt4rrbtvt29nkunupm1jknqr Query : use flama_phc
20240916@142309.4362 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240916@142309.4393 orqt4rrbtvt29nkunupm1jknqr Query : use flama_phc
20240916@142309.4395 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 1 valor from td where td.ndoc = 39
20240916@142309.4423 orqt4rrbtvt29nkunupm1jknqr Query : use flama_phc
20240916@142309.4426 orqt4rrbtvt29nkunupm1jknqr 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')
20240916@142309.4467 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240916@142309.4502 orqt4rrbtvt29nkunupm1jknqr Query : use flama_phc
20240916@142309.4505 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 ~inactivo valor from cl where no = '100810' and estab = 0 order by inactivo desc
20240916@142309.4533 orqt4rrbtvt29nkunupm1jknqr Query : use flama_phc
20240916@142309.4536 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 tipodoc,regrd from td where ndoc = 39
20240916@142309.4565 orqt4rrbtvt29nkunupm1jknqr Query : use flama_phc
20240916@142309.4568 orqt4rrbtvt29nkunupm1jknqr Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240916@142309.4608 orqt4rrbtvt29nkunupm1jknqr Query : use flama_phc
20240916@142309.4611 orqt4rrbtvt29nkunupm1jknqr Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240916@142309.4654 orqt4rrbtvt29nkunupm1jknqr Query : use flama_phc
20240916@142309.4656 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from td where ndoc = 39
20240916@142309.4668 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 manternumero, tiposaft, nmdos,td.assinadoc from td where td.ndoc = 39
20240916@142309.4681 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.4697 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142309.4715 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.4729 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142309.4756 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.4769 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142309.4783 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 ft.fno valor from ft ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142309.4851 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 ft.fno valor from wsftdata ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142309.4863 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.4879 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142309.4893 orqt4rrbtvt29nkunupm1jknqr Query : insert into wsft3data (ft3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,taxpointdt ) values ('aut66e838430366e8313d74' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?)
20240916@142309.5068 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.5085 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142309.5115 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 bo.u_nomeenv valor from bo where bo.bostamp=''
20240916@142309.5126 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 bo.u_moradaen valor from bo where bo.bostamp=''
20240916@142309.5138 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 bo.u_codposen valor from bo where bo.bostamp=''
20240916@142309.5150 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 bo.u_localenv valor from bo where bo.bostamp=''
20240916@142309.5160 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 bo.trab5 valor from bo where bo.bostamp=''
20240916@142309.5171 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 bo.serie valor from bo where bo.bostamp=''
20240916@142309.5182 orqt4rrbtvt29nkunupm1jknqr Query : insert into wsft2data (ft2stamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,u_nomeenv ,u_moradaen ,u_codposen ,u_localenv ,u_coddest ,u_codby ) values ('aut66e838430366e8313d74',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?,?,?,?,?,?)
20240916@142309.5418 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 fno valor from wsftdata order by fno desc
20240916@142309.5440 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.5456 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142309.5478 orqt4rrbtvt29nkunupm1jknqr Query : select 'normal' from dummy
20240916@142309.5494 orqt4rrbtvt29nkunupm1jknqr Query : insert into wsftdata (ftstamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,fno,no,estab,fdata,ndoc,moeda,cambio,cambiofixo,ftano,site ,classe ) values ('aut66e838430366e8313d74',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',776,100810,0,'2024-09-16',39,'euro',0,0,2024 ,?,?)
20240916@142309.5795 orqt4rrbtvt29nkunupm1jknqr Query : use flama_phc
20240916@142309.5798 orqt4rrbtvt29nkunupm1jknqr Query : select st.usalote valor from st where st.ref = '324.1834.00.1'
20240916@142309.5820 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1834.00.1'
20240916@142309.5965 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.5981 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142309.6006 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.6020 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142309.6028 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142309.6039 orqt4rrbtvt29nkunupm1jknqr Query : select sestamp valor from se where ref ='324.1834.00.1' and lote = 'r2300974200a'
20240916@142309.6052 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.6066 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142309.6077 orqt4rrbtvt29nkunupm1jknqr Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e832937166e8313d93','aut66e838430366e8313d74' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142309.6081 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.6095 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142309.6120 orqt4rrbtvt29nkunupm1jknqr Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e832937166e8313d93',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',16.000 ,'aut66e838430366e8313d74' ,0,0 ,2,23.00,10000,?,?,?,?,?)
20240916@142309.6383 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.6399 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142309.6423 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.6436 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142309.6444 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142309.6456 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.6469 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142309.6480 orqt4rrbtvt29nkunupm1jknqr Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e833478466e8313d9d','aut66e838430366e8313d74' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142309.6484 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.6513 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142309.6540 orqt4rrbtvt29nkunupm1jknqr Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e833478466e8313d9d',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e838430366e8313d74' ,0,0 ,2,23.00,20000,?,?,?)
20240916@142309.6796 orqt4rrbtvt29nkunupm1jknqr Query : use flama_phc
20240916@142309.6799 orqt4rrbtvt29nkunupm1jknqr Query : select st.usalote valor from st where st.ref = '324.1834.00.1'
20240916@142309.6818 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1834.00.1'
20240916@142309.6830 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.6847 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142309.6871 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.6885 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142309.6894 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142309.6906 orqt4rrbtvt29nkunupm1jknqr Query : select sestamp valor from se where ref ='324.1834.00.1' and lote = 'r2300974200a'
20240916@142309.7003 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.7402 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142309.7415 orqt4rrbtvt29nkunupm1jknqr Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e837445566e8313daa','aut66e838430366e8313d74' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142309.7419 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.7434 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142309.7462 orqt4rrbtvt29nkunupm1jknqr Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e837445566e8313daa',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',20.000 ,'aut66e838430366e8313d74' ,0,0 ,2,23.00,40000,?,?,?,?,?)
20240916@142309.7728 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.7747 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142309.7776 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.7792 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142309.7802 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142309.7816 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.7833 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142309.7844 orqt4rrbtvt29nkunupm1jknqr Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e836430766e8313dbe','aut66e838430366e8313d74' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142309.7848 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.7863 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142309.7888 orqt4rrbtvt29nkunupm1jknqr Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e836430766e8313dbe',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e838430366e8313d74' ,0,0 ,2,23.00,50000,?,?,?)
20240916@142309.8155 orqt4rrbtvt29nkunupm1jknqr Query : use flama_phc
20240916@142309.8159 orqt4rrbtvt29nkunupm1jknqr Query : select st.usalote valor from st where st.ref = '324.1834.00.1'
20240916@142309.8179 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1834.00.1'
20240916@142309.8195 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.8211 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142309.8238 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.8254 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142309.8266 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142309.8277 orqt4rrbtvt29nkunupm1jknqr Query : select sestamp valor from se where ref ='324.1834.00.1' and lote = 'r2400213100a'
20240916@142309.8293 orqt4rrbtvt29nkunupm1jknqr Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142309.8306 orqt4rrbtvt29nkunupm1jknqr Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142309.8316 orqt4rrbtvt29nkunupm1jknqr Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e830907166e8313dca','aut66e838430366e8313d74' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142309.8337 orqt4rrbtvt29nkunupm1jknqr Query : use flama_phc
20240916@142309.8340 orqt4rrbtvt29nkunupm1jknqr Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -116
20240916@142309.8370 orqt4rrbtvt29nkunupm1jknqr Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2031';
20240916@142309.8400 orqt4rrbtvt29nkunupm1jknqr Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2031';
20240916@142309.8949 alankdfu3qher3s0cmqddo6125 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240916@142309.8960 alankdfu3qher3s0cmqddo6125 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240916@142309.9032 alankdfu3qher3s0cmqddo6125 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2032';
20240916@142309.9099 alankdfu3qher3s0cmqddo6125 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2032';
20240916@142310.6330 alankdfu3qher3s0cmqddo6125 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2032';
20240916@142310.6610 alankdfu3qher3s0cmqddo6125 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2032';
20240916@142310.7130 alankdfu3qher3s0cmqddo6125 Query : use flama_phc
20240916@142310.7160 alankdfu3qher3s0cmqddo6125 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240916@142310.7770 alankdfu3qher3s0cmqddo6125 Query : use flama_phc
20240916@142310.7800 alankdfu3qher3s0cmqddo6125 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240916@142310.8200 alankdfu3qher3s0cmqddo6125 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1684.00.1'
20240916@142310.9810 alankdfu3qher3s0cmqddo6125 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405967 and bi.ref ='324.1684.00.1' and bi.lordem =1
20240916@142310.1543 alankdfu3qher3s0cmqddo6125 Query : use flama_phc
20240916@142310.1582 alankdfu3qher3s0cmqddo6125 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240916@142310.1773 alankdfu3qher3s0cmqddo6125 Query : use flama_phc
20240916@142310.1776 alankdfu3qher3s0cmqddo6125 Query : select top 1 1 valor from td where td.ndoc = 39
20240916@142310.1812 alankdfu3qher3s0cmqddo6125 Query : use flama_phc
20240916@142310.1815 alankdfu3qher3s0cmqddo6125 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')
20240916@142310.1843 alankdfu3qher3s0cmqddo6125 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240916@142310.1876 alankdfu3qher3s0cmqddo6125 Query : use flama_phc
20240916@142310.1879 alankdfu3qher3s0cmqddo6125 Query : select top 1 ~inactivo valor from cl where no = '100810' and estab = 0 order by inactivo desc
20240916@142310.1907 alankdfu3qher3s0cmqddo6125 Query : use flama_phc
20240916@142310.1910 alankdfu3qher3s0cmqddo6125 Query : select top 1 tipodoc,regrd from td where ndoc = 39
20240916@142310.2018 alankdfu3qher3s0cmqddo6125 Query : use flama_phc
20240916@142310.2022 alankdfu3qher3s0cmqddo6125 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240916@142310.2065 alankdfu3qher3s0cmqddo6125 Query : use flama_phc
20240916@142310.2068 alankdfu3qher3s0cmqddo6125 Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240916@142310.2114 alankdfu3qher3s0cmqddo6125 Query : use flama_phc
20240916@142310.2116 alankdfu3qher3s0cmqddo6125 Query : select 1 valor from td where ndoc = 39
20240916@142310.2128 alankdfu3qher3s0cmqddo6125 Query : select top 1 manternumero, tiposaft, nmdos,td.assinadoc from td where td.ndoc = 39
20240916@142310.2143 alankdfu3qher3s0cmqddo6125 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142310.2158 alankdfu3qher3s0cmqddo6125 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142310.2176 alankdfu3qher3s0cmqddo6125 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142310.2198 alankdfu3qher3s0cmqddo6125 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142310.2227 alankdfu3qher3s0cmqddo6125 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142310.2245 alankdfu3qher3s0cmqddo6125 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142310.2258 alankdfu3qher3s0cmqddo6125 Query : select top 1 ft.fno valor from ft ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142310.2326 alankdfu3qher3s0cmqddo6125 Query : select top 1 ft.fno valor from wsftdata ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142310.2339 alankdfu3qher3s0cmqddo6125 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142310.2354 alankdfu3qher3s0cmqddo6125 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142310.2368 alankdfu3qher3s0cmqddo6125 Query : insert into wsft3data (ft3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,taxpointdt ) values ('aut66e831652566e8313e37' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?)
20240916@142310.2562 alankdfu3qher3s0cmqddo6125 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142310.2579 alankdfu3qher3s0cmqddo6125 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142310.2614 alankdfu3qher3s0cmqddo6125 Query : select top 1 bo.u_nomeenv valor from bo where bo.bostamp=''
20240916@142310.2626 alankdfu3qher3s0cmqddo6125 Query : select top 1 bo.u_moradaen valor from bo where bo.bostamp=''
20240916@142310.2638 alankdfu3qher3s0cmqddo6125 Query : select top 1 bo.u_codposen valor from bo where bo.bostamp=''
20240916@142310.2649 alankdfu3qher3s0cmqddo6125 Query : select top 1 bo.u_localenv valor from bo where bo.bostamp=''
20240916@142310.2672 alankdfu3qher3s0cmqddo6125 Query : select top 1 bo.trab5 valor from bo where bo.bostamp=''
20240916@142310.2684 alankdfu3qher3s0cmqddo6125 Query : select top 1 bo.serie valor from bo where bo.bostamp=''
20240916@142310.2695 alankdfu3qher3s0cmqddo6125 Query : insert into wsft2data (ft2stamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,u_nomeenv ,u_moradaen ,u_codposen ,u_localenv ,u_coddest ,u_codby ) values ('aut66e831652566e8313e37',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?,?,?,?,?,?)
20240916@142310.3003 alankdfu3qher3s0cmqddo6125 Query : select top 1 fno valor from wsftdata order by fno desc
20240916@142310.3026 alankdfu3qher3s0cmqddo6125 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142310.3043 alankdfu3qher3s0cmqddo6125 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142310.3067 alankdfu3qher3s0cmqddo6125 Query : select 'normal' from dummy
20240916@142310.3082 alankdfu3qher3s0cmqddo6125 Query : insert into wsftdata (ftstamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,fno,no,estab,fdata,ndoc,moeda,cambio,cambiofixo,ftano,site ,classe ) values ('aut66e831652566e8313e37',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',776,100810,0,'2024-09-16',39,'euro',0,0,2024 ,?,?)
20240916@142310.3403 alankdfu3qher3s0cmqddo6125 Query : use flama_phc
20240916@142310.3406 alankdfu3qher3s0cmqddo6125 Query : select st.usalote valor from st where st.ref = '324.1684.00.1'
20240916@142310.3427 alankdfu3qher3s0cmqddo6125 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.1684.00.1'
20240916@142310.3592 alankdfu3qher3s0cmqddo6125 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142310.3609 alankdfu3qher3s0cmqddo6125 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142310.3634 alankdfu3qher3s0cmqddo6125 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142310.3647 alankdfu3qher3s0cmqddo6125 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142310.3656 alankdfu3qher3s0cmqddo6125 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142310.3668 alankdfu3qher3s0cmqddo6125 Query : select sestamp valor from se where ref ='324.1684.00.1' and lote = 'r2301217200a'
20240916@142310.3681 alankdfu3qher3s0cmqddo6125 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142310.3695 alankdfu3qher3s0cmqddo6125 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142310.3706 alankdfu3qher3s0cmqddo6125 Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e831307766e8313e59','aut66e831652566e8313e37' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142310.3716 alankdfu3qher3s0cmqddo6125 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142310.3730 alankdfu3qher3s0cmqddo6125 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142310.3794 alankdfu3qher3s0cmqddo6125 Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e831307766e8313e59',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',1.000 ,'aut66e831652566e8313e37' ,0,0 ,2,23.00,10000,?,?,?,?,?)
20240916@142310.4092 alankdfu3qher3s0cmqddo6125 Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66e831652566e8313e37','2405967','wait',39,'adm09112754980.682000002')
20240916@142310.4158 alankdfu3qher3s0cmqddo6125 Query : use flama_phc
20240916@142310.4161 alankdfu3qher3s0cmqddo6125 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240916@142310.4189 alankdfu3qher3s0cmqddo6125 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2032';
20240916@142310.4218 alankdfu3qher3s0cmqddo6125 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2032';
20240916@142310.4257 alankdfu3qher3s0cmqddo6125 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2032';
20240916@142310.4281 alankdfu3qher3s0cmqddo6125 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2032';
20240916@142310.4846 d1u322j43brdrok57bkc30va6k Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240916@142310.4857 d1u322j43brdrok57bkc30va6k Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240916@142310.4908 d1u322j43brdrok57bkc30va6k Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2033';
20240916@142310.4964 d1u322j43brdrok57bkc30va6k Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2033';
20240916@142310.5014 d1u322j43brdrok57bkc30va6k Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2033';
20240916@142310.5039 d1u322j43brdrok57bkc30va6k Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2033';
20240916@142310.5085 d1u322j43brdrok57bkc30va6k Query : use flama_phc
20240916@142310.5089 d1u322j43brdrok57bkc30va6k Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240916@142310.5148 d1u322j43brdrok57bkc30va6k Query : use flama_phc
20240916@142310.5151 d1u322j43brdrok57bkc30va6k Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240916@142310.5189 d1u322j43brdrok57bkc30va6k Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1831.00.2'
20240916@142310.5344 d1u322j43brdrok57bkc30va6k Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405968 and bi.ref ='324.1831.00.2' and bi.lordem =1
20240916@142310.5671 d1u322j43brdrok57bkc30va6k Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1831.00.2'
20240916@142310.5693 d1u322j43brdrok57bkc30va6k Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405968 and bi.ref ='324.1831.00.2' and bi.lordem =1
20240916@142310.5712 d1u322j43brdrok57bkc30va6k Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1831.00.2'
20240916@142310.5732 d1u322j43brdrok57bkc30va6k Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405968 and bi.ref ='324.1831.00.2' and bi.lordem =1
20240916@142310.5751 d1u322j43brdrok57bkc30va6k Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1831.00.2'
20240916@142310.5770 d1u322j43brdrok57bkc30va6k Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405968 and bi.ref ='324.1831.00.2' and bi.lordem =1
20240916@142310.5786 d1u322j43brdrok57bkc30va6k Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1831.00.2'
20240916@142310.5805 d1u322j43brdrok57bkc30va6k Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405968 and bi.ref ='324.1831.00.2' and bi.lordem =1
20240916@142310.5822 d1u322j43brdrok57bkc30va6k Query : use flama_phc
20240916@142310.5825 d1u322j43brdrok57bkc30va6k Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240916@142310.5857 d1u322j43brdrok57bkc30va6k Query : use flama_phc
20240916@142310.5860 d1u322j43brdrok57bkc30va6k Query : select top 1 1 valor from td where td.ndoc = 39
20240916@142310.5889 d1u322j43brdrok57bkc30va6k Query : use flama_phc
20240916@142310.5893 d1u322j43brdrok57bkc30va6k 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')
20240916@142310.5921 d1u322j43brdrok57bkc30va6k Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240916@142310.5956 d1u322j43brdrok57bkc30va6k Query : use flama_phc
20240916@142310.5959 d1u322j43brdrok57bkc30va6k Query : select top 1 ~inactivo valor from cl where no = '100810' and estab = 0 order by inactivo desc
20240916@142310.5988 d1u322j43brdrok57bkc30va6k Query : use flama_phc
20240916@142310.5991 d1u322j43brdrok57bkc30va6k Query : select top 1 tipodoc,regrd from td where ndoc = 39
20240916@142310.6021 d1u322j43brdrok57bkc30va6k Query : use flama_phc
20240916@142310.6024 d1u322j43brdrok57bkc30va6k Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240916@142310.6063 d1u322j43brdrok57bkc30va6k Query : use flama_phc
20240916@142310.6068 d1u322j43brdrok57bkc30va6k Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240916@142310.6112 d1u322j43brdrok57bkc30va6k Query : use flama_phc
20240916@142310.6115 d1u322j43brdrok57bkc30va6k Query : select 1 valor from td where ndoc = 39
20240916@142310.6127 d1u322j43brdrok57bkc30va6k Query : select top 1 manternumero, tiposaft, nmdos,td.assinadoc from td where td.ndoc = 39
20240916@142310.6140 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142310.6155 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142310.6173 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142310.6187 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142310.6215 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142310.6229 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142310.6243 d1u322j43brdrok57bkc30va6k Query : select top 1 ft.fno valor from ft ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142310.6310 d1u322j43brdrok57bkc30va6k Query : select top 1 ft.fno valor from wsftdata ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142310.6322 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142310.6340 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142310.6355 d1u322j43brdrok57bkc30va6k Query : insert into wsft3data (ft3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,taxpointdt ) values ('aut66e833018166e8313e98' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?)
20240916@142310.6539 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142310.6557 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142310.6589 d1u322j43brdrok57bkc30va6k Query : select top 1 bo.u_nomeenv valor from bo where bo.bostamp=''
20240916@142310.6600 d1u322j43brdrok57bkc30va6k Query : select top 1 bo.u_moradaen valor from bo where bo.bostamp=''
20240916@142310.6611 d1u322j43brdrok57bkc30va6k Query : select top 1 bo.u_codposen valor from bo where bo.bostamp=''
20240916@142310.6622 d1u322j43brdrok57bkc30va6k Query : select top 1 bo.u_localenv valor from bo where bo.bostamp=''
20240916@142310.6633 d1u322j43brdrok57bkc30va6k Query : select top 1 bo.trab5 valor from bo where bo.bostamp=''
20240916@142310.6643 d1u322j43brdrok57bkc30va6k Query : select top 1 bo.serie valor from bo where bo.bostamp=''
20240916@142310.6654 d1u322j43brdrok57bkc30va6k Query : insert into wsft2data (ft2stamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,u_nomeenv ,u_moradaen ,u_codposen ,u_localenv ,u_coddest ,u_codby ) values ('aut66e833018166e8313e98',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?,?,?,?,?,?)
20240916@142310.6914 d1u322j43brdrok57bkc30va6k Query : select top 1 fno valor from wsftdata order by fno desc
20240916@142310.6934 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142310.6950 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142310.6971 d1u322j43brdrok57bkc30va6k Query : select 'normal' from dummy
20240916@142310.6986 d1u322j43brdrok57bkc30va6k Query : insert into wsftdata (ftstamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,fno,no,estab,fdata,ndoc,moeda,cambio,cambiofixo,ftano,site ,classe ) values ('aut66e833018166e8313e98',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',777,100810,0,'2024-09-16',39,'euro',0,0,2024 ,?,?)
20240916@142310.7367 d1u322j43brdrok57bkc30va6k Query : use flama_phc
20240916@142310.7370 d1u322j43brdrok57bkc30va6k Query : select st.usalote valor from st where st.ref = '324.1831.00.2'
20240916@142310.7392 d1u322j43brdrok57bkc30va6k Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1831.00.2'
20240916@142311.1110 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.1300 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142311.1570 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.1710 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142311.1800 d1u322j43brdrok57bkc30va6k Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142311.1940 d1u322j43brdrok57bkc30va6k Query : select sestamp valor from se where ref ='324.1831.00.2' and lote = 'r2400401175a'
20240916@142311.2080 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.2240 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142311.2390 d1u322j43brdrok57bkc30va6k Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e839540466e8313f05','aut66e833018166e8313e98' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142311.2440 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.2600 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142311.2930 d1u322j43brdrok57bkc30va6k Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e839540466e8313f05',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',20.000 ,'aut66e833018166e8313e98' ,0,0 ,2,23.00,10000,?,?,?,?,?)
20240916@142311.6060 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.6250 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142311.6550 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.6720 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142311.6830 d1u322j43brdrok57bkc30va6k Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142311.7050 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.7210 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142311.7340 d1u322j43brdrok57bkc30va6k Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e834028866e8313f11','aut66e833018166e8313e98' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142311.7390 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.7570 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142311.7900 d1u322j43brdrok57bkc30va6k Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e834028866e8313f11',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e833018166e8313e98' ,0,0 ,2,23.00,20000,?,?,?)
20240916@142311.1070 d1u322j43brdrok57bkc30va6k Query : use flama_phc
20240916@142311.1074 d1u322j43brdrok57bkc30va6k Query : select st.usalote valor from st where st.ref = '324.1831.00.2'
20240916@142311.1098 d1u322j43brdrok57bkc30va6k Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1831.00.2'
20240916@142311.1114 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.1133 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142311.1166 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.1185 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142311.1195 d1u322j43brdrok57bkc30va6k Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142311.1210 d1u322j43brdrok57bkc30va6k Query : select sestamp valor from se where ref ='324.1831.00.2' and lote = 'r2400401175a'
20240916@142311.1224 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.1242 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142311.1256 d1u322j43brdrok57bkc30va6k Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e833103666e8313f1d','aut66e833018166e8313e98' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142311.1261 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.1280 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142311.1312 d1u322j43brdrok57bkc30va6k Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e833103666e8313f1d',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',20.000 ,'aut66e833018166e8313e98' ,0,0 ,2,23.00,40000,?,?,?,?,?)
20240916@142311.1600 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.1617 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142311.1644 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.1659 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142311.1668 d1u322j43brdrok57bkc30va6k Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142311.1680 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.1695 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142311.1706 d1u322j43brdrok57bkc30va6k Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e836992666e8313f29','aut66e833018166e8313e98' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142311.1710 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.1724 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142311.1751 d1u322j43brdrok57bkc30va6k Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e836992666e8313f29',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e833018166e8313e98' ,0,0 ,2,23.00,50000,?,?,?)
20240916@142311.1995 d1u322j43brdrok57bkc30va6k Query : use flama_phc
20240916@142311.2000 d1u322j43brdrok57bkc30va6k Query : select st.usalote valor from st where st.ref = '324.1831.00.2'
20240916@142311.2019 d1u322j43brdrok57bkc30va6k Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1831.00.2'
20240916@142311.2032 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.2047 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142311.2181 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.3599 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142311.3609 d1u322j43brdrok57bkc30va6k Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142311.3621 d1u322j43brdrok57bkc30va6k Query : select sestamp valor from se where ref ='324.1831.00.2' and lote = 'r2400401175a'
20240916@142311.3634 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.3649 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142311.3660 d1u322j43brdrok57bkc30va6k Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e838848466e8313f58','aut66e833018166e8313e98' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142311.3665 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.3679 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142311.3706 d1u322j43brdrok57bkc30va6k Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e838848466e8313f58',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',20.000 ,'aut66e833018166e8313e98' ,0,0 ,2,23.00,70000,?,?,?,?,?)
20240916@142311.3976 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.3998 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142311.4023 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.4039 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142311.4049 d1u322j43brdrok57bkc30va6k Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142311.4060 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.4074 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142311.4086 d1u322j43brdrok57bkc30va6k Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e839612566e8313f63','aut66e833018166e8313e98' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142311.4091 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.4106 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142311.4133 d1u322j43brdrok57bkc30va6k Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e839612566e8313f63',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e833018166e8313e98' ,0,0 ,2,23.00,80000,?,?,?)
20240916@142311.4566 d1u322j43brdrok57bkc30va6k Query : use flama_phc
20240916@142311.4681 d1u322j43brdrok57bkc30va6k Query : select st.usalote valor from st where st.ref = '324.1831.00.2'
20240916@142311.4703 d1u322j43brdrok57bkc30va6k Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1831.00.2'
20240916@142311.4716 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.4732 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142311.4757 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.4771 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142311.4779 d1u322j43brdrok57bkc30va6k Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142311.4790 d1u322j43brdrok57bkc30va6k Query : select sestamp valor from se where ref ='324.1831.00.2' and lote = 'r2400401175a'
20240916@142311.4802 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.4816 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142311.4827 d1u322j43brdrok57bkc30va6k Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e832239366e8313f75','aut66e833018166e8313e98' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142311.4832 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.4845 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142311.4871 d1u322j43brdrok57bkc30va6k Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e832239366e8313f75',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',20.000 ,'aut66e833018166e8313e98' ,0,0 ,2,23.00,100000,?,?,?,?,?)
20240916@142311.5279 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.5296 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142311.5320 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.5334 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142311.5342 d1u322j43brdrok57bkc30va6k Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142311.5354 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.5368 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142311.5379 d1u322j43brdrok57bkc30va6k Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e833150366e8313f82','aut66e833018166e8313e98' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142311.5383 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.5397 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142311.5444 d1u322j43brdrok57bkc30va6k Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e833150366e8313f82',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e833018166e8313e98' ,0,0 ,2,23.00,110000,?,?,?)
20240916@142311.5692 d1u322j43brdrok57bkc30va6k Query : use flama_phc
20240916@142311.5695 d1u322j43brdrok57bkc30va6k Query : select st.usalote valor from st where st.ref = '324.1831.00.2'
20240916@142311.5714 d1u322j43brdrok57bkc30va6k Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1831.00.2'
20240916@142311.5727 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.5742 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142311.5768 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.5782 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142311.5790 d1u322j43brdrok57bkc30va6k Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142311.5801 d1u322j43brdrok57bkc30va6k Query : select sestamp valor from se where ref ='324.1831.00.2' and lote = 'r2400401175a'
20240916@142311.5813 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.5827 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142311.5838 d1u322j43brdrok57bkc30va6k Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e838830566e8313f8d','aut66e833018166e8313e98' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142311.5842 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.5856 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142311.6249 d1u322j43brdrok57bkc30va6k Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e838830566e8313f8d',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',20.000 ,'aut66e833018166e8313e98' ,0,0 ,2,23.00,130000,?,?,?,?,?)
20240916@142311.6511 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.6528 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142311.6552 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.6566 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142311.6574 d1u322j43brdrok57bkc30va6k Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142311.6587 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.6604 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142311.6616 d1u322j43brdrok57bkc30va6k Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e830062166e8313fa0','aut66e833018166e8313e98' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142311.6620 d1u322j43brdrok57bkc30va6k Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.6634 d1u322j43brdrok57bkc30va6k Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142311.6661 d1u322j43brdrok57bkc30va6k Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e830062166e8313fa0',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e833018166e8313e98' ,0,0 ,2,23.00,140000,?,?,?)
20240916@142311.6909 d1u322j43brdrok57bkc30va6k Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66e833018166e8313e98','2405968','wait',39,'adm09112754980.682000002')
20240916@142311.6976 d1u322j43brdrok57bkc30va6k Query : use flama_phc
20240916@142311.6979 d1u322j43brdrok57bkc30va6k Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240916@142311.7010 d1u322j43brdrok57bkc30va6k Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2033';
20240916@142311.7038 d1u322j43brdrok57bkc30va6k Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2033';
20240916@142311.7136 d1u322j43brdrok57bkc30va6k Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2033';
20240916@142311.7164 d1u322j43brdrok57bkc30va6k Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2033';
20240916@142311.7828 grdusv04habptifdl3ig0glm2g Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240916@142311.7840 grdusv04habptifdl3ig0glm2g Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240916@142311.7895 grdusv04habptifdl3ig0glm2g Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2034';
20240916@142311.7949 grdusv04habptifdl3ig0glm2g Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2034';
20240916@142311.8001 grdusv04habptifdl3ig0glm2g Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2034';
20240916@142311.8024 grdusv04habptifdl3ig0glm2g Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2034';
20240916@142311.8069 grdusv04habptifdl3ig0glm2g Query : use flama_phc
20240916@142311.8071 grdusv04habptifdl3ig0glm2g Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240916@142311.8133 grdusv04habptifdl3ig0glm2g Query : use flama_phc
20240916@142311.8136 grdusv04habptifdl3ig0glm2g Query : select no, estab,szadrsdesc from szadrs where u_coddest=6737
20240916@142311.8219 grdusv04habptifdl3ig0glm2g Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '327.8261.00.1'
20240916@142311.8392 grdusv04habptifdl3ig0glm2g Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405969 and bi.ref ='327.8261.00.1' and bi.lordem =1
20240916@142311.8715 grdusv04habptifdl3ig0glm2g Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '327.8261.00.1'
20240916@142311.8735 grdusv04habptifdl3ig0glm2g Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405969 and bi.ref ='327.8261.00.1' and bi.lordem =1
20240916@142311.8751 grdusv04habptifdl3ig0glm2g Query : use flama_phc
20240916@142311.8754 grdusv04habptifdl3ig0glm2g Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240916@142311.8784 grdusv04habptifdl3ig0glm2g Query : use flama_phc
20240916@142311.8787 grdusv04habptifdl3ig0glm2g Query : select top 1 1 valor from td where td.ndoc = 39
20240916@142311.8815 grdusv04habptifdl3ig0glm2g Query : use flama_phc
20240916@142311.8817 grdusv04habptifdl3ig0glm2g 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')
20240916@142311.8843 grdusv04habptifdl3ig0glm2g Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240916@142311.8877 grdusv04habptifdl3ig0glm2g Query : use flama_phc
20240916@142311.8879 grdusv04habptifdl3ig0glm2g Query : select top 1 ~inactivo valor from cl where no = '100810' and estab = 0 order by inactivo desc
20240916@142311.8907 grdusv04habptifdl3ig0glm2g Query : use flama_phc
20240916@142311.8910 grdusv04habptifdl3ig0glm2g Query : select top 1 tipodoc,regrd from td where ndoc = 39
20240916@142311.8938 grdusv04habptifdl3ig0glm2g Query : use flama_phc
20240916@142311.8941 grdusv04habptifdl3ig0glm2g Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240916@142311.8978 grdusv04habptifdl3ig0glm2g Query : use flama_phc
20240916@142311.8980 grdusv04habptifdl3ig0glm2g Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-plaza large formats rainha'
20240916@142311.9024 grdusv04habptifdl3ig0glm2g Query : use flama_phc
20240916@142311.9027 grdusv04habptifdl3ig0glm2g Query : select 1 valor from td where ndoc = 39
20240916@142311.9038 grdusv04habptifdl3ig0glm2g Query : select top 1 manternumero, tiposaft, nmdos,td.assinadoc from td where td.ndoc = 39
20240916@142311.9051 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.9066 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142311.9083 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.9097 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142311.9122 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.9136 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142311.9148 grdusv04habptifdl3ig0glm2g Query : select top 1 ft.fno valor from ft ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142311.9249 grdusv04habptifdl3ig0glm2g Query : select top 1 ft.fno valor from wsftdata ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142311.9264 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.9283 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142311.9300 grdusv04habptifdl3ig0glm2g Query : insert into wsft3data (ft3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,taxpointdt ) values ('aut66e834154466e8313fdf' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?)
20240916@142311.9608 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142311.9806 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142311.9934 grdusv04habptifdl3ig0glm2g Query : select top 1 bo.u_nomeenv valor from bo where bo.bostamp=''
20240916@142311.9946 grdusv04habptifdl3ig0glm2g Query : select top 1 bo.u_moradaen valor from bo where bo.bostamp=''
20240916@142311.9957 grdusv04habptifdl3ig0glm2g Query : select top 1 bo.u_codposen valor from bo where bo.bostamp=''
20240916@142311.9968 grdusv04habptifdl3ig0glm2g Query : select top 1 bo.u_localenv valor from bo where bo.bostamp=''
20240916@142311.9978 grdusv04habptifdl3ig0glm2g Query : select top 1 bo.trab5 valor from bo where bo.bostamp=''
20240916@142311.9989 grdusv04habptifdl3ig0glm2g Query : select top 1 bo.serie valor from bo where bo.bostamp=''
20240916@142312.0000 grdusv04habptifdl3ig0glm2g Query : insert into wsft2data (ft2stamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,u_nomeenv ,u_moradaen ,u_codposen ,u_localenv ,u_coddest ,u_codby ) values ('aut66e834154466e8313fdf',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?,?,?,?,?,?)
20240916@142312.3110 grdusv04habptifdl3ig0glm2g Query : select top 1 fno valor from wsftdata order by fno desc
20240916@142312.4520 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.5180 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142312.6470 grdusv04habptifdl3ig0glm2g Query : select 'normal' from dummy
20240916@142312.7420 grdusv04habptifdl3ig0glm2g Query : insert into wsftdata (ftstamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,fno,no,estab,fdata,ndoc,moeda,cambio,cambiofixo,ftano,site ,classe ) values ('aut66e834154466e8313fdf',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',778,100810,0,'2024-09-16',39,'euro',0,0,2024 ,?,?)
20240916@142312.1122 grdusv04habptifdl3ig0glm2g Query : use flama_phc
20240916@142312.1125 grdusv04habptifdl3ig0glm2g Query : select st.usalote valor from st where st.ref = '327.8261.00.1'
20240916@142312.1148 grdusv04habptifdl3ig0glm2g Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '327.8261.00.1'
20240916@142312.1296 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.1311 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142312.1336 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.1351 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142312.1360 grdusv04habptifdl3ig0glm2g Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142312.1372 grdusv04habptifdl3ig0glm2g Query : select sestamp valor from se where ref ='327.8261.00.1' and lote = 'r2400465200a'
20240916@142312.1388 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.1402 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142312.1414 grdusv04habptifdl3ig0glm2g Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e830253866e8314021','aut66e834154466e8313fdf' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142312.1418 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.1435 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142312.1465 grdusv04habptifdl3ig0glm2g Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e830253866e8314021',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',4.000 ,'aut66e834154466e8313fdf' ,0,0 ,2,23.00,10000,?,?,?,?,?)
20240916@142312.1732 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.1748 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142312.1771 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.1785 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142312.1793 grdusv04habptifdl3ig0glm2g Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142312.1804 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.1818 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142312.1829 grdusv04habptifdl3ig0glm2g Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e839484266e831402c','aut66e834154466e8313fdf' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142312.1834 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.1847 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142312.1873 grdusv04habptifdl3ig0glm2g Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e839484266e831402c',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e834154466e8313fdf' ,0,0 ,2,23.00,20000,?,?,?)
20240916@142312.2125 grdusv04habptifdl3ig0glm2g Query : use flama_phc
20240916@142312.2127 grdusv04habptifdl3ig0glm2g Query : select st.usalote valor from st where st.ref = '327.8261.00.1'
20240916@142312.2145 grdusv04habptifdl3ig0glm2g Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '327.8261.00.1'
20240916@142312.2158 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.2173 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142312.2196 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.2210 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142312.2218 grdusv04habptifdl3ig0glm2g Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142312.2228 grdusv04habptifdl3ig0glm2g Query : select sestamp valor from se where ref ='327.8261.00.1' and lote = 'r2400465200a'
20240916@142312.2240 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.2253 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142312.2265 grdusv04habptifdl3ig0glm2g Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e835248266e8314036','aut66e834154466e8313fdf' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142312.2269 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.2282 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142312.2308 grdusv04habptifdl3ig0glm2g Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e835248266e8314036',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',1.000 ,'aut66e834154466e8313fdf' ,0,0 ,2,23.00,40000,?,?,?,?,?)
20240916@142312.2985 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.4023 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142312.4047 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.4062 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142312.4076 grdusv04habptifdl3ig0glm2g Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142312.4088 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.4104 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142312.4115 grdusv04habptifdl3ig0glm2g Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e839921766e8314063','aut66e834154466e8313fdf' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142312.4119 grdusv04habptifdl3ig0glm2g Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.4133 grdusv04habptifdl3ig0glm2g Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142312.4159 grdusv04habptifdl3ig0glm2g Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e839921766e8314063',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e834154466e8313fdf' ,0,0 ,2,23.00,50000,?,?,?)
20240916@142312.4413 grdusv04habptifdl3ig0glm2g Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66e834154466e8313fdf','2405969','wait',39,'adm09112754980.682000002')
20240916@142312.4482 grdusv04habptifdl3ig0glm2g Query : use flama_phc
20240916@142312.4485 grdusv04habptifdl3ig0glm2g Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240916@142312.4518 grdusv04habptifdl3ig0glm2g Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2034';
20240916@142312.4546 grdusv04habptifdl3ig0glm2g Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2034';
20240916@142312.4586 grdusv04habptifdl3ig0glm2g Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2034';
20240916@142312.4609 grdusv04habptifdl3ig0glm2g Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2034';
20240916@142312.5125 vra4iuglhg2ti8mkl3odnm7erm Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240916@142312.5135 vra4iuglhg2ti8mkl3odnm7erm Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240916@142312.5185 vra4iuglhg2ti8mkl3odnm7erm Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2035';
20240916@142312.5237 vra4iuglhg2ti8mkl3odnm7erm Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2035';
20240916@142312.5289 vra4iuglhg2ti8mkl3odnm7erm Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2035';
20240916@142312.5316 vra4iuglhg2ti8mkl3odnm7erm Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2035';
20240916@142312.5364 vra4iuglhg2ti8mkl3odnm7erm Query : use flama_phc
20240916@142312.5367 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240916@142312.5426 vra4iuglhg2ti8mkl3odnm7erm Query : use flama_phc
20240916@142312.5429 vra4iuglhg2ti8mkl3odnm7erm Query : select no, estab,szadrsdesc from szadrs where u_coddest=6737
20240916@142312.5467 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '327.8460.00.1'
20240916@142312.5620 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405970 and bi.ref ='327.8460.00.1' and bi.lordem =1
20240916@142312.5936 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '327.8460.00.1'
20240916@142312.5955 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405970 and bi.ref ='327.8460.00.1' and bi.lordem =1
20240916@142312.5970 vra4iuglhg2ti8mkl3odnm7erm Query : use flama_phc
20240916@142312.5973 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240916@142312.6003 vra4iuglhg2ti8mkl3odnm7erm Query : use flama_phc
20240916@142312.6006 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 1 valor from td where td.ndoc = 39
20240916@142312.6033 vra4iuglhg2ti8mkl3odnm7erm Query : use flama_phc
20240916@142312.6035 vra4iuglhg2ti8mkl3odnm7erm 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')
20240916@142312.6061 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240916@142312.6093 vra4iuglhg2ti8mkl3odnm7erm Query : use flama_phc
20240916@142312.6096 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 ~inactivo valor from cl where no = '100810' and estab = 0 order by inactivo desc
20240916@142312.6124 vra4iuglhg2ti8mkl3odnm7erm Query : use flama_phc
20240916@142312.6127 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 tipodoc,regrd from td where ndoc = 39
20240916@142312.6156 vra4iuglhg2ti8mkl3odnm7erm Query : use flama_phc
20240916@142312.6159 vra4iuglhg2ti8mkl3odnm7erm Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240916@142312.6195 vra4iuglhg2ti8mkl3odnm7erm Query : use flama_phc
20240916@142312.6198 vra4iuglhg2ti8mkl3odnm7erm Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-plaza large formats rainha'
20240916@142312.6239 vra4iuglhg2ti8mkl3odnm7erm Query : use flama_phc
20240916@142312.6242 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from td where ndoc = 39
20240916@142312.6253 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 manternumero, tiposaft, nmdos,td.assinadoc from td where td.ndoc = 39
20240916@142312.6266 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.6280 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142312.6299 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.6312 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142312.6337 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.6351 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142312.6362 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 ft.fno valor from ft ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142312.6499 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 ft.fno valor from wsftdata ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142312.6511 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.6527 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142312.6543 vra4iuglhg2ti8mkl3odnm7erm Query : insert into wsft3data (ft3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,taxpointdt ) values ('aut66e839665666e831409b' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?)
20240916@142312.6722 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.6738 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142312.6767 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 bo.u_nomeenv valor from bo where bo.bostamp=''
20240916@142312.6779 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 bo.u_moradaen valor from bo where bo.bostamp=''
20240916@142312.6790 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 bo.u_codposen valor from bo where bo.bostamp=''
20240916@142312.6801 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 bo.u_localenv valor from bo where bo.bostamp=''
20240916@142312.6811 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 bo.trab5 valor from bo where bo.bostamp=''
20240916@142312.6822 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 bo.serie valor from bo where bo.bostamp=''
20240916@142312.6832 vra4iuglhg2ti8mkl3odnm7erm Query : insert into wsft2data (ft2stamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,u_nomeenv ,u_moradaen ,u_codposen ,u_localenv ,u_coddest ,u_codby ) values ('aut66e839665666e831409b',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?,?,?,?,?,?)
20240916@142312.7089 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 fno valor from wsftdata order by fno desc
20240916@142312.7109 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.7126 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142312.7147 vra4iuglhg2ti8mkl3odnm7erm Query : select 'normal' from dummy
20240916@142312.7162 vra4iuglhg2ti8mkl3odnm7erm Query : insert into wsftdata (ftstamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,fno,no,estab,fdata,ndoc,moeda,cambio,cambiofixo,ftano,site ,classe ) values ('aut66e839665666e831409b',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',779,100810,0,'2024-09-16',39,'euro',0,0,2024 ,?,?)
20240916@142312.7444 vra4iuglhg2ti8mkl3odnm7erm Query : use flama_phc
20240916@142312.7447 vra4iuglhg2ti8mkl3odnm7erm Query : select st.usalote valor from st where st.ref = '327.8460.00.1'
20240916@142312.7469 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '327.8460.00.1'
20240916@142312.7611 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.7626 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142312.7653 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.7668 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142312.7676 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142312.7689 vra4iuglhg2ti8mkl3odnm7erm Query : select sestamp valor from se where ref ='327.8460.00.1' and lote = 'r2300002100a'
20240916@142312.7702 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.7716 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142312.7728 vra4iuglhg2ti8mkl3odnm7erm Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e830504166e83140bc','aut66e839665666e831409b' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142312.7732 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.7747 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142312.7773 vra4iuglhg2ti8mkl3odnm7erm Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e830504166e83140bc',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',4.000 ,'aut66e839665666e831409b' ,0,0 ,2,23.00,10000,?,?,?,?,?)
20240916@142312.8037 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.8053 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142312.8078 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.8092 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142312.8100 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142312.8111 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.8125 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142312.8136 vra4iuglhg2ti8mkl3odnm7erm Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e832012566e83140c6','aut66e839665666e831409b' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142312.8152 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.8166 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142312.8197 vra4iuglhg2ti8mkl3odnm7erm Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e832012566e83140c6',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e839665666e831409b' ,0,0 ,2,23.00,20000,?,?,?)
20240916@142312.8484 vra4iuglhg2ti8mkl3odnm7erm Query : use flama_phc
20240916@142312.8487 vra4iuglhg2ti8mkl3odnm7erm Query : select st.usalote valor from st where st.ref = '327.8460.00.1'
20240916@142312.8506 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '327.8460.00.1'
20240916@142312.8520 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.8536 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142312.8560 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.8574 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142312.8582 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142312.8593 vra4iuglhg2ti8mkl3odnm7erm Query : select sestamp valor from se where ref ='327.8460.00.1' and lote = 'r2300002100a'
20240916@142312.8605 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.8618 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142312.8629 vra4iuglhg2ti8mkl3odnm7erm Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e832095366e83140d2','aut66e839665666e831409b' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142312.8634 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.8648 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142312.8674 vra4iuglhg2ti8mkl3odnm7erm Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e832095366e83140d2',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',1.000 ,'aut66e839665666e831409b' ,0,0 ,2,23.00,40000,?,?,?,?,?)
20240916@142312.8940 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.8959 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142312.8985 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.9000 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142312.9009 vra4iuglhg2ti8mkl3odnm7erm Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142312.9021 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.9037 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142312.9049 vra4iuglhg2ti8mkl3odnm7erm Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e831849466e83140dc','aut66e839665666e831409b' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142312.9053 vra4iuglhg2ti8mkl3odnm7erm Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142312.9067 vra4iuglhg2ti8mkl3odnm7erm Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142312.9096 vra4iuglhg2ti8mkl3odnm7erm Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e831849466e83140dc',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e839665666e831409b' ,0,0 ,2,23.00,50000,?,?,?)
20240916@142313.1819 vra4iuglhg2ti8mkl3odnm7erm Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66e839665666e831409b','2405970','wait',39,'adm09112754980.682000002')
20240916@142313.1986 vra4iuglhg2ti8mkl3odnm7erm Query : use flama_phc
20240916@142313.1989 vra4iuglhg2ti8mkl3odnm7erm Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240916@142313.2029 vra4iuglhg2ti8mkl3odnm7erm Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2035';
20240916@142313.2078 vra4iuglhg2ti8mkl3odnm7erm Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2035';
20240916@142313.2134 vra4iuglhg2ti8mkl3odnm7erm Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2035';
20240916@142313.2159 vra4iuglhg2ti8mkl3odnm7erm Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2035';
20240916@142313.2822 0o3k5qesq6imfcftutmq8ajaop Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240916@142313.2833 0o3k5qesq6imfcftutmq8ajaop Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240916@142313.2888 0o3k5qesq6imfcftutmq8ajaop Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2036';
20240916@142313.4076 0o3k5qesq6imfcftutmq8ajaop Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2036';
20240916@142313.4129 0o3k5qesq6imfcftutmq8ajaop Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2036';
20240916@142313.4155 0o3k5qesq6imfcftutmq8ajaop Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2036';
20240916@142313.4199 0o3k5qesq6imfcftutmq8ajaop Query : use flama_phc
20240916@142313.4202 0o3k5qesq6imfcftutmq8ajaop Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240916@142313.4260 0o3k5qesq6imfcftutmq8ajaop Query : use flama_phc
20240916@142313.4263 0o3k5qesq6imfcftutmq8ajaop Query : select no, estab,szadrsdesc from szadrs where u_coddest=6737
20240916@142313.4303 0o3k5qesq6imfcftutmq8ajaop Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '328.9326.00.1'
20240916@142313.4460 0o3k5qesq6imfcftutmq8ajaop Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405971 and bi.ref ='328.9326.00.1' and bi.lordem =1
20240916@142313.4781 0o3k5qesq6imfcftutmq8ajaop Query : use flama_phc
20240916@142313.4784 0o3k5qesq6imfcftutmq8ajaop Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240916@142313.4815 0o3k5qesq6imfcftutmq8ajaop Query : use flama_phc
20240916@142313.4818 0o3k5qesq6imfcftutmq8ajaop Query : select top 1 1 valor from td where td.ndoc = 39
20240916@142313.4846 0o3k5qesq6imfcftutmq8ajaop Query : use flama_phc
20240916@142313.4849 0o3k5qesq6imfcftutmq8ajaop 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')
20240916@142313.4875 0o3k5qesq6imfcftutmq8ajaop Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240916@142313.4910 0o3k5qesq6imfcftutmq8ajaop Query : use flama_phc
20240916@142313.4913 0o3k5qesq6imfcftutmq8ajaop Query : select top 1 ~inactivo valor from cl where no = '100810' and estab = 0 order by inactivo desc
20240916@142313.4943 0o3k5qesq6imfcftutmq8ajaop Query : use flama_phc
20240916@142313.4945 0o3k5qesq6imfcftutmq8ajaop Query : select top 1 tipodoc,regrd from td where ndoc = 39
20240916@142313.5015 0o3k5qesq6imfcftutmq8ajaop Query : use flama_phc
20240916@142313.5018 0o3k5qesq6imfcftutmq8ajaop Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240916@142313.5055 0o3k5qesq6imfcftutmq8ajaop Query : use flama_phc
20240916@142313.5058 0o3k5qesq6imfcftutmq8ajaop Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-plaza large formats rainha'
20240916@142313.5101 0o3k5qesq6imfcftutmq8ajaop Query : use flama_phc
20240916@142313.5104 0o3k5qesq6imfcftutmq8ajaop Query : select 1 valor from td where ndoc = 39
20240916@142313.5116 0o3k5qesq6imfcftutmq8ajaop Query : select top 1 manternumero, tiposaft, nmdos,td.assinadoc from td where td.ndoc = 39
20240916@142313.5129 0o3k5qesq6imfcftutmq8ajaop Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142313.5147 0o3k5qesq6imfcftutmq8ajaop Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142313.5164 0o3k5qesq6imfcftutmq8ajaop Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142313.5178 0o3k5qesq6imfcftutmq8ajaop Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142313.5205 0o3k5qesq6imfcftutmq8ajaop Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142313.5219 0o3k5qesq6imfcftutmq8ajaop Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142313.5230 0o3k5qesq6imfcftutmq8ajaop Query : select top 1 ft.fno valor from ft ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142313.5297 0o3k5qesq6imfcftutmq8ajaop Query : select top 1 ft.fno valor from wsftdata ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142313.5309 0o3k5qesq6imfcftutmq8ajaop Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142313.5325 0o3k5qesq6imfcftutmq8ajaop Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142313.5340 0o3k5qesq6imfcftutmq8ajaop Query : insert into wsft3data (ft3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,taxpointdt ) values ('aut66e830118566e831417f' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?)
20240916@142313.5642 0o3k5qesq6imfcftutmq8ajaop Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142313.5662 0o3k5qesq6imfcftutmq8ajaop Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142313.5694 0o3k5qesq6imfcftutmq8ajaop Query : select top 1 bo.u_nomeenv valor from bo where bo.bostamp=''
20240916@142313.5705 0o3k5qesq6imfcftutmq8ajaop Query : select top 1 bo.u_moradaen valor from bo where bo.bostamp=''
20240916@142313.5716 0o3k5qesq6imfcftutmq8ajaop Query : select top 1 bo.u_codposen valor from bo where bo.bostamp=''
20240916@142313.5727 0o3k5qesq6imfcftutmq8ajaop Query : select top 1 bo.u_localenv valor from bo where bo.bostamp=''
20240916@142313.5738 0o3k5qesq6imfcftutmq8ajaop Query : select top 1 bo.trab5 valor from bo where bo.bostamp=''
20240916@142313.5751 0o3k5qesq6imfcftutmq8ajaop Query : select top 1 bo.serie valor from bo where bo.bostamp=''
20240916@142313.5762 0o3k5qesq6imfcftutmq8ajaop Query : insert into wsft2data (ft2stamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,u_nomeenv ,u_moradaen ,u_codposen ,u_localenv ,u_coddest ,u_codby ) values ('aut66e830118566e831417f',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?,?,?,?,?,?)
20240916@142313.6008 0o3k5qesq6imfcftutmq8ajaop Query : select top 1 fno valor from wsftdata order by fno desc
20240916@142313.6029 0o3k5qesq6imfcftutmq8ajaop Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142313.6044 0o3k5qesq6imfcftutmq8ajaop Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142313.6066 0o3k5qesq6imfcftutmq8ajaop Query : select 'normal' from dummy
20240916@142313.6080 0o3k5qesq6imfcftutmq8ajaop Query : insert into wsftdata (ftstamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,fno,no,estab,fdata,ndoc,moeda,cambio,cambiofixo,ftano,site ,classe ) values ('aut66e830118566e831417f',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',780,100810,0,'2024-09-16',39,'euro',0,0,2024 ,?,?)
20240916@142313.6369 0o3k5qesq6imfcftutmq8ajaop Query : use flama_phc
20240916@142313.6372 0o3k5qesq6imfcftutmq8ajaop Query : select st.usalote valor from st where st.ref = '328.9326.00.1'
20240916@142313.6394 0o3k5qesq6imfcftutmq8ajaop Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '328.9326.00.1'
20240916@142313.6536 0o3k5qesq6imfcftutmq8ajaop Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142313.6552 0o3k5qesq6imfcftutmq8ajaop Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142313.6575 0o3k5qesq6imfcftutmq8ajaop Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142313.6590 0o3k5qesq6imfcftutmq8ajaop Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142313.6598 0o3k5qesq6imfcftutmq8ajaop Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142313.6610 0o3k5qesq6imfcftutmq8ajaop Query : select sestamp valor from se where ref ='328.9326.00.1' and lote = 'r2300691100a'
20240916@142313.6623 0o3k5qesq6imfcftutmq8ajaop Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142313.6637 0o3k5qesq6imfcftutmq8ajaop Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142313.6648 0o3k5qesq6imfcftutmq8ajaop Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e836073066e83141a1','aut66e830118566e831417f' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142313.6652 0o3k5qesq6imfcftutmq8ajaop Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142313.6666 0o3k5qesq6imfcftutmq8ajaop Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142313.6694 0o3k5qesq6imfcftutmq8ajaop Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e836073066e83141a1',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',1.000 ,'aut66e830118566e831417f' ,0,0 ,2,23.00,10000,?,?,?,?,?)
20240916@142313.6945 0o3k5qesq6imfcftutmq8ajaop Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142313.6960 0o3k5qesq6imfcftutmq8ajaop Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142313.6984 0o3k5qesq6imfcftutmq8ajaop Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142313.7000 0o3k5qesq6imfcftutmq8ajaop Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142313.7009 0o3k5qesq6imfcftutmq8ajaop Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142313.7021 0o3k5qesq6imfcftutmq8ajaop Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142313.7034 0o3k5qesq6imfcftutmq8ajaop Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142313.7046 0o3k5qesq6imfcftutmq8ajaop Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e835124566e83141ab','aut66e830118566e831417f' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142313.7050 0o3k5qesq6imfcftutmq8ajaop Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142313.7064 0o3k5qesq6imfcftutmq8ajaop Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142313.7091 0o3k5qesq6imfcftutmq8ajaop Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e835124566e83141ab',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e830118566e831417f' ,0,0 ,2,23.00,20000,?,?,?)
20240916@142313.7333 0o3k5qesq6imfcftutmq8ajaop Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66e830118566e831417f','2405971','wait',39,'adm09112754980.682000002')
20240916@142313.7401 0o3k5qesq6imfcftutmq8ajaop Query : use flama_phc
20240916@142313.7403 0o3k5qesq6imfcftutmq8ajaop Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240916@142313.7432 0o3k5qesq6imfcftutmq8ajaop Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2036';
20240916@142313.7461 0o3k5qesq6imfcftutmq8ajaop Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2036';
20240916@142313.7499 0o3k5qesq6imfcftutmq8ajaop Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2036';
20240916@142313.7523 0o3k5qesq6imfcftutmq8ajaop Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2036';
20240916@142313.8591 80qu7hfn0um4egccq6n6b4rqrn Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240916@142313.8603 80qu7hfn0um4egccq6n6b4rqrn Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240916@142313.8658 80qu7hfn0um4egccq6n6b4rqrn Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2037';
20240916@142313.8718 80qu7hfn0um4egccq6n6b4rqrn Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2037';
20240916@142313.8770 80qu7hfn0um4egccq6n6b4rqrn Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2037';
20240916@142313.8796 80qu7hfn0um4egccq6n6b4rqrn Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2037';
20240916@142313.8842 80qu7hfn0um4egccq6n6b4rqrn Query : use flama_phc
20240916@142313.8845 80qu7hfn0um4egccq6n6b4rqrn Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240916@142313.8905 80qu7hfn0um4egccq6n6b4rqrn Query : use flama_phc
20240916@142313.8908 80qu7hfn0um4egccq6n6b4rqrn Query : select no, estab,szadrsdesc from szadrs where u_coddest=2686
20240916@142313.8990 80qu7hfn0um4egccq6n6b4rqrn Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1578.00.1'
20240916@142314.6730 80qu7hfn0um4egccq6n6b4rqrn Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405974 and bi.ref ='324.1578.00.1' and bi.lordem =1
20240916@142314.1000 80qu7hfn0um4egccq6n6b4rqrn Query : use flama_phc
20240916@142314.1003 80qu7hfn0um4egccq6n6b4rqrn Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240916@142314.1037 80qu7hfn0um4egccq6n6b4rqrn Query : use flama_phc
20240916@142314.1040 80qu7hfn0um4egccq6n6b4rqrn Query : select top 1 1 valor from td where td.ndoc = 39
20240916@142314.1069 80qu7hfn0um4egccq6n6b4rqrn Query : use flama_phc
20240916@142314.1072 80qu7hfn0um4egccq6n6b4rqrn 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')
20240916@142314.1097 80qu7hfn0um4egccq6n6b4rqrn Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240916@142314.1130 80qu7hfn0um4egccq6n6b4rqrn Query : use flama_phc
20240916@142314.1133 80qu7hfn0um4egccq6n6b4rqrn Query : select top 1 ~inactivo valor from cl where no = '102189' and estab = 0 order by inactivo desc
20240916@142314.1251 80qu7hfn0um4egccq6n6b4rqrn Query : use flama_phc
20240916@142314.1253 80qu7hfn0um4egccq6n6b4rqrn Query : select top 1 tipodoc,regrd from td where ndoc = 39
20240916@142314.1282 80qu7hfn0um4egccq6n6b4rqrn Query : use flama_phc
20240916@142314.1285 80qu7hfn0um4egccq6n6b4rqrn Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240916@142314.1322 80qu7hfn0um4egccq6n6b4rqrn Query : use flama_phc
20240916@142314.1325 80qu7hfn0um4egccq6n6b4rqrn Query : select szadrsstamp valor from szadrs where szadrsdesc='bom preÇo, lda.- entrega'
20240916@142314.1390 80qu7hfn0um4egccq6n6b4rqrn Query : use flama_phc
20240916@142314.1393 80qu7hfn0um4egccq6n6b4rqrn Query : select 1 valor from td where ndoc = 39
20240916@142314.1405 80qu7hfn0um4egccq6n6b4rqrn Query : select top 1 manternumero, tiposaft, nmdos,td.assinadoc from td where td.ndoc = 39
20240916@142314.1419 80qu7hfn0um4egccq6n6b4rqrn Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142314.1435 80qu7hfn0um4egccq6n6b4rqrn Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142314.1453 80qu7hfn0um4egccq6n6b4rqrn Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142314.1468 80qu7hfn0um4egccq6n6b4rqrn Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142314.1494 80qu7hfn0um4egccq6n6b4rqrn Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142314.1508 80qu7hfn0um4egccq6n6b4rqrn Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142314.1520 80qu7hfn0um4egccq6n6b4rqrn Query : select top 1 ft.fno valor from ft ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142314.1585 80qu7hfn0um4egccq6n6b4rqrn Query : select top 1 ft.fno valor from wsftdata ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142314.1598 80qu7hfn0um4egccq6n6b4rqrn Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142314.1612 80qu7hfn0um4egccq6n6b4rqrn Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142314.1626 80qu7hfn0um4egccq6n6b4rqrn Query : insert into wsft3data (ft3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,taxpointdt ) values ('aut66e839579566e8314225' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?)
20240916@142314.1806 80qu7hfn0um4egccq6n6b4rqrn Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142314.1822 80qu7hfn0um4egccq6n6b4rqrn Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142314.1855 80qu7hfn0um4egccq6n6b4rqrn Query : select top 1 bo.u_nomeenv valor from bo where bo.bostamp=''
20240916@142314.1866 80qu7hfn0um4egccq6n6b4rqrn Query : select top 1 bo.u_moradaen valor from bo where bo.bostamp=''
20240916@142314.1878 80qu7hfn0um4egccq6n6b4rqrn Query : select top 1 bo.u_codposen valor from bo where bo.bostamp=''
20240916@142314.1889 80qu7hfn0um4egccq6n6b4rqrn Query : select top 1 bo.u_localenv valor from bo where bo.bostamp=''
20240916@142314.1901 80qu7hfn0um4egccq6n6b4rqrn Query : select top 1 bo.trab5 valor from bo where bo.bostamp=''
20240916@142314.1913 80qu7hfn0um4egccq6n6b4rqrn Query : select top 1 bo.serie valor from bo where bo.bostamp=''
20240916@142314.1924 80qu7hfn0um4egccq6n6b4rqrn Query : insert into wsft2data (ft2stamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,u_nomeenv ,u_moradaen ,u_codposen ,u_localenv ,u_coddest ,u_codby ) values ('aut66e839579566e8314225',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?,?,?,?,?,?)
20240916@142314.2184 80qu7hfn0um4egccq6n6b4rqrn Query : select top 1 fno valor from wsftdata order by fno desc
20240916@142314.2204 80qu7hfn0um4egccq6n6b4rqrn Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142314.2221 80qu7hfn0um4egccq6n6b4rqrn Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142314.2243 80qu7hfn0um4egccq6n6b4rqrn Query : select 'normal' from dummy
20240916@142314.2258 80qu7hfn0um4egccq6n6b4rqrn Query : insert into wsftdata (ftstamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,fno,no,estab,fdata,ndoc,moeda,cambio,cambiofixo,ftano,site ,classe ) values ('aut66e839579566e8314225',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',781,102189,0,'2024-09-16',39,'euro',0,0,2024 ,?,?)
20240916@142314.2618 80qu7hfn0um4egccq6n6b4rqrn Query : use flama_phc
20240916@142314.2622 80qu7hfn0um4egccq6n6b4rqrn Query : select st.usalote valor from st where st.ref = '324.1578.00.1'
20240916@142314.2643 80qu7hfn0um4egccq6n6b4rqrn 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.1578.00.1'
20240916@142314.2791 80qu7hfn0um4egccq6n6b4rqrn Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142314.2806 80qu7hfn0um4egccq6n6b4rqrn Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142314.2831 80qu7hfn0um4egccq6n6b4rqrn Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142314.2845 80qu7hfn0um4egccq6n6b4rqrn Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142314.2853 80qu7hfn0um4egccq6n6b4rqrn Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142314.2865 80qu7hfn0um4egccq6n6b4rqrn Query : select sestamp valor from se where ref ='324.1578.00.1' and lote = 'r2101115200a'
20240916@142314.2883 80qu7hfn0um4egccq6n6b4rqrn Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142314.2897 80qu7hfn0um4egccq6n6b4rqrn Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142314.2908 80qu7hfn0um4egccq6n6b4rqrn Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e837667366e8314246','aut66e839579566e8314225' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142314.2924 80qu7hfn0um4egccq6n6b4rqrn Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142314.2939 80qu7hfn0um4egccq6n6b4rqrn Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142314.2967 80qu7hfn0um4egccq6n6b4rqrn Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e837667366e8314246',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',2.000 ,'aut66e839579566e8314225' ,0,0 ,2,23.00,10000,?,?,?,?,?)
20240916@142314.3229 80qu7hfn0um4egccq6n6b4rqrn Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66e839579566e8314225','2405974','wait',39,'adm09112754980.682000002')
20240916@142314.3301 80qu7hfn0um4egccq6n6b4rqrn Query : use flama_phc
20240916@142314.3304 80qu7hfn0um4egccq6n6b4rqrn Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240916@142314.3333 80qu7hfn0um4egccq6n6b4rqrn Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2037';
20240916@142314.3372 80qu7hfn0um4egccq6n6b4rqrn Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2037';
20240916@142314.3411 80qu7hfn0um4egccq6n6b4rqrn Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2037';
20240916@142314.3435 80qu7hfn0um4egccq6n6b4rqrn Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2037';
20240916@142314.3984 rct5q1cqbs354punbqvnd3m7kk Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240916@142314.3995 rct5q1cqbs354punbqvnd3m7kk Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240916@142314.4046 rct5q1cqbs354punbqvnd3m7kk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2038';
20240916@142314.4099 rct5q1cqbs354punbqvnd3m7kk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2038';
20240916@142314.4148 rct5q1cqbs354punbqvnd3m7kk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2038';
20240916@142314.4174 rct5q1cqbs354punbqvnd3m7kk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2038';
20240916@142314.4222 rct5q1cqbs354punbqvnd3m7kk Query : use flama_phc
20240916@142314.4225 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240916@142314.4287 rct5q1cqbs354punbqvnd3m7kk Query : use flama_phc
20240916@142314.4290 rct5q1cqbs354punbqvnd3m7kk Query : select no, estab,szadrsdesc from szadrs where u_coddest=4500
20240916@142314.6517 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.646.00.01'
20240916@142314.7062 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405975 and bi.ref ='324.646.00.01' and bi.lordem =1
20240916@142314.7417 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.646.00.01'
20240916@142314.7437 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405975 and bi.ref ='324.646.00.01' and bi.lordem =2
20240916@142314.7760 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.691.00.01'
20240916@142314.7910 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405975 and bi.ref ='324.691.00.01' and bi.lordem =3
20240916@142314.8220 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.691.00.01'
20240916@142314.8241 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405975 and bi.ref ='324.691.00.01' and bi.lordem =3
20240916@142314.8262 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.691.00.01'
20240916@142314.8281 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405975 and bi.ref ='324.691.00.01' and bi.lordem =4
20240916@142314.8602 rct5q1cqbs354punbqvnd3m7kk Query : use flama_phc
20240916@142314.8605 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240916@142314.8635 rct5q1cqbs354punbqvnd3m7kk Query : use flama_phc
20240916@142314.8637 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 1 valor from td where td.ndoc = 39
20240916@142314.8668 rct5q1cqbs354punbqvnd3m7kk Query : use flama_phc
20240916@142314.8671 rct5q1cqbs354punbqvnd3m7kk 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')
20240916@142314.8696 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240916@142314.8728 rct5q1cqbs354punbqvnd3m7kk Query : use flama_phc
20240916@142314.8730 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 ~inactivo valor from cl where no = '101621' and estab = 0 order by inactivo desc
20240916@142314.9059 rct5q1cqbs354punbqvnd3m7kk Query : use flama_phc
20240916@142314.9063 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 tipodoc,regrd from td where ndoc = 39
20240916@142314.9092 rct5q1cqbs354punbqvnd3m7kk Query : use flama_phc
20240916@142314.9094 rct5q1cqbs354punbqvnd3m7kk Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240916@142314.9131 rct5q1cqbs354punbqvnd3m7kk Query : use flama_phc
20240916@142314.9134 rct5q1cqbs354punbqvnd3m7kk Query : select szadrsstamp valor from szadrs where szadrsdesc='j.o.m.,lda - portimão'
20240916@142314.9179 rct5q1cqbs354punbqvnd3m7kk Query : use flama_phc
20240916@142314.9181 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from td where ndoc = 39
20240916@142314.9193 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 manternumero, tiposaft, nmdos,td.assinadoc from td where td.ndoc = 39
20240916@142314.9205 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142314.9221 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142314.9238 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142314.9251 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142314.9278 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142314.9292 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142314.9304 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 ft.fno valor from ft ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142314.9387 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 ft.fno valor from wsftdata ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142314.9398 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142314.9413 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142314.9429 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsft3data (ft3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,taxpointdt ) values ('aut66e832389766e83142e3' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?)
20240916@142314.9610 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142314.9626 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142314.9657 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 bo.u_nomeenv valor from bo where bo.bostamp=''
20240916@142314.9668 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 bo.u_moradaen valor from bo where bo.bostamp=''
20240916@142314.9680 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 bo.u_codposen valor from bo where bo.bostamp=''
20240916@142314.9692 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 bo.u_localenv valor from bo where bo.bostamp=''
20240916@142314.9706 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 bo.trab5 valor from bo where bo.bostamp=''
20240916@142314.9719 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 bo.serie valor from bo where bo.bostamp=''
20240916@142314.9729 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsft2data (ft2stamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,u_nomeenv ,u_moradaen ,u_codposen ,u_localenv ,u_coddest ,u_codby ) values ('aut66e832389766e83142e3',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?,?,?,?,?,?)
20240916@142314.9965 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 fno valor from wsftdata order by fno desc
20240916@142314.9986 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.3000 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142315.2500 rct5q1cqbs354punbqvnd3m7kk Query : select 'normal' from dummy
20240916@142315.3900 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsftdata (ftstamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,fno,no,estab,fdata,ndoc,moeda,cambio,cambiofixo,ftano,site ,classe ) values ('aut66e832389766e83142e3',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',782,101621,0,'2024-09-16',39,'euro',0,0,2024 ,?,?)
20240916@142315.3360 rct5q1cqbs354punbqvnd3m7kk Query : use flama_phc
20240916@142315.3390 rct5q1cqbs354punbqvnd3m7kk Query : select st.usalote valor from st where st.ref = '324.646.00.01'
20240916@142315.3670 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.646.00.01'
20240916@142315.5200 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.5350 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142315.5590 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.5740 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142315.5820 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142315.5940 rct5q1cqbs354punbqvnd3m7kk Query : select sestamp valor from se where ref ='324.646.00.01' and lote = 'r2400055100a'
20240916@142315.6070 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.6210 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142315.6330 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e834023166e831430e','aut66e832389766e83142e3' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142315.6370 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.6510 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142315.6800 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e834023166e831430e',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',3.000 ,'aut66e832389766e83142e3' ,0,0 ,2,23.00,10000,?,?,?,?,?)
20240916@142315.9450 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.9610 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142315.9880 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.1003 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142315.1011 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142315.1023 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.1037 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142315.1048 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e831690266e8314318','aut66e832389766e83142e3' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142315.1053 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.1067 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142315.1094 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e831690266e8314318',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e832389766e83142e3' ,0,0 ,2,23.00,20000,?,?,?)
20240916@142315.1352 rct5q1cqbs354punbqvnd3m7kk Query : use flama_phc
20240916@142315.1355 rct5q1cqbs354punbqvnd3m7kk Query : select st.usalote valor from st where st.ref = '324.646.00.01'
20240916@142315.1376 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.646.00.01'
20240916@142315.1390 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.1405 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142315.1430 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.1445 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142315.1453 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142315.1465 rct5q1cqbs354punbqvnd3m7kk Query : select sestamp valor from se where ref ='324.646.00.01' and lote = 'r2400055100a'
20240916@142315.1477 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.1491 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142315.1503 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e838598466e8314324','aut66e832389766e83142e3' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142315.1508 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.1522 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142315.1549 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e838598466e8314324',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',1.000 ,'aut66e832389766e83142e3' ,0,0 ,2,23.00,40000,?,?,?,?,?)
20240916@142315.1811 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.1827 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142315.1851 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.1866 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142315.1875 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142315.1887 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.1901 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142315.1912 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e832234966e831432e','aut66e832389766e83142e3' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142315.1917 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.1931 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142315.1958 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e832234966e831432e',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e832389766e83142e3' ,0,0 ,2,23.00,50000,?,?,?)
20240916@142315.2201 rct5q1cqbs354punbqvnd3m7kk Query : use flama_phc
20240916@142315.2204 rct5q1cqbs354punbqvnd3m7kk Query : select st.usalote valor from st where st.ref = '324.691.00.01'
20240916@142315.2227 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.691.00.01'
20240916@142315.2368 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.2384 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142315.2409 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.2425 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142315.2433 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142315.2445 rct5q1cqbs354punbqvnd3m7kk Query : select sestamp valor from se where ref ='324.691.00.01' and lote = 'r2400209200a'
20240916@142315.2459 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.2474 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142315.2485 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e838351566e831433c','aut66e832389766e83142e3' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142315.2489 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.2504 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142315.2532 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e838351566e831433c',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',2.000 ,'aut66e832389766e83142e3' ,0,0 ,2,23.00,70000,?,?,?,?,?)
20240916@142315.3737 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.4277 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142315.4302 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.4316 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142315.4326 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142315.4338 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.4351 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142315.4363 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e834807466e8314369','aut66e832389766e83142e3' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142315.4367 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.4381 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142315.4409 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e834807466e8314369',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e832389766e83142e3' ,0,0 ,2,23.00,80000,?,?,?)
20240916@142315.4653 rct5q1cqbs354punbqvnd3m7kk Query : use flama_phc
20240916@142315.4656 rct5q1cqbs354punbqvnd3m7kk Query : select st.usalote valor from st where st.ref = '324.691.00.01'
20240916@142315.4675 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.691.00.01'
20240916@142315.4688 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.4703 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142315.4727 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.4741 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142315.4749 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142315.4760 rct5q1cqbs354punbqvnd3m7kk Query : select sestamp valor from se where ref ='324.691.00.01' and lote = 'r2400209200a'
20240916@142315.4773 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.4787 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142315.4798 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e839222966e8314374','aut66e832389766e83142e3' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142315.4802 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.4816 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142315.4843 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e839222966e8314374',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',1.000 ,'aut66e832389766e83142e3' ,0,0 ,2,23.00,100000,?,?,?,?,?)
20240916@142315.6391 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.6411 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142315.6436 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.6450 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142315.6459 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142315.6471 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.6487 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142315.6498 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e839566466e831439d','aut66e832389766e83142e3' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142315.6503 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.6518 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142315.6544 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e839566466e831439d',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e832389766e83142e3' ,0,0 ,2,23.00,110000,?,?,?)
20240916@142315.6797 rct5q1cqbs354punbqvnd3m7kk Query : use flama_phc
20240916@142315.6800 rct5q1cqbs354punbqvnd3m7kk Query : select st.usalote valor from st where st.ref = '324.691.00.01'
20240916@142315.6819 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.691.00.01'
20240916@142315.6832 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.6847 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142315.6873 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.6887 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142315.6896 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142315.6908 rct5q1cqbs354punbqvnd3m7kk Query : select sestamp valor from se where ref ='324.691.00.01' and lote = 'r2400209200a'
20240916@142315.6920 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.6934 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142315.6945 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e831814566e83143a8','aut66e832389766e83142e3' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142315.6949 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.6964 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142315.6991 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e831814566e83143a8',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',1.000 ,'aut66e832389766e83142e3' ,0,0 ,2,23.00,130000,?,?,?,?,?)
20240916@142315.7246 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.7263 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142315.7288 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.7302 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142315.7311 rct5q1cqbs354punbqvnd3m7kk Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142315.7323 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.7337 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142315.7348 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e830989166e83143b2','aut66e832389766e83142e3' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142315.7353 rct5q1cqbs354punbqvnd3m7kk Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.7370 rct5q1cqbs354punbqvnd3m7kk Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142315.7399 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e830989166e83143b2',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e832389766e83142e3' ,0,0 ,2,23.00,140000,?,?,?)
20240916@142315.7671 rct5q1cqbs354punbqvnd3m7kk Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66e832389766e83142e3','2405975','wait',39,'adm09112754980.682000002')
20240916@142315.7740 rct5q1cqbs354punbqvnd3m7kk Query : use flama_phc
20240916@142315.7743 rct5q1cqbs354punbqvnd3m7kk Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240916@142315.7772 rct5q1cqbs354punbqvnd3m7kk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2038';
20240916@142315.7801 rct5q1cqbs354punbqvnd3m7kk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2038';
20240916@142315.7841 rct5q1cqbs354punbqvnd3m7kk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2038';
20240916@142315.7872 rct5q1cqbs354punbqvnd3m7kk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2038';
20240916@142315.8452 vnavg6b2mkfaaba4t19otts2bf Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240916@142315.8463 vnavg6b2mkfaaba4t19otts2bf Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240916@142315.8514 vnavg6b2mkfaaba4t19otts2bf Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2039';
20240916@142315.8574 vnavg6b2mkfaaba4t19otts2bf Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2039';
20240916@142315.8629 vnavg6b2mkfaaba4t19otts2bf Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2039';
20240916@142315.8658 vnavg6b2mkfaaba4t19otts2bf Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2039';
20240916@142315.8705 vnavg6b2mkfaaba4t19otts2bf Query : use flama_phc
20240916@142315.8708 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240916@142315.8770 vnavg6b2mkfaaba4t19otts2bf Query : use flama_phc
20240916@142315.8773 vnavg6b2mkfaaba4t19otts2bf Query : select no, estab,szadrsdesc from szadrs where u_coddest=68
20240916@142315.8855 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.691.00.01'
20240916@142315.8874 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405976 and bi.ref ='324.691.00.01' and bi.lordem =1
20240916@142315.9193 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.691.00.01'
20240916@142315.9213 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2059 and bo.obrano = 2405976 and bi.ref ='324.691.00.01' and bi.lordem =2
20240916@142315.9527 vnavg6b2mkfaaba4t19otts2bf Query : use flama_phc
20240916@142315.9531 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240916@142315.9563 vnavg6b2mkfaaba4t19otts2bf Query : use flama_phc
20240916@142315.9566 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 1 valor from td where td.ndoc = 39
20240916@142315.9593 vnavg6b2mkfaaba4t19otts2bf Query : use flama_phc
20240916@142315.9596 vnavg6b2mkfaaba4t19otts2bf 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')
20240916@142315.9622 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240916@142315.9657 vnavg6b2mkfaaba4t19otts2bf Query : use flama_phc
20240916@142315.9661 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 ~inactivo valor from cl where no = '101621' and estab = 0 order by inactivo desc
20240916@142315.9690 vnavg6b2mkfaaba4t19otts2bf Query : use flama_phc
20240916@142315.9693 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 tipodoc,regrd from td where ndoc = 39
20240916@142315.9721 vnavg6b2mkfaaba4t19otts2bf Query : use flama_phc
20240916@142315.9724 vnavg6b2mkfaaba4t19otts2bf Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240916@142315.9763 vnavg6b2mkfaaba4t19otts2bf Query : use flama_phc
20240916@142315.9766 vnavg6b2mkfaaba4t19otts2bf Query : select szadrsstamp valor from szadrs where szadrsdesc='joaquim oliveira mendes,lda jom'
20240916@142315.9813 vnavg6b2mkfaaba4t19otts2bf Query : use flama_phc
20240916@142315.9816 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from td where ndoc = 39
20240916@142315.9827 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 manternumero, tiposaft, nmdos,td.assinadoc from td where td.ndoc = 39
20240916@142315.9841 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.9857 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142315.9875 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.9890 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142315.9935 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142315.9951 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142315.9964 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 ft.fno valor from ft ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142316.3000 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 ft.fno valor from wsftdata ft where ft.ndoc = 39 and ftano=2024 order by fno desc
20240916@142316.4300 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142316.5900 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft3' and documentnumber = 39
20240916@142316.7400 vnavg6b2mkfaaba4t19otts2bf Query : insert into wsft3data (ft3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis,taxpointdt ) values ('aut66e836043166e83143f3' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?)
20240916@142316.2470 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142316.2630 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft2' and documentnumber = 39
20240916@142316.2940 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 bo.u_nomeenv valor from bo where bo.bostamp=''
20240916@142316.3060 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 bo.u_moradaen valor from bo where bo.bostamp=''
20240916@142316.3180 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 bo.u_codposen valor from bo where bo.bostamp=''
20240916@142316.3300 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 bo.u_localenv valor from bo where bo.bostamp=''
20240916@142316.3410 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 bo.trab5 valor from bo where bo.bostamp=''
20240916@142316.3590 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 bo.serie valor from bo where bo.bostamp=''
20240916@142316.3730 vnavg6b2mkfaaba4t19otts2bf Query : insert into wsft2data (ft2stamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,u_nomeenv ,u_moradaen ,u_codposen ,u_localenv ,u_coddest ,u_codby ) values ('aut66e836043166e83143f3',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',?,?,?,?,?,?)
20240916@142316.6250 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 fno valor from wsftdata order by fno desc
20240916@142316.6460 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142316.6630 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'ft' and documentnumber = 39
20240916@142316.6850 vnavg6b2mkfaaba4t19otts2bf Query : select 'normal' from dummy
20240916@142316.6990 vnavg6b2mkfaaba4t19otts2bf Query : insert into wsftdata (ftstamp, ousrdata,ousrhora, usrdata,usrhora,ousrinis,usrinis,fno,no,estab,fdata,ndoc,moeda,cambio,cambiofixo,ftano,site ,classe ) values ('aut66e836043166e83143f3',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',783,101621,0,'2024-09-16',39,'euro',0,0,2024 ,?,?)
20240916@142316.9880 vnavg6b2mkfaaba4t19otts2bf Query : use flama_phc
20240916@142316.9910 vnavg6b2mkfaaba4t19otts2bf Query : select st.usalote valor from st where st.ref = '324.691.00.01'
20240916@142316.1012 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.691.00.01'
20240916@142316.1025 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142316.1040 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142316.1064 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142316.1078 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142316.1086 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142316.1099 vnavg6b2mkfaaba4t19otts2bf Query : select sestamp valor from se where ref ='324.691.00.01' and lote = 'r2400209200a'
20240916@142316.1112 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142316.1126 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142316.1138 vnavg6b2mkfaaba4t19otts2bf Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e836054466e831441b','aut66e836043166e83143f3' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142316.1142 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142316.1155 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142316.1184 vnavg6b2mkfaaba4t19otts2bf Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e836054466e831441b',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',3.000 ,'aut66e836043166e83143f3' ,0,0 ,2,23.00,10000,?,?,?,?,?)
20240916@142316.1450 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142316.1470 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142316.1502 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142316.1525 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142316.1534 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142316.1548 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142316.1565 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142316.1578 vnavg6b2mkfaaba4t19otts2bf Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e833792666e8314425','aut66e836043166e83143f3' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142316.1584 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142316.1602 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142316.1635 vnavg6b2mkfaaba4t19otts2bf Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e833792666e8314425',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e836043166e83143f3' ,0,0 ,2,23.00,20000,?,?,?)
20240916@142316.1892 vnavg6b2mkfaaba4t19otts2bf Query : use flama_phc
20240916@142316.1895 vnavg6b2mkfaaba4t19otts2bf Query : select st.usalote valor from st where st.ref = '324.691.00.01'
20240916@142316.1915 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.691.00.01'
20240916@142316.1929 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142316.1944 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142316.1968 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142316.1982 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142316.1990 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142316.2004 vnavg6b2mkfaaba4t19otts2bf Query : select sestamp valor from se where ref ='324.691.00.01' and lote = 'r2400209200a'
20240916@142316.2015 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142316.2029 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142316.2040 vnavg6b2mkfaaba4t19otts2bf Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e830981766e8314431','aut66e836043166e83143f3' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142316.2044 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142316.2058 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142316.2086 vnavg6b2mkfaaba4t19otts2bf Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,lote,armazem,bistamp ) values ('aut66e830981766e8314431',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',1.000 ,'aut66e836043166e83143f3' ,0,0 ,2,23.00,40000,?,?,?,?,?)
20240916@142316.2328 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142316.2343 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142316.2370 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142316.2385 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142316.2394 vnavg6b2mkfaaba4t19otts2bf Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@142316.2408 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142316.2423 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi2' and documentnumber = 39
20240916@142316.2436 vnavg6b2mkfaaba4t19otts2bf Query : insert into wsfi2data (fi2stamp,ftstamp ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e831362966e831443a','aut66e836043166e83143f3' ,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv')
20240916@142316.2440 vnavg6b2mkfaaba4t19otts2bf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@142316.2457 vnavg6b2mkfaaba4t19otts2bf Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'fi' and documentnumber = 39
20240916@142316.2486 vnavg6b2mkfaaba4t19otts2bf Query : insert into wsfidata (fistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,qtt ,ftstamp ,epv,pvmoeda ,tabiva,iva,lordem ,ref, design ,armazem) values ('aut66e831362966e831443a',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'wsv','wsv',0 ,'aut66e836043166e83143f3' ,0,0 ,2,23.00,50000,?,?,?)
20240916@142316.2764 vnavg6b2mkfaaba4t19otts2bf Query : insert into wsftcreationlog (initialftstamp,externalid,creationstatus,documenttypeid,idustamp) values ('aut66e836043166e83143f3','2405976','wait',39,'adm09112754980.682000002')
20240916@142316.2840 vnavg6b2mkfaaba4t19otts2bf Query : use flama_phc
20240916@142316.2843 vnavg6b2mkfaaba4t19otts2bf Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240916@142316.2898 vnavg6b2mkfaaba4t19otts2bf Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2039';
20240916@142316.2927 vnavg6b2mkfaaba4t19otts2bf Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2039';
20240916@142316.3670 vnavg6b2mkfaaba4t19otts2bf Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2039';
20240916@142316.5537 vnavg6b2mkfaaba4t19otts2bf Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2039';

20240916@154951.5313 vjtvnn2d06dvpedfflr80sfb2i Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2040';
20240916@154951.5362 vjtvnn2d06dvpedfflr80sfb2i Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2040';
20240916@154951.5389 vjtvnn2d06dvpedfflr80sfb2i Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2040';
20240916@154951.5430 vjtvnn2d06dvpedfflr80sfb2i Query : use flama_phc
20240916@154951.5433 vjtvnn2d06dvpedfflr80sfb2i Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240916@154951.5504 vjtvnn2d06dvpedfflr80sfb2i Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1321.00.1'
20240916@154951.5624 vjtvnn2d06dvpedfflr80sfb2i 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 = 2400496 and bi.ref ='324.1321.00.1' and bi.lordem =20000
20240916@154951.5960 vjtvnn2d06dvpedfflr80sfb2i 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 = 'cps24050935508,932000002 ' 
20240916@154951.6258 vjtvnn2d06dvpedfflr80sfb2i Query : use flama_phc
20240916@154951.6261 vjtvnn2d06dvpedfflr80sfb2i Query : select top 1 1 valor from ts where ts.ndos = 61
20240916@154951.6302 vjtvnn2d06dvpedfflr80sfb2i Query : use flama_phc
20240916@154951.6306 vjtvnn2d06dvpedfflr80sfb2i 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')
20240916@154951.6336 vjtvnn2d06dvpedfflr80sfb2i 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
20240916@154951.6379 vjtvnn2d06dvpedfflr80sfb2i Query : use flama_phc
20240916@154951.6382 vjtvnn2d06dvpedfflr80sfb2i Query : select top 1 ~inactivo valor from fl where no = '202441' and estab = 00 order by inactivo desc
20240916@154951.6504 vjtvnn2d06dvpedfflr80sfb2i Query : use flama_phc
20240916@154951.6508 vjtvnn2d06dvpedfflr80sfb2i Query : select 1 valor from ts where ndos = 61
20240916@154951.6523 vjtvnn2d06dvpedfflr80sfb2i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@154951.6540 vjtvnn2d06dvpedfflr80sfb2i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240916@154951.6550 vjtvnn2d06dvpedfflr80sfb2i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@154951.6565 vjtvnn2d06dvpedfflr80sfb2i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240916@154951.6574 vjtvnn2d06dvpedfflr80sfb2i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@154951.6589 vjtvnn2d06dvpedfflr80sfb2i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240916@154951.6598 vjtvnn2d06dvpedfflr80sfb2i 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
20240916@154951.6641 vjtvnn2d06dvpedfflr80sfb2i Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240916@154951.6665 vjtvnn2d06dvpedfflr80sfb2i Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240916@154951.6687 vjtvnn2d06dvpedfflr80sfb2i Query : use flama_phc
20240916@154951.6693 vjtvnn2d06dvpedfflr80sfb2i Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202441' and estab=00
20240916@154951.6784 vjtvnn2d06dvpedfflr80sfb2i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@154951.6800 vjtvnn2d06dvpedfflr80sfb2i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240916@154951.6811 vjtvnn2d06dvpedfflr80sfb2i Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e847799566e8458fa3',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240916@154951.6816 vjtvnn2d06dvpedfflr80sfb2i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@154951.6832 vjtvnn2d06dvpedfflr80sfb2i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240916@154951.6844 vjtvnn2d06dvpedfflr80sfb2i Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e847799566e8458fa3','--','bo',1.1159189250740150307 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240916@154951.6858 vjtvnn2d06dvpedfflr80sfb2i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@154951.6882 vjtvnn2d06dvpedfflr80sfb2i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240916@154951.6893 vjtvnn2d06dvpedfflr80sfb2i 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 ('aut66e847799566e8458fa3','guia r. fornecedor','2024-09-16',61,2402634,?,?,?,?,?,?,?,?,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')
20240916@154954.9866 vjtvnn2d06dvpedfflr80sfb2i Query : use flama_phc
20240916@154954.9872 vjtvnn2d06dvpedfflr80sfb2i Query : select st.usalote valor from st where st.ref = '324.1321.00.1'
20240916@154954.9904 vjtvnn2d06dvpedfflr80sfb2i 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.1321.00.1'
20240916@154955.5600 vjtvnn2d06dvpedfflr80sfb2i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@154955.7300 vjtvnn2d06dvpedfflr80sfb2i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240916@154955.8700 vjtvnn2d06dvpedfflr80sfb2i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@154955.1040 vjtvnn2d06dvpedfflr80sfb2i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240916@154955.1140 vjtvnn2d06dvpedfflr80sfb2i Query : select sestamp valor from se where ref ='324.1321.00.1' and lote = 'r2400496200a'
20240916@154955.1270 vjtvnn2d06dvpedfflr80sfb2i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@154955.1420 vjtvnn2d06dvpedfflr80sfb2i Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240916@154955.1500 vjtvnn2d06dvpedfflr80sfb2i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@154955.1710 vjtvnn2d06dvpedfflr80sfb2i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240916@154955.1830 vjtvnn2d06dvpedfflr80sfb2i Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e846279366e8459303',?,?,'20240916',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240916@154955.7020 vjtvnn2d06dvpedfflr80sfb2i Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@154955.7160 vjtvnn2d06dvpedfflr80sfb2i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@154955.7320 vjtvnn2d06dvpedfflr80sfb2i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240916@154955.7450 vjtvnn2d06dvpedfflr80sfb2i Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut66e844661866e8459311','aut66e847799566e8458fa3',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 = 'aut66e847799566e8458fa3'
20240916@154955.9110 vjtvnn2d06dvpedfflr80sfb2i Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@154955.9270 vjtvnn2d06dvpedfflr80sfb2i Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240916@154955.9430 vjtvnn2d06dvpedfflr80sfb2i 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 'aut66e844661866e8459311',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1650, 1650*.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 ,43.91,43.91*200.48,43.91,43.91*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,43.91*1650,43.91*1650*200.48 ,52.931000,52.931000*200.48 ,52.931000,52.931000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,43.91,43.91*200.48,43.91*1650,43.91*1650*200.48,'cps24050935508,932000002 ',49,49*1650,49,49*1650,?,?,?,4 from bo bo where bo.bostamp = 'aut66e847799566e8458fa3'
20240916@155009.3080 vjtvnn2d06dvpedfflr80sfb2i Query : use flama_phc
20240916@155009.3120 vjtvnn2d06dvpedfflr80sfb2i Query : declare @bostamp varchar(25) = 'aut66e847799566e8458fa3' ,@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 
20240916@155024.3270 vjtvnn2d06dvpedfflr80sfb2i Query : use flama_phc
20240916@155024.3680 vjtvnn2d06dvpedfflr80sfb2i Query : select 1 valor from bo where bo.bostamp = 'aut66e847799566e8458fa3'
20240916@155024.6650 vjtvnn2d06dvpedfflr80sfb2i 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) = 'aut66e847799566e8458fa3' 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 
20240916@155026.6650 vjtvnn2d06dvpedfflr80sfb2i Query : use flama_phc
20240916@155026.6653 vjtvnn2d06dvpedfflr80sfb2i Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240916@155026.6706 vjtvnn2d06dvpedfflr80sfb2i Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2040';
20240916@155026.6738 vjtvnn2d06dvpedfflr80sfb2i Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2040';
20240916@160451.8598 24p4cvckgas8eldrn0jh5v23et Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240916@160451.8610 24p4cvckgas8eldrn0jh5v23et Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240916@160451.8666 24p4cvckgas8eldrn0jh5v23et Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2041';
20240916@160451.8720 24p4cvckgas8eldrn0jh5v23et Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2041';
20240916@160451.8776 24p4cvckgas8eldrn0jh5v23et Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2041';
20240916@160451.8800 24p4cvckgas8eldrn0jh5v23et Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2041';
20240916@160451.8839 24p4cvckgas8eldrn0jh5v23et Query : use flama_phc
20240916@160451.8842 24p4cvckgas8eldrn0jh5v23et Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240916@160451.8908 24p4cvckgas8eldrn0jh5v23et Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.698.00.01'
20240916@160451.9029 24p4cvckgas8eldrn0jh5v23et 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 = 2400227 and bi.ref ='324.698.00.01' and bi.lordem =20000
20240916@160451.9354 24p4cvckgas8eldrn0jh5v23et 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 = 'cps24022845531,202000002 ' 
20240916@160451.9665 24p4cvckgas8eldrn0jh5v23et Query : use flama_phc
20240916@160451.9669 24p4cvckgas8eldrn0jh5v23et Query : select top 1 1 valor from ts where ts.ndos = 61
20240916@160451.9698 24p4cvckgas8eldrn0jh5v23et Query : use flama_phc
20240916@160451.9701 24p4cvckgas8eldrn0jh5v23et 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')
20240916@160451.9729 24p4cvckgas8eldrn0jh5v23et 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
20240916@160451.9766 24p4cvckgas8eldrn0jh5v23et Query : use flama_phc
20240916@160451.9768 24p4cvckgas8eldrn0jh5v23et Query : select top 1 ~inactivo valor from fl where no = '202090' and estab = 00 order by inactivo desc
20240916@160451.9823 24p4cvckgas8eldrn0jh5v23et Query : use flama_phc
20240916@160451.9825 24p4cvckgas8eldrn0jh5v23et Query : select 1 valor from ts where ndos = 61
20240916@160451.9840 24p4cvckgas8eldrn0jh5v23et Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@160451.9855 24p4cvckgas8eldrn0jh5v23et Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240916@160451.9864 24p4cvckgas8eldrn0jh5v23et Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@160451.9881 24p4cvckgas8eldrn0jh5v23et Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240916@160451.9890 24p4cvckgas8eldrn0jh5v23et Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@160451.9907 24p4cvckgas8eldrn0jh5v23et Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240916@160451.9916 24p4cvckgas8eldrn0jh5v23et 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
20240916@160451.9933 24p4cvckgas8eldrn0jh5v23et Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240916@160451.9950 24p4cvckgas8eldrn0jh5v23et Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240916@160451.9969 24p4cvckgas8eldrn0jh5v23et Query : use flama_phc
20240916@160451.9975 24p4cvckgas8eldrn0jh5v23et Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202090' and estab=00
20240916@160452.0000 24p4cvckgas8eldrn0jh5v23et Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@160452.1500 24p4cvckgas8eldrn0jh5v23et Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240916@160452.2600 24p4cvckgas8eldrn0jh5v23et Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e848420766e84913f3',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240916@160452.3100 24p4cvckgas8eldrn0jh5v23et Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@160452.4700 24p4cvckgas8eldrn0jh5v23et Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240916@160452.5900 24p4cvckgas8eldrn0jh5v23et Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e848420766e84913f3','--','bo',7.8017732742241925269 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240916@160452.6400 24p4cvckgas8eldrn0jh5v23et Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@160452.7900 24p4cvckgas8eldrn0jh5v23et Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240916@160452.9000 24p4cvckgas8eldrn0jh5v23et 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 ('aut66e848420766e84913f3','guia r. fornecedor','2024-09-16',61,2402636,?,?,?,?,?,?,?,?,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')
20240916@160452.5640 24p4cvckgas8eldrn0jh5v23et Query : use flama_phc
20240916@160452.5670 24p4cvckgas8eldrn0jh5v23et Query : select st.usalote valor from st where st.ref = '324.698.00.01'
20240916@160452.5920 24p4cvckgas8eldrn0jh5v23et 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.698.00.01'
20240916@160452.7410 24p4cvckgas8eldrn0jh5v23et Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@160452.7570 24p4cvckgas8eldrn0jh5v23et Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240916@160452.7690 24p4cvckgas8eldrn0jh5v23et Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@160452.7840 24p4cvckgas8eldrn0jh5v23et Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240916@160452.7930 24p4cvckgas8eldrn0jh5v23et Query : select sestamp valor from se where ref ='324.698.00.01' and lote = 'r2400227200a'
20240916@160452.8060 24p4cvckgas8eldrn0jh5v23et Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@160452.8200 24p4cvckgas8eldrn0jh5v23et Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240916@160452.8290 24p4cvckgas8eldrn0jh5v23et Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@160452.8430 24p4cvckgas8eldrn0jh5v23et Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240916@160452.8540 24p4cvckgas8eldrn0jh5v23et Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e848659266e8491414',?,?,'20240916',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240916@160452.9250 24p4cvckgas8eldrn0jh5v23et Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240916@160452.9380 24p4cvckgas8eldrn0jh5v23et Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@160452.9530 24p4cvckgas8eldrn0jh5v23et Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240916@160452.9640 24p4cvckgas8eldrn0jh5v23et Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut66e843649966e8491416','aut66e848420766e84913f3',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 = 'aut66e848420766e84913f3'
20240916@160452.1215 24p4cvckgas8eldrn0jh5v23et Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240916@160452.1265 24p4cvckgas8eldrn0jh5v23et Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240916@160452.1280 24p4cvckgas8eldrn0jh5v23et 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 'aut66e843649966e8491416',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 770, 770*.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 ,31.58,31.58*200.48,31.58,31.58*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,31.58*770,31.58*770*200.48 ,37.773000,37.773000*200.48 ,37.773000,37.773000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,31.58,31.58*200.48,31.58*770,31.58*770*200.48,'cps24022845531,202000002 ',246.38,246.38*770,246.38,246.38*770,?,?,?,4 from bo bo where bo.bostamp = 'aut66e848420766e84913f3'
20240916@160452.3274 24p4cvckgas8eldrn0jh5v23et Query : use flama_phc
20240916@160452.3278 24p4cvckgas8eldrn0jh5v23et Query : declare @bostamp varchar(25) = 'aut66e848420766e84913f3' ,@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 
20240916@160452.4686 24p4cvckgas8eldrn0jh5v23et Query : use flama_phc
20240916@160452.4690 24p4cvckgas8eldrn0jh5v23et Query : select 1 valor from bo where bo.bostamp = 'aut66e848420766e84913f3'
20240916@160452.4706 24p4cvckgas8eldrn0jh5v23et 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) = 'aut66e848420766e84913f3' 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 
20240916@160452.8542 24p4cvckgas8eldrn0jh5v23et Query : use flama_phc
20240916@160452.8546 24p4cvckgas8eldrn0jh5v23et Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240916@160452.8602 24p4cvckgas8eldrn0jh5v23et Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2041';
20240916@160452.8633 24p4cvckgas8eldrn0jh5v23et Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2041';

20240917@141404.5370 348hsp3m6v0ppja39boj600tda Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2042';
20240917@141404.5727 348hsp3m6v0ppja39boj600tda Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2042';
20240917@141404.6008 348hsp3m6v0ppja39boj600tda Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2042';
20240917@141404.6273 348hsp3m6v0ppja39boj600tda Query : use flama_phc
20240917@141404.6315 348hsp3m6v0ppja39boj600tda Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240917@141404.8977 348hsp3m6v0ppja39boj600tda Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1329.00.1'
20240917@141404.9554 348hsp3m6v0ppja39boj600tda 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 = 2400496 and bi.ref ='324.1329.00.1' and bi.lordem =30000
20240917@141405.3550 348hsp3m6v0ppja39boj600tda 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 = 'cps24051332740,839000003 ' 
20240917@141405.1289 348hsp3m6v0ppja39boj600tda Query : use flama_phc
20240917@141405.1331 348hsp3m6v0ppja39boj600tda Query : select top 1 1 valor from ts where ts.ndos = 61
20240917@141405.1851 348hsp3m6v0ppja39boj600tda Query : use flama_phc
20240917@141405.1893 348hsp3m6v0ppja39boj600tda 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')
20240917@141405.2554 348hsp3m6v0ppja39boj600tda 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
20240917@141405.3256 348hsp3m6v0ppja39boj600tda Query : use flama_phc
20240917@141405.3298 348hsp3m6v0ppja39boj600tda Query : select top 1 ~inactivo valor from fl where no = '202441' and estab = 00 order by inactivo desc
20240917@141405.3463 348hsp3m6v0ppja39boj600tda Query : use flama_phc
20240917@141405.3470 348hsp3m6v0ppja39boj600tda Query : select 1 valor from ts where ndos = 61
20240917@141405.3544 348hsp3m6v0ppja39boj600tda Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@141405.3865 348hsp3m6v0ppja39boj600tda Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240917@141405.3928 348hsp3m6v0ppja39boj600tda Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@141405.3946 348hsp3m6v0ppja39boj600tda Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240917@141405.3961 348hsp3m6v0ppja39boj600tda Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@141405.3980 348hsp3m6v0ppja39boj600tda Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240917@141405.3998 348hsp3m6v0ppja39boj600tda 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
20240917@141405.4227 348hsp3m6v0ppja39boj600tda Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240917@141405.4325 348hsp3m6v0ppja39boj600tda Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240917@141405.4352 348hsp3m6v0ppja39boj600tda Query : use flama_phc
20240917@141405.4358 348hsp3m6v0ppja39boj600tda Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202441' and estab=00
20240917@141405.4442 348hsp3m6v0ppja39boj600tda Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@141405.4459 348hsp3m6v0ppja39boj600tda Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240917@141405.4513 348hsp3m6v0ppja39boj600tda Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e983743966e9809d6a',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240917@141405.4572 348hsp3m6v0ppja39boj600tda Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@141405.4588 348hsp3m6v0ppja39boj600tda Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240917@141405.4601 348hsp3m6v0ppja39boj600tda Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e983743966e9809d6a','--','bo',1.1159280667951188182 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240917@141405.4781 348hsp3m6v0ppja39boj600tda Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@141405.4798 348hsp3m6v0ppja39boj600tda Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240917@141405.4813 348hsp3m6v0ppja39boj600tda 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 ('aut66e983743966e9809d6a','guia r. fornecedor','2024-09-17',61,2402658,?,?,?,?,?,?,?,?,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')
20240917@141405.5317 348hsp3m6v0ppja39boj600tda Query : use flama_phc
20240917@141405.5320 348hsp3m6v0ppja39boj600tda Query : select st.usalote valor from st where st.ref = '324.1329.00.1'
20240917@141405.5437 348hsp3m6v0ppja39boj600tda 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.1329.00.1'
20240917@141405.6046 348hsp3m6v0ppja39boj600tda Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@141405.6317 348hsp3m6v0ppja39boj600tda Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240917@141405.6567 348hsp3m6v0ppja39boj600tda Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@141405.6820 348hsp3m6v0ppja39boj600tda Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240917@141405.6989 348hsp3m6v0ppja39boj600tda Query : select sestamp valor from se where ref ='324.1329.00.1' and lote = 'r2400496300a'
20240917@141405.7287 348hsp3m6v0ppja39boj600tda Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@141405.7543 348hsp3m6v0ppja39boj600tda Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240917@141405.7721 348hsp3m6v0ppja39boj600tda Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@141405.7978 348hsp3m6v0ppja39boj600tda Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240917@141405.8189 348hsp3m6v0ppja39boj600tda Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e989913166e9809dbc',?,?,'20240917',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240917@141406.8800 348hsp3m6v0ppja39boj600tda Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240917@141406.3660 348hsp3m6v0ppja39boj600tda Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@141406.6610 348hsp3m6v0ppja39boj600tda Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240917@141406.2135 348hsp3m6v0ppja39boj600tda Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut66e984101266e9809e08','aut66e983743966e9809d6a',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 = 'aut66e983743966e9809d6a'
20240917@141406.2516 348hsp3m6v0ppja39boj600tda Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@141406.2778 348hsp3m6v0ppja39boj600tda Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240917@141406.3080 348hsp3m6v0ppja39boj600tda 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 'aut66e984101266e9809e08',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1400, 1400*.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 ,62.28,62.28*200.48,62.28,62.28*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,62.28*1400,62.28*1400*200.48 ,.000000,.000000*200.48 ,.000000,.000000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,62.28,62.28*200.48,62.28*1400,62.28*1400*200.48,'cps24051332740,839000003 ',69.5,69.5*1400,69.5,69.5*1400,?,?,?,4 from bo bo where bo.bostamp = 'aut66e983743966e9809d6a'
20240917@141415.6531 348hsp3m6v0ppja39boj600tda Query : use flama_phc
20240917@141415.6565 348hsp3m6v0ppja39boj600tda Query : declare @bostamp varchar(25) = 'aut66e983743966e9809d6a' ,@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 
20240917@141428.9138 348hsp3m6v0ppja39boj600tda Query : use flama_phc
20240917@141428.9141 348hsp3m6v0ppja39boj600tda Query : select 1 valor from bo where bo.bostamp = 'aut66e983743966e9809d6a'
20240917@141428.9247 348hsp3m6v0ppja39boj600tda 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) = 'aut66e983743966e9809d6a' 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 
20240917@141431.4461 348hsp3m6v0ppja39boj600tda Query : use flama_phc
20240917@141431.4464 348hsp3m6v0ppja39boj600tda Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240917@141431.4518 348hsp3m6v0ppja39boj600tda Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2042';
20240917@141431.4552 348hsp3m6v0ppja39boj600tda Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2042';

20240917@144405.2525 96vnq0a6b5jgf790gi11n2fsos Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2043';
20240917@144405.2574 96vnq0a6b5jgf790gi11n2fsos Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='2043';
20240917@144405.2596 96vnq0a6b5jgf790gi11n2fsos Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='2043';
20240917@144405.2632 96vnq0a6b5jgf790gi11n2fsos Query : use flama_phc
20240917@144405.2635 96vnq0a6b5jgf790gi11n2fsos Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240917@144405.2697 96vnq0a6b5jgf790gi11n2fsos Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2300.00.1'
20240917@144405.2814 96vnq0a6b5jgf790gi11n2fsos 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 = 2400499 and bi.ref ='324.2300.00.1' and bi.lordem =20000
20240917@144405.4494 96vnq0a6b5jgf790gi11n2fsos 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 = 'cps24050938009,359000002 ' 
20240917@144405.4816 96vnq0a6b5jgf790gi11n2fsos Query : use flama_phc
20240917@144405.4819 96vnq0a6b5jgf790gi11n2fsos Query : select top 1 1 valor from ts where ts.ndos = 61
20240917@144405.4846 96vnq0a6b5jgf790gi11n2fsos Query : use flama_phc
20240917@144405.4849 96vnq0a6b5jgf790gi11n2fsos 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')
20240917@144405.4876 96vnq0a6b5jgf790gi11n2fsos 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
20240917@144405.4908 96vnq0a6b5jgf790gi11n2fsos Query : use flama_phc
20240917@144405.4911 96vnq0a6b5jgf790gi11n2fsos Query : select top 1 ~inactivo valor from fl where no = '202296' and estab = 00 order by inactivo desc
20240917@144405.5150 96vnq0a6b5jgf790gi11n2fsos Query : use flama_phc
20240917@144405.5153 96vnq0a6b5jgf790gi11n2fsos Query : select 1 valor from ts where ndos = 61
20240917@144405.5165 96vnq0a6b5jgf790gi11n2fsos Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@144405.5181 96vnq0a6b5jgf790gi11n2fsos Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240917@144405.5190 96vnq0a6b5jgf790gi11n2fsos Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@144405.5203 96vnq0a6b5jgf790gi11n2fsos Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240917@144405.5211 96vnq0a6b5jgf790gi11n2fsos Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@144405.5225 96vnq0a6b5jgf790gi11n2fsos Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240917@144405.5232 96vnq0a6b5jgf790gi11n2fsos 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
20240917@144405.5246 96vnq0a6b5jgf790gi11n2fsos Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240917@144405.5263 96vnq0a6b5jgf790gi11n2fsos Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240917@144405.5280 96vnq0a6b5jgf790gi11n2fsos Query : use flama_phc
20240917@144405.5286 96vnq0a6b5jgf790gi11n2fsos Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202296' and estab=00
20240917@144405.5378 96vnq0a6b5jgf790gi11n2fsos Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@144405.5391 96vnq0a6b5jgf790gi11n2fsos Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240917@144405.5403 96vnq0a6b5jgf790gi11n2fsos Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e981639866e987a580',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240917@144405.5407 96vnq0a6b5jgf790gi11n2fsos Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@144405.5420 96vnq0a6b5jgf790gi11n2fsos Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240917@144405.5431 96vnq0a6b5jgf790gi11n2fsos Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e981639866e987a580','--','bo',7.8747203579418344519 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240917@144405.5436 96vnq0a6b5jgf790gi11n2fsos Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@144405.5450 96vnq0a6b5jgf790gi11n2fsos Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240917@144405.5461 96vnq0a6b5jgf790gi11n2fsos 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 ('aut66e981639866e987a580','guia r. fornecedor','2024-09-17',61,2402659,?,?,?,?,?,?,?,?,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')
20240917@144408.8659 96vnq0a6b5jgf790gi11n2fsos Query : use flama_phc
20240917@144408.8666 96vnq0a6b5jgf790gi11n2fsos Query : select st.usalote valor from st where st.ref = '324.2300.00.1'
20240917@144408.8702 96vnq0a6b5jgf790gi11n2fsos 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.2300.00.1'
20240917@144408.8872 96vnq0a6b5jgf790gi11n2fsos Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@144408.8902 96vnq0a6b5jgf790gi11n2fsos Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240917@144408.8933 96vnq0a6b5jgf790gi11n2fsos Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@144408.8968 96vnq0a6b5jgf790gi11n2fsos Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240917@144408.8977 96vnq0a6b5jgf790gi11n2fsos Query : select sestamp valor from se where ref ='324.2300.00.1' and lote = 'r2400499200a'
20240917@144408.9040 96vnq0a6b5jgf790gi11n2fsos Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@144408.9056 96vnq0a6b5jgf790gi11n2fsos Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240917@144408.9067 96vnq0a6b5jgf790gi11n2fsos Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@144408.9082 96vnq0a6b5jgf790gi11n2fsos Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240917@144408.9093 96vnq0a6b5jgf790gi11n2fsos Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut66e987362566e987a8dd',?,?,'20240917',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240917@144408.9596 96vnq0a6b5jgf790gi11n2fsos Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240917@144408.9626 96vnq0a6b5jgf790gi11n2fsos Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@144408.9641 96vnq0a6b5jgf790gi11n2fsos Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240917@144408.9658 96vnq0a6b5jgf790gi11n2fsos Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut66e983504066e987a8eb','aut66e981639866e987a580',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 = 'aut66e981639866e987a580'
20240917@144408.9813 96vnq0a6b5jgf790gi11n2fsos Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240917@144408.9830 96vnq0a6b5jgf790gi11n2fsos Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240917@144408.9865 96vnq0a6b5jgf790gi11n2fsos 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 'aut66e983504066e987a8eb',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 3024, 3024*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,10000 ,4.47,4.47*200.48,4.47,4.47*200.48 ,0,0,'un ','' ,bo.marcada,1 ,4.47*3024,4.47*3024*200.48 ,6.321000,6.321000*200.48 ,6.321000,6.321000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,4.47,4.47*200.48,4.47*3024,4.47*3024*200.48,'cps24050938009,359000002 ',35.2,35.2*3024,35.2,35.2*3024,?,?,?,4 from bo bo where bo.bostamp = 'aut66e981639866e987a580'
20240917@144416.6002 96vnq0a6b5jgf790gi11n2fsos Query : use flama_phc
20240917@144416.6007 96vnq0a6b5jgf790gi11n2fsos Query : declare @bostamp varchar(25) = 'aut66e981639866e987a580' ,@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 
20240917@144429.3762 96vnq0a6b5jgf790gi11n2fsos Query : use flama_phc
20240917@144429.3766 96vnq0a6b5jgf790gi11n2fsos Query : select 1 valor from bo where bo.bostamp = 'aut66e981639866e987a580'
20240917@144429.3782 96vnq0a6b5jgf790gi11n2fsos 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) = 'aut66e981639866e987a580' 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 
