20240523@113908.4282 43742rj9r88k8ep1pbna67g28b INICIO DE FICHEIRO DE LOG :: /var/www/webservices/logs/website.sql.log
20240523@113908.4278 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@113908.4290 43742rj9r88k8ep1pbna67g28b Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@113908.4307 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='55';
20240523@113908.4326 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='55';
20240523@114142.3895 43742rj9r88k8ep1pbna67g28b Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240523@114142.3909 43742rj9r88k8ep1pbna67g28b Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240523@114142.3937 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='56';
20240523@114142.3978 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='56';
20240523@114142.3990 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='56';
20240523@114142.4003 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='56';
20240523@114142.4016 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114142.4021 43742rj9r88k8ep1pbna67g28b Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240523@114142.4038 43742rj9r88k8ep1pbna67g28b Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '2211.075.0001'
20240523@114142.4050 43742rj9r88k8ep1pbna67g28b 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 = 2400601 and bi.ref ='2211.075.0001' and bi.lordem =20000
20240523@114142.4065 43742rj9r88k8ep1pbna67g28b 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 = 'ags24052144762,631000002 ' 
20240523@114142.4081 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114142.4085 43742rj9r88k8ep1pbna67g28b Query : select top 1 1 valor from ts where ts.ndos = 61
20240523@114142.4097 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114142.4100 43742rj9r88k8ep1pbna67g28b 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')
20240523@114142.4121 43742rj9r88k8ep1pbna67g28b 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
20240523@114142.4139 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114142.4142 43742rj9r88k8ep1pbna67g28b Query : select top 1 ~inactivo valor from fl where no = '202090' and estab = 00 order by inactivo desc
20240523@114142.4159 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114142.4162 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from ts where ndos = 61
20240523@114142.4172 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114142.4187 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240523@114142.4194 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114142.4208 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240523@114142.4215 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114142.4230 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240523@114142.4237 43742rj9r88k8ep1pbna67g28b 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
20240523@114142.4253 43742rj9r88k8ep1pbna67g28b Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240523@114142.4276 43742rj9r88k8ep1pbna67g28b Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240523@114142.4295 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114142.4299 43742rj9r88k8ep1pbna67g28b Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202090' and estab=00
20240523@114142.4313 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114142.4328 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240523@114142.4336 43742rj9r88k8ep1pbna67g28b Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut664f119130664f1d6668',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240523@114142.4347 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114142.4361 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240523@114142.4370 43742rj9r88k8ep1pbna67g28b Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut664f119130664f1d6668','--','bo',0 ,0,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240523@114142.4380 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114142.4396 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240523@114142.4403 43742rj9r88k8ep1pbna67g28b 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 ('aut664f119130664f1d6668','guia r. fornecedor','2024-05-17',61,2401465,?,?,?,?,?,?,?,?,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')
20240523@114142.4850 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114142.4853 43742rj9r88k8ep1pbna67g28b Query : select st.usalote valor from st where st.ref = '2211.075.0001'
20240523@114142.4872 43742rj9r88k8ep1pbna67g28b 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 = '2211.075.0001'
20240523@114142.4887 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114142.4904 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240523@114142.4916 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114142.4930 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240523@114142.4938 43742rj9r88k8ep1pbna67g28b Query : select sestamp valor from se where ref ='2211.075.0001' and lote = 'r1900585200a'
20240523@114142.4950 43742rj9r88k8ep1pbna67g28b Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240523@114142.4962 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114142.4975 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240523@114142.4982 43742rj9r88k8ep1pbna67g28b Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut664f136392664f1d6679','aut664f119130664f1d6668',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 = 'aut664f119130664f1d6668'
20240523@114142.5379 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114142.5837 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240523@114142.5850 43742rj9r88k8ep1pbna67g28b 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 'aut664f136392664f1d6679',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1680, 1680*.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 ,9.2892,9.2892*200.48,9.2892,9.2892*200.48 ,0,0,'un',' ' ,bo.marcada,1 ,9.2892*1680,9.2892*1680*200.48 ,9.254000,9.254000*200.48 ,9.254000,9.254000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,9.2892,9.2892*200.48,9.2892*1680,9.2892*1680*200.48,'ags24052144762,631000002 ',9.2892,9.2892*1680,9.2892,9.2892*1680,?,?,?,4 from bo bo where bo.bostamp = 'aut664f119130664f1d6668'
20240523@114142.6401 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114142.6405 43742rj9r88k8ep1pbna67g28b Query : declare @bostamp varchar(25) = 'aut664f119130664f1d6668' ,@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 
20240523@114142.8116 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114142.8120 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from bo where bo.bostamp = 'aut664f119130664f1d6668'
20240523@114142.8136 43742rj9r88k8ep1pbna67g28b 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) = 'aut664f119130664f1d6668' 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 
20240523@114143.9320 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114143.9370 43742rj9r88k8ep1pbna67g28b Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@114143.9510 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='56';
20240523@114143.9660 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='56';
20240523@114357.5825 43742rj9r88k8ep1pbna67g28b Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240523@114357.5843 43742rj9r88k8ep1pbna67g28b Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240523@114357.5858 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='57';
20240523@114357.5899 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='57';
20240523@114357.5911 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='57';
20240523@114357.5923 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='57';
20240523@114357.5934 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114357.5937 43742rj9r88k8ep1pbna67g28b Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240523@114357.5953 43742rj9r88k8ep1pbna67g28b Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '2211.075.0001'
20240523@114357.5965 43742rj9r88k8ep1pbna67g28b 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 = 2400054 and bi.ref ='2211.075.0001' and bi.lordem =10000
20240523@114357.6318 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114357.6322 43742rj9r88k8ep1pbna67g28b Query : select top 1 1 valor from ts where ts.ndos = 61
20240523@114357.6334 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114357.6337 43742rj9r88k8ep1pbna67g28b 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')
20240523@114357.6361 43742rj9r88k8ep1pbna67g28b 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
20240523@114357.6379 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114357.6382 43742rj9r88k8ep1pbna67g28b Query : select top 1 ~inactivo valor from fl where no = '202090' and estab = 00 order by inactivo desc
20240523@114357.6411 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114357.6414 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from ts where ndos = 61
20240523@114357.6426 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114357.6443 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240523@114357.6451 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114357.6465 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240523@114357.6471 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114357.6484 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240523@114357.6491 43742rj9r88k8ep1pbna67g28b 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
20240523@114357.6520 43742rj9r88k8ep1pbna67g28b Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240523@114357.6540 43742rj9r88k8ep1pbna67g28b Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240523@114357.6557 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114357.6560 43742rj9r88k8ep1pbna67g28b Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202090' and estab=00
20240523@114357.6583 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114357.6598 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240523@114357.6606 43742rj9r88k8ep1pbna67g28b Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut664f194310664f1deda0',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240523@114357.6612 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114357.6626 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240523@114357.6633 43742rj9r88k8ep1pbna67g28b Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut664f194310664f1deda0','--','bo',0 ,0,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240523@114357.6638 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114357.6652 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240523@114357.6659 43742rj9r88k8ep1pbna67g28b 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 ('aut664f194310664f1deda0','guia r. fornecedor','2024-05-17',61,2401465,?,?,?,?,?,?,?,?,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')
20240523@114357.7202 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114357.7206 43742rj9r88k8ep1pbna67g28b Query : select st.usalote valor from st where st.ref = '2211.075.0001'
20240523@114357.7225 43742rj9r88k8ep1pbna67g28b 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 = '2211.075.0001'
20240523@114357.7239 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114357.7254 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240523@114357.7267 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114357.7281 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240523@114357.7287 43742rj9r88k8ep1pbna67g28b Query : select sestamp valor from se where ref ='2211.075.0001' and lote = 'r1900585200a'
20240523@114357.7300 43742rj9r88k8ep1pbna67g28b Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240523@114357.7311 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114357.7328 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240523@114357.7336 43742rj9r88k8ep1pbna67g28b Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut664f119551664f1dedb2','aut664f194310664f1deda0',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 = 'aut664f194310664f1deda0'
20240523@114357.7507 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114357.7525 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240523@114357.7538 43742rj9r88k8ep1pbna67g28b 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,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,obistamp ,stipo) select 'aut664f119551664f1dedb2',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1680, 1680*.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 ,0,0*200.48,0,0*200.48 ,0,0,'un',' ' ,bo.marcada,1 ,0*1680,0*1680*200.48 ,9.255000,9.255000*200.48 ,9.255000,9.255000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0*200.48,0*1680,0*1680*200.48,'',0,0*1680,0,0*1680,?,?,?,4 from bo bo where bo.bostamp = 'aut664f194310664f1deda0'
20240523@114357.8974 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114357.8983 43742rj9r88k8ep1pbna67g28b Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -110
20240523@114357.9043 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='57';
20240523@114357.9057 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='57';
20240523@114421.2024 43742rj9r88k8ep1pbna67g28b Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240523@114421.2040 43742rj9r88k8ep1pbna67g28b Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240523@114421.2056 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='58';
20240523@114421.2096 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='58';
20240523@114421.2107 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='58';
20240523@114421.2121 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='58';
20240523@114421.2133 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114421.2136 43742rj9r88k8ep1pbna67g28b Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240523@114421.2152 43742rj9r88k8ep1pbna67g28b Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.646.00.01'
20240523@114421.2265 43742rj9r88k8ep1pbna67g28b 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 = 2400054 and bi.ref ='324.646.00.01' and bi.lordem =10000
20240523@114421.2595 43742rj9r88k8ep1pbna67g28b 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 = 'cps24011554815,886000003 ' 
20240523@114421.2905 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114421.2909 43742rj9r88k8ep1pbna67g28b Query : select top 1 1 valor from ts where ts.ndos = 61
20240523@114421.2923 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114421.2927 43742rj9r88k8ep1pbna67g28b 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')
20240523@114421.2950 43742rj9r88k8ep1pbna67g28b 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
20240523@114421.2971 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114421.2975 43742rj9r88k8ep1pbna67g28b Query : select top 1 ~inactivo valor from fl where no = '202090' and estab = 00 order by inactivo desc
20240523@114421.2993 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114421.2997 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from ts where ndos = 61
20240523@114421.3010 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114421.3025 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240523@114421.3032 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114421.3045 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240523@114421.3051 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114421.3065 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240523@114421.3071 43742rj9r88k8ep1pbna67g28b 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
20240523@114421.3084 43742rj9r88k8ep1pbna67g28b Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240523@114421.3101 43742rj9r88k8ep1pbna67g28b Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240523@114421.3121 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114421.3125 43742rj9r88k8ep1pbna67g28b Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202090' and estab=00
20240523@114421.3140 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114421.3154 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240523@114421.3161 43742rj9r88k8ep1pbna67g28b Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut664f119944664f1e054c',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240523@114421.3177 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114421.3192 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240523@114421.3200 43742rj9r88k8ep1pbna67g28b Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut664f119944664f1e054c','--','bo',7.4184636118598382749 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240523@114421.3397 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114421.3413 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240523@114421.3420 43742rj9r88k8ep1pbna67g28b 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 ('aut664f119944664f1e054c','guia r. fornecedor','2024-05-17',61,2401465,?,?,?,?,?,?,?,?,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')
20240523@114421.3857 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114421.3862 43742rj9r88k8ep1pbna67g28b Query : select st.usalote valor from st where st.ref = '324.646.00.01'
20240523@114421.3880 43742rj9r88k8ep1pbna67g28b 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'
20240523@114421.4028 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114421.4044 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240523@114421.4056 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114421.4069 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240523@114421.4076 43742rj9r88k8ep1pbna67g28b Query : select sestamp valor from se where ref ='324.646.00.01' and lote = 'r2400054100a'
20240523@114421.4090 43742rj9r88k8ep1pbna67g28b Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240523@114421.4101 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114421.4115 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240523@114421.4123 43742rj9r88k8ep1pbna67g28b Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut664f155548664f1e0564','aut664f119944664f1e054c',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 = 'aut664f119944664f1e054c'
20240523@114421.4284 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114421.4305 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240523@114421.4321 43742rj9r88k8ep1pbna67g28b 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 'aut664f155548664f1e0564',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1428, 1428*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,10000 ,14.84,14.84*200.48,14.84,14.84*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,14.84*1428,14.84*1428*200.48 ,18.322000,18.322000*200.48 ,18.322000,18.322000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,14.84,14.84*200.48,14.84*1428,14.84*1428*200.48,'cps24011554815,886000003 ',110.09,110.09*1428,110.09,110.09*1428,?,?,?,4 from bo bo where bo.bostamp = 'aut664f119944664f1e054c'
20240523@114421.5100 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114421.5105 43742rj9r88k8ep1pbna67g28b Query : declare @bostamp varchar(25) = 'aut664f119944664f1e054c' ,@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 
20240523@114421.6793 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114421.6798 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from bo where bo.bostamp = 'aut664f119944664f1e054c'
20240523@114421.6816 43742rj9r88k8ep1pbna67g28b 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) = 'aut664f119944664f1e054c' 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 
20240523@114421.9118 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114421.9122 43742rj9r88k8ep1pbna67g28b Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@114421.9138 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='58';
20240523@114421.9157 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='58';
20240523@114558.6067 43742rj9r88k8ep1pbna67g28b Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240523@114558.6084 43742rj9r88k8ep1pbna67g28b Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240523@114558.6099 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='59';
20240523@114558.6266 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='59';
20240523@114558.7371 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='59';
20240523@114558.7388 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='59';
20240523@114558.7402 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114558.7405 43742rj9r88k8ep1pbna67g28b Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240523@114558.7425 43742rj9r88k8ep1pbna67g28b Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.646.00.01'
20240523@114558.7438 43742rj9r88k8ep1pbna67g28b 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 = 2400054 and bi.ref ='324.646.00.01' and bi.lordem =10000
20240523@114558.7453 43742rj9r88k8ep1pbna67g28b 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 = 'cps24011554815,886000003 ' 
20240523@114558.7468 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114558.7472 43742rj9r88k8ep1pbna67g28b Query : select top 1 1 valor from ts where ts.ndos = 61
20240523@114558.7485 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114558.7489 43742rj9r88k8ep1pbna67g28b 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')
20240523@114558.7509 43742rj9r88k8ep1pbna67g28b 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
20240523@114558.7527 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114558.7530 43742rj9r88k8ep1pbna67g28b Query : select top 1 ~inactivo valor from fl where no = '202090' and estab = 00 order by inactivo desc
20240523@114558.7548 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114558.7552 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from ts where ndos = 61
20240523@114558.7567 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114558.7585 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240523@114558.7593 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114558.7608 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240523@114558.7616 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114558.7630 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240523@114558.7636 43742rj9r88k8ep1pbna67g28b 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
20240523@114558.7650 43742rj9r88k8ep1pbna67g28b Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240523@114558.7669 43742rj9r88k8ep1pbna67g28b Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240523@114558.7690 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114558.7695 43742rj9r88k8ep1pbna67g28b Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202090' and estab=00
20240523@114558.7723 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114558.7740 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240523@114558.7751 43742rj9r88k8ep1pbna67g28b Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut664f128358664f1e66bb',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240523@114558.7756 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114558.7772 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240523@114558.7781 43742rj9r88k8ep1pbna67g28b Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut664f128358664f1e66bb','--','bo',7.4184636118598382749 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240523@114558.7786 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114558.7801 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240523@114558.7809 43742rj9r88k8ep1pbna67g28b 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 ('aut664f128358664f1e66bb','guia r. fornecedor','2024-05-17',61,2401465,?,?,?,?,?,?,?,?,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')
20240523@114558.8323 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114558.8327 43742rj9r88k8ep1pbna67g28b Query : select st.usalote valor from st where st.ref = '324.646.00.01'
20240523@114558.8349 43742rj9r88k8ep1pbna67g28b 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'
20240523@114558.8364 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114558.8381 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240523@114558.8393 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114558.8410 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240523@114558.8418 43742rj9r88k8ep1pbna67g28b Query : select sestamp valor from se where ref ='324.646.00.01' and lote = 'r2400054100a'
20240523@114558.8431 43742rj9r88k8ep1pbna67g28b Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240523@114558.8445 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114558.8465 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240523@114558.8474 43742rj9r88k8ep1pbna67g28b Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut664f146903664f1e66ce','aut664f128358664f1e66bb',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 = 'aut664f128358664f1e66bb'
20240523@114558.8651 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114558.8671 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240523@114558.8686 43742rj9r88k8ep1pbna67g28b 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 'aut664f146903664f1e66ce',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1428, 1428*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,10000 ,14.84,14.84*200.48,14.84,14.84*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,14.84*1428,14.84*1428*200.48 ,18.323000,18.323000*200.48 ,18.323000,18.323000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,14.84,14.84*200.48,14.84*1428,14.84*1428*200.48,'cps24011554815,886000003 ',110.09,110.09*1428,110.09,110.09*1428,?,?,?,4 from bo bo where bo.bostamp = 'aut664f128358664f1e66bb'
20240523@114558.9258 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114558.9264 43742rj9r88k8ep1pbna67g28b Query : declare @bostamp varchar(25) = 'aut664f128358664f1e66bb' ,@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 
20240523@114559.1151 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114559.1167 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from bo where bo.bostamp = 'aut664f128358664f1e66bb'
20240523@114559.1184 43742rj9r88k8ep1pbna67g28b 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) = 'aut664f128358664f1e66bb' 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 
20240523@114559.3223 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114559.3227 43742rj9r88k8ep1pbna67g28b Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@114559.3240 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='59';
20240523@114559.3254 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='59';
20240523@114755.6862 43742rj9r88k8ep1pbna67g28b Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240523@114755.6879 43742rj9r88k8ep1pbna67g28b Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240523@114755.6895 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='60';
20240523@114755.6934 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='60';
20240523@114755.6946 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='60';
20240523@114755.6957 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='60';
20240523@114755.6969 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114755.6973 43742rj9r88k8ep1pbna67g28b Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240523@114755.6989 43742rj9r88k8ep1pbna67g28b Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.646.00.01'
20240523@114755.6999 43742rj9r88k8ep1pbna67g28b 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 = 2400054 and bi.ref ='324.646.00.01' and bi.lordem =10000
20240523@114755.7013 43742rj9r88k8ep1pbna67g28b 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 = 'cps24011554815,886000003 ' 
20240523@114755.7026 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114755.7029 43742rj9r88k8ep1pbna67g28b Query : select top 1 1 valor from ts where ts.ndos = 61
20240523@114755.7040 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114755.7043 43742rj9r88k8ep1pbna67g28b 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')
20240523@114755.7064 43742rj9r88k8ep1pbna67g28b 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
20240523@114755.7082 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114755.7085 43742rj9r88k8ep1pbna67g28b Query : select top 1 ~inactivo valor from fl where no = '202090' and estab = 00 order by inactivo desc
20240523@114755.7100 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114755.7103 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from ts where ndos = 61
20240523@114755.7114 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114755.7132 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240523@114755.7140 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114755.7154 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240523@114755.7160 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114755.7174 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240523@114755.7180 43742rj9r88k8ep1pbna67g28b 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
20240523@114755.7194 43742rj9r88k8ep1pbna67g28b Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240523@114755.7284 43742rj9r88k8ep1pbna67g28b Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240523@114755.7303 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114755.7307 43742rj9r88k8ep1pbna67g28b Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202090' and estab=00
20240523@114755.7322 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114755.7340 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240523@114755.7347 43742rj9r88k8ep1pbna67g28b Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut664f101533664f1edbb2',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240523@114755.7358 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114755.7374 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240523@114755.7383 43742rj9r88k8ep1pbna67g28b Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut664f101533664f1edbb2','--','bo',7.4184636118598382749 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240523@114755.7388 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114755.7402 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240523@114755.7409 43742rj9r88k8ep1pbna67g28b 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 ('aut664f101533664f1edbb2','guia r. fornecedor','2024-05-17',61,2401465,?,?,?,?,?,?,?,?,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')
20240523@114755.7904 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114755.7909 43742rj9r88k8ep1pbna67g28b Query : select st.usalote valor from st where st.ref = '324.646.00.01'
20240523@114755.7927 43742rj9r88k8ep1pbna67g28b 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'
20240523@114755.7941 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114755.7957 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240523@114755.7968 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114755.7982 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240523@114755.7991 43742rj9r88k8ep1pbna67g28b Query : select sestamp valor from se where ref ='324.646.00.01' and lote = 'rxxa'
20240523@114755.8001 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114755.8015 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240523@114755.8023 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114755.8038 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240523@114755.8048 43742rj9r88k8ep1pbna67g28b Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut664f165036664f1edbc3',?,?,'20240523',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240523@114755.8160 43742rj9r88k8ep1pbna67g28b Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240523@114755.8175 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114755.8191 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240523@114755.8198 43742rj9r88k8ep1pbna67g28b Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut664f129410664f1edbc7','aut664f101533664f1edbb2',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 = 'aut664f101533664f1edbb2'
20240523@114755.8397 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@114755.8414 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240523@114755.8428 43742rj9r88k8ep1pbna67g28b 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 'aut664f129410664f1edbc7',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1428, 1428*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,10000 ,14.84,14.84*200.48,14.84,14.84*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,14.84*1428,14.84*1428*200.48 ,18.323000,18.323000*200.48 ,18.323000,18.323000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,14.84,14.84*200.48,14.84*1428,14.84*1428*200.48,'cps24011554815,886000003 ',110.09,110.09*1428,110.09,110.09*1428,?,?,?,4 from bo bo where bo.bostamp = 'aut664f101533664f1edbb2'
20240523@114755.9117 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114755.9137 43742rj9r88k8ep1pbna67g28b Query : declare @bostamp varchar(25) = 'aut664f101533664f1edbb2' ,@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 
20240523@114756.9620 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114756.9660 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from bo where bo.bostamp = 'aut664f101533664f1edbb2'
20240523@114756.9830 43742rj9r88k8ep1pbna67g28b 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) = 'aut664f101533664f1edbb2' 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 
20240523@114756.3931 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@114756.3937 43742rj9r88k8ep1pbna67g28b Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@114756.3951 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='60';
20240523@114756.3965 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='60';
20240523@115057.3485 43742rj9r88k8ep1pbna67g28b Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240523@115057.3499 43742rj9r88k8ep1pbna67g28b Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240523@115057.3518 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='61';
20240523@115057.3558 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='61';
20240523@115057.3569 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='61';
20240523@115057.3584 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='61';
20240523@115057.3594 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@115057.3598 43742rj9r88k8ep1pbna67g28b Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240523@115057.3618 43742rj9r88k8ep1pbna67g28b Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.646.00.01'
20240523@115057.3634 43742rj9r88k8ep1pbna67g28b 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 = 2400054 and bi.ref ='324.646.00.01' and bi.lordem =10000
20240523@115057.3651 43742rj9r88k8ep1pbna67g28b 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 = 'cps24011554815,886000003 ' 
20240523@115329.8037 43742rj9r88k8ep1pbna67g28b Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240523@115329.8061 43742rj9r88k8ep1pbna67g28b Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240523@115329.8078 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='62';
20240523@115329.8118 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='62';
20240523@115329.8129 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='62';
20240523@115329.8142 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='62';
20240523@115329.8175 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@115329.8179 43742rj9r88k8ep1pbna67g28b Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240523@115329.8199 43742rj9r88k8ep1pbna67g28b Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.646.00.01'
20240523@115329.8224 43742rj9r88k8ep1pbna67g28b 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 = 2400054 and bi.ref ='324.646.00.01' and bi.lordem =10000
20240523@115329.8292 43742rj9r88k8ep1pbna67g28b 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 = 'cps24011554815,886000003 ' 
20240523@115701.5449 43742rj9r88k8ep1pbna67g28b Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240523@115701.5500 43742rj9r88k8ep1pbna67g28b Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240523@115701.5517 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='63';
20240523@115701.5553 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='63';
20240523@115701.5565 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='63';
20240523@115701.5577 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='63';
20240523@115701.5588 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@115701.5592 43742rj9r88k8ep1pbna67g28b Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240523@115701.5611 43742rj9r88k8ep1pbna67g28b Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.646.00.01'
20240523@115701.5622 43742rj9r88k8ep1pbna67g28b 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 = 2400054 and bi.ref ='324.646.00.01' and bi.lordem =10000
20240523@115701.5636 43742rj9r88k8ep1pbna67g28b 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 = 'cps24011554815,886000003 ' 
20240523@115701.5649 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@115701.5652 43742rj9r88k8ep1pbna67g28b Query : select top 1 1 valor from ts where ts.ndos = 61
20240523@115701.5664 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@115701.5667 43742rj9r88k8ep1pbna67g28b 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')
20240523@115701.5753 43742rj9r88k8ep1pbna67g28b 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
20240523@115701.5771 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@115701.5774 43742rj9r88k8ep1pbna67g28b Query : select top 1 ~inactivo valor from fl where no = '202090' and estab = 00 order by inactivo desc
20240523@115701.5853 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@115701.5856 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from ts where ndos = 61
20240523@115701.5867 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@115701.5925 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240523@115701.5954 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@115701.5969 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240523@115701.5976 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@115701.6050 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240523@115701.6058 43742rj9r88k8ep1pbna67g28b 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
20240523@115701.6073 43742rj9r88k8ep1pbna67g28b Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240523@115701.6157 43742rj9r88k8ep1pbna67g28b Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240523@115701.6176 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@115701.6179 43742rj9r88k8ep1pbna67g28b Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202090' and estab=00
20240523@115701.6232 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@115701.6272 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240523@115701.6279 43742rj9r88k8ep1pbna67g28b Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut664f245184664f20fd96',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240523@115701.6327 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@115701.6366 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240523@115701.6374 43742rj9r88k8ep1pbna67g28b Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut664f245184664f20fd96','--','bo',7.4184636118598382749 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240523@115701.6380 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@115701.6395 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240523@115701.6459 43742rj9r88k8ep1pbna67g28b 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 ('aut664f245184664f20fd96','guia r. fornecedor','2024-05-17',61,2401465,?,?,?,?,?,?,?,?,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')
20240523@115701.7305 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@115701.7346 43742rj9r88k8ep1pbna67g28b Query : select st.usalote valor from st where st.ref = '324.646.00.01'
20240523@115701.7363 43742rj9r88k8ep1pbna67g28b 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'
20240523@115701.7386 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@115701.7565 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240523@115701.7576 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@115701.7591 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240523@115701.7598 43742rj9r88k8ep1pbna67g28b Query : select sestamp valor from se where ref ='324.646.00.01' and lote = 'rxxa'
20240523@115701.7691 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@115701.8573 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240523@115701.8964 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@115701.9335 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240523@115701.9614 43742rj9r88k8ep1pbna67g28b Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut664f228246664f20fdda',?,?,'20240523',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240523@115701.9943 43742rj9r88k8ep1pbna67g28b Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240523@115702.4470 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@115702.8560 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240523@115702.9830 43742rj9r88k8ep1pbna67g28b Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut664f299573664f20fe0a','aut664f245184664f20fd96',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 = 'aut664f245184664f20fd96'
20240523@115702.1372 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240523@115702.2045 43742rj9r88k8ep1pbna67g28b Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240523@115702.3212 43742rj9r88k8ep1pbna67g28b 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 'aut664f299573664f20fe0a',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1428, 1428*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,10000 ,14.84,14.84*200.48,14.84,14.84*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,14.84*1428,14.84*1428*200.48 ,18.323000,18.323000*200.48 ,18.323000,18.323000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,14.84,14.84*200.48,14.84*1428,14.84*1428*200.48,'cps24011554815,886000003 ',110.09,110.09*1428,110.09,110.09*1428,?,?,?,4 from bo bo where bo.bostamp = 'aut664f245184664f20fd96'
20240523@115702.4648 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@115702.4667 43742rj9r88k8ep1pbna67g28b Query : declare @bostamp varchar(25) = 'aut664f245184664f20fd96' ,@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 
20240523@115702.9627 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@115702.9855 43742rj9r88k8ep1pbna67g28b Query : select 1 valor from bo where bo.bostamp = 'aut664f245184664f20fd96'
20240523@115703.4430 43742rj9r88k8ep1pbna67g28b 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) = 'aut664f245184664f20fd96' 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 
20240523@115703.7828 43742rj9r88k8ep1pbna67g28b Query : use flama_phc
20240523@115703.7874 43742rj9r88k8ep1pbna67g28b Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@115703.7952 43742rj9r88k8ep1pbna67g28b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='63';
20240523@115703.8392 43742rj9r88k8ep1pbna67g28b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='63';
20240523@121913.3663 43sbn7h4i3qd0o2b1b90oqcbl3 Query : use flama_phc
20240523@121913.3668 43sbn7h4i3qd0o2b1b90oqcbl3 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@121913.3693 43sbn7h4i3qd0o2b1b90oqcbl3 Query : use flama_phc
20240523@121913.3696 43sbn7h4i3qd0o2b1b90oqcbl3 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@123613.6329 phted5pl8afil5msdga46ohqj3 Query : use flama_phc
20240523@123613.6334 phted5pl8afil5msdga46ohqj3 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@123613.6351 phted5pl8afil5msdga46ohqj3 Query : use flama_phc
20240523@123613.6354 phted5pl8afil5msdga46ohqj3 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@131910.7071 i7modfkg6khr3mibptec5rko4j Query : use flama_phc
20240523@131910.7076 i7modfkg6khr3mibptec5rko4j Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@131910.7149 i7modfkg6khr3mibptec5rko4j Query : use flama_phc
20240523@131910.7152 i7modfkg6khr3mibptec5rko4j Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@133610.6095 r4chr8gavk800f127i0lgdphja Query : use flama_phc
20240523@133610.6100 r4chr8gavk800f127i0lgdphja Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@133610.6117 r4chr8gavk800f127i0lgdphja Query : use flama_phc
20240523@133610.6121 r4chr8gavk800f127i0lgdphja Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@141910.7369 qt5djgrj8j5rpou5g7gt31sp6v Query : use flama_phc
20240523@141910.7373 qt5djgrj8j5rpou5g7gt31sp6v Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@141910.7391 qt5djgrj8j5rpou5g7gt31sp6v Query : use flama_phc
20240523@141910.7393 qt5djgrj8j5rpou5g7gt31sp6v Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@143610.6710 207t9re98oh339l46gujiv7t53 Query : use flama_phc
20240523@143610.6716 207t9re98oh339l46gujiv7t53 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@143610.6733 207t9re98oh339l46gujiv7t53 Query : use flama_phc
20240523@143610.6736 207t9re98oh339l46gujiv7t53 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@151913.1291 gpi5i8jii0c9kb97m8pke02dag Query : use flama_phc
20240523@151913.1296 gpi5i8jii0c9kb97m8pke02dag Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@151913.1312 gpi5i8jii0c9kb97m8pke02dag Query : use flama_phc
20240523@151913.1315 gpi5i8jii0c9kb97m8pke02dag Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@153613.1500 89k89sfoqekmcc5p3m0el60a87 Query : use flama_phc
20240523@153613.1560 89k89sfoqekmcc5p3m0el60a87 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@153613.1750 89k89sfoqekmcc5p3m0el60a87 Query : use flama_phc
20240523@153613.1780 89k89sfoqekmcc5p3m0el60a87 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@153656.6925 kfbtc5mqs84l4q9kgoiofb7cra Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240523@153656.6941 kfbtc5mqs84l4q9kgoiofb7cra Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240523@153656.7026 kfbtc5mqs84l4q9kgoiofb7cra Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='64';
20240523@153656.7072 kfbtc5mqs84l4q9kgoiofb7cra Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='64';
20240523@153656.7083 kfbtc5mqs84l4q9kgoiofb7cra Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='64';
20240523@153656.7095 kfbtc5mqs84l4q9kgoiofb7cra Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='64';
20240523@153656.7104 kfbtc5mqs84l4q9kgoiofb7cra Query : use flama_phc
20240523@153656.7107 kfbtc5mqs84l4q9kgoiofb7cra Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240523@153656.7129 kfbtc5mqs84l4q9kgoiofb7cra Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.692.00.01'
20240523@153656.8595 kfbtc5mqs84l4q9kgoiofb7cra Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =gt2 and bo.boano =2002 and bo.obrano = 24/3628 and bi.ref ='324.692.00.01' and bi.lordem =1
20240523@161912.3800 nb0j48ut7c7soh9342aqvq64oa Query : use flama_phc
20240523@161912.3805 nb0j48ut7c7soh9342aqvq64oa Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@161912.3964 nb0j48ut7c7soh9342aqvq64oa Query : use flama_phc
20240523@161912.4098 nb0j48ut7c7soh9342aqvq64oa Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@163612.6700 0rcl7ff8ddklh217kud87c6o6a Query : use flama_phc
20240523@163612.6705 0rcl7ff8ddklh217kud87c6o6a Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@163612.6723 0rcl7ff8ddklh217kud87c6o6a Query : use flama_phc
20240523@163612.6725 0rcl7ff8ddklh217kud87c6o6a Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@171911.1571 jael99u8e0ihrfjge2ger9mq56 Query : use flama_phc
20240523@171911.1576 jael99u8e0ihrfjge2ger9mq56 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@171911.1599 jael99u8e0ihrfjge2ger9mq56 Query : use flama_phc
20240523@171911.1602 jael99u8e0ihrfjge2ger9mq56 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@173610.8566 n4ao51smjmqnb12iaqee9v3ep4 Query : use flama_phc
20240523@173610.8571 n4ao51smjmqnb12iaqee9v3ep4 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@173610.8607 n4ao51smjmqnb12iaqee9v3ep4 Query : use flama_phc
20240523@173610.8610 n4ao51smjmqnb12iaqee9v3ep4 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@181912.1025 fj02tkdl9tif4khtjv5ljrj5rm Query : use flama_phc
20240523@181912.1034 fj02tkdl9tif4khtjv5ljrj5rm Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@181912.1051 fj02tkdl9tif4khtjv5ljrj5rm Query : use flama_phc
20240523@181912.1054 fj02tkdl9tif4khtjv5ljrj5rm Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@183612.1781 3f5lnjjm727qm9k5ptdknpk1qc Query : use flama_phc
20240523@183612.1786 3f5lnjjm727qm9k5ptdknpk1qc Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@183612.1802 3f5lnjjm727qm9k5ptdknpk1qc Query : use flama_phc
20240523@183612.1805 3f5lnjjm727qm9k5ptdknpk1qc Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@191912.3559 g7gekuchqege72vn24qek17diu Query : use flama_phc
20240523@191912.3564 g7gekuchqege72vn24qek17diu Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@191912.3582 g7gekuchqege72vn24qek17diu Query : use flama_phc
20240523@191912.3585 g7gekuchqege72vn24qek17diu Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@193612.4131 hkngc9ljj593om9u735hsa6shs Query : use flama_phc
20240523@193612.4136 hkngc9ljj593om9u735hsa6shs Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@193612.4155 hkngc9ljj593om9u735hsa6shs Query : use flama_phc
20240523@193612.4158 hkngc9ljj593om9u735hsa6shs Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@211910.5255 7t8f91bn16ob81ntpnbm05s4ug Query : use flama_phc
20240523@211910.5260 7t8f91bn16ob81ntpnbm05s4ug Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@211910.5277 7t8f91bn16ob81ntpnbm05s4ug Query : use flama_phc
20240523@211910.5280 7t8f91bn16ob81ntpnbm05s4ug Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@213610.4412 blbu2dgiefpe45mktcvnkcvqik Query : use flama_phc
20240523@213610.4417 blbu2dgiefpe45mktcvnkcvqik Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@213610.4434 blbu2dgiefpe45mktcvnkcvqik Query : use flama_phc
20240523@213610.4437 blbu2dgiefpe45mktcvnkcvqik Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@221911.7233 nplrh1a2e90s7n6lmmc1lf0mjc Query : use flama_phc
20240523@221911.7238 nplrh1a2e90s7n6lmmc1lf0mjc Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@221911.7255 nplrh1a2e90s7n6lmmc1lf0mjc Query : use flama_phc
20240523@221911.7258 nplrh1a2e90s7n6lmmc1lf0mjc Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@223611.5384 kesptj06tj3347h55c3gcuoegp Query : use flama_phc
20240523@223611.5389 kesptj06tj3347h55c3gcuoegp Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@223611.5410 kesptj06tj3347h55c3gcuoegp Query : use flama_phc
20240523@223611.5413 kesptj06tj3347h55c3gcuoegp Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@231910.8009 6hn4igrgca6sk00a2028ks2hhj Query : use flama_phc
20240523@231910.8014 6hn4igrgca6sk00a2028ks2hhj Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@231910.8035 6hn4igrgca6sk00a2028ks2hhj Query : use flama_phc
20240523@231910.8038 6hn4igrgca6sk00a2028ks2hhj Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240523@233610.6388 4lor8qaui4jl30fpbqsfibnnv0 Query : use flama_phc
20240523@233610.6393 4lor8qaui4jl30fpbqsfibnnv0 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240523@233610.6411 4lor8qaui4jl30fpbqsfibnnv0 Query : use flama_phc
20240523@233610.6414 4lor8qaui4jl30fpbqsfibnnv0 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@071919.1208 4kdn1tqretkb72jc2hupee354q Query : use flama_phc
20240524@071919.1213 4kdn1tqretkb72jc2hupee354q Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@071919.1274 4kdn1tqretkb72jc2hupee354q Query : use flama_phc
20240524@071919.1277 4kdn1tqretkb72jc2hupee354q Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@073629.5168 ndcmf7cjqfaj05f9701le04f1n Query : use flama_phc
20240524@073629.5175 ndcmf7cjqfaj05f9701le04f1n Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@073629.5273 ndcmf7cjqfaj05f9701le04f1n Query : use flama_phc
20240524@073629.5277 ndcmf7cjqfaj05f9701le04f1n Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@081843.6917 n9m9jakfo2mh3sadspi9f423ud Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240524@081843.6948 n9m9jakfo2mh3sadspi9f423ud Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240524@081843.7058 n9m9jakfo2mh3sadspi9f423ud Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='65';
20240524@081843.7092 n9m9jakfo2mh3sadspi9f423ud Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='65';
20240524@081843.7115 n9m9jakfo2mh3sadspi9f423ud Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='65';
20240524@081843.7126 n9m9jakfo2mh3sadspi9f423ud Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='65';
20240524@081843.7136 n9m9jakfo2mh3sadspi9f423ud Query : use flama_phc
20240524@081843.7139 n9m9jakfo2mh3sadspi9f423ud Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240524@081843.7183 n9m9jakfo2mh3sadspi9f423ud Query : use flama_phc
20240524@081843.7187 n9m9jakfo2mh3sadspi9f423ud Query : select no, estab,szadrsdesc from szadrs where u_coddest=4785
20240524@081843.7268 n9m9jakfo2mh3sadspi9f423ud Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1879.00.1'
20240524@081843.7407 n9m9jakfo2mh3sadspi9f423ud Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2036 and bo.obrano = 2403680 and bi.ref ='324.1879.00.1' and bi.lordem =1
20240524@081843.8040 n9m9jakfo2mh3sadspi9f423ud Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1879.00.1'
20240524@081843.8250 n9m9jakfo2mh3sadspi9f423ud Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2036 and bo.obrano = 2403680 and bi.ref ='324.1879.00.1' and bi.lordem =1
20240524@081843.8265 n9m9jakfo2mh3sadspi9f423ud Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1879.00.1'
20240524@081843.8497 n9m9jakfo2mh3sadspi9f423ud Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2036 and bo.obrano = 2403680 and bi.ref ='324.1879.00.1' and bi.lordem =2
20240524@081843.8836 n9m9jakfo2mh3sadspi9f423ud Query : use flama_phc
20240524@081843.8839 n9m9jakfo2mh3sadspi9f423ud Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240524@081843.9014 n9m9jakfo2mh3sadspi9f423ud Query : use flama_phc
20240524@081843.9017 n9m9jakfo2mh3sadspi9f423ud Query : select top 1 1 valor from td where td.ndoc = 39
20240524@081843.9094 n9m9jakfo2mh3sadspi9f423ud Query : use flama_phc
20240524@081843.9097 n9m9jakfo2mh3sadspi9f423ud 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')
20240524@081843.9645 7r6f01pla7a5l44btuk5i3o1o0 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240524@081843.9657 7r6f01pla7a5l44btuk5i3o1o0 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240524@081843.9670 7r6f01pla7a5l44btuk5i3o1o0 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='66';
20240524@081843.9704 7r6f01pla7a5l44btuk5i3o1o0 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='66';
20240524@081843.9716 7r6f01pla7a5l44btuk5i3o1o0 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='66';
20240524@081843.9727 7r6f01pla7a5l44btuk5i3o1o0 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='66';
20240524@081843.9737 7r6f01pla7a5l44btuk5i3o1o0 Query : use flama_phc
20240524@081843.9740 7r6f01pla7a5l44btuk5i3o1o0 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240524@081843.9754 7r6f01pla7a5l44btuk5i3o1o0 Query : use flama_phc
20240524@081843.9756 7r6f01pla7a5l44btuk5i3o1o0 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4801
20240524@081843.9826 7r6f01pla7a5l44btuk5i3o1o0 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'
20240524@081843.9967 7r6f01pla7a5l44btuk5i3o1o0 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2036 and bo.obrano = 2403686 and bi.ref ='324.1824.00.1' and bi.lordem =1
20240524@081844.7530 7r6f01pla7a5l44btuk5i3o1o0 Query : use flama_phc
20240524@081844.9140 7r6f01pla7a5l44btuk5i3o1o0 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240524@081844.1478 7r6f01pla7a5l44btuk5i3o1o0 Query : use flama_phc
20240524@081844.1482 7r6f01pla7a5l44btuk5i3o1o0 Query : select top 1 1 valor from td where td.ndoc = 39
20240524@081844.1528 7r6f01pla7a5l44btuk5i3o1o0 Query : use flama_phc
20240524@081844.1530 7r6f01pla7a5l44btuk5i3o1o0 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')
20240524@081844.2016 abo940vpsi9qrju8qv5c7i40nv Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240524@081844.2028 abo940vpsi9qrju8qv5c7i40nv Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240524@081844.2041 abo940vpsi9qrju8qv5c7i40nv Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='67';
20240524@081844.2074 abo940vpsi9qrju8qv5c7i40nv Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='67';
20240524@081844.2084 abo940vpsi9qrju8qv5c7i40nv Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='67';
20240524@081844.2094 abo940vpsi9qrju8qv5c7i40nv Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='67';
20240524@081844.2104 abo940vpsi9qrju8qv5c7i40nv Query : use flama_phc
20240524@081844.2107 abo940vpsi9qrju8qv5c7i40nv Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240524@081844.2121 abo940vpsi9qrju8qv5c7i40nv Query : use flama_phc
20240524@081844.2124 abo940vpsi9qrju8qv5c7i40nv Query : select no, estab,szadrsdesc from szadrs where u_coddest=743
20240524@081844.2196 abo940vpsi9qrju8qv5c7i40nv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '323.367.09.00'
20240524@081844.2338 abo940vpsi9qrju8qv5c7i40nv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403707 and bi.ref ='323.367.09.00' and bi.lordem =1
20240524@081844.2656 abo940vpsi9qrju8qv5c7i40nv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1675.00.2'
20240524@081844.2804 abo940vpsi9qrju8qv5c7i40nv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403707 and bi.ref ='324.1675.00.2' and bi.lordem =2
20240524@081844.3120 abo940vpsi9qrju8qv5c7i40nv 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'
20240524@081844.3256 abo940vpsi9qrju8qv5c7i40nv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403707 and bi.ref ='324.691.00.01' and bi.lordem =3
20240524@081844.3575 abo940vpsi9qrju8qv5c7i40nv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.692.00.01'
20240524@081844.3718 abo940vpsi9qrju8qv5c7i40nv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403707 and bi.ref ='324.692.00.01' and bi.lordem =4
20240524@081844.4040 abo940vpsi9qrju8qv5c7i40nv Query : use flama_phc
20240524@081844.4043 abo940vpsi9qrju8qv5c7i40nv Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240524@081844.4058 abo940vpsi9qrju8qv5c7i40nv Query : use flama_phc
20240524@081844.4061 abo940vpsi9qrju8qv5c7i40nv Query : select top 1 1 valor from td where td.ndoc = 39
20240524@081844.4072 abo940vpsi9qrju8qv5c7i40nv Query : use flama_phc
20240524@081844.4075 abo940vpsi9qrju8qv5c7i40nv 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')
20240524@081844.4800 p2t4b2f2mad5852spcim3f78qp Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240524@081844.4814 p2t4b2f2mad5852spcim3f78qp Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240524@081844.4826 p2t4b2f2mad5852spcim3f78qp Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='68';
20240524@081844.4861 p2t4b2f2mad5852spcim3f78qp Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='68';
20240524@081844.4871 p2t4b2f2mad5852spcim3f78qp Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='68';
20240524@081844.4883 p2t4b2f2mad5852spcim3f78qp Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='68';
20240524@081844.4894 p2t4b2f2mad5852spcim3f78qp Query : use flama_phc
20240524@081844.4896 p2t4b2f2mad5852spcim3f78qp Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240524@081844.4910 p2t4b2f2mad5852spcim3f78qp Query : use flama_phc
20240524@081844.4912 p2t4b2f2mad5852spcim3f78qp Query : select no, estab,szadrsdesc from szadrs where u_coddest=1334
20240524@081844.4990 p2t4b2f2mad5852spcim3f78qp 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'
20240524@081844.5000 p2t4b2f2mad5852spcim3f78qp Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403714 and bi.ref ='324.691.00.01' and bi.lordem =1
20240524@081844.5315 p2t4b2f2mad5852spcim3f78qp Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.692.00.01'
20240524@081844.5327 p2t4b2f2mad5852spcim3f78qp Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403714 and bi.ref ='324.692.00.01' and bi.lordem =2
20240524@081844.5666 p2t4b2f2mad5852spcim3f78qp Query : use flama_phc
20240524@081844.5669 p2t4b2f2mad5852spcim3f78qp Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240524@081844.5682 p2t4b2f2mad5852spcim3f78qp Query : use flama_phc
20240524@081844.5685 p2t4b2f2mad5852spcim3f78qp Query : select top 1 1 valor from td where td.ndoc = 39
20240524@081844.5696 p2t4b2f2mad5852spcim3f78qp Query : use flama_phc
20240524@081844.5699 p2t4b2f2mad5852spcim3f78qp 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')
20240524@081844.6592 nhbh26i3c0vf1udqgh1d6d1t5c Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240524@081844.6605 nhbh26i3c0vf1udqgh1d6d1t5c Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240524@081844.6618 nhbh26i3c0vf1udqgh1d6d1t5c Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='69';
20240524@081844.6654 nhbh26i3c0vf1udqgh1d6d1t5c Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='69';
20240524@081844.6665 nhbh26i3c0vf1udqgh1d6d1t5c Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='69';
20240524@081844.6675 nhbh26i3c0vf1udqgh1d6d1t5c Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='69';
20240524@081844.6685 nhbh26i3c0vf1udqgh1d6d1t5c Query : use flama_phc
20240524@081844.6688 nhbh26i3c0vf1udqgh1d6d1t5c Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240524@081844.6700 nhbh26i3c0vf1udqgh1d6d1t5c Query : use flama_phc
20240524@081844.6703 nhbh26i3c0vf1udqgh1d6d1t5c Query : select no, estab,szadrsdesc from szadrs where u_coddest=6625
20240524@081844.6779 nhbh26i3c0vf1udqgh1d6d1t5c Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2223.00.1'
20240524@081844.6914 nhbh26i3c0vf1udqgh1d6d1t5c Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403715 and bi.ref ='324.2223.00.1' and bi.lordem =1
20240524@081844.7223 nhbh26i3c0vf1udqgh1d6d1t5c Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.681.00.01'
20240524@081844.7369 nhbh26i3c0vf1udqgh1d6d1t5c Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403715 and bi.ref ='324.681.00.01' and bi.lordem =2
20240524@081844.7693 nhbh26i3c0vf1udqgh1d6d1t5c Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4521.00.1'
20240524@081844.7841 nhbh26i3c0vf1udqgh1d6d1t5c Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403715 and bi.ref ='324.4521.00.1' and bi.lordem =3
20240524@081844.8160 nhbh26i3c0vf1udqgh1d6d1t5c Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4521.00.1'
20240524@081844.8170 nhbh26i3c0vf1udqgh1d6d1t5c Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403715 and bi.ref ='324.4521.00.1' and bi.lordem =3
20240524@081844.8177 nhbh26i3c0vf1udqgh1d6d1t5c Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.5342.00.1'
20240524@081844.8320 nhbh26i3c0vf1udqgh1d6d1t5c Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403715 and bi.ref ='324.5342.00.1' and bi.lordem =4
20240524@081844.8648 nhbh26i3c0vf1udqgh1d6d1t5c Query : use flama_phc
20240524@081844.8651 nhbh26i3c0vf1udqgh1d6d1t5c Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240524@081844.8664 nhbh26i3c0vf1udqgh1d6d1t5c Query : use flama_phc
20240524@081844.8667 nhbh26i3c0vf1udqgh1d6d1t5c Query : select top 1 1 valor from td where td.ndoc = 39
20240524@081844.8677 nhbh26i3c0vf1udqgh1d6d1t5c Query : use flama_phc
20240524@081844.8680 nhbh26i3c0vf1udqgh1d6d1t5c 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')
20240524@081844.9157 4656t8iguu3mqt8eimlvp721sa Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240524@081844.9169 4656t8iguu3mqt8eimlvp721sa Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240524@081844.9182 4656t8iguu3mqt8eimlvp721sa Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='70';
20240524@081844.9217 4656t8iguu3mqt8eimlvp721sa Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='70';
20240524@081844.9227 4656t8iguu3mqt8eimlvp721sa Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='70';
20240524@081844.9237 4656t8iguu3mqt8eimlvp721sa Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='70';
20240524@081844.9247 4656t8iguu3mqt8eimlvp721sa Query : use flama_phc
20240524@081844.9250 4656t8iguu3mqt8eimlvp721sa Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240524@081844.9273 4656t8iguu3mqt8eimlvp721sa Query : use flama_phc
20240524@081844.9276 4656t8iguu3mqt8eimlvp721sa Query : select no, estab,szadrsdesc from szadrs where u_coddest=5187
20240524@081845.4660 4656t8iguu3mqt8eimlvp721sa Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2221.00.1'
20240524@081845.6130 4656t8iguu3mqt8eimlvp721sa Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403716 and bi.ref ='324.2221.00.1' and bi.lordem =1
20240524@081845.9410 4656t8iguu3mqt8eimlvp721sa Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240524@081845.1085 4656t8iguu3mqt8eimlvp721sa Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403716 and bi.ref ='324.645.00.01' and bi.lordem =2
20240524@081845.1418 4656t8iguu3mqt8eimlvp721sa 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'
20240524@081845.1558 4656t8iguu3mqt8eimlvp721sa Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403716 and bi.ref ='324.646.00.01' and bi.lordem =3
20240524@081845.1907 4656t8iguu3mqt8eimlvp721sa Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.642.00.01'
20240524@081845.2063 4656t8iguu3mqt8eimlvp721sa Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403716 and bi.ref ='324.642.00.01' and bi.lordem =4
20240524@081845.2540 4656t8iguu3mqt8eimlvp721sa Query : use flama_phc
20240524@081845.2544 4656t8iguu3mqt8eimlvp721sa Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240524@081845.2559 4656t8iguu3mqt8eimlvp721sa Query : use flama_phc
20240524@081845.2561 4656t8iguu3mqt8eimlvp721sa Query : select top 1 1 valor from td where td.ndoc = 39
20240524@081845.2572 4656t8iguu3mqt8eimlvp721sa Query : use flama_phc
20240524@081845.2575 4656t8iguu3mqt8eimlvp721sa 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')
20240524@081845.3069 eooehklv8ltqciqkls39ia6169 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240524@081845.3081 eooehklv8ltqciqkls39ia6169 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240524@081845.3094 eooehklv8ltqciqkls39ia6169 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='71';
20240524@081845.3129 eooehklv8ltqciqkls39ia6169 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='71';
20240524@081845.3140 eooehklv8ltqciqkls39ia6169 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='71';
20240524@081845.3149 eooehklv8ltqciqkls39ia6169 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='71';
20240524@081845.3159 eooehklv8ltqciqkls39ia6169 Query : use flama_phc
20240524@081845.3162 eooehklv8ltqciqkls39ia6169 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240524@081845.3175 eooehklv8ltqciqkls39ia6169 Query : use flama_phc
20240524@081845.3178 eooehklv8ltqciqkls39ia6169 Query : select no, estab,szadrsdesc from szadrs where u_coddest=1124
20240524@081845.3254 eooehklv8ltqciqkls39ia6169 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1461.00.1'
20240524@081845.3397 eooehklv8ltqciqkls39ia6169 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403720 and bi.ref ='324.1461.00.1' and bi.lordem =1
20240524@081845.3739 eooehklv8ltqciqkls39ia6169 Query : use flama_phc
20240524@081845.3742 eooehklv8ltqciqkls39ia6169 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240524@081845.3755 eooehklv8ltqciqkls39ia6169 Query : use flama_phc
20240524@081845.3758 eooehklv8ltqciqkls39ia6169 Query : select top 1 1 valor from td where td.ndoc = 39
20240524@081845.3769 eooehklv8ltqciqkls39ia6169 Query : use flama_phc
20240524@081845.3772 eooehklv8ltqciqkls39ia6169 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')
20240524@081845.4350 cfoglsai7cde6vo6c17lhl6buv Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240524@081845.4363 cfoglsai7cde6vo6c17lhl6buv Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240524@081845.4376 cfoglsai7cde6vo6c17lhl6buv Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='72';
20240524@081845.4412 cfoglsai7cde6vo6c17lhl6buv Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='72';
20240524@081845.4422 cfoglsai7cde6vo6c17lhl6buv Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='72';
20240524@081845.4433 cfoglsai7cde6vo6c17lhl6buv Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='72';
20240524@081845.4443 cfoglsai7cde6vo6c17lhl6buv Query : use flama_phc
20240524@081845.4446 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240524@081845.4459 cfoglsai7cde6vo6c17lhl6buv Query : use flama_phc
20240524@081845.4462 cfoglsai7cde6vo6c17lhl6buv Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240524@081845.4537 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240524@081845.4548 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403728 and bi.ref ='324.645.00.01' and bi.lordem =1
20240524@081845.4886 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240524@081845.4897 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403728 and bi.ref ='324.645.00.01' and bi.lordem =1
20240524@081845.4904 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240524@081845.4914 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403728 and bi.ref ='324.645.00.01' and bi.lordem =1
20240524@081845.4921 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240524@081845.4931 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403728 and bi.ref ='324.645.00.01' and bi.lordem =1
20240524@081845.4940 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240524@081845.4950 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403728 and bi.ref ='324.645.00.01' and bi.lordem =1
20240524@081845.4957 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240524@081845.4967 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403728 and bi.ref ='324.645.00.01' and bi.lordem =1
20240524@081845.4974 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240524@081845.4984 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403728 and bi.ref ='324.645.00.01' and bi.lordem =1
20240524@081845.5071 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240524@081845.5698 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403728 and bi.ref ='324.645.00.01' and bi.lordem =1
20240524@081845.5707 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240524@081845.5717 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403728 and bi.ref ='324.645.00.01' and bi.lordem =1
20240524@081845.5725 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240524@081845.5736 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403728 and bi.ref ='324.645.00.01' and bi.lordem =1
20240524@081845.5745 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240524@081845.5755 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403728 and bi.ref ='324.645.00.01' and bi.lordem =1
20240524@081845.5764 cfoglsai7cde6vo6c17lhl6buv Query : use flama_phc
20240524@081845.5767 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240524@081845.5808 cfoglsai7cde6vo6c17lhl6buv Query : use flama_phc
20240524@081845.5811 cfoglsai7cde6vo6c17lhl6buv Query : select top 1 1 valor from td where td.ndoc = 39
20240524@081845.5820 cfoglsai7cde6vo6c17lhl6buv Query : use flama_phc
20240524@081845.5823 cfoglsai7cde6vo6c17lhl6buv 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')
20240524@081909.4164 jfqoobtkeurr2ao3tcvdl63uba Query : use flama_phc
20240524@081909.4169 jfqoobtkeurr2ao3tcvdl63uba Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@081909.4225 jfqoobtkeurr2ao3tcvdl63uba Query : use flama_phc
20240524@081909.4228 jfqoobtkeurr2ao3tcvdl63uba Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@083609.5330 t886kbli3ohehqu93r3tmabur9 Query : use flama_phc
20240524@083609.5336 t886kbli3ohehqu93r3tmabur9 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@083609.5367 t886kbli3ohehqu93r3tmabur9 Query : use flama_phc
20240524@083609.5371 t886kbli3ohehqu93r3tmabur9 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@091913.3137 sc75imqs81s1hdkvuls7m7d61o Query : use flama_phc
20240524@091913.3148 sc75imqs81s1hdkvuls7m7d61o Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@091913.3204 sc75imqs81s1hdkvuls7m7d61o Query : use flama_phc
20240524@091913.3207 sc75imqs81s1hdkvuls7m7d61o Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@093613.2106 lh4nlcmgnb79rohhnbfjp2f95j Query : use flama_phc
20240524@093613.2111 lh4nlcmgnb79rohhnbfjp2f95j Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@093613.2130 lh4nlcmgnb79rohhnbfjp2f95j Query : use flama_phc
20240524@093613.2133 lh4nlcmgnb79rohhnbfjp2f95j Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@101910.8330 a9m2ftf3ugq61okgcmavg3of61 Query : use flama_phc
20240524@101910.8380 a9m2ftf3ugq61okgcmavg3of61 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@101910.8560 a9m2ftf3ugq61okgcmavg3of61 Query : use flama_phc
20240524@101910.8590 a9m2ftf3ugq61okgcmavg3of61 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@103610.2992 df2qt06nugfh3p4cm4h3j3tdjl Query : use flama_phc
20240524@103610.2999 df2qt06nugfh3p4cm4h3j3tdjl Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@103610.3192 df2qt06nugfh3p4cm4h3j3tdjl Query : use flama_phc
20240524@103610.3196 df2qt06nugfh3p4cm4h3j3tdjl Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@111909.2695 tv5n75pab45kmuq7cv49mruobe Query : use flama_phc
20240524@111909.3306 tv5n75pab45kmuq7cv49mruobe Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@111909.3779 tv5n75pab45kmuq7cv49mruobe Query : use flama_phc
20240524@111909.3869 tv5n75pab45kmuq7cv49mruobe Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@113608.9802 gdlkv338rdhj7r2ut55m2ucpga Query : use flama_phc
20240524@113608.9807 gdlkv338rdhj7r2ut55m2ucpga Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@113608.9824 gdlkv338rdhj7r2ut55m2ucpga Query : use flama_phc
20240524@113608.9827 gdlkv338rdhj7r2ut55m2ucpga Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@121909.5786 rdju38129lhmk244vfv7s9atvt Query : use flama_phc
20240524@121909.5791 rdju38129lhmk244vfv7s9atvt Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@121909.5823 rdju38129lhmk244vfv7s9atvt Query : use flama_phc
20240524@121909.5826 rdju38129lhmk244vfv7s9atvt Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@123609.6691 b58j3b6inq70j7isri19ablhtm Query : use flama_phc
20240524@123609.6697 b58j3b6inq70j7isri19ablhtm Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@123609.6718 b58j3b6inq70j7isri19ablhtm Query : use flama_phc
20240524@123609.6723 b58j3b6inq70j7isri19ablhtm Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@131910.7155 npekjbejl2rimg4rughdh2p6hu Query : use flama_phc
20240524@131910.7160 npekjbejl2rimg4rughdh2p6hu Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@131910.7178 npekjbejl2rimg4rughdh2p6hu Query : use flama_phc
20240524@131910.7181 npekjbejl2rimg4rughdh2p6hu Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@133610.8224 l6ct1jene2otsamjvdd8r2q0hv Query : use flama_phc
20240524@133610.8238 l6ct1jene2otsamjvdd8r2q0hv Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@133610.8257 l6ct1jene2otsamjvdd8r2q0hv Query : use flama_phc
20240524@133610.8260 l6ct1jene2otsamjvdd8r2q0hv Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@141911.7602 ofdfhelkt9c39s8ater1jc20n3 Query : use flama_phc
20240524@141911.7607 ofdfhelkt9c39s8ater1jc20n3 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@141911.7626 ofdfhelkt9c39s8ater1jc20n3 Query : use flama_phc
20240524@141911.7630 ofdfhelkt9c39s8ater1jc20n3 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@143611.6274 0g8p9ljign2aftmp04lapu09q5 Query : use flama_phc
20240524@143611.6280 0g8p9ljign2aftmp04lapu09q5 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@143611.6300 0g8p9ljign2aftmp04lapu09q5 Query : use flama_phc
20240524@143611.6304 0g8p9ljign2aftmp04lapu09q5 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@151910.7479 gbppej5vlv2lr28l28mn5c7ah4 Query : use flama_phc
20240524@151910.7483 gbppej5vlv2lr28l28mn5c7ah4 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@151910.7500 gbppej5vlv2lr28l28mn5c7ah4 Query : use flama_phc
20240524@151910.7520 gbppej5vlv2lr28l28mn5c7ah4 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@153610.9389 jmbbok4bt82s00rg011tjt2sr0 Query : use flama_phc
20240524@153610.9394 jmbbok4bt82s00rg011tjt2sr0 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@153610.9412 jmbbok4bt82s00rg011tjt2sr0 Query : use flama_phc
20240524@153610.9427 jmbbok4bt82s00rg011tjt2sr0 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@161914.6609 lpbpte0e0b92jcorc7tlknmt5i Query : use flama_phc
20240524@161914.6614 lpbpte0e0b92jcorc7tlknmt5i Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@161914.6639 lpbpte0e0b92jcorc7tlknmt5i Query : use flama_phc
20240524@161914.6642 lpbpte0e0b92jcorc7tlknmt5i Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@163548.4262 lgji1he9unf4iufn27sufj8eee Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240524@163548.4296 lgji1he9unf4iufn27sufj8eee Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240524@163548.4414 lgji1he9unf4iufn27sufj8eee Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='73';
20240524@163548.4449 lgji1he9unf4iufn27sufj8eee Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='73';
20240524@163548.4474 lgji1he9unf4iufn27sufj8eee Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='73';
20240524@163548.4488 lgji1he9unf4iufn27sufj8eee Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='73';
20240524@163548.4503 lgji1he9unf4iufn27sufj8eee Query : use flama_phc
20240524@163548.4506 lgji1he9unf4iufn27sufj8eee Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240524@163548.4575 lgji1he9unf4iufn27sufj8eee Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '304.421.00.04'
20240524@163548.4682 lgji1he9unf4iufn27sufj8eee Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =gt2 and bo.boano =2002 and bo.obrano = a39/289 and bi.ref ='304.421.00.04' and bi.lordem =1
20240524@163614.5615 1nkg4tcpagfbgk04c090mik7gf Query : use flama_phc
20240524@163614.5620 1nkg4tcpagfbgk04c090mik7gf Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@163614.5636 1nkg4tcpagfbgk04c090mik7gf Query : use flama_phc
20240524@163614.5639 1nkg4tcpagfbgk04c090mik7gf Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@165048.4126 oabokcs6qk9kh82q52dn62u0mi Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240524@165048.4143 oabokcs6qk9kh82q52dn62u0mi Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240524@165048.4157 oabokcs6qk9kh82q52dn62u0mi Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='74';
20240524@165048.4195 oabokcs6qk9kh82q52dn62u0mi Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='74';
20240524@165048.4205 oabokcs6qk9kh82q52dn62u0mi Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='74';
20240524@165048.4215 oabokcs6qk9kh82q52dn62u0mi Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='74';
20240524@165048.4225 oabokcs6qk9kh82q52dn62u0mi Query : use flama_phc
20240524@165048.4228 oabokcs6qk9kh82q52dn62u0mi Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240524@165048.4243 oabokcs6qk9kh82q52dn62u0mi Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2200.94.1'
20240524@165048.4351 oabokcs6qk9kh82q52dn62u0mi Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =med and bo.boano =20u1 and bo.obrano = 1518466 and bi.ref ='324.2200.94.1' and bi.lordem =1
20240524@171911.2496 hovth07bvf0pvngorrcr8i06ar Query : use flama_phc
20240524@171911.2501 hovth07bvf0pvngorrcr8i06ar Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@171911.2563 hovth07bvf0pvngorrcr8i06ar Query : use flama_phc
20240524@171911.2566 hovth07bvf0pvngorrcr8i06ar Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@173611.6346 tirqnk4i6mtfhr3nr48hslcaks Query : use flama_phc
20240524@173611.6353 tirqnk4i6mtfhr3nr48hslcaks Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@173611.6383 tirqnk4i6mtfhr3nr48hslcaks Query : use flama_phc
20240524@173611.6386 tirqnk4i6mtfhr3nr48hslcaks Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@181912.1640 v1vc21316utg5shuc6m8l9rjtn Query : use flama_phc
20240524@181912.1690 v1vc21316utg5shuc6m8l9rjtn Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@181912.1860 v1vc21316utg5shuc6m8l9rjtn Query : use flama_phc
20240524@181912.1900 v1vc21316utg5shuc6m8l9rjtn Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@183611.7113 hdhsptj0b4karqfnok2bonge9q Query : use flama_phc
20240524@183611.7120 hdhsptj0b4karqfnok2bonge9q Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@183611.7139 hdhsptj0b4karqfnok2bonge9q Query : use flama_phc
20240524@183611.7163 hdhsptj0b4karqfnok2bonge9q Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@191922.2092 6col2e88joj1vsep3lta51fvss Query : use flama_phc
20240524@191922.2096 6col2e88joj1vsep3lta51fvss Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@191922.2114 6col2e88joj1vsep3lta51fvss Query : use flama_phc
20240524@191922.2117 6col2e88joj1vsep3lta51fvss Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@193621.9455 j9aa1f7uhheovnhsefn3qti6f2 Query : use flama_phc
20240524@193621.9460 j9aa1f7uhheovnhsefn3qti6f2 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@193621.9478 j9aa1f7uhheovnhsefn3qti6f2 Query : use flama_phc
20240524@193621.9481 j9aa1f7uhheovnhsefn3qti6f2 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@201915.1298 oko4mrtg5b78qqamor3hvvued5 Query : use flama_phc
20240524@201915.1302 oko4mrtg5b78qqamor3hvvued5 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@201915.1338 oko4mrtg5b78qqamor3hvvued5 Query : use flama_phc
20240524@201915.1341 oko4mrtg5b78qqamor3hvvued5 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@203614.8500 vdicfggqgkee61j0fco4okp20f Query : use flama_phc
20240524@203614.8504 vdicfggqgkee61j0fco4okp20f Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@203614.8521 vdicfggqgkee61j0fco4okp20f Query : use flama_phc
20240524@203614.8523 vdicfggqgkee61j0fco4okp20f Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@211912.4618 qr01o2oq8bgt3uobtie0cgvf0m Query : use flama_phc
20240524@211912.4624 qr01o2oq8bgt3uobtie0cgvf0m Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@211912.4644 qr01o2oq8bgt3uobtie0cgvf0m Query : use flama_phc
20240524@211912.4647 qr01o2oq8bgt3uobtie0cgvf0m Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@213612.6343 r8rh18pakggb772dj8p9t8s9bt Query : use flama_phc
20240524@213612.6349 r8rh18pakggb772dj8p9t8s9bt Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@213612.6371 r8rh18pakggb772dj8p9t8s9bt Query : use flama_phc
20240524@213612.6374 r8rh18pakggb772dj8p9t8s9bt Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@221913.4820 eogdv6tsenfj62hunvm7oe79nj Query : use flama_phc
20240524@221913.4870 eogdv6tsenfj62hunvm7oe79nj Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@221913.5050 eogdv6tsenfj62hunvm7oe79nj Query : use flama_phc
20240524@221913.5080 eogdv6tsenfj62hunvm7oe79nj Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@223613.6310 aoiauaiggm6i0e7djh4c0jhc7e Query : use flama_phc
20240524@223613.6350 aoiauaiggm6i0e7djh4c0jhc7e Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@223613.6540 aoiauaiggm6i0e7djh4c0jhc7e Query : use flama_phc
20240524@223613.6570 aoiauaiggm6i0e7djh4c0jhc7e Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@231910.9461 batdolvtroln1lgk1vqk00tbvk Query : use flama_phc
20240524@231910.9465 batdolvtroln1lgk1vqk00tbvk Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@231910.9484 batdolvtroln1lgk1vqk00tbvk Query : use flama_phc
20240524@231910.9488 batdolvtroln1lgk1vqk00tbvk Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240524@233611.4572 la9penjun74e9levqfp4bj76tj Query : use flama_phc
20240524@233611.4577 la9penjun74e9levqfp4bj76tj Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240524@233611.4595 la9penjun74e9levqfp4bj76tj Query : use flama_phc
20240524@233611.4599 la9penjun74e9levqfp4bj76tj Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@071912.6253 8ol58vut8ouf33u8jcchq54ndc Query : use flama_phc
20240525@071912.6259 8ol58vut8ouf33u8jcchq54ndc Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@071912.6320 8ol58vut8ouf33u8jcchq54ndc Query : use flama_phc
20240525@071912.6323 8ol58vut8ouf33u8jcchq54ndc Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@073633.6632 8qd1s5kj4r07h7ddhkdf1ofom4 Query : use flama_phc
20240525@073633.6656 8qd1s5kj4r07h7ddhkdf1ofom4 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@073633.6699 8qd1s5kj4r07h7ddhkdf1ofom4 Query : use flama_phc
20240525@073633.6703 8qd1s5kj4r07h7ddhkdf1ofom4 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@081910.7822 dudbe9n2i942jj6ucoip3glfol Query : use flama_phc
20240525@081910.7828 dudbe9n2i942jj6ucoip3glfol Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@081910.7883 dudbe9n2i942jj6ucoip3glfol Query : use flama_phc
20240525@081910.7886 dudbe9n2i942jj6ucoip3glfol Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@083610.4080 ok7143rtk3de04tc1h20fu62fd Query : use flama_phc
20240525@083610.4085 ok7143rtk3de04tc1h20fu62fd Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@083610.4106 ok7143rtk3de04tc1h20fu62fd Query : use flama_phc
20240525@083610.4109 ok7143rtk3de04tc1h20fu62fd Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@091910.4300 r1i5ijfo2agg3hni132cdvtr1j Query : use flama_phc
20240525@091910.4350 r1i5ijfo2agg3hni132cdvtr1j Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@091910.4990 r1i5ijfo2agg3hni132cdvtr1j Query : use flama_phc
20240525@091910.5020 r1i5ijfo2agg3hni132cdvtr1j Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@093610.9470 5vtm3al1t7edf4itic0noj83ve Query : use flama_phc
20240525@093610.9520 5vtm3al1t7edf4itic0noj83ve Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@093610.9730 5vtm3al1t7edf4itic0noj83ve Query : use flama_phc
20240525@093610.9760 5vtm3al1t7edf4itic0noj83ve Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@101912.9091 1rsordbji04qqej58as3rldofq Query : use flama_phc
20240525@101912.9096 1rsordbji04qqej58as3rldofq Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@101912.9151 1rsordbji04qqej58as3rldofq Query : use flama_phc
20240525@101912.9154 1rsordbji04qqej58as3rldofq Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@103613.3770 ou6impocksk1nbs7nt1alac5vi Query : use flama_phc
20240525@103613.3810 ou6impocksk1nbs7nt1alac5vi Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@103613.3980 ou6impocksk1nbs7nt1alac5vi Query : use flama_phc
20240525@103613.4010 ou6impocksk1nbs7nt1alac5vi Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@111911.6537 ckf1o83091eku7kqef2vn38jul Query : use flama_phc
20240525@111911.6543 ckf1o83091eku7kqef2vn38jul Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@111911.6572 ckf1o83091eku7kqef2vn38jul Query : use flama_phc
20240525@111911.6575 ckf1o83091eku7kqef2vn38jul Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@113611.7042 pbitl0gc350omehrslug3e1k6f Query : use flama_phc
20240525@113611.7048 pbitl0gc350omehrslug3e1k6f Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@113611.7067 pbitl0gc350omehrslug3e1k6f Query : use flama_phc
20240525@113611.7071 pbitl0gc350omehrslug3e1k6f Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@121914.4879 l0u4lugc5o1bc6vq8qdls2u217 Query : use flama_phc
20240525@121914.4884 l0u4lugc5o1bc6vq8qdls2u217 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@121914.4951 l0u4lugc5o1bc6vq8qdls2u217 Query : use flama_phc
20240525@121914.4954 l0u4lugc5o1bc6vq8qdls2u217 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@123614.7446 n3tkk5fvngse2k8ngq6pilorfu Query : use flama_phc
20240525@123614.7451 n3tkk5fvngse2k8ngq6pilorfu Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@123614.7469 n3tkk5fvngse2k8ngq6pilorfu Query : use flama_phc
20240525@123614.7472 n3tkk5fvngse2k8ngq6pilorfu Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@131909.7072 2q5bptnn9pm2ftg1ccl5d798tq Query : use flama_phc
20240525@131909.7077 2q5bptnn9pm2ftg1ccl5d798tq Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@131909.7096 2q5bptnn9pm2ftg1ccl5d798tq Query : use flama_phc
20240525@131909.7099 2q5bptnn9pm2ftg1ccl5d798tq Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@133609.3623 1q1jjcbc42t117dpuad2p3u3ss Query : use flama_phc
20240525@133609.3629 1q1jjcbc42t117dpuad2p3u3ss Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@133609.3647 1q1jjcbc42t117dpuad2p3u3ss Query : use flama_phc
20240525@133609.3650 1q1jjcbc42t117dpuad2p3u3ss Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@141910.7531 bn0hfm22m8cbbiaefo4gf10i44 Query : use flama_phc
20240525@141910.7535 bn0hfm22m8cbbiaefo4gf10i44 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@141910.7554 bn0hfm22m8cbbiaefo4gf10i44 Query : use flama_phc
20240525@141910.7557 bn0hfm22m8cbbiaefo4gf10i44 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@143611.2363 de4m0kstciv8fosv4olce7sdm5 Query : use flama_phc
20240525@143611.2368 de4m0kstciv8fosv4olce7sdm5 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@143611.2387 de4m0kstciv8fosv4olce7sdm5 Query : use flama_phc
20240525@143611.2389 de4m0kstciv8fosv4olce7sdm5 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@151909.9353 jr3qjuub6dkmjhml3lc3v1l5tl Query : use flama_phc
20240525@151909.9358 jr3qjuub6dkmjhml3lc3v1l5tl Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@151909.9375 jr3qjuub6dkmjhml3lc3v1l5tl Query : use flama_phc
20240525@151909.9378 jr3qjuub6dkmjhml3lc3v1l5tl Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@153609.9773 vippdlvnrcbtmav9ehbg5rufh4 Query : use flama_phc
20240525@153609.9778 vippdlvnrcbtmav9ehbg5rufh4 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@153609.9798 vippdlvnrcbtmav9ehbg5rufh4 Query : use flama_phc
20240525@153609.9801 vippdlvnrcbtmav9ehbg5rufh4 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@161912.1244 dfje24d9ia481b1hbtsi15sse4 Query : use flama_phc
20240525@161912.1251 dfje24d9ia481b1hbtsi15sse4 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@161912.1270 dfje24d9ia481b1hbtsi15sse4 Query : use flama_phc
20240525@161912.1273 dfje24d9ia481b1hbtsi15sse4 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@163612.1987 iu52gvbi7k9jkvk8imek3foofq Query : use flama_phc
20240525@163612.1992 iu52gvbi7k9jkvk8imek3foofq Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@163612.2011 iu52gvbi7k9jkvk8imek3foofq Query : use flama_phc
20240525@163612.2015 iu52gvbi7k9jkvk8imek3foofq Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@171910.8100 ihdr86gn730i33kggv0ogrckkc Query : use flama_phc
20240525@171910.8600 ihdr86gn730i33kggv0ogrckkc Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@171910.1070 ihdr86gn730i33kggv0ogrckkc Query : use flama_phc
20240525@171910.1110 ihdr86gn730i33kggv0ogrckkc Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@173610.1708 1l9rgaq341cforehkr1j7f122v Query : use flama_phc
20240525@173610.1713 1l9rgaq341cforehkr1j7f122v Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@173610.1741 1l9rgaq341cforehkr1j7f122v Query : use flama_phc
20240525@173610.1744 1l9rgaq341cforehkr1j7f122v Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@181911.3660 oj1ckcrdr9oglvik70d4ihhsmc Query : use flama_phc
20240525@181911.3710 oj1ckcrdr9oglvik70d4ihhsmc Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@181911.3890 oj1ckcrdr9oglvik70d4ihhsmc Query : use flama_phc
20240525@181911.3920 oj1ckcrdr9oglvik70d4ihhsmc Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@183611.7800 a3pe6f28f1j055ip7rjhidih8b Query : use flama_phc
20240525@183611.8400 a3pe6f28f1j055ip7rjhidih8b Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@183611.1050 a3pe6f28f1j055ip7rjhidih8b Query : use flama_phc
20240525@183611.1090 a3pe6f28f1j055ip7rjhidih8b Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@191910.2147 lvmfp89igb3bmvnjqeediml1qc Query : use flama_phc
20240525@191910.2153 lvmfp89igb3bmvnjqeediml1qc Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@191910.2172 lvmfp89igb3bmvnjqeediml1qc Query : use flama_phc
20240525@191910.2175 lvmfp89igb3bmvnjqeediml1qc Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@193610.4840 l45ntns8d7vp08e44qvalaup16 Query : use flama_phc
20240525@193610.4846 l45ntns8d7vp08e44qvalaup16 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@193610.4863 l45ntns8d7vp08e44qvalaup16 Query : use flama_phc
20240525@193610.4866 l45ntns8d7vp08e44qvalaup16 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@201910.6931 5u5ob9pmklju4jjggffkoi474a Query : use flama_phc
20240525@201910.6937 5u5ob9pmklju4jjggffkoi474a Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@201910.6955 5u5ob9pmklju4jjggffkoi474a Query : use flama_phc
20240525@201910.6958 5u5ob9pmklju4jjggffkoi474a Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@203610.8346 e6fdiurg1ah7ah4km2sfc07akt Query : use flama_phc
20240525@203610.8350 e6fdiurg1ah7ah4km2sfc07akt Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@203610.8368 e6fdiurg1ah7ah4km2sfc07akt Query : use flama_phc
20240525@203610.8371 e6fdiurg1ah7ah4km2sfc07akt Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@211909.1746 70m80al7sfp6br37mqbt5f5ch3 Query : use flama_phc
20240525@211909.1752 70m80al7sfp6br37mqbt5f5ch3 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@211909.1772 70m80al7sfp6br37mqbt5f5ch3 Query : use flama_phc
20240525@211909.1775 70m80al7sfp6br37mqbt5f5ch3 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@213609.3315 agffrf8d21e2v7opfio789l5a1 Query : use flama_phc
20240525@213609.3322 agffrf8d21e2v7opfio789l5a1 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@213609.3344 agffrf8d21e2v7opfio789l5a1 Query : use flama_phc
20240525@213609.3347 agffrf8d21e2v7opfio789l5a1 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@221909.8440 pgsvalvefhov189dahmo0sgqgq Query : use flama_phc
20240525@221909.8490 pgsvalvefhov189dahmo0sgqgq Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@221909.8670 pgsvalvefhov189dahmo0sgqgq Query : use flama_phc
20240525@221909.8700 pgsvalvefhov189dahmo0sgqgq Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@223608.8135 5ut24lpfjkl5e09704ajm7m4fm Query : use flama_phc
20240525@223608.8141 5ut24lpfjkl5e09704ajm7m4fm Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@223608.8160 5ut24lpfjkl5e09704ajm7m4fm Query : use flama_phc
20240525@223608.8162 5ut24lpfjkl5e09704ajm7m4fm Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@231913.9165 6m94rvlvi7uqttqffdthf568aj Query : use flama_phc
20240525@231913.9170 6m94rvlvi7uqttqffdthf568aj Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@231913.9211 6m94rvlvi7uqttqffdthf568aj Query : use flama_phc
20240525@231913.9215 6m94rvlvi7uqttqffdthf568aj Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240525@233614.8490 ql7a1oi3dge1c8g3kijiv13l21 Query : use flama_phc
20240525@233614.8690 ql7a1oi3dge1c8g3kijiv13l21 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240525@233614.9610 ql7a1oi3dge1c8g3kijiv13l21 Query : use flama_phc
20240525@233614.9660 ql7a1oi3dge1c8g3kijiv13l21 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@071956.5064 3ukq8ue00ppvmmk1m3719n2305 Query : use flama_phc
20240526@071956.5069 3ukq8ue00ppvmmk1m3719n2305 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@071956.5122 3ukq8ue00ppvmmk1m3719n2305 Query : use flama_phc
20240526@071956.5125 3ukq8ue00ppvmmk1m3719n2305 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@073656.3678 o5cggpnta51pcg57li6fimn060 Query : use flama_phc
20240526@073656.3684 o5cggpnta51pcg57li6fimn060 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@073656.3705 o5cggpnta51pcg57li6fimn060 Query : use flama_phc
20240526@073656.3708 o5cggpnta51pcg57li6fimn060 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@081913.2922 6tt02rkqvt0o1g1ueflcfqqe8s Query : use flama_phc
20240526@081913.2931 6tt02rkqvt0o1g1ueflcfqqe8s Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@081913.2976 6tt02rkqvt0o1g1ueflcfqqe8s Query : use flama_phc
20240526@081913.2984 6tt02rkqvt0o1g1ueflcfqqe8s Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@083613.4884 v7ual0ecqelivqmfb0ga0o3oa0 Query : use flama_phc
20240526@083613.4890 v7ual0ecqelivqmfb0ga0o3oa0 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@083613.4910 v7ual0ecqelivqmfb0ga0o3oa0 Query : use flama_phc
20240526@083613.4913 v7ual0ecqelivqmfb0ga0o3oa0 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@091908.8003 f0bei8q0o3308n9etqabp4a735 Query : use flama_phc
20240526@091908.8008 f0bei8q0o3308n9etqabp4a735 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@091908.8069 f0bei8q0o3308n9etqabp4a735 Query : use flama_phc
20240526@091908.8072 f0bei8q0o3308n9etqabp4a735 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@093609.2930 gar1tdisbd2uc7epu6mf2lv3d6 Query : use flama_phc
20240526@093609.2990 gar1tdisbd2uc7epu6mf2lv3d6 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@093609.3180 gar1tdisbd2uc7epu6mf2lv3d6 Query : use flama_phc
20240526@093609.3210 gar1tdisbd2uc7epu6mf2lv3d6 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@101910.4783 r2umb297lcbomvfhtp1d9ghkgh Query : use flama_phc
20240526@101910.4808 r2umb297lcbomvfhtp1d9ghkgh Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@101910.4826 r2umb297lcbomvfhtp1d9ghkgh Query : use flama_phc
20240526@101910.4829 r2umb297lcbomvfhtp1d9ghkgh Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@103610.6209 v50lu19plc1fl21pngvu54lckl Query : use flama_phc
20240526@103610.6214 v50lu19plc1fl21pngvu54lckl Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@103610.6236 v50lu19plc1fl21pngvu54lckl Query : use flama_phc
20240526@103610.6239 v50lu19plc1fl21pngvu54lckl Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@111909.8643 msh1pbncjdhdot21q1s79o02s1 Query : use flama_phc
20240526@111909.8648 msh1pbncjdhdot21q1s79o02s1 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@111909.8667 msh1pbncjdhdot21q1s79o02s1 Query : use flama_phc
20240526@111909.8670 msh1pbncjdhdot21q1s79o02s1 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@113609.5933 ggrop67k19fkujl3ntof308s56 Query : use flama_phc
20240526@113609.5939 ggrop67k19fkujl3ntof308s56 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@113609.5960 ggrop67k19fkujl3ntof308s56 Query : use flama_phc
20240526@113609.5963 ggrop67k19fkujl3ntof308s56 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@121909.9714 1c9tj11elcog9duscir7pat4qk Query : use flama_phc
20240526@121909.9719 1c9tj11elcog9duscir7pat4qk Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@121909.9736 1c9tj11elcog9duscir7pat4qk Query : use flama_phc
20240526@121909.9739 1c9tj11elcog9duscir7pat4qk Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@123609.8310 4vc6oqvpjbppfs6trmimt7bdei Query : use flama_phc
20240526@123609.8314 4vc6oqvpjbppfs6trmimt7bdei Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@123609.8332 4vc6oqvpjbppfs6trmimt7bdei Query : use flama_phc
20240526@123609.8335 4vc6oqvpjbppfs6trmimt7bdei Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@131909.2189 vbav22ihfhc48blbdqus94oam0 Query : use flama_phc
20240526@131909.2194 vbav22ihfhc48blbdqus94oam0 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@131909.2213 vbav22ihfhc48blbdqus94oam0 Query : use flama_phc
20240526@131909.2216 vbav22ihfhc48blbdqus94oam0 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@133609.3805 erm4ciko68gtuui00buam40nhk Query : use flama_phc
20240526@133609.3809 erm4ciko68gtuui00buam40nhk Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@133609.4283 erm4ciko68gtuui00buam40nhk Query : use flama_phc
20240526@133609.4486 erm4ciko68gtuui00buam40nhk Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@141909.2322 nth2khi1ogrqk9s8t6da65nkso Query : use flama_phc
20240526@141909.2327 nth2khi1ogrqk9s8t6da65nkso Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@141909.2344 nth2khi1ogrqk9s8t6da65nkso Query : use flama_phc
20240526@141909.2347 nth2khi1ogrqk9s8t6da65nkso Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@143609.1226 hgde78vedbmptgne3ndbpp6hbu Query : use flama_phc
20240526@143609.1231 hgde78vedbmptgne3ndbpp6hbu Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@143609.1249 hgde78vedbmptgne3ndbpp6hbu Query : use flama_phc
20240526@143609.1252 hgde78vedbmptgne3ndbpp6hbu Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@151909.6180 hgub26l31t813bnhrn77f99ubj Query : use flama_phc
20240526@151909.6185 hgub26l31t813bnhrn77f99ubj Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@151909.6204 hgub26l31t813bnhrn77f99ubj Query : use flama_phc
20240526@151909.6207 hgub26l31t813bnhrn77f99ubj Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@153609.3734 q2229i3icge6irgvi3o5r9ma8l Query : use flama_phc
20240526@153609.3739 q2229i3icge6irgvi3o5r9ma8l Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@153609.3757 q2229i3icge6irgvi3o5r9ma8l Query : use flama_phc
20240526@153609.3760 q2229i3icge6irgvi3o5r9ma8l Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@161910.4060 hmv27ca4s1e3v5qi9fkjqr4dps Query : use flama_phc
20240526@161910.4099 hmv27ca4s1e3v5qi9fkjqr4dps Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@161910.4119 hmv27ca4s1e3v5qi9fkjqr4dps Query : use flama_phc
20240526@161910.4121 hmv27ca4s1e3v5qi9fkjqr4dps Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@163610.5561 5e8d2tmnubo5n7cq7uinmna5ju Query : use flama_phc
20240526@163610.5566 5e8d2tmnubo5n7cq7uinmna5ju Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@163610.5586 5e8d2tmnubo5n7cq7uinmna5ju Query : use flama_phc
20240526@163610.5589 5e8d2tmnubo5n7cq7uinmna5ju Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@171910.8073 ard514a2rahckl0cu29n7e7moi Query : use flama_phc
20240526@171910.8080 ard514a2rahckl0cu29n7e7moi Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@171910.8098 ard514a2rahckl0cu29n7e7moi Query : use flama_phc
20240526@171910.8101 ard514a2rahckl0cu29n7e7moi Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@173610.9167 r55pcllb6vaoi4eb59hcn4471t Query : use flama_phc
20240526@173610.9184 r55pcllb6vaoi4eb59hcn4471t Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@173610.9918 r55pcllb6vaoi4eb59hcn4471t Query : use flama_phc
20240526@173610.9955 r55pcllb6vaoi4eb59hcn4471t Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@181910.2339 fghp807dhaqtlq93709f3qs5lk Query : use flama_phc
20240526@181910.2344 fghp807dhaqtlq93709f3qs5lk Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@181910.2363 fghp807dhaqtlq93709f3qs5lk Query : use flama_phc
20240526@181910.2366 fghp807dhaqtlq93709f3qs5lk Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@183609.9028 khc1814shess0nstv2i2mj372l Query : use flama_phc
20240526@183609.9034 khc1814shess0nstv2i2mj372l Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@183609.9051 khc1814shess0nstv2i2mj372l Query : use flama_phc
20240526@183609.9054 khc1814shess0nstv2i2mj372l Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@191910.6884 1c7fstrgtegd2noavvse4rmhga Query : use flama_phc
20240526@191910.6889 1c7fstrgtegd2noavvse4rmhga Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@191910.6912 1c7fstrgtegd2noavvse4rmhga Query : use flama_phc
20240526@191910.6915 1c7fstrgtegd2noavvse4rmhga Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@193610.7422 pa4vcojgjmf6rrq4jk64j8u5el Query : use flama_phc
20240526@193610.7429 pa4vcojgjmf6rrq4jk64j8u5el Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@193610.7458 pa4vcojgjmf6rrq4jk64j8u5el Query : use flama_phc
20240526@193610.7462 pa4vcojgjmf6rrq4jk64j8u5el Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@201910.2483 hghqmhgi7q3ec966ie5lrp044t Query : use flama_phc
20240526@201910.2489 hghqmhgi7q3ec966ie5lrp044t Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@201910.2507 hghqmhgi7q3ec966ie5lrp044t Query : use flama_phc
20240526@201910.2510 hghqmhgi7q3ec966ie5lrp044t Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@203610.5130 0973bi5vi4n05vgid4p7m722bk Query : use flama_phc
20240526@203610.5135 0973bi5vi4n05vgid4p7m722bk Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@203610.5154 0973bi5vi4n05vgid4p7m722bk Query : use flama_phc
20240526@203610.5157 0973bi5vi4n05vgid4p7m722bk Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@211909.6516 abc3idnii9cicde2gq0dqq69p8 Query : use flama_phc
20240526@211909.6562 abc3idnii9cicde2gq0dqq69p8 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@211909.6586 abc3idnii9cicde2gq0dqq69p8 Query : use flama_phc
20240526@211909.6591 abc3idnii9cicde2gq0dqq69p8 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@213609.9837 amp5argpoel2pm7sj49q0qjkst Query : use flama_phc
20240526@213609.9843 amp5argpoel2pm7sj49q0qjkst Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@213609.9864 amp5argpoel2pm7sj49q0qjkst Query : use flama_phc
20240526@213609.9866 amp5argpoel2pm7sj49q0qjkst Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@221908.7156 u6dhuft8484j69t2067eeaf595 Query : use flama_phc
20240526@221908.7169 u6dhuft8484j69t2067eeaf595 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@221908.7201 u6dhuft8484j69t2067eeaf595 Query : use flama_phc
20240526@221908.7204 u6dhuft8484j69t2067eeaf595 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@223608.8603 4eo81646ri9uiaa8mtnobv7nnp Query : use flama_phc
20240526@223608.8608 4eo81646ri9uiaa8mtnobv7nnp Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@223608.8625 4eo81646ri9uiaa8mtnobv7nnp Query : use flama_phc
20240526@223608.8628 4eo81646ri9uiaa8mtnobv7nnp Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@231910.5402 d4edbh4djqftvpslu27nft56nt Query : use flama_phc
20240526@231910.5407 d4edbh4djqftvpslu27nft56nt Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@231910.5425 d4edbh4djqftvpslu27nft56nt Query : use flama_phc
20240526@231910.5428 d4edbh4djqftvpslu27nft56nt Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240526@233610.2775 ec053gshccvlrre629cud3unqv Query : use flama_phc
20240526@233610.2779 ec053gshccvlrre629cud3unqv Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240526@233610.2797 ec053gshccvlrre629cud3unqv Query : use flama_phc
20240526@233610.2800 ec053gshccvlrre629cud3unqv Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@071925.2950 7q3fbqjp1fam5b0l55bbb9q9p5 Query : use flama_phc
20240527@071925.3040 7q3fbqjp1fam5b0l55bbb9q9p5 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@071925.3220 7q3fbqjp1fam5b0l55bbb9q9p5 Query : use flama_phc
20240527@071925.3250 7q3fbqjp1fam5b0l55bbb9q9p5 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@073643.7602 nmki0paiov44jsvndl23eh7nrq Query : use flama_phc
20240527@073643.7608 nmki0paiov44jsvndl23eh7nrq Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@073643.7625 nmki0paiov44jsvndl23eh7nrq Query : use flama_phc
20240527@073643.7628 nmki0paiov44jsvndl23eh7nrq Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@074545.3141 ld5dsvd9to4fq3j3o3ektaiih1 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240527@074545.3176 ld5dsvd9to4fq3j3o3ektaiih1 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240527@074545.3300 ld5dsvd9to4fq3j3o3ektaiih1 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='75';
20240527@074545.3416 ld5dsvd9to4fq3j3o3ektaiih1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='75';
20240527@074545.3454 ld5dsvd9to4fq3j3o3ektaiih1 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='75';
20240527@074545.3465 ld5dsvd9to4fq3j3o3ektaiih1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='75';
20240527@074545.3477 ld5dsvd9to4fq3j3o3ektaiih1 Query : use flama_phc
20240527@074545.3480 ld5dsvd9to4fq3j3o3ektaiih1 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240527@074545.3529 ld5dsvd9to4fq3j3o3ektaiih1 Query : use flama_phc
20240527@074545.3532 ld5dsvd9to4fq3j3o3ektaiih1 Query : select no, estab,szadrsdesc from szadrs where u_coddest=6737
20240527@074545.3616 ld5dsvd9to4fq3j3o3ektaiih1 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '328.9106.00.1'
20240527@074545.3772 ld5dsvd9to4fq3j3o3ektaiih1 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403704 and bi.ref ='328.9106.00.1' and bi.lordem =1
20240527@074545.4146 ld5dsvd9to4fq3j3o3ektaiih1 Query : use flama_phc
20240527@074545.4166 ld5dsvd9to4fq3j3o3ektaiih1 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240527@074545.4343 ld5dsvd9to4fq3j3o3ektaiih1 Query : use flama_phc
20240527@074545.4346 ld5dsvd9to4fq3j3o3ektaiih1 Query : select top 1 1 valor from td where td.ndoc = 39
20240527@074545.4419 ld5dsvd9to4fq3j3o3ektaiih1 Query : use flama_phc
20240527@074545.4422 ld5dsvd9to4fq3j3o3ektaiih1 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')
20240527@074545.5008 tk5k4o2gjdeitk7p9mbuo4l8op Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240527@074545.5021 tk5k4o2gjdeitk7p9mbuo4l8op Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240527@074545.5035 tk5k4o2gjdeitk7p9mbuo4l8op Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='76';
20240527@074545.5070 tk5k4o2gjdeitk7p9mbuo4l8op Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='76';
20240527@074545.5085 tk5k4o2gjdeitk7p9mbuo4l8op Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='76';
20240527@074545.5095 tk5k4o2gjdeitk7p9mbuo4l8op Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='76';
20240527@074545.5106 tk5k4o2gjdeitk7p9mbuo4l8op Query : use flama_phc
20240527@074545.5109 tk5k4o2gjdeitk7p9mbuo4l8op Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240527@074545.5125 tk5k4o2gjdeitk7p9mbuo4l8op Query : use flama_phc
20240527@074545.5128 tk5k4o2gjdeitk7p9mbuo4l8op Query : select no, estab,szadrsdesc from szadrs where u_coddest=4779
20240527@074545.5206 tk5k4o2gjdeitk7p9mbuo4l8op Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.421.00.04'
20240527@074545.5386 tk5k4o2gjdeitk7p9mbuo4l8op Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403705 and bi.ref ='304.421.00.04' and bi.lordem =1
20240527@074545.5789 tk5k4o2gjdeitk7p9mbuo4l8op Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4521.00.1'
20240527@074545.5970 tk5k4o2gjdeitk7p9mbuo4l8op Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403705 and bi.ref ='324.4521.00.1' and bi.lordem =2
20240527@074545.6324 tk5k4o2gjdeitk7p9mbuo4l8op Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4960.00.1'
20240527@074545.6468 tk5k4o2gjdeitk7p9mbuo4l8op Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403705 and bi.ref ='324.4960.00.1' and bi.lordem =3
20240527@074545.7835 tk5k4o2gjdeitk7p9mbuo4l8op Query : use flama_phc
20240527@074545.7839 tk5k4o2gjdeitk7p9mbuo4l8op Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240527@074545.7854 tk5k4o2gjdeitk7p9mbuo4l8op Query : use flama_phc
20240527@074545.7857 tk5k4o2gjdeitk7p9mbuo4l8op Query : select top 1 1 valor from td where td.ndoc = 39
20240527@074545.7867 tk5k4o2gjdeitk7p9mbuo4l8op Query : use flama_phc
20240527@074545.7870 tk5k4o2gjdeitk7p9mbuo4l8op 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')
20240527@074545.8316 o8880hg74ih8sqv2p79mnqturv Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240527@074545.8329 o8880hg74ih8sqv2p79mnqturv Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240527@074545.8343 o8880hg74ih8sqv2p79mnqturv Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='77';
20240527@074545.8991 o8880hg74ih8sqv2p79mnqturv Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='77';
20240527@074545.9006 o8880hg74ih8sqv2p79mnqturv Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='77';
20240527@074545.9018 o8880hg74ih8sqv2p79mnqturv Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='77';
20240527@074545.9030 o8880hg74ih8sqv2p79mnqturv Query : use flama_phc
20240527@074545.9033 o8880hg74ih8sqv2p79mnqturv Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240527@074545.9048 o8880hg74ih8sqv2p79mnqturv Query : use flama_phc
20240527@074545.9050 o8880hg74ih8sqv2p79mnqturv Query : select no, estab,szadrsdesc from szadrs where u_coddest=6917
20240527@074545.9123 o8880hg74ih8sqv2p79mnqturv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2000.94.1'
20240527@074545.9270 o8880hg74ih8sqv2p79mnqturv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403718 and bi.ref ='324.2000.94.1' and bi.lordem =1
20240527@074545.9630 o8880hg74ih8sqv2p79mnqturv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2000.94.1'
20240527@074545.9641 o8880hg74ih8sqv2p79mnqturv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403718 and bi.ref ='324.2000.94.1' and bi.lordem =1
20240527@074545.9647 o8880hg74ih8sqv2p79mnqturv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.900.94.02'
20240527@074545.9847 o8880hg74ih8sqv2p79mnqturv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403718 and bi.ref ='324.900.94.02' and bi.lordem =2
20240527@074546.1660 o8880hg74ih8sqv2p79mnqturv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.900.94.02'
20240527@074546.1730 o8880hg74ih8sqv2p79mnqturv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403718 and bi.ref ='324.900.94.02' and bi.lordem =2
20240527@074546.1800 o8880hg74ih8sqv2p79mnqturv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.700.94.01'
20240527@074546.3290 o8880hg74ih8sqv2p79mnqturv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403718 and bi.ref ='324.700.94.01' and bi.lordem =3
20240527@074546.7590 o8880hg74ih8sqv2p79mnqturv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2200.94.1'
20240527@074546.9030 o8880hg74ih8sqv2p79mnqturv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403718 and bi.ref ='324.2200.94.1' and bi.lordem =4
20240527@074546.1214 o8880hg74ih8sqv2p79mnqturv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2200.94.1'
20240527@074546.1226 o8880hg74ih8sqv2p79mnqturv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403718 and bi.ref ='324.2200.94.1' and bi.lordem =4
20240527@074546.1235 o8880hg74ih8sqv2p79mnqturv Query : use flama_phc
20240527@074546.1238 o8880hg74ih8sqv2p79mnqturv Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240527@074546.1285 o8880hg74ih8sqv2p79mnqturv Query : use flama_phc
20240527@074546.1288 o8880hg74ih8sqv2p79mnqturv Query : select top 1 errorresult result ,errornumber errornumber ,descriptionpt description ,isnull(descriptionen,'') descriptionen ,isnull(descriptionfr,'') descriptionfr from wserrorcodes where errornumber = -65
20240527@074546.1339 o8880hg74ih8sqv2p79mnqturv Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='77';
20240527@074546.1350 o8880hg74ih8sqv2p79mnqturv Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='77';
20240527@074546.1809 mn89g6nupvfmd2c3mlb5vmtc56 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240527@074546.1821 mn89g6nupvfmd2c3mlb5vmtc56 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240527@074546.1835 mn89g6nupvfmd2c3mlb5vmtc56 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='78';
20240527@074546.1882 mn89g6nupvfmd2c3mlb5vmtc56 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='78';
20240527@074546.1893 mn89g6nupvfmd2c3mlb5vmtc56 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='78';
20240527@074546.1904 mn89g6nupvfmd2c3mlb5vmtc56 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='78';
20240527@074546.1914 mn89g6nupvfmd2c3mlb5vmtc56 Query : use flama_phc
20240527@074546.1917 mn89g6nupvfmd2c3mlb5vmtc56 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240527@074546.1930 mn89g6nupvfmd2c3mlb5vmtc56 Query : use flama_phc
20240527@074546.1933 mn89g6nupvfmd2c3mlb5vmtc56 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4774
20240527@074546.2008 mn89g6nupvfmd2c3mlb5vmtc56 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1461.00.1'
20240527@074546.2254 mn89g6nupvfmd2c3mlb5vmtc56 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403719 and bi.ref ='324.1461.00.1' and bi.lordem =1
20240527@074546.2721 mn89g6nupvfmd2c3mlb5vmtc56 Query : use flama_phc
20240527@074546.2725 mn89g6nupvfmd2c3mlb5vmtc56 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240527@074546.2738 mn89g6nupvfmd2c3mlb5vmtc56 Query : use flama_phc
20240527@074546.2741 mn89g6nupvfmd2c3mlb5vmtc56 Query : select top 1 1 valor from td where td.ndoc = 39
20240527@074546.2752 mn89g6nupvfmd2c3mlb5vmtc56 Query : use flama_phc
20240527@074546.2755 mn89g6nupvfmd2c3mlb5vmtc56 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')
20240527@074546.4040 e55m1j0ft0qh3o2cnrjola2ff4 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240527@074546.4054 e55m1j0ft0qh3o2cnrjola2ff4 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240527@074546.4068 e55m1j0ft0qh3o2cnrjola2ff4 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='79';
20240527@074546.4397 e55m1j0ft0qh3o2cnrjola2ff4 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='79';
20240527@074546.4749 e55m1j0ft0qh3o2cnrjola2ff4 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='79';
20240527@074546.4763 e55m1j0ft0qh3o2cnrjola2ff4 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='79';
20240527@074546.4777 e55m1j0ft0qh3o2cnrjola2ff4 Query : use flama_phc
20240527@074546.4780 e55m1j0ft0qh3o2cnrjola2ff4 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240527@074546.4795 e55m1j0ft0qh3o2cnrjola2ff4 Query : use flama_phc
20240527@074546.4798 e55m1j0ft0qh3o2cnrjola2ff4 Query : select no, estab,szadrsdesc from szadrs where u_coddest=6737
20240527@074546.4830 e55m1j0ft0qh3o2cnrjola2ff4 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '328.9902.00.1'
20240527@074546.4979 e55m1j0ft0qh3o2cnrjola2ff4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403729 and bi.ref ='328.9902.00.1' and bi.lordem =1
20240527@074546.5300 e55m1j0ft0qh3o2cnrjola2ff4 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '328.9902.00.1'
20240527@074546.5312 e55m1j0ft0qh3o2cnrjola2ff4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403729 and bi.ref ='328.9902.00.1' and bi.lordem =1
20240527@074546.5320 e55m1j0ft0qh3o2cnrjola2ff4 Query : use flama_phc
20240527@074546.5323 e55m1j0ft0qh3o2cnrjola2ff4 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240527@074546.5337 e55m1j0ft0qh3o2cnrjola2ff4 Query : use flama_phc
20240527@074546.5339 e55m1j0ft0qh3o2cnrjola2ff4 Query : select top 1 1 valor from td where td.ndoc = 39
20240527@074546.5351 e55m1j0ft0qh3o2cnrjola2ff4 Query : use flama_phc
20240527@074546.5353 e55m1j0ft0qh3o2cnrjola2ff4 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')
20240527@074546.6926 n3harbp4ba54u0a2av9qprji7c Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240527@074546.6939 n3harbp4ba54u0a2av9qprji7c Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240527@074546.6953 n3harbp4ba54u0a2av9qprji7c Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='80';
20240527@074546.6993 n3harbp4ba54u0a2av9qprji7c Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='80';
20240527@074546.7004 n3harbp4ba54u0a2av9qprji7c Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='80';
20240527@074546.7016 n3harbp4ba54u0a2av9qprji7c Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='80';
20240527@074546.7026 n3harbp4ba54u0a2av9qprji7c Query : use flama_phc
20240527@074546.7029 n3harbp4ba54u0a2av9qprji7c Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240527@074546.7043 n3harbp4ba54u0a2av9qprji7c Query : use flama_phc
20240527@074546.7046 n3harbp4ba54u0a2av9qprji7c Query : select no, estab,szadrsdesc from szadrs where u_coddest=4801
20240527@074546.7117 n3harbp4ba54u0a2av9qprji7c Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.499.00.01'
20240527@074546.7256 n3harbp4ba54u0a2av9qprji7c Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403730 and bi.ref ='324.499.00.01' and bi.lordem =1
20240527@074546.7573 n3harbp4ba54u0a2av9qprji7c Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4723.00.2'
20240527@074546.7713 n3harbp4ba54u0a2av9qprji7c Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403730 and bi.ref ='324.4723.00.2' and bi.lordem =2
20240527@074546.8025 n3harbp4ba54u0a2av9qprji7c Query : use flama_phc
20240527@074546.8029 n3harbp4ba54u0a2av9qprji7c Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240527@074546.8044 n3harbp4ba54u0a2av9qprji7c Query : use flama_phc
20240527@074546.8047 n3harbp4ba54u0a2av9qprji7c Query : select top 1 1 valor from td where td.ndoc = 39
20240527@074546.8057 n3harbp4ba54u0a2av9qprji7c Query : use flama_phc
20240527@074546.8060 n3harbp4ba54u0a2av9qprji7c 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')
20240527@074546.8557 jd062u7q7h1e1oo9lt1n0pi8c8 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240527@074546.8574 jd062u7q7h1e1oo9lt1n0pi8c8 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240527@074546.8588 jd062u7q7h1e1oo9lt1n0pi8c8 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='81';
20240527@074546.8626 jd062u7q7h1e1oo9lt1n0pi8c8 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='81';
20240527@074546.8637 jd062u7q7h1e1oo9lt1n0pi8c8 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='81';
20240527@074546.8648 jd062u7q7h1e1oo9lt1n0pi8c8 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='81';
20240527@074546.8658 jd062u7q7h1e1oo9lt1n0pi8c8 Query : use flama_phc
20240527@074546.8660 jd062u7q7h1e1oo9lt1n0pi8c8 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240527@074546.8675 jd062u7q7h1e1oo9lt1n0pi8c8 Query : use flama_phc
20240527@074546.8678 jd062u7q7h1e1oo9lt1n0pi8c8 Query : select no, estab,szadrsdesc from szadrs where u_coddest=5338
20240527@074546.8756 jd062u7q7h1e1oo9lt1n0pi8c8 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'
20240527@074546.8910 jd062u7q7h1e1oo9lt1n0pi8c8 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403738 and bi.ref ='324.691.00.01' and bi.lordem =1
20240527@074546.9219 jd062u7q7h1e1oo9lt1n0pi8c8 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'
20240527@074546.9230 jd062u7q7h1e1oo9lt1n0pi8c8 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403738 and bi.ref ='324.691.00.01' and bi.lordem =2
20240527@074546.9992 jd062u7q7h1e1oo9lt1n0pi8c8 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.421.00.04'
20240527@074547.4000 jd062u7q7h1e1oo9lt1n0pi8c8 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403738 and bi.ref ='304.421.00.04' and bi.lordem =3
20240527@074547.3300 jd062u7q7h1e1oo9lt1n0pi8c8 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'
20240527@074547.4660 jd062u7q7h1e1oo9lt1n0pi8c8 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403738 and bi.ref ='324.1578.00.1' and bi.lordem =4
20240527@074547.7830 jd062u7q7h1e1oo9lt1n0pi8c8 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1675.00.2'
20240527@074547.9270 jd062u7q7h1e1oo9lt1n0pi8c8 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403738 and bi.ref ='324.1675.00.2' and bi.lordem =5
20240527@074547.1232 jd062u7q7h1e1oo9lt1n0pi8c8 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1675.00.2'
20240527@074547.1242 jd062u7q7h1e1oo9lt1n0pi8c8 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403738 and bi.ref ='324.1675.00.2' and bi.lordem =6
20240527@074547.1547 jd062u7q7h1e1oo9lt1n0pi8c8 Query : use flama_phc
20240527@074547.1550 jd062u7q7h1e1oo9lt1n0pi8c8 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240527@074547.1563 jd062u7q7h1e1oo9lt1n0pi8c8 Query : use flama_phc
20240527@074547.1566 jd062u7q7h1e1oo9lt1n0pi8c8 Query : select top 1 1 valor from td where td.ndoc = 39
20240527@074547.1576 jd062u7q7h1e1oo9lt1n0pi8c8 Query : use flama_phc
20240527@074547.1579 jd062u7q7h1e1oo9lt1n0pi8c8 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')
20240527@074547.3425 70g3a3dpgjahk3rao7rmlbc76u Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240527@074547.3439 70g3a3dpgjahk3rao7rmlbc76u Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240527@074547.3452 70g3a3dpgjahk3rao7rmlbc76u Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='82';
20240527@074547.3488 70g3a3dpgjahk3rao7rmlbc76u Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='82';
20240527@074547.3499 70g3a3dpgjahk3rao7rmlbc76u Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='82';
20240527@074547.3509 70g3a3dpgjahk3rao7rmlbc76u Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='82';
20240527@074547.3527 70g3a3dpgjahk3rao7rmlbc76u Query : use flama_phc
20240527@074547.3529 70g3a3dpgjahk3rao7rmlbc76u Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240527@074547.3542 70g3a3dpgjahk3rao7rmlbc76u Query : use flama_phc
20240527@074547.3545 70g3a3dpgjahk3rao7rmlbc76u Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240527@074547.3612 70g3a3dpgjahk3rao7rmlbc76u Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4906.00.1'
20240527@074547.3796 70g3a3dpgjahk3rao7rmlbc76u Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403740 and bi.ref ='324.4906.00.1' and bi.lordem =1
20240527@074547.4113 70g3a3dpgjahk3rao7rmlbc76u Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4906.00.1'
20240527@074547.4124 70g3a3dpgjahk3rao7rmlbc76u Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403740 and bi.ref ='324.4906.00.1' and bi.lordem =1
20240527@074547.4131 70g3a3dpgjahk3rao7rmlbc76u Query : use flama_phc
20240527@074547.4134 70g3a3dpgjahk3rao7rmlbc76u Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240527@074547.4149 70g3a3dpgjahk3rao7rmlbc76u Query : use flama_phc
20240527@074547.4152 70g3a3dpgjahk3rao7rmlbc76u Query : select top 1 1 valor from td where td.ndoc = 39
20240527@074547.4163 70g3a3dpgjahk3rao7rmlbc76u Query : use flama_phc
20240527@074547.4166 70g3a3dpgjahk3rao7rmlbc76u 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')
20240527@074547.5192 holo4cp6l3j9anfn7aqgfq2io9 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240527@074547.5207 holo4cp6l3j9anfn7aqgfq2io9 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240527@074547.5221 holo4cp6l3j9anfn7aqgfq2io9 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='83';
20240527@074547.5256 holo4cp6l3j9anfn7aqgfq2io9 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='83';
20240527@074547.5268 holo4cp6l3j9anfn7aqgfq2io9 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='83';
20240527@074547.5278 holo4cp6l3j9anfn7aqgfq2io9 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='83';
20240527@074547.5288 holo4cp6l3j9anfn7aqgfq2io9 Query : use flama_phc
20240527@074547.5291 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240527@074547.5304 holo4cp6l3j9anfn7aqgfq2io9 Query : use flama_phc
20240527@074547.5307 holo4cp6l3j9anfn7aqgfq2io9 Query : select no, estab,szadrsdesc from szadrs where u_coddest=6975
20240527@074547.5378 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4840.00.1'
20240527@074547.5526 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403741 and bi.ref ='324.4840.00.1' and bi.lordem =1
20240527@074547.5836 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.421.00.04'
20240527@074547.5848 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403741 and bi.ref ='304.421.00.04' and bi.lordem =2
20240527@074547.6159 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2221.00.1'
20240527@074547.6302 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403741 and bi.ref ='324.2221.00.1' and bi.lordem =3
20240527@074547.6616 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2222.00.1'
20240527@074547.6756 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403741 and bi.ref ='324.2222.00.1' and bi.lordem =4
20240527@074547.7082 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2223.00.1'
20240527@074547.7221 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403741 and bi.ref ='324.2223.00.1' and bi.lordem =5
20240527@074547.7530 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2224.00.1'
20240527@074547.7690 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403741 and bi.ref ='324.2224.00.1' and bi.lordem =6
20240527@074547.7999 holo4cp6l3j9anfn7aqgfq2io9 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'
20240527@074547.8139 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403741 and bi.ref ='324.646.00.01' and bi.lordem =7
20240527@074547.8451 holo4cp6l3j9anfn7aqgfq2io9 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'
20240527@074547.8488 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403741 and bi.ref ='324.646.00.01' and bi.lordem =7
20240527@074547.8977 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.642.00.01'
20240527@074547.9198 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403741 and bi.ref ='324.642.00.01' and bi.lordem =8
20240527@074547.9619 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4521.00.1'
20240527@074547.9631 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403741 and bi.ref ='324.4521.00.1' and bi.lordem =9
20240527@074547.9943 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1528.00.1'
20240527@074548.8000 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403741 and bi.ref ='324.1528.00.1' and bi.lordem =10
20240527@074548.3790 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1536.00.1'
20240527@074548.5180 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403741 and bi.ref ='324.1536.00.1' and bi.lordem =11
20240527@074548.8710 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4964.00.1'
20240527@074548.1012 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403741 and bi.ref ='324.4964.00.1' and bi.lordem =12
20240527@074548.1404 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.948.00.01'
20240527@074548.1548 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403741 and bi.ref ='324.948.00.01' and bi.lordem =13
20240527@074548.3064 holo4cp6l3j9anfn7aqgfq2io9 Query : use flama_phc
20240527@074548.3110 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240527@074548.3127 holo4cp6l3j9anfn7aqgfq2io9 Query : use flama_phc
20240527@074548.3131 holo4cp6l3j9anfn7aqgfq2io9 Query : select top 1 1 valor from td where td.ndoc = 39
20240527@074548.3143 holo4cp6l3j9anfn7aqgfq2io9 Query : use flama_phc
20240527@074548.3146 holo4cp6l3j9anfn7aqgfq2io9 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')
20240527@074548.3682 660tdipd1ujc4ntl6ae7akqnur Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240527@074548.3695 660tdipd1ujc4ntl6ae7akqnur Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240527@074548.3707 660tdipd1ujc4ntl6ae7akqnur Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='84';
20240527@074548.3744 660tdipd1ujc4ntl6ae7akqnur Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='84';
20240527@074548.3755 660tdipd1ujc4ntl6ae7akqnur Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='84';
20240527@074548.3765 660tdipd1ujc4ntl6ae7akqnur Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='84';
20240527@074548.3775 660tdipd1ujc4ntl6ae7akqnur Query : use flama_phc
20240527@074548.3777 660tdipd1ujc4ntl6ae7akqnur Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240527@074548.3790 660tdipd1ujc4ntl6ae7akqnur Query : use flama_phc
20240527@074548.3793 660tdipd1ujc4ntl6ae7akqnur Query : select no, estab,szadrsdesc from szadrs where u_coddest=227
20240527@074548.4018 660tdipd1ujc4ntl6ae7akqnur Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2232.00.1'
20240527@074548.4171 660tdipd1ujc4ntl6ae7akqnur Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403744 and bi.ref ='324.2232.00.1' and bi.lordem =1
20240527@074548.4825 660tdipd1ujc4ntl6ae7akqnur Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2232.00.1'
20240527@074548.4957 660tdipd1ujc4ntl6ae7akqnur Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403744 and bi.ref ='324.2232.00.1' and bi.lordem =1
20240527@074548.4968 660tdipd1ujc4ntl6ae7akqnur Query : use flama_phc
20240527@074548.4971 660tdipd1ujc4ntl6ae7akqnur Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240527@074548.4983 660tdipd1ujc4ntl6ae7akqnur Query : use flama_phc
20240527@074548.4986 660tdipd1ujc4ntl6ae7akqnur Query : select top 1 1 valor from td where td.ndoc = 39
20240527@074548.4996 660tdipd1ujc4ntl6ae7akqnur Query : use flama_phc
20240527@074548.4999 660tdipd1ujc4ntl6ae7akqnur 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')
20240527@074548.5576 rvq7edvg1vit906df0c36cob00 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240527@074548.5607 rvq7edvg1vit906df0c36cob00 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240527@074548.5622 rvq7edvg1vit906df0c36cob00 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='85';
20240527@074548.5658 rvq7edvg1vit906df0c36cob00 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='85';
20240527@074548.5668 rvq7edvg1vit906df0c36cob00 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='85';
20240527@074548.5678 rvq7edvg1vit906df0c36cob00 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='85';
20240527@074548.5688 rvq7edvg1vit906df0c36cob00 Query : use flama_phc
20240527@074548.5691 rvq7edvg1vit906df0c36cob00 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240527@074548.5870 rvq7edvg1vit906df0c36cob00 Query : use flama_phc
20240527@074548.5874 rvq7edvg1vit906df0c36cob00 Query : select no, estab,szadrsdesc from szadrs where u_coddest=3674
20240527@074548.5946 rvq7edvg1vit906df0c36cob00 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.5343.00.1'
20240527@074548.6097 rvq7edvg1vit906df0c36cob00 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403745 and bi.ref ='324.5343.00.1' and bi.lordem =1
20240527@074548.6400 rvq7edvg1vit906df0c36cob00 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.5343.00.1'
20240527@074548.6411 rvq7edvg1vit906df0c36cob00 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403745 and bi.ref ='324.5343.00.1' and bi.lordem =1
20240527@074548.6417 rvq7edvg1vit906df0c36cob00 Query : use flama_phc
20240527@074548.6420 rvq7edvg1vit906df0c36cob00 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240527@074548.6432 rvq7edvg1vit906df0c36cob00 Query : use flama_phc
20240527@074548.6435 rvq7edvg1vit906df0c36cob00 Query : select top 1 1 valor from td where td.ndoc = 39
20240527@074548.6445 rvq7edvg1vit906df0c36cob00 Query : use flama_phc
20240527@074548.6448 rvq7edvg1vit906df0c36cob00 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')
20240527@074548.6903 pmvf60rt69sqpm7d2tsg65dm3g Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240527@074548.6917 pmvf60rt69sqpm7d2tsg65dm3g Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240527@074548.6932 pmvf60rt69sqpm7d2tsg65dm3g Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='86';
20240527@074548.6969 pmvf60rt69sqpm7d2tsg65dm3g Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='86';
20240527@074548.6981 pmvf60rt69sqpm7d2tsg65dm3g Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='86';
20240527@074548.6990 pmvf60rt69sqpm7d2tsg65dm3g Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='86';
20240527@074548.7000 pmvf60rt69sqpm7d2tsg65dm3g Query : use flama_phc
20240527@074548.7002 pmvf60rt69sqpm7d2tsg65dm3g Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240527@074548.7015 pmvf60rt69sqpm7d2tsg65dm3g Query : use flama_phc
20240527@074548.7018 pmvf60rt69sqpm7d2tsg65dm3g Query : select no, estab,szadrsdesc from szadrs where u_coddest=3674
20240527@074548.7048 pmvf60rt69sqpm7d2tsg65dm3g Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4930.00.1'
20240527@074548.7190 pmvf60rt69sqpm7d2tsg65dm3g Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403748 and bi.ref ='324.4930.00.1' and bi.lordem =1
20240527@074548.7587 pmvf60rt69sqpm7d2tsg65dm3g Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4724.00.1'
20240527@074548.7734 pmvf60rt69sqpm7d2tsg65dm3g Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403748 and bi.ref ='324.4724.00.1' and bi.lordem =2
20240527@074548.8052 pmvf60rt69sqpm7d2tsg65dm3g Query : use flama_phc
20240527@074548.8055 pmvf60rt69sqpm7d2tsg65dm3g Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240527@074548.8068 pmvf60rt69sqpm7d2tsg65dm3g Query : use flama_phc
20240527@074548.8071 pmvf60rt69sqpm7d2tsg65dm3g Query : select top 1 1 valor from td where td.ndoc = 39
20240527@074548.8082 pmvf60rt69sqpm7d2tsg65dm3g Query : use flama_phc
20240527@074548.8084 pmvf60rt69sqpm7d2tsg65dm3g 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')
20240527@074549.9910 riqpj5eee4klies5tlcidgqk5t Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240527@074549.1005 riqpj5eee4klies5tlcidgqk5t Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240527@074549.1019 riqpj5eee4klies5tlcidgqk5t Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='87';
20240527@074549.1055 riqpj5eee4klies5tlcidgqk5t Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='87';
20240527@074549.1066 riqpj5eee4klies5tlcidgqk5t Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='87';
20240527@074549.1078 riqpj5eee4klies5tlcidgqk5t Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='87';
20240527@074549.1089 riqpj5eee4klies5tlcidgqk5t Query : use flama_phc
20240527@074549.1092 riqpj5eee4klies5tlcidgqk5t Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240527@074549.1107 riqpj5eee4klies5tlcidgqk5t Query : use flama_phc
20240527@074549.1110 riqpj5eee4klies5tlcidgqk5t Query : select no, estab,szadrsdesc from szadrs where u_coddest=2214
20240527@074549.1181 riqpj5eee4klies5tlcidgqk5t Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4930.00.1'
20240527@074549.1192 riqpj5eee4klies5tlcidgqk5t Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403749 and bi.ref ='324.4930.00.1' and bi.lordem =1
20240527@074549.1733 riqpj5eee4klies5tlcidgqk5t Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4421.00.1'
20240527@074549.1876 riqpj5eee4klies5tlcidgqk5t Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403749 and bi.ref ='324.4421.00.1' and bi.lordem =2
20240527@074549.2190 riqpj5eee4klies5tlcidgqk5t 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'
20240527@074549.2327 riqpj5eee4klies5tlcidgqk5t Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403749 and bi.ref ='324.1824.00.1' and bi.lordem =3
20240527@074549.2629 riqpj5eee4klies5tlcidgqk5t Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1879.00.1'
20240527@074549.3489 riqpj5eee4klies5tlcidgqk5t Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403749 and bi.ref ='324.1879.00.1' and bi.lordem =4
20240527@074549.3814 riqpj5eee4klies5tlcidgqk5t Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.4320.00.1'
20240527@074549.3952 riqpj5eee4klies5tlcidgqk5t Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403749 and bi.ref ='304.4320.00.1' and bi.lordem =5
20240527@074549.4277 riqpj5eee4klies5tlcidgqk5t Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2231.00.1'
20240527@074549.4419 riqpj5eee4klies5tlcidgqk5t Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403749 and bi.ref ='324.2231.00.1' and bi.lordem =6
20240527@074549.4729 riqpj5eee4klies5tlcidgqk5t Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4521.00.1'
20240527@074549.4739 riqpj5eee4klies5tlcidgqk5t Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403749 and bi.ref ='324.4521.00.1' and bi.lordem =7
20240527@074549.5140 riqpj5eee4klies5tlcidgqk5t Query : use flama_phc
20240527@074549.5145 riqpj5eee4klies5tlcidgqk5t Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240527@074549.5160 riqpj5eee4klies5tlcidgqk5t Query : use flama_phc
20240527@074549.5163 riqpj5eee4klies5tlcidgqk5t Query : select top 1 1 valor from td where td.ndoc = 39
20240527@074549.5191 riqpj5eee4klies5tlcidgqk5t Query : use flama_phc
20240527@074549.5194 riqpj5eee4klies5tlcidgqk5t 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')
20240527@074549.6721 456dbs2npml18dhg2ccto5n9nn Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240527@074549.6734 456dbs2npml18dhg2ccto5n9nn Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240527@074549.6747 456dbs2npml18dhg2ccto5n9nn Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='88';
20240527@074549.6783 456dbs2npml18dhg2ccto5n9nn Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='88';
20240527@074549.6794 456dbs2npml18dhg2ccto5n9nn Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='88';
20240527@074549.6824 456dbs2npml18dhg2ccto5n9nn Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='88';
20240527@074549.6835 456dbs2npml18dhg2ccto5n9nn Query : use flama_phc
20240527@074549.6838 456dbs2npml18dhg2ccto5n9nn Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240527@074549.6852 456dbs2npml18dhg2ccto5n9nn Query : use flama_phc
20240527@074549.6855 456dbs2npml18dhg2ccto5n9nn Query : select no, estab,szadrsdesc from szadrs where u_coddest=2821
20240527@074549.6922 456dbs2npml18dhg2ccto5n9nn Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.692.00.01'
20240527@074549.7068 456dbs2npml18dhg2ccto5n9nn Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403750 and bi.ref ='324.692.00.01' and bi.lordem =1
20240527@074549.7919 456dbs2npml18dhg2ccto5n9nn Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.692.00.01'
20240527@074549.7933 456dbs2npml18dhg2ccto5n9nn Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403750 and bi.ref ='324.692.00.01' and bi.lordem =1
20240527@074549.7941 456dbs2npml18dhg2ccto5n9nn 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'
20240527@074549.7951 456dbs2npml18dhg2ccto5n9nn Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403750 and bi.ref ='324.691.00.01' and bi.lordem =2
20240527@074549.8276 456dbs2npml18dhg2ccto5n9nn Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2231.00.1'
20240527@074549.8287 456dbs2npml18dhg2ccto5n9nn Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403750 and bi.ref ='324.2231.00.1' and bi.lordem =3
20240527@074549.8609 456dbs2npml18dhg2ccto5n9nn Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2232.00.1'
20240527@074549.8620 456dbs2npml18dhg2ccto5n9nn Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403750 and bi.ref ='324.2232.00.1' and bi.lordem =4
20240527@074549.8941 456dbs2npml18dhg2ccto5n9nn Query : use flama_phc
20240527@074549.8944 456dbs2npml18dhg2ccto5n9nn Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240527@074549.8959 456dbs2npml18dhg2ccto5n9nn Query : use flama_phc
20240527@074549.8962 456dbs2npml18dhg2ccto5n9nn Query : select top 1 1 valor from td where td.ndoc = 39
20240527@074549.8973 456dbs2npml18dhg2ccto5n9nn Query : use flama_phc
20240527@074549.8976 456dbs2npml18dhg2ccto5n9nn 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')
20240527@074549.9482 e3q1icva6np1hhraq5spnecpdr Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240527@074549.9496 e3q1icva6np1hhraq5spnecpdr Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240527@074549.9510 e3q1icva6np1hhraq5spnecpdr Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='89';
20240527@074549.9546 e3q1icva6np1hhraq5spnecpdr Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='89';
20240527@074549.9558 e3q1icva6np1hhraq5spnecpdr Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='89';
20240527@074549.9569 e3q1icva6np1hhraq5spnecpdr Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='89';
20240527@074549.9579 e3q1icva6np1hhraq5spnecpdr Query : use flama_phc
20240527@074549.9582 e3q1icva6np1hhraq5spnecpdr Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240527@074549.9595 e3q1icva6np1hhraq5spnecpdr Query : use flama_phc
20240527@074549.9598 e3q1icva6np1hhraq5spnecpdr Query : select no, estab,szadrsdesc from szadrs where u_coddest=1779
20240527@074549.9670 e3q1icva6np1hhraq5spnecpdr Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.5396.00.1'
20240527@074550.8950 e3q1icva6np1hhraq5spnecpdr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403751 and bi.ref ='324.5396.00.1' and bi.lordem =1
20240527@074550.1216 e3q1icva6np1hhraq5spnecpdr Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '323.367.09.00'
20240527@074550.1356 e3q1icva6np1hhraq5spnecpdr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403751 and bi.ref ='323.367.09.00' and bi.lordem =3
20240527@074550.1667 e3q1icva6np1hhraq5spnecpdr Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2031.00.1'
20240527@074550.1921 e3q1icva6np1hhraq5spnecpdr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403751 and bi.ref ='324.2031.00.1' and bi.lordem =4
20240527@074550.2248 e3q1icva6np1hhraq5spnecpdr Query : use flama_phc
20240527@074550.2251 e3q1icva6np1hhraq5spnecpdr Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240527@074550.2265 e3q1icva6np1hhraq5spnecpdr Query : use flama_phc
20240527@074550.2268 e3q1icva6np1hhraq5spnecpdr Query : select top 1 1 valor from td where td.ndoc = 39
20240527@074550.2280 e3q1icva6np1hhraq5spnecpdr Query : use flama_phc
20240527@074550.2283 e3q1icva6np1hhraq5spnecpdr 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')
20240527@081910.5258 lgg52euvumo70oeq73kp8juk6k Query : use flama_phc
20240527@081910.5264 lgg52euvumo70oeq73kp8juk6k Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@081910.5317 lgg52euvumo70oeq73kp8juk6k Query : use flama_phc
20240527@081910.5320 lgg52euvumo70oeq73kp8juk6k Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@083610.5767 9191iadbostujotjnd13bku4it Query : use flama_phc
20240527@083610.5772 9191iadbostujotjnd13bku4it Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@083610.5789 9191iadbostujotjnd13bku4it Query : use flama_phc
20240527@083610.5792 9191iadbostujotjnd13bku4it Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@091911.5850 vut65p1s1e1bdjjtk742d4qebv Query : use flama_phc
20240527@091911.5910 vut65p1s1e1bdjjtk742d4qebv Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@091911.6510 vut65p1s1e1bdjjtk742d4qebv Query : use flama_phc
20240527@091911.6550 vut65p1s1e1bdjjtk742d4qebv Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@093610.8149 f0c32r1oc5p35j74h89himl6h5 Query : use flama_phc
20240527@093610.8156 f0c32r1oc5p35j74h89himl6h5 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@093610.8222 f0c32r1oc5p35j74h89himl6h5 Query : use flama_phc
20240527@093610.8226 f0c32r1oc5p35j74h89himl6h5 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@101910.2070 2n6qfnhg3vn6393o3vsve275au Query : use flama_phc
20240527@101910.2076 2n6qfnhg3vn6393o3vsve275au Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@101910.2092 2n6qfnhg3vn6393o3vsve275au Query : use flama_phc
20240527@101910.2094 2n6qfnhg3vn6393o3vsve275au Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@103610.2410 vlvtmldgiqkl1f5ogiaab63seb Query : use flama_phc
20240527@103610.2450 vlvtmldgiqkl1f5ogiaab63seb Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@103610.2610 vlvtmldgiqkl1f5ogiaab63seb Query : use flama_phc
20240527@103610.2640 vlvtmldgiqkl1f5ogiaab63seb Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@111913.7376 g4ahnpdeo938r5vcaktfct9u1a Query : use flama_phc
20240527@111913.7382 g4ahnpdeo938r5vcaktfct9u1a Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@111913.7407 g4ahnpdeo938r5vcaktfct9u1a Query : use flama_phc
20240527@111913.7411 g4ahnpdeo938r5vcaktfct9u1a Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@113614.1348 n98t7uv3tjbbucblm8p5mt4kqp Query : use flama_phc
20240527@113614.1353 n98t7uv3tjbbucblm8p5mt4kqp Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@113614.1373 n98t7uv3tjbbucblm8p5mt4kqp Query : use flama_phc
20240527@113614.1376 n98t7uv3tjbbucblm8p5mt4kqp Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@121911.8689 hu0ml6l4d2c403i1rtdil31vv5 Query : use flama_phc
20240527@121911.8695 hu0ml6l4d2c403i1rtdil31vv5 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@121911.8754 hu0ml6l4d2c403i1rtdil31vv5 Query : use flama_phc
20240527@121911.8757 hu0ml6l4d2c403i1rtdil31vv5 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@123611.8720 4jvvnmovmnfbj16ckmrtvhp8ug Query : use flama_phc
20240527@123611.8726 4jvvnmovmnfbj16ckmrtvhp8ug Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@123611.8743 4jvvnmovmnfbj16ckmrtvhp8ug Query : use flama_phc
20240527@123611.8746 4jvvnmovmnfbj16ckmrtvhp8ug Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@131911.2647 1gsqec40bouu7vhhdboh865q55 Query : use flama_phc
20240527@131911.2653 1gsqec40bouu7vhhdboh865q55 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@131911.2672 1gsqec40bouu7vhhdboh865q55 Query : use flama_phc
20240527@131911.2676 1gsqec40bouu7vhhdboh865q55 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@133611.5880 mrkglv5g83hu370jloumg8m06q Query : use flama_phc
20240527@133611.5885 mrkglv5g83hu370jloumg8m06q Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@133611.5902 mrkglv5g83hu370jloumg8m06q Query : use flama_phc
20240527@133611.5905 mrkglv5g83hu370jloumg8m06q Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@133726.1675 coqlkfuvimfaa8u760t5mcftiu Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240527@133726.1704 coqlkfuvimfaa8u760t5mcftiu Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240527@133726.1761 coqlkfuvimfaa8u760t5mcftiu Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='90';
20240527@133726.1809 coqlkfuvimfaa8u760t5mcftiu Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='90';
20240527@133726.1830 coqlkfuvimfaa8u760t5mcftiu Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='90';
20240527@133726.1847 coqlkfuvimfaa8u760t5mcftiu Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='90';
20240527@133726.1857 coqlkfuvimfaa8u760t5mcftiu Query : use flama_phc
20240527@133726.1860 coqlkfuvimfaa8u760t5mcftiu Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240527@133726.1907 coqlkfuvimfaa8u760t5mcftiu Query : use flama_phc
20240527@133726.1910 coqlkfuvimfaa8u760t5mcftiu Query : select no, estab,szadrsdesc from szadrs where u_coddest=170
20240527@133726.1983 coqlkfuvimfaa8u760t5mcftiu Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.692.00.01'
20240527@133726.2159 coqlkfuvimfaa8u760t5mcftiu Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.692.00.01'
20240527@133726.2169 coqlkfuvimfaa8u760t5mcftiu Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.692.00.01'
20240527@133726.2178 coqlkfuvimfaa8u760t5mcftiu Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.692.00.01'
20240527@133726.2187 coqlkfuvimfaa8u760t5mcftiu Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.692.00.01'
20240527@133726.2196 coqlkfuvimfaa8u760t5mcftiu Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.692.00.01'
20240527@133726.2205 coqlkfuvimfaa8u760t5mcftiu Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.692.00.01'
20240527@133726.2214 coqlkfuvimfaa8u760t5mcftiu Query : use flama_phc
20240527@133726.2217 coqlkfuvimfaa8u760t5mcftiu Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240527@133726.2402 coqlkfuvimfaa8u760t5mcftiu Query : use flama_phc
20240527@133726.2405 coqlkfuvimfaa8u760t5mcftiu Query : select top 1 1 valor from td where td.ndoc = 39
20240527@133726.2473 coqlkfuvimfaa8u760t5mcftiu Query : use flama_phc
20240527@133726.2476 coqlkfuvimfaa8u760t5mcftiu 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')
20240527@141912.2229 jmm6o1oq16pa4spa6hjotmcj7t Query : use flama_phc
20240527@141912.2234 jmm6o1oq16pa4spa6hjotmcj7t Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@141912.2254 jmm6o1oq16pa4spa6hjotmcj7t Query : use flama_phc
20240527@141912.2257 jmm6o1oq16pa4spa6hjotmcj7t Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@143612.2554 e9jjmvt7k5kb8l6lc3katfg1u5 Query : use flama_phc
20240527@143612.2561 e9jjmvt7k5kb8l6lc3katfg1u5 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@143612.2584 e9jjmvt7k5kb8l6lc3katfg1u5 Query : use flama_phc
20240527@143612.2587 e9jjmvt7k5kb8l6lc3katfg1u5 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@151915.1373 12s3enoqlohf4qr1ibh0knl7c1 Query : use flama_phc
20240527@151915.1394 12s3enoqlohf4qr1ibh0knl7c1 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@151915.1492 12s3enoqlohf4qr1ibh0knl7c1 Query : use flama_phc
20240527@151915.1495 12s3enoqlohf4qr1ibh0knl7c1 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@153615.7109 je2p37i3hj20bd8i2uon9hqep2 Query : use flama_phc
20240527@153615.7114 je2p37i3hj20bd8i2uon9hqep2 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@153615.7137 je2p37i3hj20bd8i2uon9hqep2 Query : use flama_phc
20240527@153615.7140 je2p37i3hj20bd8i2uon9hqep2 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@161912.9930 qdrpnehip5vgp5klg28ebagsl7 Query : use flama_phc
20240527@161912.9980 qdrpnehip5vgp5klg28ebagsl7 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@161912.1014 qdrpnehip5vgp5klg28ebagsl7 Query : use flama_phc
20240527@161912.1017 qdrpnehip5vgp5klg28ebagsl7 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@163612.1770 ol7i0fbue3j1gidjeh25ojfohl Query : use flama_phc
20240527@163612.1775 ol7i0fbue3j1gidjeh25ojfohl Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@163612.1791 ol7i0fbue3j1gidjeh25ojfohl Query : use flama_phc
20240527@163612.1794 ol7i0fbue3j1gidjeh25ojfohl Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@171912.8208 c18hcmkeg3hojjoj9k3f2lia7j Query : use flama_phc
20240527@171912.8217 c18hcmkeg3hojjoj9k3f2lia7j Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@171912.8322 c18hcmkeg3hojjoj9k3f2lia7j Query : use flama_phc
20240527@171912.8326 c18hcmkeg3hojjoj9k3f2lia7j Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@173613.1318 3q9m6n1sc2pkskga1o1gvja923 Query : use flama_phc
20240527@173613.1323 3q9m6n1sc2pkskga1o1gvja923 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@173613.1341 3q9m6n1sc2pkskga1o1gvja923 Query : use flama_phc
20240527@173613.1345 3q9m6n1sc2pkskga1o1gvja923 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@181911.9636 862l93ln0jm10kct8q3ie947b1 Query : use flama_phc
20240527@181911.9641 862l93ln0jm10kct8q3ie947b1 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@181911.9659 862l93ln0jm10kct8q3ie947b1 Query : use flama_phc
20240527@181911.9662 862l93ln0jm10kct8q3ie947b1 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@183612.3149 ii76f1v6s2vhj79cslmr97icaa Query : use flama_phc
20240527@183612.3153 ii76f1v6s2vhj79cslmr97icaa Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@183612.3171 ii76f1v6s2vhj79cslmr97icaa Query : use flama_phc
20240527@183612.3174 ii76f1v6s2vhj79cslmr97icaa Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@191933.1860 qnepoh5osp4r9vqbaht92viees Query : use flama_phc
20240527@191933.1864 qnepoh5osp4r9vqbaht92viees Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@191933.1881 qnepoh5osp4r9vqbaht92viees Query : use flama_phc
20240527@191933.1884 qnepoh5osp4r9vqbaht92viees Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@193633.4158 bckat9d2b44srv9ecvr7f0f46k Query : use flama_phc
20240527@193633.4163 bckat9d2b44srv9ecvr7f0f46k Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@193633.4181 bckat9d2b44srv9ecvr7f0f46k Query : use flama_phc
20240527@193633.4184 bckat9d2b44srv9ecvr7f0f46k Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@201913.1489 7puflj2lvue41aoj99j4l8qgtq Query : use flama_phc
20240527@201913.1494 7puflj2lvue41aoj99j4l8qgtq Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@201913.1511 7puflj2lvue41aoj99j4l8qgtq Query : use flama_phc
20240527@201913.1514 7puflj2lvue41aoj99j4l8qgtq Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@203613.3663 id9vp1ct720s1pvk4n9rusp7os Query : use flama_phc
20240527@203613.3669 id9vp1ct720s1pvk4n9rusp7os Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@203613.3687 id9vp1ct720s1pvk4n9rusp7os Query : use flama_phc
20240527@203613.3690 id9vp1ct720s1pvk4n9rusp7os Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@211911.2589 mrtmdk4fo1plf7ke9ucbck7nm9 Query : use flama_phc
20240527@211911.2598 mrtmdk4fo1plf7ke9ucbck7nm9 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@211911.2619 mrtmdk4fo1plf7ke9ucbck7nm9 Query : use flama_phc
20240527@211911.2622 mrtmdk4fo1plf7ke9ucbck7nm9 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@213611.1491 ucogtcifl4b8fno7r4hpegnob1 Query : use flama_phc
20240527@213611.1497 ucogtcifl4b8fno7r4hpegnob1 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@213611.1520 ucogtcifl4b8fno7r4hpegnob1 Query : use flama_phc
20240527@213611.1524 ucogtcifl4b8fno7r4hpegnob1 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@221920.6720 qvcmfgmnurcg5gq8dtp7e7etrp Query : use flama_phc
20240527@221920.6726 qvcmfgmnurcg5gq8dtp7e7etrp Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@221920.6743 qvcmfgmnurcg5gq8dtp7e7etrp Query : use flama_phc
20240527@221920.6746 qvcmfgmnurcg5gq8dtp7e7etrp Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@223620.9260 f8bhmh84pbv56ovbokd0rn2eje Query : use flama_phc
20240527@223620.9320 f8bhmh84pbv56ovbokd0rn2eje Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@223620.9520 f8bhmh84pbv56ovbokd0rn2eje Query : use flama_phc
20240527@223620.9550 f8bhmh84pbv56ovbokd0rn2eje Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@231912.1894 t4phe2tufos6s6kiniopenil79 Query : use flama_phc
20240527@231912.1901 t4phe2tufos6s6kiniopenil79 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@231912.1921 t4phe2tufos6s6kiniopenil79 Query : use flama_phc
20240527@231912.1925 t4phe2tufos6s6kiniopenil79 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240527@233612.4827 2qvr94sccec98mp9h6glmqd3n1 Query : use flama_phc
20240527@233612.4832 2qvr94sccec98mp9h6glmqd3n1 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240527@233612.4851 2qvr94sccec98mp9h6glmqd3n1 Query : use flama_phc
20240527@233612.4853 2qvr94sccec98mp9h6glmqd3n1 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240528@071923.6275 spueghboiusk44117jtu0uubrs Query : use flama_phc
20240528@071923.6280 spueghboiusk44117jtu0uubrs Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240528@071923.6347 spueghboiusk44117jtu0uubrs Query : use flama_phc
20240528@071923.6350 spueghboiusk44117jtu0uubrs Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240528@073058.2950 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240528@073058.3330 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240528@073058.3980 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='91';
20240528@073058.4340 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='91';
20240528@073058.4560 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='91';
20240528@073058.4700 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='91';
20240528@073058.4810 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : use flama_phc
20240528@073058.4850 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240528@073058.5300 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : use flama_phc
20240528@073058.5330 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select no, estab,szadrsdesc from szadrs where u_coddest=5546
20240528@073058.6160 pe0mhrtgrd0ov2a3uqgt1dvqhc 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'
20240528@073058.7510 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.646.00.01' and bi.lordem =1
20240528@073058.1089 pe0mhrtgrd0ov2a3uqgt1dvqhc 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'
20240528@073058.1100 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.646.00.01' and bi.lordem =1
20240528@073058.1107 pe0mhrtgrd0ov2a3uqgt1dvqhc 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'
20240528@073058.1117 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.646.00.01' and bi.lordem =1
20240528@073058.1124 pe0mhrtgrd0ov2a3uqgt1dvqhc 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'
20240528@073058.1135 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.646.00.01' and bi.lordem =1
20240528@073058.1141 pe0mhrtgrd0ov2a3uqgt1dvqhc 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'
20240528@073058.1151 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.646.00.01' and bi.lordem =1
20240528@073058.1158 pe0mhrtgrd0ov2a3uqgt1dvqhc 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'
20240528@073058.1167 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.646.00.01' and bi.lordem =1
20240528@073058.1174 pe0mhrtgrd0ov2a3uqgt1dvqhc 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'
20240528@073058.1184 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.646.00.01' and bi.lordem =1
20240528@073058.1191 pe0mhrtgrd0ov2a3uqgt1dvqhc 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'
20240528@073058.1201 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.646.00.01' and bi.lordem =1
20240528@073058.1208 pe0mhrtgrd0ov2a3uqgt1dvqhc 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'
20240528@073058.1218 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.646.00.01' and bi.lordem =1
20240528@073058.1225 pe0mhrtgrd0ov2a3uqgt1dvqhc 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'
20240528@073058.1234 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.646.00.01' and bi.lordem =1
20240528@073058.1241 pe0mhrtgrd0ov2a3uqgt1dvqhc 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'
20240528@073058.1251 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.646.00.01' and bi.lordem =1
20240528@073058.1259 pe0mhrtgrd0ov2a3uqgt1dvqhc 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'
20240528@073058.1269 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.646.00.01' and bi.lordem =1
20240528@073058.1276 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240528@073058.1418 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.645.00.01' and bi.lordem =2
20240528@073058.1835 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240528@073058.1846 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.645.00.01' and bi.lordem =2
20240528@073058.1854 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240528@073058.1865 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.645.00.01' and bi.lordem =2
20240528@073058.1872 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240528@073058.1923 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.645.00.01' and bi.lordem =2
20240528@073058.1931 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240528@073058.1941 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.645.00.01' and bi.lordem =2
20240528@073058.1947 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240528@073058.1956 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.645.00.01' and bi.lordem =2
20240528@073058.1964 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240528@073058.1974 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.645.00.01' and bi.lordem =2
20240528@073058.1981 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240528@073058.1990 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.645.00.01' and bi.lordem =2
20240528@073058.1998 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240528@073058.2008 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.645.00.01' and bi.lordem =2
20240528@073058.2015 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240528@073058.2025 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403727 and bi.ref ='324.645.00.01' and bi.lordem =2
20240528@073058.2032 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : use flama_phc
20240528@073058.2035 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240528@073058.2217 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : use flama_phc
20240528@073058.2220 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : select top 1 1 valor from td where td.ndoc = 39
20240528@073058.2320 pe0mhrtgrd0ov2a3uqgt1dvqhc Query : use flama_phc
20240528@073058.2323 pe0mhrtgrd0ov2a3uqgt1dvqhc 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')
20240528@073058.2978 kv1gn36t73alg8r4lp7quoq046 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240528@073058.2991 kv1gn36t73alg8r4lp7quoq046 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240528@073058.3004 kv1gn36t73alg8r4lp7quoq046 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='92';
20240528@073058.3038 kv1gn36t73alg8r4lp7quoq046 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='92';
20240528@073058.3049 kv1gn36t73alg8r4lp7quoq046 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='92';
20240528@073058.3059 kv1gn36t73alg8r4lp7quoq046 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='92';
20240528@073058.3069 kv1gn36t73alg8r4lp7quoq046 Query : use flama_phc
20240528@073058.3072 kv1gn36t73alg8r4lp7quoq046 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240528@073058.3086 kv1gn36t73alg8r4lp7quoq046 Query : use flama_phc
20240528@073058.3088 kv1gn36t73alg8r4lp7quoq046 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4787
20240528@073058.3161 kv1gn36t73alg8r4lp7quoq046 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.4320.00.1'
20240528@073058.3301 kv1gn36t73alg8r4lp7quoq046 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403734 and bi.ref ='304.4320.00.1' and bi.lordem =1
20240528@073058.3602 kv1gn36t73alg8r4lp7quoq046 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4743.00.1'
20240528@073058.3734 kv1gn36t73alg8r4lp7quoq046 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403734 and bi.ref ='324.4743.00.1' and bi.lordem =2
20240528@073058.4048 kv1gn36t73alg8r4lp7quoq046 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4751.00.1'
20240528@073058.4276 kv1gn36t73alg8r4lp7quoq046 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403734 and bi.ref ='324.4751.00.1' and bi.lordem =3
20240528@073058.4596 kv1gn36t73alg8r4lp7quoq046 Query : use flama_phc
20240528@073058.4600 kv1gn36t73alg8r4lp7quoq046 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240528@073058.4613 kv1gn36t73alg8r4lp7quoq046 Query : use flama_phc
20240528@073058.4616 kv1gn36t73alg8r4lp7quoq046 Query : select top 1 1 valor from td where td.ndoc = 39
20240528@073058.4626 kv1gn36t73alg8r4lp7quoq046 Query : use flama_phc
20240528@073058.4629 kv1gn36t73alg8r4lp7quoq046 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')
20240528@073058.5129 cbc7k7so41djsbmfel3tctti6h Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240528@073058.5142 cbc7k7so41djsbmfel3tctti6h Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240528@073058.5154 cbc7k7so41djsbmfel3tctti6h Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='93';
20240528@073058.5188 cbc7k7so41djsbmfel3tctti6h Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='93';
20240528@073058.5199 cbc7k7so41djsbmfel3tctti6h Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='93';
20240528@073058.5209 cbc7k7so41djsbmfel3tctti6h Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='93';
20240528@073058.5219 cbc7k7so41djsbmfel3tctti6h Query : use flama_phc
20240528@073058.5222 cbc7k7so41djsbmfel3tctti6h Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240528@073058.5235 cbc7k7so41djsbmfel3tctti6h Query : use flama_phc
20240528@073058.5238 cbc7k7so41djsbmfel3tctti6h Query : select no, estab,szadrsdesc from szadrs where u_coddest=4782
20240528@073058.5304 cbc7k7so41djsbmfel3tctti6h Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.4320.00.1'
20240528@073058.5316 cbc7k7so41djsbmfel3tctti6h Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403735 and bi.ref ='304.4320.00.1' and bi.lordem =1
20240528@073058.5630 cbc7k7so41djsbmfel3tctti6h Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1470.00.1'
20240528@073058.5765 cbc7k7so41djsbmfel3tctti6h Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403735 and bi.ref ='324.1470.00.1' and bi.lordem =2
20240528@073058.6066 cbc7k7so41djsbmfel3tctti6h Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4960.00.1'
20240528@073058.6206 cbc7k7so41djsbmfel3tctti6h Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403735 and bi.ref ='324.4960.00.1' and bi.lordem =3
20240528@073058.6512 cbc7k7so41djsbmfel3tctti6h Query : use flama_phc
20240528@073058.6515 cbc7k7so41djsbmfel3tctti6h Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240528@073058.6528 cbc7k7so41djsbmfel3tctti6h Query : use flama_phc
20240528@073058.6531 cbc7k7so41djsbmfel3tctti6h Query : select top 1 1 valor from td where td.ndoc = 39
20240528@073058.6540 cbc7k7so41djsbmfel3tctti6h Query : use flama_phc
20240528@073058.6544 cbc7k7so41djsbmfel3tctti6h 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')
20240528@073058.7173 1fcse0d5uanhuqg31giskq8dp8 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240528@073058.7187 1fcse0d5uanhuqg31giskq8dp8 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240528@073058.7199 1fcse0d5uanhuqg31giskq8dp8 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='94';
20240528@073058.7643 1fcse0d5uanhuqg31giskq8dp8 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='94';
20240528@073058.8580 1fcse0d5uanhuqg31giskq8dp8 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='94';
20240528@073058.8592 1fcse0d5uanhuqg31giskq8dp8 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='94';
20240528@073058.8602 1fcse0d5uanhuqg31giskq8dp8 Query : use flama_phc
20240528@073058.8605 1fcse0d5uanhuqg31giskq8dp8 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240528@073058.8618 1fcse0d5uanhuqg31giskq8dp8 Query : use flama_phc
20240528@073058.8620 1fcse0d5uanhuqg31giskq8dp8 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4781
20240528@073058.8692 1fcse0d5uanhuqg31giskq8dp8 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4990.00.1'
20240528@073058.8858 1fcse0d5uanhuqg31giskq8dp8 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403736 and bi.ref ='324.4990.00.1' and bi.lordem =1
20240528@073058.9163 1fcse0d5uanhuqg31giskq8dp8 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4960.00.1'
20240528@073058.9173 1fcse0d5uanhuqg31giskq8dp8 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403736 and bi.ref ='324.4960.00.1' and bi.lordem =2
20240528@073058.9491 1fcse0d5uanhuqg31giskq8dp8 Query : use flama_phc
20240528@073058.9494 1fcse0d5uanhuqg31giskq8dp8 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240528@073058.9508 1fcse0d5uanhuqg31giskq8dp8 Query : use flama_phc
20240528@073058.9511 1fcse0d5uanhuqg31giskq8dp8 Query : select top 1 1 valor from td where td.ndoc = 39
20240528@073058.9521 1fcse0d5uanhuqg31giskq8dp8 Query : use flama_phc
20240528@073058.9523 1fcse0d5uanhuqg31giskq8dp8 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')
20240528@073059.1700 ara7t9o9ljgcudg6gu90k314m9 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240528@073059.3100 ara7t9o9ljgcudg6gu90k314m9 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240528@073059.4300 ara7t9o9ljgcudg6gu90k314m9 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='95';
20240528@073059.8000 ara7t9o9ljgcudg6gu90k314m9 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='95';
20240528@073059.9100 ara7t9o9ljgcudg6gu90k314m9 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='95';
20240528@073059.1010 ara7t9o9ljgcudg6gu90k314m9 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='95';
20240528@073059.1110 ara7t9o9ljgcudg6gu90k314m9 Query : use flama_phc
20240528@073059.1140 ara7t9o9ljgcudg6gu90k314m9 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240528@073059.1270 ara7t9o9ljgcudg6gu90k314m9 Query : use flama_phc
20240528@073059.1300 ara7t9o9ljgcudg6gu90k314m9 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4785
20240528@073059.1960 ara7t9o9ljgcudg6gu90k314m9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.4320.00.1'
20240528@073059.2060 ara7t9o9ljgcudg6gu90k314m9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403737 and bi.ref ='304.4320.00.1' and bi.lordem =1
20240528@073059.5340 ara7t9o9ljgcudg6gu90k314m9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4743.00.1'
20240528@073059.5440 ara7t9o9ljgcudg6gu90k314m9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403737 and bi.ref ='324.4743.00.1' and bi.lordem =2
20240528@073059.8550 ara7t9o9ljgcudg6gu90k314m9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.422.00.07'
20240528@073059.9960 ara7t9o9ljgcudg6gu90k314m9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403737 and bi.ref ='304.422.00.07' and bi.lordem =3
20240528@073059.1312 ara7t9o9ljgcudg6gu90k314m9 Query : use flama_phc
20240528@073059.1315 ara7t9o9ljgcudg6gu90k314m9 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240528@073059.1328 ara7t9o9ljgcudg6gu90k314m9 Query : use flama_phc
20240528@073059.1331 ara7t9o9ljgcudg6gu90k314m9 Query : select top 1 1 valor from td where td.ndoc = 39
20240528@073059.1341 ara7t9o9ljgcudg6gu90k314m9 Query : use flama_phc
20240528@073059.1343 ara7t9o9ljgcudg6gu90k314m9 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')
20240528@073059.1928 nucnaenia2r5orh4e0ofu2t3lj Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240528@073059.2023 nucnaenia2r5orh4e0ofu2t3lj Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240528@073059.2036 nucnaenia2r5orh4e0ofu2t3lj Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='96';
20240528@073059.2073 nucnaenia2r5orh4e0ofu2t3lj Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='96';
20240528@073059.2091 nucnaenia2r5orh4e0ofu2t3lj Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='96';
20240528@073059.2102 nucnaenia2r5orh4e0ofu2t3lj Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='96';
20240528@073059.2112 nucnaenia2r5orh4e0ofu2t3lj Query : use flama_phc
20240528@073059.2115 nucnaenia2r5orh4e0ofu2t3lj Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240528@073059.2214 nucnaenia2r5orh4e0ofu2t3lj Query : use flama_phc
20240528@073059.2218 nucnaenia2r5orh4e0ofu2t3lj Query : select no, estab,szadrsdesc from szadrs where u_coddest=4783
20240528@073059.2355 nucnaenia2r5orh4e0ofu2t3lj Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.4320.00.1'
20240528@073059.2365 nucnaenia2r5orh4e0ofu2t3lj Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403747 and bi.ref ='304.4320.00.1' and bi.lordem =1
20240528@073059.2676 nucnaenia2r5orh4e0ofu2t3lj Query : use flama_phc
20240528@073059.2679 nucnaenia2r5orh4e0ofu2t3lj Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240528@073059.2692 nucnaenia2r5orh4e0ofu2t3lj Query : use flama_phc
20240528@073059.2695 nucnaenia2r5orh4e0ofu2t3lj Query : select top 1 1 valor from td where td.ndoc = 39
20240528@073059.2705 nucnaenia2r5orh4e0ofu2t3lj Query : use flama_phc
20240528@073059.2709 nucnaenia2r5orh4e0ofu2t3lj 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')
20240528@073059.3226 1cue0bo7hbjec6dsass19o692a Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240528@073059.3239 1cue0bo7hbjec6dsass19o692a Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240528@073059.3252 1cue0bo7hbjec6dsass19o692a Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='97';
20240528@073059.3288 1cue0bo7hbjec6dsass19o692a Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='97';
20240528@073059.3300 1cue0bo7hbjec6dsass19o692a Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='97';
20240528@073059.3312 1cue0bo7hbjec6dsass19o692a Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='97';
20240528@073059.3322 1cue0bo7hbjec6dsass19o692a Query : use flama_phc
20240528@073059.3325 1cue0bo7hbjec6dsass19o692a Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240528@073059.3339 1cue0bo7hbjec6dsass19o692a Query : use flama_phc
20240528@073059.3342 1cue0bo7hbjec6dsass19o692a Query : select no, estab,szadrsdesc from szadrs where u_coddest=6076
20240528@073059.3421 1cue0bo7hbjec6dsass19o692a Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.4211.00.1'
20240528@073059.3564 1cue0bo7hbjec6dsass19o692a Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403752 and bi.ref ='304.4211.00.1' and bi.lordem =1
20240528@073059.3878 1cue0bo7hbjec6dsass19o692a Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.4211.00.1'
20240528@073059.3888 1cue0bo7hbjec6dsass19o692a Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403752 and bi.ref ='304.4211.00.1' and bi.lordem =1
20240528@073059.3895 1cue0bo7hbjec6dsass19o692a Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4521.00.1'
20240528@073059.4038 1cue0bo7hbjec6dsass19o692a Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403752 and bi.ref ='324.4521.00.1' and bi.lordem =3
20240528@073059.4472 1cue0bo7hbjec6dsass19o692a Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4902.00.1'
20240528@073059.4632 1cue0bo7hbjec6dsass19o692a Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403752 and bi.ref ='324.4902.00.1' and bi.lordem =5
20240528@073059.4948 1cue0bo7hbjec6dsass19o692a Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1470.00.1'
20240528@073059.4965 1cue0bo7hbjec6dsass19o692a Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403752 and bi.ref ='324.1470.00.1' and bi.lordem =7
20240528@073059.5298 1cue0bo7hbjec6dsass19o692a Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1470.00.1'
20240528@073059.5310 1cue0bo7hbjec6dsass19o692a Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403752 and bi.ref ='324.1470.00.1' and bi.lordem =7
20240528@073059.5319 1cue0bo7hbjec6dsass19o692a Query : use flama_phc
20240528@073059.5322 1cue0bo7hbjec6dsass19o692a Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240528@073059.5336 1cue0bo7hbjec6dsass19o692a Query : use flama_phc
20240528@073059.5339 1cue0bo7hbjec6dsass19o692a Query : select top 1 1 valor from td where td.ndoc = 39
20240528@073059.5350 1cue0bo7hbjec6dsass19o692a Query : use flama_phc
20240528@073059.5353 1cue0bo7hbjec6dsass19o692a 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')
20240528@073059.5890 tpllisj49bnmsdr4vb39pmph3s Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240528@073059.5903 tpllisj49bnmsdr4vb39pmph3s Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240528@073059.5916 tpllisj49bnmsdr4vb39pmph3s Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='98';
20240528@073059.5953 tpllisj49bnmsdr4vb39pmph3s Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='98';
20240528@073059.5964 tpllisj49bnmsdr4vb39pmph3s Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='98';
20240528@073059.5975 tpllisj49bnmsdr4vb39pmph3s Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='98';
20240528@073059.5985 tpllisj49bnmsdr4vb39pmph3s Query : use flama_phc
20240528@073059.5988 tpllisj49bnmsdr4vb39pmph3s Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240528@073059.6001 tpllisj49bnmsdr4vb39pmph3s Query : use flama_phc
20240528@073059.6004 tpllisj49bnmsdr4vb39pmph3s Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240528@073059.6073 tpllisj49bnmsdr4vb39pmph3s Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1643.00.1'
20240528@073059.6216 tpllisj49bnmsdr4vb39pmph3s Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403754 and bi.ref ='324.1643.00.1' and bi.lordem =1
20240528@073059.6521 tpllisj49bnmsdr4vb39pmph3s Query : use flama_phc
20240528@073059.6525 tpllisj49bnmsdr4vb39pmph3s Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240528@073059.6538 tpllisj49bnmsdr4vb39pmph3s Query : use flama_phc
20240528@073059.6541 tpllisj49bnmsdr4vb39pmph3s Query : select top 1 1 valor from td where td.ndoc = 39
20240528@073059.6551 tpllisj49bnmsdr4vb39pmph3s Query : use flama_phc
20240528@073059.6553 tpllisj49bnmsdr4vb39pmph3s 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')
20240528@073059.7060 7q8164gep30j6to0afj0dc8nmn Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240528@073059.7072 7q8164gep30j6to0afj0dc8nmn Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240528@073059.7086 7q8164gep30j6to0afj0dc8nmn Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='99';
20240528@073059.7121 7q8164gep30j6to0afj0dc8nmn Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='99';
20240528@073059.7132 7q8164gep30j6to0afj0dc8nmn Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='99';
20240528@073059.7143 7q8164gep30j6to0afj0dc8nmn Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='99';
20240528@073059.7155 7q8164gep30j6to0afj0dc8nmn Query : use flama_phc
20240528@073059.7159 7q8164gep30j6to0afj0dc8nmn Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240528@073059.7173 7q8164gep30j6to0afj0dc8nmn Query : use flama_phc
20240528@073059.7176 7q8164gep30j6to0afj0dc8nmn Query : select no, estab,szadrsdesc from szadrs where u_coddest=1246
20240528@073059.7253 7q8164gep30j6to0afj0dc8nmn Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1685.00.1'
20240528@073059.7394 7q8164gep30j6to0afj0dc8nmn Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403767 and bi.ref ='324.1685.00.1' and bi.lordem =1
20240528@073059.7714 7q8164gep30j6to0afj0dc8nmn Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '323.318.09.00'
20240528@073059.7855 7q8164gep30j6to0afj0dc8nmn Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403767 and bi.ref ='323.318.09.00' and bi.lordem =2
20240528@073059.8171 7q8164gep30j6to0afj0dc8nmn Query : use flama_phc
20240528@073059.8174 7q8164gep30j6to0afj0dc8nmn Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240528@073059.8189 7q8164gep30j6to0afj0dc8nmn Query : use flama_phc
20240528@073059.8192 7q8164gep30j6to0afj0dc8nmn Query : select top 1 1 valor from td where td.ndoc = 39
20240528@073059.8203 7q8164gep30j6to0afj0dc8nmn Query : use flama_phc
20240528@073059.8205 7q8164gep30j6to0afj0dc8nmn 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')
20240528@073059.9659 gd8t859m864gp7f69i8l8oecrl Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240528@073059.9672 gd8t859m864gp7f69i8l8oecrl Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240528@073059.9686 gd8t859m864gp7f69i8l8oecrl Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='100';
20240528@073059.9728 gd8t859m864gp7f69i8l8oecrl Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='100';
20240528@073059.9742 gd8t859m864gp7f69i8l8oecrl Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='100';
20240528@073059.9754 gd8t859m864gp7f69i8l8oecrl Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='100';
20240528@073059.9764 gd8t859m864gp7f69i8l8oecrl Query : use flama_phc
20240528@073059.9768 gd8t859m864gp7f69i8l8oecrl Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240528@073059.9783 gd8t859m864gp7f69i8l8oecrl Query : use flama_phc
20240528@073059.9802 gd8t859m864gp7f69i8l8oecrl Query : select no, estab,szadrsdesc from szadrs where u_coddest=170
20240528@073059.9879 gd8t859m864gp7f69i8l8oecrl Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1706.00.1'
20240528@073100.1800 gd8t859m864gp7f69i8l8oecrl Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403769 and bi.ref ='324.1706.00.1' and bi.lordem =1
20240528@073100.3380 gd8t859m864gp7f69i8l8oecrl Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1706.00.1'
20240528@073100.3490 gd8t859m864gp7f69i8l8oecrl Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403769 and bi.ref ='324.1706.00.1' and bi.lordem =2
20240528@073100.6700 gd8t859m864gp7f69i8l8oecrl Query : use flama_phc
20240528@073100.6730 gd8t859m864gp7f69i8l8oecrl Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240528@073100.6860 gd8t859m864gp7f69i8l8oecrl Query : use flama_phc
20240528@073100.6890 gd8t859m864gp7f69i8l8oecrl Query : select top 1 1 valor from td where td.ndoc = 39
20240528@073100.7000 gd8t859m864gp7f69i8l8oecrl Query : use flama_phc
20240528@073100.7030 gd8t859m864gp7f69i8l8oecrl 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')
20240528@073100.1462 1d3l0l8dv4igomm31u8491enur Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240528@073100.1498 1d3l0l8dv4igomm31u8491enur Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240528@073100.1623 1d3l0l8dv4igomm31u8491enur Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='101';
20240528@073100.1820 1d3l0l8dv4igomm31u8491enur Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='101';
20240528@073100.1832 1d3l0l8dv4igomm31u8491enur Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='101';
20240528@073100.1844 1d3l0l8dv4igomm31u8491enur Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='101';
20240528@073100.1853 1d3l0l8dv4igomm31u8491enur Query : use flama_phc
20240528@073100.1856 1d3l0l8dv4igomm31u8491enur Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240528@073100.1869 1d3l0l8dv4igomm31u8491enur Query : use flama_phc
20240528@073100.1872 1d3l0l8dv4igomm31u8491enur Query : select no, estab,szadrsdesc from szadrs where u_coddest=6737
20240528@073100.2021 1d3l0l8dv4igomm31u8491enur Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '328.9106.00.1'
20240528@073100.2318 1d3l0l8dv4igomm31u8491enur Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403774 and bi.ref ='328.9106.00.1' and bi.lordem =1
20240528@073100.2649 1d3l0l8dv4igomm31u8491enur Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '328.9345.00.1'
20240528@073100.2783 1d3l0l8dv4igomm31u8491enur Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2037 and bo.obrano = 2403774 and bi.ref ='328.9345.00.1' and bi.lordem =2
20240528@073100.3092 1d3l0l8dv4igomm31u8491enur Query : use flama_phc
20240528@073100.3095 1d3l0l8dv4igomm31u8491enur Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240528@073100.3108 1d3l0l8dv4igomm31u8491enur Query : use flama_phc
20240528@073100.3110 1d3l0l8dv4igomm31u8491enur Query : select top 1 1 valor from td where td.ndoc = 39
20240528@073100.3120 1d3l0l8dv4igomm31u8491enur Query : use flama_phc
20240528@073100.3123 1d3l0l8dv4igomm31u8491enur 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')
20240528@073100.3655 54haqto68u8n161e7oegl8vns3 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240528@073100.3668 54haqto68u8n161e7oegl8vns3 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240528@073100.3680 54haqto68u8n161e7oegl8vns3 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='102';
