20240719@192022.1742 j61ghnscpu6ob4713amgcbqc07 Query : use flama_phc
20240719@192022.1745 j61ghnscpu6ob4713amgcbqc07 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192022.1756 j61ghnscpu6ob4713amgcbqc07 Query : use flama_phc
20240719@192022.1758 j61ghnscpu6ob4713amgcbqc07 Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240719@192022.1771 j61ghnscpu6ob4713amgcbqc07 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1059';
20240719@192022.1786 j61ghnscpu6ob4713amgcbqc07 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1059';
20240719@192022.2582 9hmgr0ldhrr8bc0csjrk1egs8j Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192022.2596 9hmgr0ldhrr8bc0csjrk1egs8j Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192022.2614 9hmgr0ldhrr8bc0csjrk1egs8j Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1060';
20240719@192022.2656 9hmgr0ldhrr8bc0csjrk1egs8j Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1060';
20240719@192022.2672 9hmgr0ldhrr8bc0csjrk1egs8j Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1060';
20240719@192022.2685 9hmgr0ldhrr8bc0csjrk1egs8j Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1060';
20240719@192022.2702 9hmgr0ldhrr8bc0csjrk1egs8j Query : use flama_phc
20240719@192022.2706 9hmgr0ldhrr8bc0csjrk1egs8j Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192022.2720 9hmgr0ldhrr8bc0csjrk1egs8j Query : use flama_phc
20240719@192022.2722 9hmgr0ldhrr8bc0csjrk1egs8j Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240719@192022.2753 9hmgr0ldhrr8bc0csjrk1egs8j Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.657.00.01'
20240719@192022.2763 9hmgr0ldhrr8bc0csjrk1egs8j Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404824 and bi.ref ='324.657.00.01' and bi.lordem =1
20240719@192022.3075 9hmgr0ldhrr8bc0csjrk1egs8j Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.657.00.01'
20240719@192022.3148 9hmgr0ldhrr8bc0csjrk1egs8j Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404824 and bi.ref ='324.657.00.01' and bi.lordem =1
20240719@192022.3156 9hmgr0ldhrr8bc0csjrk1egs8j Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.657.00.01'
20240719@192022.3166 9hmgr0ldhrr8bc0csjrk1egs8j Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404824 and bi.ref ='324.657.00.01' and bi.lordem =1
20240719@192022.3173 9hmgr0ldhrr8bc0csjrk1egs8j Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.657.00.01'
20240719@192022.3183 9hmgr0ldhrr8bc0csjrk1egs8j Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404824 and bi.ref ='324.657.00.01' and bi.lordem =1
20240719@192022.3190 9hmgr0ldhrr8bc0csjrk1egs8j Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.657.00.01'
20240719@192022.3200 9hmgr0ldhrr8bc0csjrk1egs8j Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404824 and bi.ref ='324.657.00.01' and bi.lordem =1
20240719@192022.3206 9hmgr0ldhrr8bc0csjrk1egs8j Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.657.00.01'
20240719@192022.3216 9hmgr0ldhrr8bc0csjrk1egs8j Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404824 and bi.ref ='324.657.00.01' and bi.lordem =1
20240719@192022.3223 9hmgr0ldhrr8bc0csjrk1egs8j Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.657.00.01'
20240719@192022.3232 9hmgr0ldhrr8bc0csjrk1egs8j Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404824 and bi.ref ='324.657.00.01' and bi.lordem =1
20240719@192022.3240 9hmgr0ldhrr8bc0csjrk1egs8j Query : use flama_phc
20240719@192022.3243 9hmgr0ldhrr8bc0csjrk1egs8j Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192022.3257 9hmgr0ldhrr8bc0csjrk1egs8j Query : use flama_phc
20240719@192022.3259 9hmgr0ldhrr8bc0csjrk1egs8j Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192022.3271 9hmgr0ldhrr8bc0csjrk1egs8j Query : use flama_phc
20240719@192022.3274 9hmgr0ldhrr8bc0csjrk1egs8j 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')
20240719@192022.3293 9hmgr0ldhrr8bc0csjrk1egs8j Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192022.3308 9hmgr0ldhrr8bc0csjrk1egs8j Query : use flama_phc
20240719@192022.3311 9hmgr0ldhrr8bc0csjrk1egs8j Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192022.3322 9hmgr0ldhrr8bc0csjrk1egs8j Query : use flama_phc
20240719@192022.3324 9hmgr0ldhrr8bc0csjrk1egs8j Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240719@192022.3339 9hmgr0ldhrr8bc0csjrk1egs8j Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1060';
20240719@192022.3354 9hmgr0ldhrr8bc0csjrk1egs8j Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1060';
20240719@192022.4203 ivgof788fbfcqj6humgd17cebi Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192022.4217 ivgof788fbfcqj6humgd17cebi Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192022.4236 ivgof788fbfcqj6humgd17cebi Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1061';
20240719@192022.4279 ivgof788fbfcqj6humgd17cebi Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1061';
20240719@192022.4297 ivgof788fbfcqj6humgd17cebi Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1061';
20240719@192022.4312 ivgof788fbfcqj6humgd17cebi Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1061';
20240719@192022.4327 ivgof788fbfcqj6humgd17cebi Query : use flama_phc
20240719@192022.4330 ivgof788fbfcqj6humgd17cebi Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192022.4346 ivgof788fbfcqj6humgd17cebi Query : use flama_phc
20240719@192022.4349 ivgof788fbfcqj6humgd17cebi Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240719@192022.4394 ivgof788fbfcqj6humgd17cebi Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.682.00.01'
20240719@192022.4500 ivgof788fbfcqj6humgd17cebi Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404825 and bi.ref ='324.682.00.01' and bi.lordem =1
20240719@192022.4858 ivgof788fbfcqj6humgd17cebi Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.682.00.01'
20240719@192022.4870 ivgof788fbfcqj6humgd17cebi Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404825 and bi.ref ='324.682.00.01' and bi.lordem =1
20240719@192022.4878 ivgof788fbfcqj6humgd17cebi Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.682.00.01'
20240719@192022.4888 ivgof788fbfcqj6humgd17cebi Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404825 and bi.ref ='324.682.00.01' and bi.lordem =1
20240719@192022.4895 ivgof788fbfcqj6humgd17cebi Query : use flama_phc
20240719@192022.4898 ivgof788fbfcqj6humgd17cebi Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192022.4912 ivgof788fbfcqj6humgd17cebi Query : use flama_phc
20240719@192022.4915 ivgof788fbfcqj6humgd17cebi Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192022.4952 ivgof788fbfcqj6humgd17cebi Query : use flama_phc
20240719@192022.4955 ivgof788fbfcqj6humgd17cebi 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')
20240719@192022.4974 ivgof788fbfcqj6humgd17cebi Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192022.4990 ivgof788fbfcqj6humgd17cebi Query : use flama_phc
20240719@192022.4993 ivgof788fbfcqj6humgd17cebi Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192022.5006 ivgof788fbfcqj6humgd17cebi Query : use flama_phc
20240719@192022.5009 ivgof788fbfcqj6humgd17cebi Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240719@192022.5021 ivgof788fbfcqj6humgd17cebi Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1061';
20240719@192022.5036 ivgof788fbfcqj6humgd17cebi Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1061';
20240719@192022.5555 6ouns21lomk6c4rb1802bd0v44 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192022.5569 6ouns21lomk6c4rb1802bd0v44 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192022.5588 6ouns21lomk6c4rb1802bd0v44 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1062';
20240719@192022.5630 6ouns21lomk6c4rb1802bd0v44 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1062';
20240719@192022.5648 6ouns21lomk6c4rb1802bd0v44 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1062';
20240719@192022.5662 6ouns21lomk6c4rb1802bd0v44 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1062';
20240719@192022.5676 6ouns21lomk6c4rb1802bd0v44 Query : use flama_phc
20240719@192022.5679 6ouns21lomk6c4rb1802bd0v44 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192022.5697 6ouns21lomk6c4rb1802bd0v44 Query : use flama_phc
20240719@192022.5700 6ouns21lomk6c4rb1802bd0v44 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240719@192022.5729 6ouns21lomk6c4rb1802bd0v44 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4161.00.1'
20240719@192022.5833 6ouns21lomk6c4rb1802bd0v44 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404826 and bi.ref ='324.4161.00.1' and bi.lordem =1
20240719@192022.6103 6ouns21lomk6c4rb1802bd0v44 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4161.00.1'
20240719@192022.6114 6ouns21lomk6c4rb1802bd0v44 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404826 and bi.ref ='324.4161.00.1' and bi.lordem =1
20240719@192022.6123 6ouns21lomk6c4rb1802bd0v44 Query : use flama_phc
20240719@192022.6126 6ouns21lomk6c4rb1802bd0v44 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192022.6141 6ouns21lomk6c4rb1802bd0v44 Query : use flama_phc
20240719@192022.6144 6ouns21lomk6c4rb1802bd0v44 Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192022.6155 6ouns21lomk6c4rb1802bd0v44 Query : use flama_phc
20240719@192022.6158 6ouns21lomk6c4rb1802bd0v44 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')
20240719@192022.6178 6ouns21lomk6c4rb1802bd0v44 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192022.6195 6ouns21lomk6c4rb1802bd0v44 Query : use flama_phc
20240719@192022.6198 6ouns21lomk6c4rb1802bd0v44 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192022.6209 6ouns21lomk6c4rb1802bd0v44 Query : use flama_phc
20240719@192022.6212 6ouns21lomk6c4rb1802bd0v44 Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240719@192022.6224 6ouns21lomk6c4rb1802bd0v44 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1062';
20240719@192022.6240 6ouns21lomk6c4rb1802bd0v44 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1062';
20240719@192022.6739 vskbpeca9pvhjl6t41uo7dj84b Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192022.6757 vskbpeca9pvhjl6t41uo7dj84b Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192022.6780 vskbpeca9pvhjl6t41uo7dj84b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1063';
20240719@192022.6822 vskbpeca9pvhjl6t41uo7dj84b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1063';
20240719@192022.6841 vskbpeca9pvhjl6t41uo7dj84b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1063';
20240719@192022.6855 vskbpeca9pvhjl6t41uo7dj84b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1063';
20240719@192022.6870 vskbpeca9pvhjl6t41uo7dj84b Query : use flama_phc
20240719@192022.6873 vskbpeca9pvhjl6t41uo7dj84b Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192022.6889 vskbpeca9pvhjl6t41uo7dj84b Query : use flama_phc
20240719@192022.6892 vskbpeca9pvhjl6t41uo7dj84b Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240719@192022.6922 vskbpeca9pvhjl6t41uo7dj84b 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'
20240719@192022.7029 vskbpeca9pvhjl6t41uo7dj84b Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404827 and bi.ref ='324.4723.00.2' and bi.lordem =1
20240719@192022.7432 vskbpeca9pvhjl6t41uo7dj84b 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'
20240719@192022.7583 vskbpeca9pvhjl6t41uo7dj84b Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404827 and bi.ref ='324.4723.00.2' and bi.lordem =1
20240719@192022.7594 vskbpeca9pvhjl6t41uo7dj84b Query : use flama_phc
20240719@192022.7598 vskbpeca9pvhjl6t41uo7dj84b Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192022.7615 vskbpeca9pvhjl6t41uo7dj84b Query : use flama_phc
20240719@192022.7618 vskbpeca9pvhjl6t41uo7dj84b Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192022.7631 vskbpeca9pvhjl6t41uo7dj84b Query : use flama_phc
20240719@192022.7634 vskbpeca9pvhjl6t41uo7dj84b 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')
20240719@192022.7663 vskbpeca9pvhjl6t41uo7dj84b Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192022.7683 vskbpeca9pvhjl6t41uo7dj84b Query : use flama_phc
20240719@192022.7686 vskbpeca9pvhjl6t41uo7dj84b Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192022.7703 vskbpeca9pvhjl6t41uo7dj84b Query : use flama_phc
20240719@192022.7748 vskbpeca9pvhjl6t41uo7dj84b Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240719@192022.8040 vskbpeca9pvhjl6t41uo7dj84b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1063';
20240719@192022.8082 vskbpeca9pvhjl6t41uo7dj84b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1063';
20240719@192022.9475 2map7t21d45hc1dn80i7n3dffa Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192022.9490 2map7t21d45hc1dn80i7n3dffa Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192022.9511 2map7t21d45hc1dn80i7n3dffa Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1064';
20240719@192022.9552 2map7t21d45hc1dn80i7n3dffa Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1064';
20240719@192022.9570 2map7t21d45hc1dn80i7n3dffa Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1064';
20240719@192022.9592 2map7t21d45hc1dn80i7n3dffa Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1064';
20240719@192022.9608 2map7t21d45hc1dn80i7n3dffa Query : use flama_phc
20240719@192022.9612 2map7t21d45hc1dn80i7n3dffa Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192022.9628 2map7t21d45hc1dn80i7n3dffa Query : use flama_phc
20240719@192022.9631 2map7t21d45hc1dn80i7n3dffa Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240719@192022.9660 2map7t21d45hc1dn80i7n3dffa 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'
20240719@192022.9764 2map7t21d45hc1dn80i7n3dffa Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404828 and bi.ref ='324.4840.00.1' and bi.lordem =1
20240719@192023.5400 2map7t21d45hc1dn80i7n3dffa 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'
20240719@192023.6600 2map7t21d45hc1dn80i7n3dffa Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404828 and bi.ref ='324.4840.00.1' and bi.lordem =1
20240719@192023.7300 2map7t21d45hc1dn80i7n3dffa Query : use flama_phc
20240719@192023.7600 2map7t21d45hc1dn80i7n3dffa Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192023.1530 2map7t21d45hc1dn80i7n3dffa Query : use flama_phc
20240719@192023.1580 2map7t21d45hc1dn80i7n3dffa Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192023.1700 2map7t21d45hc1dn80i7n3dffa Query : use flama_phc
20240719@192023.1730 2map7t21d45hc1dn80i7n3dffa 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')
20240719@192023.1920 2map7t21d45hc1dn80i7n3dffa Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192023.2090 2map7t21d45hc1dn80i7n3dffa Query : use flama_phc
20240719@192023.2130 2map7t21d45hc1dn80i7n3dffa Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192023.2250 2map7t21d45hc1dn80i7n3dffa Query : use flama_phc
20240719@192023.2270 2map7t21d45hc1dn80i7n3dffa Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240719@192023.2390 2map7t21d45hc1dn80i7n3dffa Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1064';
20240719@192023.2550 2map7t21d45hc1dn80i7n3dffa Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1064';
20240719@192023.8250 kdepc6b269ol2s5ej1q1qv7j5h Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192023.8390 kdepc6b269ol2s5ej1q1qv7j5h Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192023.8610 kdepc6b269ol2s5ej1q1qv7j5h Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1065';
20240719@192023.9020 kdepc6b269ol2s5ej1q1qv7j5h Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1065';
20240719@192023.9200 kdepc6b269ol2s5ej1q1qv7j5h Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1065';
20240719@192023.9330 kdepc6b269ol2s5ej1q1qv7j5h Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1065';
20240719@192023.9480 kdepc6b269ol2s5ej1q1qv7j5h Query : use flama_phc
20240719@192023.9520 kdepc6b269ol2s5ej1q1qv7j5h Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192023.9710 kdepc6b269ol2s5ej1q1qv7j5h Query : use flama_phc
20240719@192023.9740 kdepc6b269ol2s5ej1q1qv7j5h Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240719@192023.1004 kdepc6b269ol2s5ej1q1qv7j5h 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'
20240719@192023.1101 kdepc6b269ol2s5ej1q1qv7j5h Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404829 and bi.ref ='324.692.00.01' and bi.lordem =1
20240719@192023.1366 kdepc6b269ol2s5ej1q1qv7j5h 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'
20240719@192023.1377 kdepc6b269ol2s5ej1q1qv7j5h Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404829 and bi.ref ='324.692.00.01' and bi.lordem =1
20240719@192023.1384 kdepc6b269ol2s5ej1q1qv7j5h 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'
20240719@192023.1393 kdepc6b269ol2s5ej1q1qv7j5h Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404829 and bi.ref ='324.692.00.01' and bi.lordem =1
20240719@192023.1401 kdepc6b269ol2s5ej1q1qv7j5h 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'
20240719@192023.1413 kdepc6b269ol2s5ej1q1qv7j5h Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404829 and bi.ref ='324.692.00.01' and bi.lordem =1
20240719@192023.1419 kdepc6b269ol2s5ej1q1qv7j5h 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'
20240719@192023.1429 kdepc6b269ol2s5ej1q1qv7j5h Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404829 and bi.ref ='324.692.00.01' and bi.lordem =1
20240719@192023.1436 kdepc6b269ol2s5ej1q1qv7j5h 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'
20240719@192023.1446 kdepc6b269ol2s5ej1q1qv7j5h Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404829 and bi.ref ='324.692.00.01' and bi.lordem =1
20240719@192023.1453 kdepc6b269ol2s5ej1q1qv7j5h 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'
20240719@192023.1462 kdepc6b269ol2s5ej1q1qv7j5h Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404829 and bi.ref ='324.692.00.01' and bi.lordem =1
20240719@192023.1470 kdepc6b269ol2s5ej1q1qv7j5h Query : use flama_phc
20240719@192023.1473 kdepc6b269ol2s5ej1q1qv7j5h Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192023.1486 kdepc6b269ol2s5ej1q1qv7j5h Query : use flama_phc
20240719@192023.1489 kdepc6b269ol2s5ej1q1qv7j5h Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192023.1499 kdepc6b269ol2s5ej1q1qv7j5h Query : use flama_phc
20240719@192023.1502 kdepc6b269ol2s5ej1q1qv7j5h 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')
20240719@192023.1535 kdepc6b269ol2s5ej1q1qv7j5h Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192023.1550 kdepc6b269ol2s5ej1q1qv7j5h Query : use flama_phc
20240719@192023.1553 kdepc6b269ol2s5ej1q1qv7j5h Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192023.1566 kdepc6b269ol2s5ej1q1qv7j5h Query : use flama_phc
20240719@192023.1568 kdepc6b269ol2s5ej1q1qv7j5h Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240719@192023.1580 kdepc6b269ol2s5ej1q1qv7j5h Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1065';
20240719@192023.1600 kdepc6b269ol2s5ej1q1qv7j5h Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1065';
20240719@192023.2097 qejfvav621cqee29pc470qgc6e Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192023.2112 qejfvav621cqee29pc470qgc6e Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192023.2133 qejfvav621cqee29pc470qgc6e Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1066';
20240719@192023.2173 qejfvav621cqee29pc470qgc6e Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1066';
20240719@192023.2190 qejfvav621cqee29pc470qgc6e Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1066';
20240719@192023.2203 qejfvav621cqee29pc470qgc6e Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1066';
20240719@192023.2218 qejfvav621cqee29pc470qgc6e Query : use flama_phc
20240719@192023.2222 qejfvav621cqee29pc470qgc6e Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192023.2237 qejfvav621cqee29pc470qgc6e Query : use flama_phc
20240719@192023.2239 qejfvav621cqee29pc470qgc6e Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240719@192023.2268 qejfvav621cqee29pc470qgc6e 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'
20240719@192023.2279 qejfvav621cqee29pc470qgc6e Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404830 and bi.ref ='324.692.00.01' and bi.lordem =1
20240719@192023.2570 qejfvav621cqee29pc470qgc6e 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'
20240719@192023.2581 qejfvav621cqee29pc470qgc6e Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404830 and bi.ref ='324.692.00.01' and bi.lordem =1
20240719@192023.2587 qejfvav621cqee29pc470qgc6e 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'
20240719@192023.2597 qejfvav621cqee29pc470qgc6e Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404830 and bi.ref ='324.692.00.01' and bi.lordem =1
20240719@192023.2604 qejfvav621cqee29pc470qgc6e 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'
20240719@192023.2613 qejfvav621cqee29pc470qgc6e Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404830 and bi.ref ='324.692.00.01' and bi.lordem =1
20240719@192023.2620 qejfvav621cqee29pc470qgc6e 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'
20240719@192023.2629 qejfvav621cqee29pc470qgc6e Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404830 and bi.ref ='324.692.00.01' and bi.lordem =1
20240719@192023.2636 qejfvav621cqee29pc470qgc6e 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'
20240719@192023.2645 qejfvav621cqee29pc470qgc6e Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404830 and bi.ref ='324.692.00.01' and bi.lordem =1
20240719@192023.2653 qejfvav621cqee29pc470qgc6e 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'
20240719@192023.2664 qejfvav621cqee29pc470qgc6e Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404830 and bi.ref ='324.692.00.01' and bi.lordem =1
20240719@192023.2672 qejfvav621cqee29pc470qgc6e Query : use flama_phc
20240719@192023.2675 qejfvav621cqee29pc470qgc6e Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192023.2687 qejfvav621cqee29pc470qgc6e Query : use flama_phc
20240719@192023.2690 qejfvav621cqee29pc470qgc6e Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192023.2701 qejfvav621cqee29pc470qgc6e Query : use flama_phc
20240719@192023.2704 qejfvav621cqee29pc470qgc6e 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')
20240719@192023.2722 qejfvav621cqee29pc470qgc6e Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192023.2737 qejfvav621cqee29pc470qgc6e Query : use flama_phc
20240719@192023.2740 qejfvav621cqee29pc470qgc6e Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192023.2750 qejfvav621cqee29pc470qgc6e Query : use flama_phc
20240719@192023.2753 qejfvav621cqee29pc470qgc6e Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240719@192023.2765 qejfvav621cqee29pc470qgc6e Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1066';
20240719@192023.2780 qejfvav621cqee29pc470qgc6e Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1066';
20240719@192023.3255 tqjnqdma8agvmtdg99t8r8ujeo Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192023.3269 tqjnqdma8agvmtdg99t8r8ujeo Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192023.3289 tqjnqdma8agvmtdg99t8r8ujeo Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1067';
20240719@192023.3335 tqjnqdma8agvmtdg99t8r8ujeo Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1067';
20240719@192023.3354 tqjnqdma8agvmtdg99t8r8ujeo Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1067';
20240719@192023.3371 tqjnqdma8agvmtdg99t8r8ujeo Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1067';
20240719@192023.3387 tqjnqdma8agvmtdg99t8r8ujeo Query : use flama_phc
20240719@192023.3390 tqjnqdma8agvmtdg99t8r8ujeo Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192023.3406 tqjnqdma8agvmtdg99t8r8ujeo Query : use flama_phc
20240719@192023.3410 tqjnqdma8agvmtdg99t8r8ujeo Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240719@192023.3439 tqjnqdma8agvmtdg99t8r8ujeo Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.946.00.01'
20240719@192023.3552 tqjnqdma8agvmtdg99t8r8ujeo Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404831 and bi.ref ='324.946.00.01' and bi.lordem =1
20240719@192023.3851 tqjnqdma8agvmtdg99t8r8ujeo Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.946.00.01'
20240719@192023.3862 tqjnqdma8agvmtdg99t8r8ujeo Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404831 and bi.ref ='324.946.00.01' and bi.lordem =1
20240719@192023.3870 tqjnqdma8agvmtdg99t8r8ujeo Query : use flama_phc
20240719@192023.3875 tqjnqdma8agvmtdg99t8r8ujeo Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192023.3888 tqjnqdma8agvmtdg99t8r8ujeo Query : use flama_phc
20240719@192023.3891 tqjnqdma8agvmtdg99t8r8ujeo Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192023.3902 tqjnqdma8agvmtdg99t8r8ujeo Query : use flama_phc
20240719@192023.3904 tqjnqdma8agvmtdg99t8r8ujeo 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')
20240719@192023.3923 tqjnqdma8agvmtdg99t8r8ujeo Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192023.3939 tqjnqdma8agvmtdg99t8r8ujeo Query : use flama_phc
20240719@192023.3942 tqjnqdma8agvmtdg99t8r8ujeo Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192023.3953 tqjnqdma8agvmtdg99t8r8ujeo Query : use flama_phc
20240719@192023.3956 tqjnqdma8agvmtdg99t8r8ujeo Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240719@192023.3967 tqjnqdma8agvmtdg99t8r8ujeo Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1067';
20240719@192023.3986 tqjnqdma8agvmtdg99t8r8ujeo Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1067';
20240719@192023.4782 92nl7f1lc7c85u3t8p9r1erfvo Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192023.4798 92nl7f1lc7c85u3t8p9r1erfvo Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192023.4819 92nl7f1lc7c85u3t8p9r1erfvo Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1068';
20240719@192023.4949 92nl7f1lc7c85u3t8p9r1erfvo Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1068';
20240719@192023.5032 92nl7f1lc7c85u3t8p9r1erfvo Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1068';
20240719@192023.5089 92nl7f1lc7c85u3t8p9r1erfvo Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1068';
20240719@192023.5161 92nl7f1lc7c85u3t8p9r1erfvo Query : use flama_phc
20240719@192023.5166 92nl7f1lc7c85u3t8p9r1erfvo Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192023.5182 92nl7f1lc7c85u3t8p9r1erfvo Query : use flama_phc
20240719@192023.5185 92nl7f1lc7c85u3t8p9r1erfvo Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240719@192023.5245 92nl7f1lc7c85u3t8p9r1erfvo Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.727.00.01'
20240719@192023.5465 92nl7f1lc7c85u3t8p9r1erfvo Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404832 and bi.ref ='324.727.00.01' and bi.lordem =1
20240719@192023.5857 92nl7f1lc7c85u3t8p9r1erfvo Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.727.00.01'
20240719@192023.5869 92nl7f1lc7c85u3t8p9r1erfvo Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404832 and bi.ref ='324.727.00.01' and bi.lordem =1
20240719@192023.5876 92nl7f1lc7c85u3t8p9r1erfvo Query : use flama_phc
20240719@192023.5879 92nl7f1lc7c85u3t8p9r1erfvo Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192023.5894 92nl7f1lc7c85u3t8p9r1erfvo Query : use flama_phc
20240719@192023.5897 92nl7f1lc7c85u3t8p9r1erfvo Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192023.5908 92nl7f1lc7c85u3t8p9r1erfvo Query : use flama_phc
20240719@192023.5911 92nl7f1lc7c85u3t8p9r1erfvo 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')
20240719@192023.5929 92nl7f1lc7c85u3t8p9r1erfvo Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192023.5961 92nl7f1lc7c85u3t8p9r1erfvo Query : use flama_phc
20240719@192023.5965 92nl7f1lc7c85u3t8p9r1erfvo Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192023.5977 92nl7f1lc7c85u3t8p9r1erfvo Query : use flama_phc
20240719@192023.5979 92nl7f1lc7c85u3t8p9r1erfvo Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240719@192023.5990 92nl7f1lc7c85u3t8p9r1erfvo Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1068';
20240719@192023.6005 92nl7f1lc7c85u3t8p9r1erfvo Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1068';
20240719@192023.6542 u8m8luch8ilir9hehed0sg3vof Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192023.6560 u8m8luch8ilir9hehed0sg3vof Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192023.6581 u8m8luch8ilir9hehed0sg3vof Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1069';
20240719@192023.6625 u8m8luch8ilir9hehed0sg3vof Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1069';
20240719@192023.6643 u8m8luch8ilir9hehed0sg3vof Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1069';
20240719@192023.6659 u8m8luch8ilir9hehed0sg3vof Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1069';
20240719@192023.6675 u8m8luch8ilir9hehed0sg3vof Query : use flama_phc
20240719@192023.6677 u8m8luch8ilir9hehed0sg3vof Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192023.6693 u8m8luch8ilir9hehed0sg3vof Query : use flama_phc
20240719@192023.6696 u8m8luch8ilir9hehed0sg3vof Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240719@192023.6728 u8m8luch8ilir9hehed0sg3vof Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.938.00.01'
20240719@192023.6832 u8m8luch8ilir9hehed0sg3vof Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404833 and bi.ref ='324.938.00.01' and bi.lordem =1
20240719@192023.7112 u8m8luch8ilir9hehed0sg3vof Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.938.00.01'
20240719@192023.7123 u8m8luch8ilir9hehed0sg3vof Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404833 and bi.ref ='324.938.00.01' and bi.lordem =1
20240719@192023.7131 u8m8luch8ilir9hehed0sg3vof Query : use flama_phc
20240719@192023.7134 u8m8luch8ilir9hehed0sg3vof Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192023.7148 u8m8luch8ilir9hehed0sg3vof Query : use flama_phc
20240719@192023.7151 u8m8luch8ilir9hehed0sg3vof Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192023.7162 u8m8luch8ilir9hehed0sg3vof Query : use flama_phc
20240719@192023.7165 u8m8luch8ilir9hehed0sg3vof 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')
20240719@192023.7184 u8m8luch8ilir9hehed0sg3vof Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192023.7201 u8m8luch8ilir9hehed0sg3vof Query : use flama_phc
20240719@192023.7204 u8m8luch8ilir9hehed0sg3vof Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192023.7215 u8m8luch8ilir9hehed0sg3vof Query : use flama_phc
20240719@192023.7217 u8m8luch8ilir9hehed0sg3vof Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240719@192023.7230 u8m8luch8ilir9hehed0sg3vof Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1069';
20240719@192023.7245 u8m8luch8ilir9hehed0sg3vof Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1069';
20240719@192023.7738 4ou6s901as018134eah8fek11a Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192023.7752 4ou6s901as018134eah8fek11a Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192023.7774 4ou6s901as018134eah8fek11a Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1070';
20240719@192023.7819 4ou6s901as018134eah8fek11a Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1070';
20240719@192023.7837 4ou6s901as018134eah8fek11a Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1070';
20240719@192023.7855 4ou6s901as018134eah8fek11a Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1070';
20240719@192023.7871 4ou6s901as018134eah8fek11a Query : use flama_phc
20240719@192023.7875 4ou6s901as018134eah8fek11a Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192023.7892 4ou6s901as018134eah8fek11a Query : use flama_phc
20240719@192023.7896 4ou6s901as018134eah8fek11a Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240719@192023.7928 4ou6s901as018134eah8fek11a Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.945.00.01'
20240719@192023.8040 4ou6s901as018134eah8fek11a Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404834 and bi.ref ='324.945.00.01' and bi.lordem =1
20240719@192023.8312 4ou6s901as018134eah8fek11a Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.945.00.01'
20240719@192023.8323 4ou6s901as018134eah8fek11a Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404834 and bi.ref ='324.945.00.01' and bi.lordem =1
20240719@192023.8331 4ou6s901as018134eah8fek11a Query : use flama_phc
20240719@192023.8335 4ou6s901as018134eah8fek11a Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192023.8349 4ou6s901as018134eah8fek11a Query : use flama_phc
20240719@192023.8352 4ou6s901as018134eah8fek11a Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192023.8363 4ou6s901as018134eah8fek11a Query : use flama_phc
20240719@192023.8366 4ou6s901as018134eah8fek11a 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')
20240719@192023.8385 4ou6s901as018134eah8fek11a Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192023.8402 4ou6s901as018134eah8fek11a Query : use flama_phc
20240719@192023.8406 4ou6s901as018134eah8fek11a Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192023.8418 4ou6s901as018134eah8fek11a Query : use flama_phc
20240719@192023.8421 4ou6s901as018134eah8fek11a Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240719@192023.8433 4ou6s901as018134eah8fek11a Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1070';
20240719@192023.8451 4ou6s901as018134eah8fek11a Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1070';
20240719@192023.8938 5es7ngfmrjd6klre44lluv0lgq Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192023.8952 5es7ngfmrjd6klre44lluv0lgq Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192023.8974 5es7ngfmrjd6klre44lluv0lgq Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1071';
20240719@192023.9017 5es7ngfmrjd6klre44lluv0lgq Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1071';
20240719@192023.9034 5es7ngfmrjd6klre44lluv0lgq Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1071';
20240719@192023.9047 5es7ngfmrjd6klre44lluv0lgq Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1071';
20240719@192023.9062 5es7ngfmrjd6klre44lluv0lgq Query : use flama_phc
20240719@192023.9065 5es7ngfmrjd6klre44lluv0lgq Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192023.9080 5es7ngfmrjd6klre44lluv0lgq Query : use flama_phc
20240719@192023.9083 5es7ngfmrjd6klre44lluv0lgq Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240719@192023.9119 5es7ngfmrjd6klre44lluv0lgq Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.945.00.01'
20240719@192023.9131 5es7ngfmrjd6klre44lluv0lgq Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404835 and bi.ref ='324.945.00.01' and bi.lordem =1
20240719@192023.9415 5es7ngfmrjd6klre44lluv0lgq Query : use flama_phc
20240719@192023.9418 5es7ngfmrjd6klre44lluv0lgq Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192023.9431 5es7ngfmrjd6klre44lluv0lgq Query : use flama_phc
20240719@192023.9434 5es7ngfmrjd6klre44lluv0lgq Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192023.9445 5es7ngfmrjd6klre44lluv0lgq Query : use flama_phc
20240719@192023.9447 5es7ngfmrjd6klre44lluv0lgq 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')
20240719@192023.9467 5es7ngfmrjd6klre44lluv0lgq Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192023.9482 5es7ngfmrjd6klre44lluv0lgq Query : use flama_phc
20240719@192023.9485 5es7ngfmrjd6klre44lluv0lgq Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192023.9496 5es7ngfmrjd6klre44lluv0lgq Query : use flama_phc
20240719@192023.9499 5es7ngfmrjd6klre44lluv0lgq Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240719@192023.9510 5es7ngfmrjd6klre44lluv0lgq Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1071';
20240719@192023.9525 5es7ngfmrjd6klre44lluv0lgq Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1071';
20240719@192024.1094 lrehdjrhq20ppd63740vofaep7 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192024.1109 lrehdjrhq20ppd63740vofaep7 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192024.1129 lrehdjrhq20ppd63740vofaep7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1072';
20240719@192024.1172 lrehdjrhq20ppd63740vofaep7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1072';
20240719@192024.1189 lrehdjrhq20ppd63740vofaep7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1072';
20240719@192024.1203 lrehdjrhq20ppd63740vofaep7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1072';
20240719@192024.1217 lrehdjrhq20ppd63740vofaep7 Query : use flama_phc
20240719@192024.1221 lrehdjrhq20ppd63740vofaep7 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192024.1235 lrehdjrhq20ppd63740vofaep7 Query : use flama_phc
20240719@192024.1239 lrehdjrhq20ppd63740vofaep7 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240719@192024.1331 lrehdjrhq20ppd63740vofaep7 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'
20240719@192024.1344 lrehdjrhq20ppd63740vofaep7 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404836 and bi.ref ='324.4751.00.1' and bi.lordem =1
20240719@192024.1617 lrehdjrhq20ppd63740vofaep7 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'
20240719@192024.1628 lrehdjrhq20ppd63740vofaep7 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404836 and bi.ref ='324.4751.00.1' and bi.lordem =1
20240719@192024.1635 lrehdjrhq20ppd63740vofaep7 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'
20240719@192024.1645 lrehdjrhq20ppd63740vofaep7 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404836 and bi.ref ='324.4751.00.1' and bi.lordem =1
20240719@192024.1652 lrehdjrhq20ppd63740vofaep7 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'
20240719@192024.1662 lrehdjrhq20ppd63740vofaep7 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404836 and bi.ref ='324.4751.00.1' and bi.lordem =1
20240719@192024.1669 lrehdjrhq20ppd63740vofaep7 Query : use flama_phc
20240719@192024.1673 lrehdjrhq20ppd63740vofaep7 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192024.1685 lrehdjrhq20ppd63740vofaep7 Query : use flama_phc
20240719@192024.1688 lrehdjrhq20ppd63740vofaep7 Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192024.1699 lrehdjrhq20ppd63740vofaep7 Query : use flama_phc
20240719@192024.1701 lrehdjrhq20ppd63740vofaep7 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')
20240719@192024.1730 lrehdjrhq20ppd63740vofaep7 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192024.1745 lrehdjrhq20ppd63740vofaep7 Query : use flama_phc
20240719@192024.1748 lrehdjrhq20ppd63740vofaep7 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192024.1759 lrehdjrhq20ppd63740vofaep7 Query : use flama_phc
20240719@192024.1762 lrehdjrhq20ppd63740vofaep7 Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240719@192024.1775 lrehdjrhq20ppd63740vofaep7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1072';
20240719@192024.1792 lrehdjrhq20ppd63740vofaep7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1072';
20240719@192024.2334 o56hb7msq5pfovilvn0dd3ri26 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192024.2347 o56hb7msq5pfovilvn0dd3ri26 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192024.2367 o56hb7msq5pfovilvn0dd3ri26 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1073';
20240719@192024.2412 o56hb7msq5pfovilvn0dd3ri26 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1073';
20240719@192024.2429 o56hb7msq5pfovilvn0dd3ri26 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1073';
20240719@192024.2443 o56hb7msq5pfovilvn0dd3ri26 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1073';
20240719@192024.2458 o56hb7msq5pfovilvn0dd3ri26 Query : use flama_phc
20240719@192024.2462 o56hb7msq5pfovilvn0dd3ri26 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192024.2479 o56hb7msq5pfovilvn0dd3ri26 Query : use flama_phc
20240719@192024.2482 o56hb7msq5pfovilvn0dd3ri26 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240719@192024.2513 o56hb7msq5pfovilvn0dd3ri26 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'
20240719@192024.2620 o56hb7msq5pfovilvn0dd3ri26 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404837 and bi.ref ='324.4906.00.1' and bi.lordem =1
20240719@192024.2883 o56hb7msq5pfovilvn0dd3ri26 Query : use flama_phc
20240719@192024.2887 o56hb7msq5pfovilvn0dd3ri26 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192024.2902 o56hb7msq5pfovilvn0dd3ri26 Query : use flama_phc
20240719@192024.2905 o56hb7msq5pfovilvn0dd3ri26 Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192024.2917 o56hb7msq5pfovilvn0dd3ri26 Query : use flama_phc
20240719@192024.2920 o56hb7msq5pfovilvn0dd3ri26 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')
20240719@192024.2939 o56hb7msq5pfovilvn0dd3ri26 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192024.2956 o56hb7msq5pfovilvn0dd3ri26 Query : use flama_phc
20240719@192024.2959 o56hb7msq5pfovilvn0dd3ri26 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192024.2970 o56hb7msq5pfovilvn0dd3ri26 Query : use flama_phc
20240719@192024.2973 o56hb7msq5pfovilvn0dd3ri26 Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240719@192024.2985 o56hb7msq5pfovilvn0dd3ri26 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1073';
20240719@192024.3001 o56hb7msq5pfovilvn0dd3ri26 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1073';
20240719@192024.3568 i7pq5vcu30dkanqte5kq4v5amd Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192024.3582 i7pq5vcu30dkanqte5kq4v5amd Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192024.3603 i7pq5vcu30dkanqte5kq4v5amd Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1074';
20240719@192024.3645 i7pq5vcu30dkanqte5kq4v5amd Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1074';
20240719@192024.3663 i7pq5vcu30dkanqte5kq4v5amd Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1074';
20240719@192024.3676 i7pq5vcu30dkanqte5kq4v5amd Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1074';
20240719@192024.3694 i7pq5vcu30dkanqte5kq4v5amd Query : use flama_phc
20240719@192024.3698 i7pq5vcu30dkanqte5kq4v5amd Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192024.3715 i7pq5vcu30dkanqte5kq4v5amd Query : use flama_phc
20240719@192024.3718 i7pq5vcu30dkanqte5kq4v5amd Query : select no, estab,szadrsdesc from szadrs where u_coddest=6737
20240719@192024.3790 i7pq5vcu30dkanqte5kq4v5amd 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'
20240719@192024.3896 i7pq5vcu30dkanqte5kq4v5amd Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404838 and bi.ref ='328.9106.00.1' and bi.lordem =1
20240719@192024.4347 i7pq5vcu30dkanqte5kq4v5amd Query : use flama_phc
20240719@192024.4351 i7pq5vcu30dkanqte5kq4v5amd Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192024.4367 i7pq5vcu30dkanqte5kq4v5amd Query : use flama_phc
20240719@192024.4397 i7pq5vcu30dkanqte5kq4v5amd Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192024.4540 i7pq5vcu30dkanqte5kq4v5amd Query : use flama_phc
20240719@192024.4554 i7pq5vcu30dkanqte5kq4v5amd 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')
20240719@192024.4662 i7pq5vcu30dkanqte5kq4v5amd Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192024.4678 i7pq5vcu30dkanqte5kq4v5amd Query : use flama_phc
20240719@192024.4722 i7pq5vcu30dkanqte5kq4v5amd Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192024.4743 i7pq5vcu30dkanqte5kq4v5amd Query : use flama_phc
20240719@192024.4746 i7pq5vcu30dkanqte5kq4v5amd Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-plaza large formats rainha'
20240719@192024.4758 i7pq5vcu30dkanqte5kq4v5amd Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1074';
20240719@192024.4810 i7pq5vcu30dkanqte5kq4v5amd Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1074';
20240719@192024.5308 i6ohoqk4ibiejaj358ggjusf9t Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192024.5322 i6ohoqk4ibiejaj358ggjusf9t Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192024.5343 i6ohoqk4ibiejaj358ggjusf9t Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1075';
20240719@192024.5386 i6ohoqk4ibiejaj358ggjusf9t Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1075';
20240719@192024.5404 i6ohoqk4ibiejaj358ggjusf9t Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1075';
20240719@192024.5417 i6ohoqk4ibiejaj358ggjusf9t Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1075';
20240719@192024.5431 i6ohoqk4ibiejaj358ggjusf9t Query : use flama_phc
20240719@192024.5434 i6ohoqk4ibiejaj358ggjusf9t Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192024.5449 i6ohoqk4ibiejaj358ggjusf9t Query : use flama_phc
20240719@192024.5453 i6ohoqk4ibiejaj358ggjusf9t Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240719@192024.5483 i6ohoqk4ibiejaj358ggjusf9t Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4161.00.1'
20240719@192024.5494 i6ohoqk4ibiejaj358ggjusf9t Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404839 and bi.ref ='324.4161.00.1' and bi.lordem =1
20240719@192024.5973 i6ohoqk4ibiejaj358ggjusf9t Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4161.00.1'
20240719@192024.5985 i6ohoqk4ibiejaj358ggjusf9t Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404839 and bi.ref ='324.4161.00.1' and bi.lordem =1
20240719@192024.5992 i6ohoqk4ibiejaj358ggjusf9t Query : use flama_phc
20240719@192024.5996 i6ohoqk4ibiejaj358ggjusf9t Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192024.6009 i6ohoqk4ibiejaj358ggjusf9t Query : use flama_phc
20240719@192024.6013 i6ohoqk4ibiejaj358ggjusf9t Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192024.6023 i6ohoqk4ibiejaj358ggjusf9t Query : use flama_phc
20240719@192024.6026 i6ohoqk4ibiejaj358ggjusf9t 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')
20240719@192024.6046 i6ohoqk4ibiejaj358ggjusf9t Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192024.6062 i6ohoqk4ibiejaj358ggjusf9t Query : use flama_phc
20240719@192024.6065 i6ohoqk4ibiejaj358ggjusf9t Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192024.6076 i6ohoqk4ibiejaj358ggjusf9t Query : use flama_phc
20240719@192024.6078 i6ohoqk4ibiejaj358ggjusf9t Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240719@192024.6090 i6ohoqk4ibiejaj358ggjusf9t Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1075';
20240719@192024.6106 i6ohoqk4ibiejaj358ggjusf9t Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1075';
20240719@192024.6777 uc21bp4cov0gr74rq1ekuv4thc Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192024.6791 uc21bp4cov0gr74rq1ekuv4thc Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192024.6810 uc21bp4cov0gr74rq1ekuv4thc Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1076';
20240719@192024.6851 uc21bp4cov0gr74rq1ekuv4thc Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1076';
20240719@192024.6868 uc21bp4cov0gr74rq1ekuv4thc Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1076';
20240719@192024.6880 uc21bp4cov0gr74rq1ekuv4thc Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1076';
20240719@192024.6895 uc21bp4cov0gr74rq1ekuv4thc Query : use flama_phc
20240719@192024.6898 uc21bp4cov0gr74rq1ekuv4thc Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192024.6913 uc21bp4cov0gr74rq1ekuv4thc Query : use flama_phc
20240719@192024.6915 uc21bp4cov0gr74rq1ekuv4thc Query : select no, estab,szadrsdesc from szadrs where u_coddest=2211
20240719@192024.6982 uc21bp4cov0gr74rq1ekuv4thc Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '327.8410.00.1'
20240719@192024.7082 uc21bp4cov0gr74rq1ekuv4thc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404840 and bi.ref ='327.8410.00.1' and bi.lordem =1
20240719@192024.7354 uc21bp4cov0gr74rq1ekuv4thc Query : use flama_phc
20240719@192024.7357 uc21bp4cov0gr74rq1ekuv4thc Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192024.7371 uc21bp4cov0gr74rq1ekuv4thc Query : use flama_phc
20240719@192024.7374 uc21bp4cov0gr74rq1ekuv4thc Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192024.7385 uc21bp4cov0gr74rq1ekuv4thc Query : use flama_phc
20240719@192024.7388 uc21bp4cov0gr74rq1ekuv4thc 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')
20240719@192024.7405 uc21bp4cov0gr74rq1ekuv4thc Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192024.7421 uc21bp4cov0gr74rq1ekuv4thc Query : use flama_phc
20240719@192024.7424 uc21bp4cov0gr74rq1ekuv4thc Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192024.7435 uc21bp4cov0gr74rq1ekuv4thc Query : use flama_phc
20240719@192024.7438 uc21bp4cov0gr74rq1ekuv4thc Query : select szadrsstamp valor from szadrs where szadrsdesc='m.miranda electrodomÉsticos, lda.'
20240719@192024.7450 uc21bp4cov0gr74rq1ekuv4thc Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1076';
20240719@192024.7465 uc21bp4cov0gr74rq1ekuv4thc Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1076';
20240719@192024.7957 e0tk0flbb34sihnjq8g2num3kr Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192024.7971 e0tk0flbb34sihnjq8g2num3kr Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192024.7990 e0tk0flbb34sihnjq8g2num3kr Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1077';
20240719@192024.8035 e0tk0flbb34sihnjq8g2num3kr Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1077';
20240719@192024.8052 e0tk0flbb34sihnjq8g2num3kr Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1077';
20240719@192024.8067 e0tk0flbb34sihnjq8g2num3kr Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1077';
20240719@192024.8081 e0tk0flbb34sihnjq8g2num3kr Query : use flama_phc
20240719@192024.8084 e0tk0flbb34sihnjq8g2num3kr Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192024.8101 e0tk0flbb34sihnjq8g2num3kr Query : use flama_phc
20240719@192024.8103 e0tk0flbb34sihnjq8g2num3kr Query : select no, estab,szadrsdesc from szadrs where u_coddest=8748
20240719@192024.8133 e0tk0flbb34sihnjq8g2num3kr Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4970.00.1'
20240719@192024.8233 e0tk0flbb34sihnjq8g2num3kr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404841 and bi.ref ='324.4970.00.1' and bi.lordem =1
20240719@192024.8600 e0tk0flbb34sihnjq8g2num3kr Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.727.00.01'
20240719@192024.8611 e0tk0flbb34sihnjq8g2num3kr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404841 and bi.ref ='324.727.00.01' and bi.lordem =2
20240719@192024.9041 e0tk0flbb34sihnjq8g2num3kr Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1416.00.1'
20240719@192024.9632 e0tk0flbb34sihnjq8g2num3kr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404841 and bi.ref ='324.1416.00.1' and bi.lordem =3
20240719@192025.2200 e0tk0flbb34sihnjq8g2num3kr Query : use flama_phc
20240719@192025.2230 e0tk0flbb34sihnjq8g2num3kr Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192025.2370 e0tk0flbb34sihnjq8g2num3kr Query : use flama_phc
20240719@192025.2400 e0tk0flbb34sihnjq8g2num3kr Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192025.2500 e0tk0flbb34sihnjq8g2num3kr Query : use flama_phc
20240719@192025.2530 e0tk0flbb34sihnjq8g2num3kr 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')
20240719@192025.2740 e0tk0flbb34sihnjq8g2num3kr Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192025.2910 e0tk0flbb34sihnjq8g2num3kr Query : use flama_phc
20240719@192025.2950 e0tk0flbb34sihnjq8g2num3kr Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192025.3070 e0tk0flbb34sihnjq8g2num3kr Query : use flama_phc
20240719@192025.3100 e0tk0flbb34sihnjq8g2num3kr Query : select szadrsstamp valor from szadrs where szadrsdesc='fnac - entrega'
20240719@192025.3210 e0tk0flbb34sihnjq8g2num3kr Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1077';
20240719@192025.3390 e0tk0flbb34sihnjq8g2num3kr Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1077';
20240719@192025.8600 6m0sjmv4buaeo69dbu9k44k7jp Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192025.8740 6m0sjmv4buaeo69dbu9k44k7jp Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192025.8940 6m0sjmv4buaeo69dbu9k44k7jp Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1078';
20240719@192025.9370 6m0sjmv4buaeo69dbu9k44k7jp Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1078';
20240719@192025.9550 6m0sjmv4buaeo69dbu9k44k7jp Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1078';
20240719@192025.9730 6m0sjmv4buaeo69dbu9k44k7jp Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1078';
20240719@192025.9950 6m0sjmv4buaeo69dbu9k44k7jp Query : use flama_phc
20240719@192025.9990 6m0sjmv4buaeo69dbu9k44k7jp Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192025.1018 6m0sjmv4buaeo69dbu9k44k7jp Query : use flama_phc
20240719@192025.1022 6m0sjmv4buaeo69dbu9k44k7jp Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240719@192025.1054 6m0sjmv4buaeo69dbu9k44k7jp Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1667.00.1'
20240719@192025.1066 6m0sjmv4buaeo69dbu9k44k7jp Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404843 and bi.ref ='324.1667.00.1' and bi.lordem =1
20240719@192025.1349 6m0sjmv4buaeo69dbu9k44k7jp Query : use flama_phc
20240719@192025.1353 6m0sjmv4buaeo69dbu9k44k7jp Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192025.1367 6m0sjmv4buaeo69dbu9k44k7jp Query : use flama_phc
20240719@192025.1370 6m0sjmv4buaeo69dbu9k44k7jp Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192025.1381 6m0sjmv4buaeo69dbu9k44k7jp Query : use flama_phc
20240719@192025.1383 6m0sjmv4buaeo69dbu9k44k7jp 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')
20240719@192025.1403 6m0sjmv4buaeo69dbu9k44k7jp Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192025.1419 6m0sjmv4buaeo69dbu9k44k7jp Query : use flama_phc
20240719@192025.1422 6m0sjmv4buaeo69dbu9k44k7jp Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192025.1434 6m0sjmv4buaeo69dbu9k44k7jp Query : use flama_phc
20240719@192025.1437 6m0sjmv4buaeo69dbu9k44k7jp Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240719@192025.1449 6m0sjmv4buaeo69dbu9k44k7jp Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1078';
20240719@192025.1464 6m0sjmv4buaeo69dbu9k44k7jp Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1078';
20240719@192025.2008 pic21hacr3g1o66vkn5l8o3rgf Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192025.2022 pic21hacr3g1o66vkn5l8o3rgf Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192025.2042 pic21hacr3g1o66vkn5l8o3rgf Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1079';
20240719@192025.2101 pic21hacr3g1o66vkn5l8o3rgf Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1079';
20240719@192025.2119 pic21hacr3g1o66vkn5l8o3rgf Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1079';
20240719@192025.2133 pic21hacr3g1o66vkn5l8o3rgf Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1079';
20240719@192025.2147 pic21hacr3g1o66vkn5l8o3rgf Query : use flama_phc
20240719@192025.2150 pic21hacr3g1o66vkn5l8o3rgf Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192025.2166 pic21hacr3g1o66vkn5l8o3rgf Query : use flama_phc
20240719@192025.2169 pic21hacr3g1o66vkn5l8o3rgf Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240719@192025.2198 pic21hacr3g1o66vkn5l8o3rgf 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'
20240719@192025.2300 pic21hacr3g1o66vkn5l8o3rgf Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404844 and bi.ref ='324.1685.00.1' and bi.lordem =1
20240719@192025.2617 pic21hacr3g1o66vkn5l8o3rgf Query : use flama_phc
20240719@192025.2622 pic21hacr3g1o66vkn5l8o3rgf Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192025.2638 pic21hacr3g1o66vkn5l8o3rgf Query : use flama_phc
20240719@192025.2641 pic21hacr3g1o66vkn5l8o3rgf Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192025.2654 pic21hacr3g1o66vkn5l8o3rgf Query : use flama_phc
20240719@192025.2658 pic21hacr3g1o66vkn5l8o3rgf 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')
20240719@192025.2679 pic21hacr3g1o66vkn5l8o3rgf Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192025.2700 pic21hacr3g1o66vkn5l8o3rgf Query : use flama_phc
20240719@192025.2704 pic21hacr3g1o66vkn5l8o3rgf Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192025.2716 pic21hacr3g1o66vkn5l8o3rgf Query : use flama_phc
20240719@192025.2719 pic21hacr3g1o66vkn5l8o3rgf Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240719@192025.2732 pic21hacr3g1o66vkn5l8o3rgf Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1079';
20240719@192025.2751 pic21hacr3g1o66vkn5l8o3rgf Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1079';
20240719@192025.3336 087setu91ko8237d42u4d02mil Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192025.3351 087setu91ko8237d42u4d02mil Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192025.3374 087setu91ko8237d42u4d02mil Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1080';
20240719@192025.3416 087setu91ko8237d42u4d02mil Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1080';
20240719@192025.3471 087setu91ko8237d42u4d02mil Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1080';
20240719@192025.3495 087setu91ko8237d42u4d02mil Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1080';
20240719@192025.3515 087setu91ko8237d42u4d02mil Query : use flama_phc
20240719@192025.3520 087setu91ko8237d42u4d02mil Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192025.4661 087setu91ko8237d42u4d02mil Query : use flama_phc
20240719@192025.4666 087setu91ko8237d42u4d02mil Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240719@192025.4698 087setu91ko8237d42u4d02mil Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '326.595.00.01'
20240719@192025.4711 087setu91ko8237d42u4d02mil Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404845 and bi.ref ='326.595.00.01' and bi.lordem =1
20240719@192025.5056 087setu91ko8237d42u4d02mil Query : use flama_phc
20240719@192025.5060 087setu91ko8237d42u4d02mil Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192025.5077 087setu91ko8237d42u4d02mil Query : use flama_phc
20240719@192025.5081 087setu91ko8237d42u4d02mil Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192025.5093 087setu91ko8237d42u4d02mil Query : use flama_phc
20240719@192025.5096 087setu91ko8237d42u4d02mil 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')
20240719@192025.5118 087setu91ko8237d42u4d02mil Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192025.5137 087setu91ko8237d42u4d02mil Query : use flama_phc
20240719@192025.5140 087setu91ko8237d42u4d02mil Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192025.5153 087setu91ko8237d42u4d02mil Query : use flama_phc
20240719@192025.5155 087setu91ko8237d42u4d02mil Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240719@192025.5168 087setu91ko8237d42u4d02mil Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1080';
20240719@192025.5185 087setu91ko8237d42u4d02mil Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1080';
20240719@192025.5680 be4ufpmhjj81k6dc32mjuclj8i Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192025.5693 be4ufpmhjj81k6dc32mjuclj8i Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192025.5712 be4ufpmhjj81k6dc32mjuclj8i Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1081';
20240719@192025.5797 be4ufpmhjj81k6dc32mjuclj8i Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1081';
20240719@192025.5816 be4ufpmhjj81k6dc32mjuclj8i Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1081';
20240719@192025.5832 be4ufpmhjj81k6dc32mjuclj8i Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1081';
20240719@192025.5847 be4ufpmhjj81k6dc32mjuclj8i Query : use flama_phc
20240719@192025.5851 be4ufpmhjj81k6dc32mjuclj8i Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192025.5868 be4ufpmhjj81k6dc32mjuclj8i Query : use flama_phc
20240719@192025.5872 be4ufpmhjj81k6dc32mjuclj8i Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240719@192025.5905 be4ufpmhjj81k6dc32mjuclj8i Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4980.00.1'
20240719@192025.6011 be4ufpmhjj81k6dc32mjuclj8i Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404846 and bi.ref ='324.4980.00.1' and bi.lordem =1
20240719@192025.6433 be4ufpmhjj81k6dc32mjuclj8i Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4980.00.1'
20240719@192025.6446 be4ufpmhjj81k6dc32mjuclj8i Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404846 and bi.ref ='324.4980.00.1' and bi.lordem =1
20240719@192025.6454 be4ufpmhjj81k6dc32mjuclj8i Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4980.00.1'
20240719@192025.6466 be4ufpmhjj81k6dc32mjuclj8i Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404846 and bi.ref ='324.4980.00.1' and bi.lordem =1
20240719@192025.6475 be4ufpmhjj81k6dc32mjuclj8i Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4980.00.1'
20240719@192025.6486 be4ufpmhjj81k6dc32mjuclj8i Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404846 and bi.ref ='324.4980.00.1' and bi.lordem =1
20240719@192025.6495 be4ufpmhjj81k6dc32mjuclj8i Query : use flama_phc
20240719@192025.6499 be4ufpmhjj81k6dc32mjuclj8i Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192025.6513 be4ufpmhjj81k6dc32mjuclj8i Query : use flama_phc
20240719@192025.6517 be4ufpmhjj81k6dc32mjuclj8i Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192025.6529 be4ufpmhjj81k6dc32mjuclj8i Query : use flama_phc
20240719@192025.6533 be4ufpmhjj81k6dc32mjuclj8i 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')
20240719@192025.6553 be4ufpmhjj81k6dc32mjuclj8i Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192025.6572 be4ufpmhjj81k6dc32mjuclj8i Query : use flama_phc
20240719@192025.6575 be4ufpmhjj81k6dc32mjuclj8i Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192025.6587 be4ufpmhjj81k6dc32mjuclj8i Query : use flama_phc
20240719@192025.6590 be4ufpmhjj81k6dc32mjuclj8i Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240719@192025.6603 be4ufpmhjj81k6dc32mjuclj8i Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1081';
20240719@192025.6621 be4ufpmhjj81k6dc32mjuclj8i Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1081';
20240719@192025.7124 dsl43ent8b7od5tm4tc6ut7916 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192025.7139 dsl43ent8b7od5tm4tc6ut7916 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192025.7164 dsl43ent8b7od5tm4tc6ut7916 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1082';
20240719@192025.7209 dsl43ent8b7od5tm4tc6ut7916 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1082';
20240719@192025.7228 dsl43ent8b7od5tm4tc6ut7916 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1082';
20240719@192025.7242 dsl43ent8b7od5tm4tc6ut7916 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1082';
20240719@192025.7257 dsl43ent8b7od5tm4tc6ut7916 Query : use flama_phc
20240719@192025.7260 dsl43ent8b7od5tm4tc6ut7916 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192025.7276 dsl43ent8b7od5tm4tc6ut7916 Query : use flama_phc
20240719@192025.7279 dsl43ent8b7od5tm4tc6ut7916 Query : select no, estab,szadrsdesc from szadrs where u_coddest=6737
20240719@192025.7316 dsl43ent8b7od5tm4tc6ut7916 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'
20240719@192025.7342 dsl43ent8b7od5tm4tc6ut7916 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404847 and bi.ref ='328.9106.00.1' and bi.lordem =1
20240719@192025.7627 dsl43ent8b7od5tm4tc6ut7916 Query : use flama_phc
20240719@192025.7633 dsl43ent8b7od5tm4tc6ut7916 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192025.7650 dsl43ent8b7od5tm4tc6ut7916 Query : use flama_phc
20240719@192025.7655 dsl43ent8b7od5tm4tc6ut7916 Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192025.7679 dsl43ent8b7od5tm4tc6ut7916 Query : use flama_phc
20240719@192025.7682 dsl43ent8b7od5tm4tc6ut7916 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')
20240719@192025.7704 dsl43ent8b7od5tm4tc6ut7916 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192025.7723 dsl43ent8b7od5tm4tc6ut7916 Query : use flama_phc
20240719@192025.7726 dsl43ent8b7od5tm4tc6ut7916 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192025.7738 dsl43ent8b7od5tm4tc6ut7916 Query : use flama_phc
20240719@192025.7740 dsl43ent8b7od5tm4tc6ut7916 Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-plaza large formats rainha'
20240719@192025.7752 dsl43ent8b7od5tm4tc6ut7916 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1082';
20240719@192025.7768 dsl43ent8b7od5tm4tc6ut7916 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1082';
20240719@192025.8254 jt6hflcdahe3rk183v0dtd1b44 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192025.8268 jt6hflcdahe3rk183v0dtd1b44 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192025.8289 jt6hflcdahe3rk183v0dtd1b44 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1083';
20240719@192025.8346 jt6hflcdahe3rk183v0dtd1b44 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1083';
20240719@192025.8364 jt6hflcdahe3rk183v0dtd1b44 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1083';
20240719@192025.8382 jt6hflcdahe3rk183v0dtd1b44 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1083';
20240719@192025.8397 jt6hflcdahe3rk183v0dtd1b44 Query : use flama_phc
20240719@192025.8400 jt6hflcdahe3rk183v0dtd1b44 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192025.8418 jt6hflcdahe3rk183v0dtd1b44 Query : use flama_phc
20240719@192025.8422 jt6hflcdahe3rk183v0dtd1b44 Query : select no, estab,szadrsdesc from szadrs where u_coddest=170
20240719@192025.8489 jt6hflcdahe3rk183v0dtd1b44 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'
20240719@192025.8587 jt6hflcdahe3rk183v0dtd1b44 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404849 and bi.ref ='324.2232.00.1' and bi.lordem =1
20240719@192025.8863 jt6hflcdahe3rk183v0dtd1b44 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'
20240719@192025.8874 jt6hflcdahe3rk183v0dtd1b44 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404849 and bi.ref ='324.2232.00.1' and bi.lordem =3
20240719@192025.9189 jt6hflcdahe3rk183v0dtd1b44 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'
20240719@192025.9200 jt6hflcdahe3rk183v0dtd1b44 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404849 and bi.ref ='324.2232.00.1' and bi.lordem =3
20240719@192025.9208 jt6hflcdahe3rk183v0dtd1b44 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1676.00.1'
20240719@192025.9310 jt6hflcdahe3rk183v0dtd1b44 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404849 and bi.ref ='324.1676.00.1' and bi.lordem =5
20240719@192025.9576 jt6hflcdahe3rk183v0dtd1b44 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1676.00.1'
20240719@192025.9589 jt6hflcdahe3rk183v0dtd1b44 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404849 and bi.ref ='324.1676.00.1' and bi.lordem =5
20240719@192025.9597 jt6hflcdahe3rk183v0dtd1b44 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.5501.00.1'
20240719@192025.9699 jt6hflcdahe3rk183v0dtd1b44 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404849 and bi.ref ='324.5501.00.1' and bi.lordem =7
20240719@192025.9982 jt6hflcdahe3rk183v0dtd1b44 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.5501.00.1'
20240719@192025.9995 jt6hflcdahe3rk183v0dtd1b44 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404849 and bi.ref ='324.5501.00.1' and bi.lordem =7
20240719@192026.2000 jt6hflcdahe3rk183v0dtd1b44 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.727.00.01'
20240719@192026.1300 jt6hflcdahe3rk183v0dtd1b44 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404849 and bi.ref ='324.727.00.01' and bi.lordem =9
20240719@192026.2910 jt6hflcdahe3rk183v0dtd1b44 Query : use flama_phc
20240719@192026.2940 jt6hflcdahe3rk183v0dtd1b44 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192026.3510 jt6hflcdahe3rk183v0dtd1b44 Query : use flama_phc
20240719@192026.3710 jt6hflcdahe3rk183v0dtd1b44 Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192026.3850 jt6hflcdahe3rk183v0dtd1b44 Query : use flama_phc
20240719@192026.3880 jt6hflcdahe3rk183v0dtd1b44 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')
20240719@192026.4080 jt6hflcdahe3rk183v0dtd1b44 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192026.4260 jt6hflcdahe3rk183v0dtd1b44 Query : use flama_phc
20240719@192026.4290 jt6hflcdahe3rk183v0dtd1b44 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192026.4410 jt6hflcdahe3rk183v0dtd1b44 Query : use flama_phc
20240719@192026.4440 jt6hflcdahe3rk183v0dtd1b44 Query : select szadrsstamp valor from szadrs where szadrsdesc='magalhÃes & vinha, lda.'
20240719@192026.4580 jt6hflcdahe3rk183v0dtd1b44 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1083';
20240719@192026.4760 jt6hflcdahe3rk183v0dtd1b44 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1083';
20240719@192026.1074 4cvbrlguv9d758i9k7vadfavou Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192026.1089 4cvbrlguv9d758i9k7vadfavou Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192026.1108 4cvbrlguv9d758i9k7vadfavou Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1084';
20240719@192026.1151 4cvbrlguv9d758i9k7vadfavou Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1084';
20240719@192026.1169 4cvbrlguv9d758i9k7vadfavou Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1084';
20240719@192026.1183 4cvbrlguv9d758i9k7vadfavou Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1084';
20240719@192026.1198 4cvbrlguv9d758i9k7vadfavou Query : use flama_phc
20240719@192026.1201 4cvbrlguv9d758i9k7vadfavou Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192026.1218 4cvbrlguv9d758i9k7vadfavou Query : use flama_phc
20240719@192026.1226 4cvbrlguv9d758i9k7vadfavou Query : select no, estab,szadrsdesc from szadrs where u_coddest=1124
20240719@192026.1307 4cvbrlguv9d758i9k7vadfavou 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'
20240719@192026.1442 4cvbrlguv9d758i9k7vadfavou Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404850 and bi.ref ='324.1578.00.1' and bi.lordem =1
20240719@192026.1761 4cvbrlguv9d758i9k7vadfavou 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'
20240719@192026.1862 4cvbrlguv9d758i9k7vadfavou Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404850 and bi.ref ='324.1536.00.1' and bi.lordem =2
20240719@192026.2130 4cvbrlguv9d758i9k7vadfavou Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1896.00.1'
20240719@192026.2228 4cvbrlguv9d758i9k7vadfavou Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404850 and bi.ref ='324.1896.00.1' and bi.lordem =3
20240719@192026.2498 4cvbrlguv9d758i9k7vadfavou Query : use flama_phc
20240719@192026.2501 4cvbrlguv9d758i9k7vadfavou Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192026.2515 4cvbrlguv9d758i9k7vadfavou Query : use flama_phc
20240719@192026.2518 4cvbrlguv9d758i9k7vadfavou Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192026.2531 4cvbrlguv9d758i9k7vadfavou Query : use flama_phc
20240719@192026.2534 4cvbrlguv9d758i9k7vadfavou 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')
20240719@192026.2553 4cvbrlguv9d758i9k7vadfavou Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192026.2570 4cvbrlguv9d758i9k7vadfavou Query : use flama_phc
20240719@192026.2573 4cvbrlguv9d758i9k7vadfavou Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192026.2585 4cvbrlguv9d758i9k7vadfavou Query : use flama_phc
20240719@192026.2588 4cvbrlguv9d758i9k7vadfavou Query : select szadrsstamp valor from szadrs where szadrsdesc='albino novais da venda & filhos, lda.'
20240719@192026.2600 4cvbrlguv9d758i9k7vadfavou Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1084';
20240719@192026.2617 4cvbrlguv9d758i9k7vadfavou Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1084';
20240719@192026.3096 5mkemdit7mhd64a5s71s6ob6a9 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192026.3108 5mkemdit7mhd64a5s71s6ob6a9 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192026.3127 5mkemdit7mhd64a5s71s6ob6a9 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1085';
20240719@192026.3167 5mkemdit7mhd64a5s71s6ob6a9 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1085';
20240719@192026.3184 5mkemdit7mhd64a5s71s6ob6a9 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1085';
20240719@192026.3200 5mkemdit7mhd64a5s71s6ob6a9 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1085';
20240719@192026.3218 5mkemdit7mhd64a5s71s6ob6a9 Query : use flama_phc
20240719@192026.3221 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192026.3239 5mkemdit7mhd64a5s71s6ob6a9 Query : use flama_phc
20240719@192026.3242 5mkemdit7mhd64a5s71s6ob6a9 Query : select no, estab,szadrsdesc from szadrs where u_coddest=3104
20240719@192026.3343 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.5540.00.1'
20240719@192026.3490 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404851 and bi.ref ='324.5540.00.1' and bi.lordem =2
20240719@192026.3858 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.5540.00.1'
20240719@192026.3871 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404851 and bi.ref ='324.5540.00.1' and bi.lordem =2
20240719@192026.3878 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.5540.00.1'
20240719@192026.3889 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404851 and bi.ref ='324.5540.00.1' and bi.lordem =3
20240719@192026.5981 5mkemdit7mhd64a5s71s6ob6a9 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'
20240719@192026.6085 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404851 and bi.ref ='328.9902.00.1' and bi.lordem =4
20240719@192026.6348 5mkemdit7mhd64a5s71s6ob6a9 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'
20240719@192026.6360 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404851 and bi.ref ='328.9902.00.1' and bi.lordem =4
20240719@192026.6367 5mkemdit7mhd64a5s71s6ob6a9 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'
20240719@192026.6464 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404851 and bi.ref ='324.642.00.01' and bi.lordem =5
20240719@192026.6755 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.4860.00.1'
20240719@192026.6766 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404851 and bi.ref ='304.4860.00.1' and bi.lordem =6
20240719@192026.7100 5mkemdit7mhd64a5s71s6ob6a9 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'
20240719@192026.7203 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404851 and bi.ref ='324.646.00.01' and bi.lordem =7
20240719@192026.7475 5mkemdit7mhd64a5s71s6ob6a9 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'
20240719@192026.7490 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404851 and bi.ref ='324.646.00.01' and bi.lordem =8
20240719@192026.7753 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1831.00.2'
20240719@192026.7847 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404851 and bi.ref ='324.1831.00.2' and bi.lordem =9
20240719@192026.8111 5mkemdit7mhd64a5s71s6ob6a9 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'
20240719@192026.8124 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404851 and bi.ref ='324.1536.00.1' and bi.lordem =10
20240719@192026.8442 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1221.00.1'
20240719@192026.8540 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404851 and bi.ref ='324.1221.00.1' and bi.lordem =11
20240719@192026.8891 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1417.00.1'
20240719@192026.9016 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404851 and bi.ref ='324.1417.00.1' and bi.lordem =13
20240719@192026.9291 5mkemdit7mhd64a5s71s6ob6a9 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'
20240719@192026.9388 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404851 and bi.ref ='324.5396.00.1' and bi.lordem =14
20240719@192026.9655 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.5365.00.1'
20240719@192026.9752 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404851 and bi.ref ='324.5365.00.1' and bi.lordem =16
20240719@192027.4500 5mkemdit7mhd64a5s71s6ob6a9 Query : use flama_phc
20240719@192027.4900 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192027.6400 5mkemdit7mhd64a5s71s6ob6a9 Query : use flama_phc
20240719@192027.6800 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192027.8000 5mkemdit7mhd64a5s71s6ob6a9 Query : use flama_phc
20240719@192027.8300 5mkemdit7mhd64a5s71s6ob6a9 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')
20240719@192027.1040 5mkemdit7mhd64a5s71s6ob6a9 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192027.1200 5mkemdit7mhd64a5s71s6ob6a9 Query : use flama_phc
20240719@192027.1240 5mkemdit7mhd64a5s71s6ob6a9 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192027.1360 5mkemdit7mhd64a5s71s6ob6a9 Query : use flama_phc
20240719@192027.1390 5mkemdit7mhd64a5s71s6ob6a9 Query : select szadrsstamp valor from szadrs where szadrsdesc='electro pereira, lda'
20240719@192027.1550 5mkemdit7mhd64a5s71s6ob6a9 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1085';
20240719@192027.1890 5mkemdit7mhd64a5s71s6ob6a9 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1085';
20240719@192027.7070 8nqfsih0e40ne0c8d4b3s6igve Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192027.7210 8nqfsih0e40ne0c8d4b3s6igve Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192027.7430 8nqfsih0e40ne0c8d4b3s6igve Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1086';
20240719@192027.7980 8nqfsih0e40ne0c8d4b3s6igve Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1086';
20240719@192027.8160 8nqfsih0e40ne0c8d4b3s6igve Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1086';
20240719@192027.8320 8nqfsih0e40ne0c8d4b3s6igve Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1086';
20240719@192027.8470 8nqfsih0e40ne0c8d4b3s6igve Query : use flama_phc
20240719@192027.8510 8nqfsih0e40ne0c8d4b3s6igve Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192027.8680 8nqfsih0e40ne0c8d4b3s6igve Query : use flama_phc
20240719@192027.8720 8nqfsih0e40ne0c8d4b3s6igve Query : select no, estab,szadrsdesc from szadrs where u_coddest=752
20240719@192027.9400 8nqfsih0e40ne0c8d4b3s6igve Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '326.597.00.01'
20240719@192027.1044 8nqfsih0e40ne0c8d4b3s6igve Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404852 and bi.ref ='326.597.00.01' and bi.lordem =1
20240719@192027.1310 8nqfsih0e40ne0c8d4b3s6igve Query : use flama_phc
20240719@192027.1314 8nqfsih0e40ne0c8d4b3s6igve Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192027.1329 8nqfsih0e40ne0c8d4b3s6igve Query : use flama_phc
20240719@192027.1333 8nqfsih0e40ne0c8d4b3s6igve Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192027.1345 8nqfsih0e40ne0c8d4b3s6igve Query : use flama_phc
20240719@192027.1349 8nqfsih0e40ne0c8d4b3s6igve 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')
20240719@192027.1371 8nqfsih0e40ne0c8d4b3s6igve Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192027.1391 8nqfsih0e40ne0c8d4b3s6igve Query : use flama_phc
20240719@192027.1394 8nqfsih0e40ne0c8d4b3s6igve Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192027.1407 8nqfsih0e40ne0c8d4b3s6igve Query : use flama_phc
20240719@192027.1410 8nqfsih0e40ne0c8d4b3s6igve Query : select szadrsstamp valor from szadrs where szadrsdesc='transÁfrica, lda.'
20240719@192027.1426 8nqfsih0e40ne0c8d4b3s6igve Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1086';
20240719@192027.1444 8nqfsih0e40ne0c8d4b3s6igve Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1086';
20240719@192027.3013 b5b5pli453o2hr1qnajqrnqo0c Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192027.3029 b5b5pli453o2hr1qnajqrnqo0c Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192027.3056 b5b5pli453o2hr1qnajqrnqo0c Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1087';
20240719@192027.3096 b5b5pli453o2hr1qnajqrnqo0c Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1087';
20240719@192027.3114 b5b5pli453o2hr1qnajqrnqo0c Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1087';
20240719@192027.3127 b5b5pli453o2hr1qnajqrnqo0c Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1087';
20240719@192027.3141 b5b5pli453o2hr1qnajqrnqo0c Query : use flama_phc
20240719@192027.3145 b5b5pli453o2hr1qnajqrnqo0c Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192027.3161 b5b5pli453o2hr1qnajqrnqo0c Query : use flama_phc
20240719@192027.3164 b5b5pli453o2hr1qnajqrnqo0c Query : select no, estab,szadrsdesc from szadrs where u_coddest=2759
20240719@192027.3242 b5b5pli453o2hr1qnajqrnqo0c Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1676.00.1'
20240719@192027.3253 b5b5pli453o2hr1qnajqrnqo0c Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404854 and bi.ref ='324.1676.00.1' and bi.lordem =1
20240719@192027.3555 b5b5pli453o2hr1qnajqrnqo0c 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'
20240719@192027.3566 b5b5pli453o2hr1qnajqrnqo0c Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404854 and bi.ref ='324.1824.00.1' and bi.lordem =2
20240719@192027.3834 b5b5pli453o2hr1qnajqrnqo0c Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1676.00.1'
20240719@192027.3846 b5b5pli453o2hr1qnajqrnqo0c Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404854 and bi.ref ='324.1676.00.1' and bi.lordem =3
20240719@192027.4247 b5b5pli453o2hr1qnajqrnqo0c Query : use flama_phc
20240719@192027.4251 b5b5pli453o2hr1qnajqrnqo0c Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192027.4266 b5b5pli453o2hr1qnajqrnqo0c Query : use flama_phc
20240719@192027.4271 b5b5pli453o2hr1qnajqrnqo0c Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192027.4282 b5b5pli453o2hr1qnajqrnqo0c Query : use flama_phc
20240719@192027.4285 b5b5pli453o2hr1qnajqrnqo0c 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')
20240719@192027.4310 b5b5pli453o2hr1qnajqrnqo0c Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192027.4326 b5b5pli453o2hr1qnajqrnqo0c Query : use flama_phc
20240719@192027.4329 b5b5pli453o2hr1qnajqrnqo0c Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192027.4340 b5b5pli453o2hr1qnajqrnqo0c Query : use flama_phc
20240719@192027.4342 b5b5pli453o2hr1qnajqrnqo0c Query : select szadrsstamp valor from szadrs where szadrsdesc='paulo jorge almeida gomes unip.,lda.-entrega'
20240719@192027.4354 b5b5pli453o2hr1qnajqrnqo0c Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1087';
20240719@192027.4370 b5b5pli453o2hr1qnajqrnqo0c Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1087';
20240719@192027.4840 lhas84jp76uj8ddimgc9rr4g72 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240719@192027.4854 lhas84jp76uj8ddimgc9rr4g72 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240719@192027.4878 lhas84jp76uj8ddimgc9rr4g72 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1088';
20240719@192027.4987 lhas84jp76uj8ddimgc9rr4g72 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1088';
20240719@192027.5006 lhas84jp76uj8ddimgc9rr4g72 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1088';
20240719@192027.5021 lhas84jp76uj8ddimgc9rr4g72 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1088';
20240719@192027.5037 lhas84jp76uj8ddimgc9rr4g72 Query : use flama_phc
20240719@192027.5041 lhas84jp76uj8ddimgc9rr4g72 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240719@192027.5059 lhas84jp76uj8ddimgc9rr4g72 Query : use flama_phc
20240719@192027.5062 lhas84jp76uj8ddimgc9rr4g72 Query : select no, estab,szadrsdesc from szadrs where u_coddest=1123
20240719@192027.5129 lhas84jp76uj8ddimgc9rr4g72 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'
20240719@192027.5141 lhas84jp76uj8ddimgc9rr4g72 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404855 and bi.ref ='324.646.00.01' and bi.lordem =1
20240719@192027.5620 lhas84jp76uj8ddimgc9rr4g72 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'
20240719@192027.5635 lhas84jp76uj8ddimgc9rr4g72 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404855 and bi.ref ='324.646.00.01' and bi.lordem =1
20240719@192027.5643 lhas84jp76uj8ddimgc9rr4g72 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'
20240719@192027.5655 lhas84jp76uj8ddimgc9rr4g72 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404855 and bi.ref ='324.646.00.01' and bi.lordem =2
20240719@192027.5918 lhas84jp76uj8ddimgc9rr4g72 Query : use flama_phc
20240719@192027.5922 lhas84jp76uj8ddimgc9rr4g72 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240719@192027.5938 lhas84jp76uj8ddimgc9rr4g72 Query : use flama_phc
20240719@192027.5942 lhas84jp76uj8ddimgc9rr4g72 Query : select top 1 1 valor from td where td.ndoc = 39
20240719@192027.5954 lhas84jp76uj8ddimgc9rr4g72 Query : use flama_phc
20240719@192027.5957 lhas84jp76uj8ddimgc9rr4g72 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')
20240719@192027.5984 lhas84jp76uj8ddimgc9rr4g72 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240719@192027.6004 lhas84jp76uj8ddimgc9rr4g72 Query : use flama_phc
20240719@192027.6007 lhas84jp76uj8ddimgc9rr4g72 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240719@192027.6019 lhas84jp76uj8ddimgc9rr4g72 Query : use flama_phc
20240719@192027.6022 lhas84jp76uj8ddimgc9rr4g72 Query : select szadrsstamp valor from szadrs where szadrsdesc='dario alberto almeida, lda'
20240719@192027.6035 lhas84jp76uj8ddimgc9rr4g72 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1088';
20240719@192027.6055 lhas84jp76uj8ddimgc9rr4g72 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1088';

20240722@134016.8662 h9n0r2hi9scvolibec0m1162c1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1089';
20240722@134016.8694 h9n0r2hi9scvolibec0m1162c1 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1089';
20240722@134016.8708 h9n0r2hi9scvolibec0m1162c1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1089';
20240722@134016.8725 h9n0r2hi9scvolibec0m1162c1 Query : use flama_phc
20240722@134016.8728 h9n0r2hi9scvolibec0m1162c1 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240722@134016.8794 h9n0r2hi9scvolibec0m1162c1 Query : use flama_phc
20240722@134016.8798 h9n0r2hi9scvolibec0m1162c1 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240722@134016.8862 h9n0r2hi9scvolibec0m1162c1 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'
20240722@134016.8967 h9n0r2hi9scvolibec0m1162c1 Query : use flama_phc
20240722@134016.8970 h9n0r2hi9scvolibec0m1162c1 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240722@134016.9117 h9n0r2hi9scvolibec0m1162c1 Query : use flama_phc
20240722@134016.9120 h9n0r2hi9scvolibec0m1162c1 Query : select top 1 1 valor from td where td.ndoc = 39
20240722@134016.9174 h9n0r2hi9scvolibec0m1162c1 Query : use flama_phc
20240722@134016.9177 h9n0r2hi9scvolibec0m1162c1 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')
20240722@134016.9322 h9n0r2hi9scvolibec0m1162c1 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240722@134016.9432 h9n0r2hi9scvolibec0m1162c1 Query : use flama_phc
20240722@134016.9435 h9n0r2hi9scvolibec0m1162c1 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240722@134016.9482 h9n0r2hi9scvolibec0m1162c1 Query : use flama_phc
20240722@134016.9485 h9n0r2hi9scvolibec0m1162c1 Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240722@134016.9498 h9n0r2hi9scvolibec0m1162c1 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1089';
20240722@134016.9514 h9n0r2hi9scvolibec0m1162c1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1089';

20240722@181117.8364 2ctus3qjboruhrjhk02lootndf Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1090';
20240722@181117.8395 2ctus3qjboruhrjhk02lootndf Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1090';
20240722@181117.8409 2ctus3qjboruhrjhk02lootndf Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1090';
20240722@181117.8425 2ctus3qjboruhrjhk02lootndf Query : use flama_phc
20240722@181117.8428 2ctus3qjboruhrjhk02lootndf Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240722@181117.8500 2ctus3qjboruhrjhk02lootndf Query : use flama_phc
20240722@181117.8503 2ctus3qjboruhrjhk02lootndf Query : select no, estab,szadrsdesc from szadrs where u_coddest=201
20240722@181117.8565 2ctus3qjboruhrjhk02lootndf 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'
20240722@181117.8665 2ctus3qjboruhrjhk02lootndf 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'
20240722@181117.8675 2ctus3qjboruhrjhk02lootndf 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'
20240722@181117.8772 2ctus3qjboruhrjhk02lootndf 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'
20240722@181117.8781 2ctus3qjboruhrjhk02lootndf 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'
20240722@181117.8791 2ctus3qjboruhrjhk02lootndf 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'
20240722@181117.8802 2ctus3qjboruhrjhk02lootndf Query : use flama_phc
20240722@181117.8805 2ctus3qjboruhrjhk02lootndf Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240722@181117.8940 2ctus3qjboruhrjhk02lootndf Query : use flama_phc
20240722@181117.8945 2ctus3qjboruhrjhk02lootndf Query : select top 1 1 valor from td where td.ndoc = 39
20240722@181117.8989 2ctus3qjboruhrjhk02lootndf Query : use flama_phc
20240722@181117.8991 2ctus3qjboruhrjhk02lootndf 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')
20240722@181117.9075 2ctus3qjboruhrjhk02lootndf Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240722@181117.9164 2ctus3qjboruhrjhk02lootndf Query : use flama_phc
20240722@181117.9167 2ctus3qjboruhrjhk02lootndf Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240722@181117.9201 2ctus3qjboruhrjhk02lootndf Query : use flama_phc
20240722@181117.9203 2ctus3qjboruhrjhk02lootndf Query : select szadrsstamp valor from szadrs where szadrsdesc='sorefoz - electrod. e equipamentos, s.a.'
20240722@181117.9215 2ctus3qjboruhrjhk02lootndf Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1090';
20240722@181117.9230 2ctus3qjboruhrjhk02lootndf Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1090';
20240722@181117.9709 meqiglq4at0um3p057dr6lkdj9 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240722@181117.9722 meqiglq4at0um3p057dr6lkdj9 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240722@181117.9741 meqiglq4at0um3p057dr6lkdj9 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1091';
20240722@181117.9781 meqiglq4at0um3p057dr6lkdj9 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1091';
20240722@181117.9798 meqiglq4at0um3p057dr6lkdj9 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1091';
20240722@181117.9813 meqiglq4at0um3p057dr6lkdj9 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1091';
20240722@181117.9826 meqiglq4at0um3p057dr6lkdj9 Query : use flama_phc
20240722@181117.9829 meqiglq4at0um3p057dr6lkdj9 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240722@181117.9843 meqiglq4at0um3p057dr6lkdj9 Query : use flama_phc
20240722@181117.9846 meqiglq4at0um3p057dr6lkdj9 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240722@181117.9935 meqiglq4at0um3p057dr6lkdj9 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1667.00.1'
20240722@181118.5500 meqiglq4at0um3p057dr6lkdj9 Query : use flama_phc
20240722@181118.5900 meqiglq4at0um3p057dr6lkdj9 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240722@181118.7300 meqiglq4at0um3p057dr6lkdj9 Query : use flama_phc
20240722@181118.7600 meqiglq4at0um3p057dr6lkdj9 Query : select top 1 1 valor from td where td.ndoc = 39
20240722@181118.8900 meqiglq4at0um3p057dr6lkdj9 Query : use flama_phc
20240722@181118.9200 meqiglq4at0um3p057dr6lkdj9 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')
20240722@181118.1360 meqiglq4at0um3p057dr6lkdj9 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240722@181118.1520 meqiglq4at0um3p057dr6lkdj9 Query : use flama_phc
20240722@181118.1550 meqiglq4at0um3p057dr6lkdj9 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240722@181118.1670 meqiglq4at0um3p057dr6lkdj9 Query : use flama_phc
20240722@181118.1690 meqiglq4at0um3p057dr6lkdj9 Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240722@181118.1810 meqiglq4at0um3p057dr6lkdj9 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1091';
20240722@181118.1980 meqiglq4at0um3p057dr6lkdj9 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1091';
20240722@181118.9010 70jcrjir1o22nppdbrb8fps0lq Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240722@181118.9210 70jcrjir1o22nppdbrb8fps0lq Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240722@181118.1164 70jcrjir1o22nppdbrb8fps0lq Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1092';
20240722@181118.1530 70jcrjir1o22nppdbrb8fps0lq Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1092';
20240722@181118.1589 70jcrjir1o22nppdbrb8fps0lq Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1092';
20240722@181118.1621 70jcrjir1o22nppdbrb8fps0lq Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1092';
20240722@181118.1651 70jcrjir1o22nppdbrb8fps0lq Query : use flama_phc
20240722@181118.1655 70jcrjir1o22nppdbrb8fps0lq Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240722@181118.1669 70jcrjir1o22nppdbrb8fps0lq Query : use flama_phc
20240722@181118.1672 70jcrjir1o22nppdbrb8fps0lq Query : select no, estab,szadrsdesc from szadrs where u_coddest=3457
20240722@181118.1741 70jcrjir1o22nppdbrb8fps0lq Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1705.00.1'
20240722@181118.1856 70jcrjir1o22nppdbrb8fps0lq 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'
20240722@181118.1958 70jcrjir1o22nppdbrb8fps0lq 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'
20240722@181118.1968 70jcrjir1o22nppdbrb8fps0lq Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1831.00.2'
20240722@181118.2068 70jcrjir1o22nppdbrb8fps0lq 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'
20240722@181118.2176 70jcrjir1o22nppdbrb8fps0lq 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'
20240722@181118.2394 70jcrjir1o22nppdbrb8fps0lq 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'
20240722@181118.2510 70jcrjir1o22nppdbrb8fps0lq Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4585.00.1'
20240722@181118.2611 70jcrjir1o22nppdbrb8fps0lq Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4585.00.1'
20240722@181118.2621 70jcrjir1o22nppdbrb8fps0lq Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4961.00.1'
20240722@181118.2725 70jcrjir1o22nppdbrb8fps0lq Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4962.00.1'
20240722@181118.2836 70jcrjir1o22nppdbrb8fps0lq Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4963.00.1'
20240722@181118.2926 70jcrjir1o22nppdbrb8fps0lq 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'
20240722@181118.3020 70jcrjir1o22nppdbrb8fps0lq Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1705.00.1'
20240722@181118.3031 70jcrjir1o22nppdbrb8fps0lq Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1705.00.1'
20240722@181118.3043 70jcrjir1o22nppdbrb8fps0lq Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1705.00.1'
20240722@181118.3054 70jcrjir1o22nppdbrb8fps0lq Query : use flama_phc
20240722@181118.3056 70jcrjir1o22nppdbrb8fps0lq Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240722@181118.3070 70jcrjir1o22nppdbrb8fps0lq Query : use flama_phc
20240722@181118.3072 70jcrjir1o22nppdbrb8fps0lq Query : select top 1 1 valor from td where td.ndoc = 39
20240722@181118.3090 70jcrjir1o22nppdbrb8fps0lq Query : use flama_phc
20240722@181118.3093 70jcrjir1o22nppdbrb8fps0lq 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')
20240722@181118.3116 70jcrjir1o22nppdbrb8fps0lq Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240722@181118.3131 70jcrjir1o22nppdbrb8fps0lq Query : use flama_phc
20240722@181118.3134 70jcrjir1o22nppdbrb8fps0lq Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240722@181118.3145 70jcrjir1o22nppdbrb8fps0lq Query : use flama_phc
20240722@181118.3148 70jcrjir1o22nppdbrb8fps0lq Query : select szadrsstamp valor from szadrs where szadrsdesc='representaciones sanjurjo, s.l.u.'
20240722@181118.3170 70jcrjir1o22nppdbrb8fps0lq Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1092';
20240722@181118.3185 70jcrjir1o22nppdbrb8fps0lq Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1092';
20240722@181118.4655 7mb5d7uujiib5p7g3d6qhdltud Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240722@181118.4668 7mb5d7uujiib5p7g3d6qhdltud Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240722@181118.4687 7mb5d7uujiib5p7g3d6qhdltud Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1093';
20240722@181118.4728 7mb5d7uujiib5p7g3d6qhdltud Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1093';
20240722@181118.4746 7mb5d7uujiib5p7g3d6qhdltud Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1093';
20240722@181118.4760 7mb5d7uujiib5p7g3d6qhdltud Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1093';
20240722@181118.4774 7mb5d7uujiib5p7g3d6qhdltud Query : use flama_phc
20240722@181118.4789 7mb5d7uujiib5p7g3d6qhdltud Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240722@181118.4802 7mb5d7uujiib5p7g3d6qhdltud Query : use flama_phc
20240722@181118.4805 7mb5d7uujiib5p7g3d6qhdltud Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240722@181118.4834 7mb5d7uujiib5p7g3d6qhdltud Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1832.00.2'
20240722@181118.4950 7mb5d7uujiib5p7g3d6qhdltud Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1832.00.2'
20240722@181118.4959 7mb5d7uujiib5p7g3d6qhdltud Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1832.00.2'
20240722@181118.4968 7mb5d7uujiib5p7g3d6qhdltud Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1832.00.2'
20240722@181118.4979 7mb5d7uujiib5p7g3d6qhdltud Query : use flama_phc
20240722@181118.4982 7mb5d7uujiib5p7g3d6qhdltud Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240722@181118.4995 7mb5d7uujiib5p7g3d6qhdltud Query : use flama_phc
20240722@181118.4998 7mb5d7uujiib5p7g3d6qhdltud Query : select top 1 1 valor from td where td.ndoc = 39
20240722@181118.5008 7mb5d7uujiib5p7g3d6qhdltud Query : use flama_phc
20240722@181118.5010 7mb5d7uujiib5p7g3d6qhdltud 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')
20240722@181118.5027 7mb5d7uujiib5p7g3d6qhdltud Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240722@181118.5056 7mb5d7uujiib5p7g3d6qhdltud Query : use flama_phc
20240722@181118.5059 7mb5d7uujiib5p7g3d6qhdltud Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240722@181118.5069 7mb5d7uujiib5p7g3d6qhdltud Query : use flama_phc
20240722@181118.5072 7mb5d7uujiib5p7g3d6qhdltud Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240722@181118.5082 7mb5d7uujiib5p7g3d6qhdltud Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1093';
20240722@181118.5098 7mb5d7uujiib5p7g3d6qhdltud Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1093';
20240722@181118.5545 q694qhhja3ot865u80mjcbbd32 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240722@181118.5557 q694qhhja3ot865u80mjcbbd32 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240722@181118.5581 q694qhhja3ot865u80mjcbbd32 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1094';
20240722@181118.5626 q694qhhja3ot865u80mjcbbd32 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1094';
20240722@181118.5642 q694qhhja3ot865u80mjcbbd32 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1094';
20240722@181118.5657 q694qhhja3ot865u80mjcbbd32 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1094';
20240722@181118.5671 q694qhhja3ot865u80mjcbbd32 Query : use flama_phc
20240722@181118.5674 q694qhhja3ot865u80mjcbbd32 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240722@181118.5689 q694qhhja3ot865u80mjcbbd32 Query : use flama_phc
20240722@181118.5698 q694qhhja3ot865u80mjcbbd32 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240722@181118.5726 q694qhhja3ot865u80mjcbbd32 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1834.00.1'
20240722@181118.5825 q694qhhja3ot865u80mjcbbd32 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1834.00.1'
20240722@181118.5842 q694qhhja3ot865u80mjcbbd32 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1834.00.1'
20240722@181118.5868 q694qhhja3ot865u80mjcbbd32 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1834.00.1'
20240722@181118.5878 q694qhhja3ot865u80mjcbbd32 Query : use flama_phc
20240722@181118.5880 q694qhhja3ot865u80mjcbbd32 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240722@181118.5893 q694qhhja3ot865u80mjcbbd32 Query : use flama_phc
20240722@181118.5896 q694qhhja3ot865u80mjcbbd32 Query : select top 1 1 valor from td where td.ndoc = 39
20240722@181118.5907 q694qhhja3ot865u80mjcbbd32 Query : use flama_phc
20240722@181118.5909 q694qhhja3ot865u80mjcbbd32 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')
20240722@181118.5928 q694qhhja3ot865u80mjcbbd32 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240722@181118.5946 q694qhhja3ot865u80mjcbbd32 Query : use flama_phc
20240722@181118.5949 q694qhhja3ot865u80mjcbbd32 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240722@181118.5962 q694qhhja3ot865u80mjcbbd32 Query : use flama_phc
20240722@181118.5965 q694qhhja3ot865u80mjcbbd32 Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240722@181118.5977 q694qhhja3ot865u80mjcbbd32 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1094';
20240722@181118.6072 q694qhhja3ot865u80mjcbbd32 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1094';
20240722@181118.6548 qdpkb9t9vjulfgfppsb0ajttbk Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240722@181118.6561 qdpkb9t9vjulfgfppsb0ajttbk Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240722@181118.6580 qdpkb9t9vjulfgfppsb0ajttbk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1095';
20240722@181118.6628 qdpkb9t9vjulfgfppsb0ajttbk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1095';
20240722@181118.6645 qdpkb9t9vjulfgfppsb0ajttbk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1095';
20240722@181118.6659 qdpkb9t9vjulfgfppsb0ajttbk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1095';
20240722@181118.6672 qdpkb9t9vjulfgfppsb0ajttbk Query : use flama_phc
20240722@181118.6676 qdpkb9t9vjulfgfppsb0ajttbk Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240722@181118.6691 qdpkb9t9vjulfgfppsb0ajttbk Query : use flama_phc
20240722@181118.6694 qdpkb9t9vjulfgfppsb0ajttbk Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240722@181118.6722 qdpkb9t9vjulfgfppsb0ajttbk Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1831.00.2'
20240722@181118.6733 qdpkb9t9vjulfgfppsb0ajttbk Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1831.00.2'
20240722@181118.6743 qdpkb9t9vjulfgfppsb0ajttbk Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1831.00.2'
20240722@181118.6758 qdpkb9t9vjulfgfppsb0ajttbk Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1831.00.2'
20240722@181118.6768 qdpkb9t9vjulfgfppsb0ajttbk Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1831.00.2'
20240722@181118.6778 qdpkb9t9vjulfgfppsb0ajttbk Query : use flama_phc
20240722@181118.6781 qdpkb9t9vjulfgfppsb0ajttbk Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240722@181118.6952 qdpkb9t9vjulfgfppsb0ajttbk Query : use flama_phc
20240722@181118.6955 qdpkb9t9vjulfgfppsb0ajttbk Query : select top 1 1 valor from td where td.ndoc = 39
20240722@181118.6966 qdpkb9t9vjulfgfppsb0ajttbk Query : use flama_phc
20240722@181118.6968 qdpkb9t9vjulfgfppsb0ajttbk 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')
20240722@181118.6987 qdpkb9t9vjulfgfppsb0ajttbk Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240722@181118.7033 qdpkb9t9vjulfgfppsb0ajttbk Query : use flama_phc
20240722@181118.7037 qdpkb9t9vjulfgfppsb0ajttbk Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240722@181118.7068 qdpkb9t9vjulfgfppsb0ajttbk Query : use flama_phc
20240722@181118.7071 qdpkb9t9vjulfgfppsb0ajttbk Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240722@181118.7082 qdpkb9t9vjulfgfppsb0ajttbk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1095';
20240722@181118.7108 qdpkb9t9vjulfgfppsb0ajttbk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1095';
20240722@181118.7725 n9s21l7sjfki6o97mcheea31oj Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240722@181118.7741 n9s21l7sjfki6o97mcheea31oj Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240722@181118.7779 n9s21l7sjfki6o97mcheea31oj Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1096';
20240722@181118.7825 n9s21l7sjfki6o97mcheea31oj Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1096';
20240722@181118.7842 n9s21l7sjfki6o97mcheea31oj Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1096';
20240722@181118.7855 n9s21l7sjfki6o97mcheea31oj Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1096';
20240722@181118.7868 n9s21l7sjfki6o97mcheea31oj Query : use flama_phc
20240722@181118.7871 n9s21l7sjfki6o97mcheea31oj Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240722@181118.7906 n9s21l7sjfki6o97mcheea31oj Query : use flama_phc
20240722@181118.7909 n9s21l7sjfki6o97mcheea31oj Query : select no, estab,szadrsdesc from szadrs where u_coddest=2128
20240722@181118.7976 n9s21l7sjfki6o97mcheea31oj 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'
20240722@181118.8083 n9s21l7sjfki6o97mcheea31oj Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240722@181118.8187 n9s21l7sjfki6o97mcheea31oj 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'
20240722@181118.8284 n9s21l7sjfki6o97mcheea31oj Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.938.00.01'
20240722@181118.8380 n9s21l7sjfki6o97mcheea31oj Query : use flama_phc
20240722@181118.8383 n9s21l7sjfki6o97mcheea31oj Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240722@181118.8407 n9s21l7sjfki6o97mcheea31oj Query : use flama_phc
20240722@181118.8410 n9s21l7sjfki6o97mcheea31oj Query : select top 1 1 valor from td where td.ndoc = 39
20240722@181118.8420 n9s21l7sjfki6o97mcheea31oj Query : use flama_phc
20240722@181118.8423 n9s21l7sjfki6o97mcheea31oj 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')
20240722@181118.8441 n9s21l7sjfki6o97mcheea31oj Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240722@181118.8469 n9s21l7sjfki6o97mcheea31oj Query : use flama_phc
20240722@181118.8472 n9s21l7sjfki6o97mcheea31oj Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240722@181118.8482 n9s21l7sjfki6o97mcheea31oj Query : use flama_phc
20240722@181118.8484 n9s21l7sjfki6o97mcheea31oj Query : select szadrsstamp valor from szadrs where szadrsdesc='jose dos santos gonÇalves'
20240722@181118.8497 n9s21l7sjfki6o97mcheea31oj Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1096';
20240722@181118.8519 n9s21l7sjfki6o97mcheea31oj Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1096';
20240722@181118.8965 gnc63ljjh23jhfs9gjeihqnkpk Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240722@181118.9057 gnc63ljjh23jhfs9gjeihqnkpk Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240722@181118.9077 gnc63ljjh23jhfs9gjeihqnkpk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1097';
20240722@181118.9117 gnc63ljjh23jhfs9gjeihqnkpk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1097';
20240722@181118.9133 gnc63ljjh23jhfs9gjeihqnkpk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1097';
20240722@181118.9149 gnc63ljjh23jhfs9gjeihqnkpk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1097';
20240722@181118.9174 gnc63ljjh23jhfs9gjeihqnkpk Query : use flama_phc
20240722@181118.9177 gnc63ljjh23jhfs9gjeihqnkpk Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240722@181118.9193 gnc63ljjh23jhfs9gjeihqnkpk Query : use flama_phc
20240722@181118.9196 gnc63ljjh23jhfs9gjeihqnkpk Query : select no, estab,szadrsdesc from szadrs where u_coddest=720
20240722@181118.9266 gnc63ljjh23jhfs9gjeihqnkpk 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'
20240722@181118.9459 gnc63ljjh23jhfs9gjeihqnkpk Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1676.00.1'
20240722@181119.8840 gnc63ljjh23jhfs9gjeihqnkpk Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1676.00.1'
20240722@181119.8940 gnc63ljjh23jhfs9gjeihqnkpk 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'
20240722@181119.1191 gnc63ljjh23jhfs9gjeihqnkpk Query : use flama_phc
20240722@181119.1196 gnc63ljjh23jhfs9gjeihqnkpk Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240722@181119.1210 gnc63ljjh23jhfs9gjeihqnkpk Query : use flama_phc
20240722@181119.1213 gnc63ljjh23jhfs9gjeihqnkpk Query : select top 1 1 valor from td where td.ndoc = 39
20240722@181119.1223 gnc63ljjh23jhfs9gjeihqnkpk Query : use flama_phc
20240722@181119.1229 gnc63ljjh23jhfs9gjeihqnkpk 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')
20240722@181119.1248 gnc63ljjh23jhfs9gjeihqnkpk Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240722@181119.1268 gnc63ljjh23jhfs9gjeihqnkpk Query : use flama_phc
20240722@181119.1271 gnc63ljjh23jhfs9gjeihqnkpk Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240722@181119.1281 gnc63ljjh23jhfs9gjeihqnkpk Query : use flama_phc
20240722@181119.1283 gnc63ljjh23jhfs9gjeihqnkpk Query : select szadrsstamp valor from szadrs where szadrsdesc='jose alberto barata'
20240722@181119.1296 gnc63ljjh23jhfs9gjeihqnkpk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1097';
20240722@181119.1321 gnc63ljjh23jhfs9gjeihqnkpk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1097';
20240722@181119.1942 fiasp1arssbtubp141ttkse9kn Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240722@181119.1958 fiasp1arssbtubp141ttkse9kn Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240722@181119.1983 fiasp1arssbtubp141ttkse9kn Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1098';
20240722@181119.2022 fiasp1arssbtubp141ttkse9kn Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1098';
20240722@181119.2038 fiasp1arssbtubp141ttkse9kn Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1098';
20240722@181119.2051 fiasp1arssbtubp141ttkse9kn Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1098';
20240722@181119.2065 fiasp1arssbtubp141ttkse9kn Query : use flama_phc
20240722@181119.2068 fiasp1arssbtubp141ttkse9kn Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240722@181119.2081 fiasp1arssbtubp141ttkse9kn Query : use flama_phc
20240722@181119.2084 fiasp1arssbtubp141ttkse9kn Query : select no, estab,szadrsdesc from szadrs where u_coddest=2183
20240722@181119.2147 fiasp1arssbtubp141ttkse9kn Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.2185.00.1'
20240722@181119.2248 fiasp1arssbtubp141ttkse9kn Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1293.00.1'
20240722@181119.2339 fiasp1arssbtubp141ttkse9kn Query : use flama_phc
20240722@181119.2342 fiasp1arssbtubp141ttkse9kn Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240722@181119.2355 fiasp1arssbtubp141ttkse9kn Query : use flama_phc
20240722@181119.2358 fiasp1arssbtubp141ttkse9kn Query : select top 1 1 valor from td where td.ndoc = 39
20240722@181119.2368 fiasp1arssbtubp141ttkse9kn Query : use flama_phc
20240722@181119.2370 fiasp1arssbtubp141ttkse9kn 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')
20240722@181119.2396 fiasp1arssbtubp141ttkse9kn Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240722@181119.2412 fiasp1arssbtubp141ttkse9kn Query : use flama_phc
20240722@181119.2415 fiasp1arssbtubp141ttkse9kn Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240722@181119.2425 fiasp1arssbtubp141ttkse9kn Query : use flama_phc
20240722@181119.2427 fiasp1arssbtubp141ttkse9kn Query : select szadrsstamp valor from szadrs where szadrsdesc='jose martins'
20240722@181119.2449 fiasp1arssbtubp141ttkse9kn Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1098';
20240722@181119.2463 fiasp1arssbtubp141ttkse9kn Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1098';
20240722@181119.3015 72b9pp1efqea40uig41h0bs4p7 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240722@181119.3027 72b9pp1efqea40uig41h0bs4p7 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240722@181119.3046 72b9pp1efqea40uig41h0bs4p7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1099';
20240722@181119.3092 72b9pp1efqea40uig41h0bs4p7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1099';
20240722@181119.3110 72b9pp1efqea40uig41h0bs4p7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1099';
20240722@181119.3123 72b9pp1efqea40uig41h0bs4p7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1099';
20240722@181119.3137 72b9pp1efqea40uig41h0bs4p7 Query : use flama_phc
20240722@181119.3140 72b9pp1efqea40uig41h0bs4p7 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240722@181119.3155 72b9pp1efqea40uig41h0bs4p7 Query : use flama_phc
20240722@181119.3166 72b9pp1efqea40uig41h0bs4p7 Query : select no, estab,szadrsdesc from szadrs where u_coddest=928
20240722@181119.3233 72b9pp1efqea40uig41h0bs4p7 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'
20240722@181119.3431 72b9pp1efqea40uig41h0bs4p7 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'
20240722@181119.3441 72b9pp1efqea40uig41h0bs4p7 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'
20240722@181119.3453 72b9pp1efqea40uig41h0bs4p7 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1705.00.1'
20240722@181119.3464 72b9pp1efqea40uig41h0bs4p7 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.5365.00.1'
20240722@181119.3563 72b9pp1efqea40uig41h0bs4p7 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'
20240722@181119.3690 72b9pp1efqea40uig41h0bs4p7 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.938.00.01'
20240722@181119.3701 72b9pp1efqea40uig41h0bs4p7 Query : use flama_phc
20240722@181119.3704 72b9pp1efqea40uig41h0bs4p7 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240722@181119.3716 72b9pp1efqea40uig41h0bs4p7 Query : use flama_phc
20240722@181119.3721 72b9pp1efqea40uig41h0bs4p7 Query : select top 1 1 valor from td where td.ndoc = 39
20240722@181119.3734 72b9pp1efqea40uig41h0bs4p7 Query : use flama_phc
20240722@181119.3736 72b9pp1efqea40uig41h0bs4p7 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')
20240722@181119.3754 72b9pp1efqea40uig41h0bs4p7 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240722@181119.3772 72b9pp1efqea40uig41h0bs4p7 Query : use flama_phc
20240722@181119.3775 72b9pp1efqea40uig41h0bs4p7 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240722@181119.3786 72b9pp1efqea40uig41h0bs4p7 Query : use flama_phc
20240722@181119.3789 72b9pp1efqea40uig41h0bs4p7 Query : select szadrsstamp valor from szadrs where szadrsdesc='aderito de jesus gonÇalves'
20240722@181119.3801 72b9pp1efqea40uig41h0bs4p7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1099';
20240722@181119.3816 72b9pp1efqea40uig41h0bs4p7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1099';
20240722@181119.4331 9vs67j2fdhhu02b3mi6mtnnjnl Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240722@181119.4344 9vs67j2fdhhu02b3mi6mtnnjnl Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240722@181119.4362 9vs67j2fdhhu02b3mi6mtnnjnl Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1100';
20240722@181119.4403 9vs67j2fdhhu02b3mi6mtnnjnl Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1100';
20240722@181119.4420 9vs67j2fdhhu02b3mi6mtnnjnl Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1100';
20240722@181119.4437 9vs67j2fdhhu02b3mi6mtnnjnl Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1100';
20240722@181119.4451 9vs67j2fdhhu02b3mi6mtnnjnl Query : use flama_phc
20240722@181119.4454 9vs67j2fdhhu02b3mi6mtnnjnl Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240722@181119.4467 9vs67j2fdhhu02b3mi6mtnnjnl Query : use flama_phc
20240722@181119.4477 9vs67j2fdhhu02b3mi6mtnnjnl Query : select no, estab,szadrsdesc from szadrs where u_coddest=7778
20240722@181119.4620 9vs67j2fdhhu02b3mi6mtnnjnl 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'
20240722@181119.4631 9vs67j2fdhhu02b3mi6mtnnjnl 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'
20240722@181119.4729 9vs67j2fdhhu02b3mi6mtnnjnl 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'
20240722@181119.4738 9vs67j2fdhhu02b3mi6mtnnjnl Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.958.00.01'
20240722@181119.4827 9vs67j2fdhhu02b3mi6mtnnjnl Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1705.00.1'
20240722@181119.4842 9vs67j2fdhhu02b3mi6mtnnjnl 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'
20240722@181119.5077 9vs67j2fdhhu02b3mi6mtnnjnl 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'
20240722@181119.5087 9vs67j2fdhhu02b3mi6mtnnjnl Query : use flama_phc
20240722@181119.5090 9vs67j2fdhhu02b3mi6mtnnjnl Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240722@181119.5102 9vs67j2fdhhu02b3mi6mtnnjnl Query : use flama_phc
20240722@181119.5105 9vs67j2fdhhu02b3mi6mtnnjnl Query : select top 1 1 valor from td where td.ndoc = 39
20240722@181119.5115 9vs67j2fdhhu02b3mi6mtnnjnl Query : use flama_phc
20240722@181119.5118 9vs67j2fdhhu02b3mi6mtnnjnl 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')
20240722@181119.5141 9vs67j2fdhhu02b3mi6mtnnjnl Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240722@181119.5156 9vs67j2fdhhu02b3mi6mtnnjnl Query : use flama_phc
20240722@181119.5159 9vs67j2fdhhu02b3mi6mtnnjnl Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240722@181119.5169 9vs67j2fdhhu02b3mi6mtnnjnl Query : use flama_phc
20240722@181119.5172 9vs67j2fdhhu02b3mi6mtnnjnl Query : select szadrsstamp valor from szadrs where szadrsdesc='bonfilex sa-entrega'
20240722@181119.5184 9vs67j2fdhhu02b3mi6mtnnjnl Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1100';
20240722@181119.5212 9vs67j2fdhhu02b3mi6mtnnjnl Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1100';
20240722@181119.5666 arkrgov9k93cnc1hpi86vkksa8 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240722@181119.5679 arkrgov9k93cnc1hpi86vkksa8 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240722@181119.5698 arkrgov9k93cnc1hpi86vkksa8 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1101';
20240722@181119.5779 arkrgov9k93cnc1hpi86vkksa8 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1101';
20240722@181119.5795 arkrgov9k93cnc1hpi86vkksa8 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1101';
20240722@181119.5813 arkrgov9k93cnc1hpi86vkksa8 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1101';
20240722@181119.5827 arkrgov9k93cnc1hpi86vkksa8 Query : use flama_phc
20240722@181119.5830 arkrgov9k93cnc1hpi86vkksa8 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240722@181119.5845 arkrgov9k93cnc1hpi86vkksa8 Query : use flama_phc
20240722@181119.5848 arkrgov9k93cnc1hpi86vkksa8 Query : select no, estab,szadrsdesc from szadrs where u_coddest=2017
20240722@181119.5912 arkrgov9k93cnc1hpi86vkksa8 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.5501.00.1'
20240722@181119.6017 arkrgov9k93cnc1hpi86vkksa8 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'
20240722@181119.6028 arkrgov9k93cnc1hpi86vkksa8 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1805.00.1'
20240722@181119.6119 arkrgov9k93cnc1hpi86vkksa8 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.497.00.01'
20240722@181119.6207 arkrgov9k93cnc1hpi86vkksa8 Query : use flama_phc
20240722@181119.6210 arkrgov9k93cnc1hpi86vkksa8 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240722@181119.6224 arkrgov9k93cnc1hpi86vkksa8 Query : use flama_phc
20240722@181119.6229 arkrgov9k93cnc1hpi86vkksa8 Query : select top 1 1 valor from td where td.ndoc = 39
20240722@181119.6239 arkrgov9k93cnc1hpi86vkksa8 Query : use flama_phc
20240722@181119.6242 arkrgov9k93cnc1hpi86vkksa8 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')
20240722@181119.6350 arkrgov9k93cnc1hpi86vkksa8 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240722@181119.6374 arkrgov9k93cnc1hpi86vkksa8 Query : use flama_phc
20240722@181119.6377 arkrgov9k93cnc1hpi86vkksa8 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240722@181119.6387 arkrgov9k93cnc1hpi86vkksa8 Query : use flama_phc
20240722@181119.6390 arkrgov9k93cnc1hpi86vkksa8 Query : select szadrsstamp valor from szadrs where szadrsdesc='joÃo mota nunes'
20240722@181119.6403 arkrgov9k93cnc1hpi86vkksa8 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1101';
20240722@181119.6418 arkrgov9k93cnc1hpi86vkksa8 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1101';
20240722@181119.6872 gptitl0f4ritq42qskbtpm3ns4 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240722@181119.6885 gptitl0f4ritq42qskbtpm3ns4 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240722@181119.6905 gptitl0f4ritq42qskbtpm3ns4 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1102';
20240722@181119.7100 gptitl0f4ritq42qskbtpm3ns4 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1102';
20240722@181119.7129 gptitl0f4ritq42qskbtpm3ns4 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1102';
20240722@181119.7148 gptitl0f4ritq42qskbtpm3ns4 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1102';
20240722@181119.7165 gptitl0f4ritq42qskbtpm3ns4 Query : use flama_phc
20240722@181119.7168 gptitl0f4ritq42qskbtpm3ns4 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240722@181119.7194 gptitl0f4ritq42qskbtpm3ns4 Query : use flama_phc
20240722@181119.7198 gptitl0f4ritq42qskbtpm3ns4 Query : select no, estab,szadrsdesc from szadrs where u_coddest=2437
20240722@181119.7267 gptitl0f4ritq42qskbtpm3ns4 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1705.00.1'
20240722@181119.7277 gptitl0f4ritq42qskbtpm3ns4 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'
20240722@181119.7287 gptitl0f4ritq42qskbtpm3ns4 Query : use flama_phc
20240722@181119.7289 gptitl0f4ritq42qskbtpm3ns4 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240722@181119.7302 gptitl0f4ritq42qskbtpm3ns4 Query : use flama_phc
20240722@181119.7305 gptitl0f4ritq42qskbtpm3ns4 Query : select top 1 1 valor from td where td.ndoc = 39
20240722@181119.7326 gptitl0f4ritq42qskbtpm3ns4 Query : use flama_phc
20240722@181119.7329 gptitl0f4ritq42qskbtpm3ns4 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')
20240722@181119.7347 gptitl0f4ritq42qskbtpm3ns4 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240722@181119.7364 gptitl0f4ritq42qskbtpm3ns4 Query : use flama_phc
20240722@181119.7367 gptitl0f4ritq42qskbtpm3ns4 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240722@181119.7377 gptitl0f4ritq42qskbtpm3ns4 Query : use flama_phc
20240722@181119.7380 gptitl0f4ritq42qskbtpm3ns4 Query : select szadrsstamp valor from szadrs where szadrsdesc='mirandis,s.l.'
20240722@181119.7394 gptitl0f4ritq42qskbtpm3ns4 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1102';
20240722@181119.7411 gptitl0f4ritq42qskbtpm3ns4 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1102';
20240722@181119.7901 jscf4lka0btm8abui3j8g0mbes Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240722@181119.7914 jscf4lka0btm8abui3j8g0mbes Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240722@181119.7932 jscf4lka0btm8abui3j8g0mbes Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1103';
20240722@181119.7974 jscf4lka0btm8abui3j8g0mbes Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1103';
20240722@181119.7990 jscf4lka0btm8abui3j8g0mbes Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1103';
20240722@181119.8003 jscf4lka0btm8abui3j8g0mbes Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1103';
20240722@181119.8017 jscf4lka0btm8abui3j8g0mbes Query : use flama_phc
20240722@181119.8020 jscf4lka0btm8abui3j8g0mbes Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240722@181119.8034 jscf4lka0btm8abui3j8g0mbes Query : use flama_phc
20240722@181119.8036 jscf4lka0btm8abui3j8g0mbes Query : select no, estab,szadrsdesc from szadrs where u_coddest=5187
20240722@181119.8099 jscf4lka0btm8abui3j8g0mbes Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.958.00.01'
20240722@181119.8110 jscf4lka0btm8abui3j8g0mbes Query : use flama_phc
20240722@181119.8113 jscf4lka0btm8abui3j8g0mbes Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240722@181119.8126 jscf4lka0btm8abui3j8g0mbes Query : use flama_phc
20240722@181119.8129 jscf4lka0btm8abui3j8g0mbes Query : select top 1 1 valor from td where td.ndoc = 39
20240722@181119.8140 jscf4lka0btm8abui3j8g0mbes Query : use flama_phc
20240722@181119.8144 jscf4lka0btm8abui3j8g0mbes 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')
20240722@181119.8166 jscf4lka0btm8abui3j8g0mbes Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240722@181119.8184 jscf4lka0btm8abui3j8g0mbes Query : use flama_phc
20240722@181119.8187 jscf4lka0btm8abui3j8g0mbes Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240722@181119.8198 jscf4lka0btm8abui3j8g0mbes Query : use flama_phc
20240722@181119.8201 jscf4lka0btm8abui3j8g0mbes Query : select szadrsstamp valor from szadrs where szadrsdesc='eldisser, s.a. - grucoga'
20240722@181119.8213 jscf4lka0btm8abui3j8g0mbes Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1103';
20240722@181119.8229 jscf4lka0btm8abui3j8g0mbes Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1103';
20240722@181119.9634 vlnr5bi4nnmp1g4em6rbq3msvg Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240722@181119.9651 vlnr5bi4nnmp1g4em6rbq3msvg Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240722@181119.9692 vlnr5bi4nnmp1g4em6rbq3msvg Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1104';
20240722@181119.9754 vlnr5bi4nnmp1g4em6rbq3msvg Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1104';
20240722@181119.9877 vlnr5bi4nnmp1g4em6rbq3msvg Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1104';
20240722@181119.9892 vlnr5bi4nnmp1g4em6rbq3msvg Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1104';
20240722@181119.9906 vlnr5bi4nnmp1g4em6rbq3msvg Query : use flama_phc
20240722@181119.9909 vlnr5bi4nnmp1g4em6rbq3msvg Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240722@181119.9922 vlnr5bi4nnmp1g4em6rbq3msvg Query : use flama_phc
20240722@181119.9925 vlnr5bi4nnmp1g4em6rbq3msvg Query : select no, estab,szadrsdesc from szadrs where u_coddest=6975
20240722@181119.9990 vlnr5bi4nnmp1g4em6rbq3msvg Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.958.00.01'
20240722@181120.1200 vlnr5bi4nnmp1g4em6rbq3msvg Query : use flama_phc
20240722@181120.1500 vlnr5bi4nnmp1g4em6rbq3msvg Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240722@181120.3200 vlnr5bi4nnmp1g4em6rbq3msvg Query : use flama_phc
20240722@181120.3400 vlnr5bi4nnmp1g4em6rbq3msvg Query : select top 1 1 valor from td where td.ndoc = 39
20240722@181120.4500 vlnr5bi4nnmp1g4em6rbq3msvg Query : use flama_phc
20240722@181120.4800 vlnr5bi4nnmp1g4em6rbq3msvg 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')
20240722@181120.7600 vlnr5bi4nnmp1g4em6rbq3msvg Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240722@181120.9200 vlnr5bi4nnmp1g4em6rbq3msvg Query : use flama_phc
20240722@181120.9600 vlnr5bi4nnmp1g4em6rbq3msvg Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240722@181120.1060 vlnr5bi4nnmp1g4em6rbq3msvg Query : use flama_phc
20240722@181120.1080 vlnr5bi4nnmp1g4em6rbq3msvg Query : select szadrsstamp valor from szadrs where szadrsdesc='eldisser, s.a. - tarragona'
20240722@181120.1190 vlnr5bi4nnmp1g4em6rbq3msvg Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1104';
20240722@181120.1510 vlnr5bi4nnmp1g4em6rbq3msvg Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1104';

20240723@093659.1836 ef8v6o5auvnk6npod7v45cf7hn Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1105';
20240723@093659.1872 ef8v6o5auvnk6npod7v45cf7hn Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1105';
20240723@093659.1891 ef8v6o5auvnk6npod7v45cf7hn Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1105';
20240723@093659.3445 scj3333p1bu7t00t9o48ag7puf Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240723@093659.3579 scj3333p1bu7t00t9o48ag7puf Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240723@093659.3604 scj3333p1bu7t00t9o48ag7puf Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1106';
20240723@093659.3654 scj3333p1bu7t00t9o48ag7puf Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1106';
20240723@093659.3734 scj3333p1bu7t00t9o48ag7puf Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1106';
20240723@093659.3871 scj3333p1bu7t00t9o48ag7puf Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1106';
20240723@093720.8117 0uqkgr5pau614kcj8mp7o1ndbt Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240723@093720.8152 0uqkgr5pau614kcj8mp7o1ndbt Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240723@093720.8174 0uqkgr5pau614kcj8mp7o1ndbt Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1107';
20240723@093720.8226 0uqkgr5pau614kcj8mp7o1ndbt Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1107';
20240723@093720.8246 0uqkgr5pau614kcj8mp7o1ndbt Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1107';
20240723@093720.8299 0uqkgr5pau614kcj8mp7o1ndbt Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1107';
20240723@093836.1740 idt7ciu60ur4hajv9l90303j80 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240723@093836.1900 idt7ciu60ur4hajv9l90303j80 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240723@093836.2260 idt7ciu60ur4hajv9l90303j80 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1108';
20240723@093836.2800 idt7ciu60ur4hajv9l90303j80 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1108';
20240723@093836.3000 idt7ciu60ur4hajv9l90303j80 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1108';
20240723@093836.3220 idt7ciu60ur4hajv9l90303j80 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1108';
20240723@093836.6040 i14j8l62tsfm7r7vj2fkpd8i68 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240723@093836.6180 i14j8l62tsfm7r7vj2fkpd8i68 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240723@093836.6440 i14j8l62tsfm7r7vj2fkpd8i68 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1109';
20240723@093836.7600 i14j8l62tsfm7r7vj2fkpd8i68 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1109';
20240723@093836.7910 i14j8l62tsfm7r7vj2fkpd8i68 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1109';
20240723@093836.8100 i14j8l62tsfm7r7vj2fkpd8i68 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1109';
20240723@093836.1303 bgc740c48o8ds6tl322mc1bco1 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240723@093836.1318 bgc740c48o8ds6tl322mc1bco1 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240723@093836.1346 bgc740c48o8ds6tl322mc1bco1 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1110';
20240723@093836.1403 bgc740c48o8ds6tl322mc1bco1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1110';
20240723@093836.1421 bgc740c48o8ds6tl322mc1bco1 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1110';
20240723@093836.1441 bgc740c48o8ds6tl322mc1bco1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1110';
20240723@093836.1699 cjqej11c4fq0hoq9as1me20ee2 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240723@093836.1715 cjqej11c4fq0hoq9as1me20ee2 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240723@093836.1745 cjqej11c4fq0hoq9as1me20ee2 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1111';
20240723@093836.1796 cjqej11c4fq0hoq9as1me20ee2 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1111';
20240723@093836.1815 cjqej11c4fq0hoq9as1me20ee2 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1111';
20240723@093836.1841 cjqej11c4fq0hoq9as1me20ee2 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1111';
20240723@095226.3228 i2hns9ob4o6paj6jneo09oal8t Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240723@095226.3245 i2hns9ob4o6paj6jneo09oal8t Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240723@095226.3268 i2hns9ob4o6paj6jneo09oal8t Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1112';
20240723@095226.3310 i2hns9ob4o6paj6jneo09oal8t Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1112';
20240723@095226.3332 i2hns9ob4o6paj6jneo09oal8t Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1112';
20240723@095226.3346 i2hns9ob4o6paj6jneo09oal8t Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1112';
20240723@095226.4547 abp2dr6lloeof70jjehj3o24j4 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240723@095226.4562 abp2dr6lloeof70jjehj3o24j4 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240723@095226.4582 abp2dr6lloeof70jjehj3o24j4 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1113';
20240723@095226.4624 abp2dr6lloeof70jjehj3o24j4 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1113';
20240723@095226.4643 abp2dr6lloeof70jjehj3o24j4 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1113';
20240723@095226.4660 abp2dr6lloeof70jjehj3o24j4 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1113';
20240723@095226.4676 abp2dr6lloeof70jjehj3o24j4 Query : use flama_phc
20240723@095226.4683 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240723@095226.4732 abp2dr6lloeof70jjehj3o24j4 Query : select no, estab,szadrsdesc from szadrs where u_coddest=8857
20240723@095226.4804 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.948.00.01'
20240723@095226.4885 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.948.00.01' and bi.lordem =10000
20240723@095226.5178 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238338,967000001 ' 
20240723@095226.5445 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.948.00.01'
20240723@095226.5458 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.948.00.01' and bi.lordem =10000
20240723@095226.5473 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238338,967000001 ' 
20240723@095226.5488 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '304.421.00.04'
20240723@095226.5569 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='304.421.00.04' and bi.lordem =20000
20240723@095226.5894 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238592,682000002 ' 
20240723@095226.6174 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '304.421.00.04'
20240723@095226.6187 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='304.421.00.04' and bi.lordem =20000
20240723@095226.6200 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238592,682000002 ' 
20240723@095226.6215 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1705.00.1'
20240723@095226.6325 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.1705.00.1' and bi.lordem =30000
20240723@095226.6612 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238628,791000003 ' 
20240723@095226.6861 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.4421.00.1'
20240723@095226.6938 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.4421.00.1' and bi.lordem =40000
20240723@095226.7266 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238640,027000004 ' 
20240723@095226.7538 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.969.00.01'
20240723@095226.7614 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.969.00.01' and bi.lordem =50000
20240723@095226.7923 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238651,583000005 ' 
20240723@095226.8191 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.4521.00.1'
20240723@095226.8292 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.4521.00.1' and bi.lordem =60000
20240723@095226.8572 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238662,346000006 ' 
20240723@095226.8838 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.4906.00.1'
20240723@095226.8912 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.4906.00.1' and bi.lordem =70000
20240723@095226.9199 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238674,546000007 ' 
20240723@095226.9461 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.5501.00.1'
20240723@095226.9547 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.5501.00.1' and bi.lordem =90000
20240723@095226.9837 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238698,187000009 ' 
20240723@095227.1470 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.5501.00.1'
20240723@095227.1680 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.5501.00.1' and bi.lordem =90000
20240723@095227.1850 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238698,187000009 ' 
20240723@095227.1990 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.4970.00.1'
20240723@095227.2740 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.4970.00.1' and bi.lordem =100000
20240723@095227.5630 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238710,685000010 ' 
20240723@095227.8390 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.5343.00.1'
20240723@095227.9250 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.5343.00.1' and bi.lordem =110000
20240723@095227.1214 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238732,609000011 ' 
20240723@095227.1480 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.5347.00.1'
20240723@095227.1557 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.5347.00.1' and bi.lordem =120000
20240723@095227.1931 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238751,934000012 ' 
20240723@095227.2189 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '325.551.00.15'
20240723@095227.2265 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='325.551.00.15' and bi.lordem =130000
20240723@095227.2539 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238764,420000013 ' 
20240723@095227.2866 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.4902.00.1'
20240723@095227.2951 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.4902.00.1' and bi.lordem =140000
20240723@095227.3247 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238783,098000014 ' 
20240723@095227.3512 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.4901.00.1'
20240723@095227.3614 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.4901.00.1' and bi.lordem =150000
20240723@095227.3928 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238794,615000015 ' 
20240723@095227.4209 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1416.00.1'
20240723@095227.4287 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.1416.00.1' and bi.lordem =160000
20240723@095227.4600 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238814,277000016 ' 
20240723@095227.4871 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1690.00.1'
20240723@095227.4952 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.1690.00.1' and bi.lordem =170000
20240723@095227.5235 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238829,419000017 ' 
20240723@095227.5551 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.5500.00.1'
20240723@095227.5635 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.5500.00.1' and bi.lordem =180000
20240723@095227.5926 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238850,248000018 ' 
20240723@095227.6192 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1871.00.1'
20240723@095227.6270 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.1871.00.1' and bi.lordem =190000
20240723@095227.6556 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238862,481000019 ' 
20240723@095227.6808 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.646.00.01'
20240723@095227.6898 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.646.00.01' and bi.lordem =200000
20240723@095227.7188 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238874,049000020 ' 
20240723@095227.7450 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.657.00.01'
20240723@095227.8410 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.657.00.01' and bi.lordem =210000
20240723@095227.8910 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238886,647000021 ' 
20240723@095227.9181 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.657.00.01'
20240723@095227.9193 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.657.00.01' and bi.lordem =210000
20240723@095227.9207 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238886,647000021 ' 
20240723@095227.9221 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.681.00.01'
20240723@095227.9307 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.681.00.01' and bi.lordem =220000
20240723@095227.9599 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238900,664000022 ' 
20240723@095227.9870 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.682.00.01'
20240723@095227.9953 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.682.00.01' and bi.lordem =230000
20240723@095228.2400 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238928,767000023 ' 
20240723@095228.5090 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.4840.00.1'
20240723@095228.5880 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.4840.00.1' and bi.lordem =240000
20240723@095228.8830 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238947,330000024 ' 
20240723@095228.1147 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.4840.00.1'
20240723@095228.1160 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.4840.00.1' and bi.lordem =240000
20240723@095228.1176 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238947,330000024 ' 
20240723@095228.1188 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.4585.00.1'
20240723@095228.1268 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.4585.00.1' and bi.lordem =250000
20240723@095228.1557 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238959,563000025 ' 
20240723@095228.1821 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.4988.00.1'
20240723@095228.1902 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.4988.00.1' and bi.lordem =260000
20240723@095228.2190 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072238979,477000026 ' 
20240723@095228.2463 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.727.00.01'
20240723@095228.2546 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.727.00.01' and bi.lordem =270000
20240723@095228.2835 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072239211,660000027 ' 
20240723@095228.3336 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2224.00.1'
20240723@095228.3466 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.2224.00.1' and bi.lordem =280000
20240723@095228.3766 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072239232,872000028 ' 
20240723@095228.4062 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.2232.00.1'
20240723@095228.4146 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =001 and bo.boano =2024 and bo.obrano = 0001564 and bi.ref ='324.2232.00.1' and bi.lordem =290000
20240723@095228.4423 abp2dr6lloeof70jjehj3o24j4 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 = 'az24072239244,208000029 ' 
20240723@095228.4718 abp2dr6lloeof70jjehj3o24j4 Query : use flama_phc
20240723@095228.4722 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 1 valor from ts where ts.ndos = 5
20240723@095228.4800 abp2dr6lloeof70jjehj3o24j4 Query : use flama_phc
20240723@095228.4804 abp2dr6lloeof70jjehj3o24j4 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')
20240723@095228.4867 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 assinadoc issigned ,ts.stocks ,ts.bdempresas origin ,case when (cmstocks between 1 and 50 or cm2stocks between 1 and 50 ) then 1 else 0 end entrada ,case when cmstocks>50 or (cm2stocks>50 and trfa =1) then 1 else 0 end saida ,stneg validatestock ,tiposaft ,veserie useserialnumber ,foserie assetin ,ftserie assetout ,veserie assets ,trfarm assetstransfer ,grelha usegridfields from ts inner join ts2 on ts.tsstamp=ts2.ts2stamp where ts.ndos =5
20240723@095228.4989 abp2dr6lloeof70jjehj3o24j4 Query : use flama_phc
20240723@095228.4992 abp2dr6lloeof70jjehj3o24j4 Query : select top 1 ~inactivo valor from fl where no = '100001' and estab = 0 order by inactivo desc
20240723@095228.5056 abp2dr6lloeof70jjehj3o24j4 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1113';
20240723@095228.5076 abp2dr6lloeof70jjehj3o24j4 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1113';
20240723@095228.5861 k14vhpfs7qr5pc2fc337gh2mt2 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240723@095228.5876 k14vhpfs7qr5pc2fc337gh2mt2 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240723@095228.5898 k14vhpfs7qr5pc2fc337gh2mt2 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1114';
20240723@095228.5944 k14vhpfs7qr5pc2fc337gh2mt2 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1114';
20240723@095228.5963 k14vhpfs7qr5pc2fc337gh2mt2 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1114';
20240723@095228.5981 k14vhpfs7qr5pc2fc337gh2mt2 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1114';
20240723@095228.6270 73ad4v41elbtckgofeuab0dihk Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240723@095228.6287 73ad4v41elbtckgofeuab0dihk Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240723@095228.6311 73ad4v41elbtckgofeuab0dihk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1115';
20240723@095228.6355 73ad4v41elbtckgofeuab0dihk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1115';
20240723@095228.6374 73ad4v41elbtckgofeuab0dihk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1115';
20240723@095228.6390 73ad4v41elbtckgofeuab0dihk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1115';
20240723@095228.6406 73ad4v41elbtckgofeuab0dihk Query : use flama_phc
20240723@095228.6409 73ad4v41elbtckgofeuab0dihk Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240723@095228.6427 73ad4v41elbtckgofeuab0dihk Query : select no, estab,szadrsdesc from szadrs where u_coddest=23
20240723@095228.6520 73ad4v41elbtckgofeuab0dihk Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.719.00.01'
20240723@095228.6595 73ad4v41elbtckgofeuab0dihk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =054 and bo.boano =2024 and bo.obrano = 0000030 and bi.ref ='324.719.00.01' and bi.lordem =10000
20240723@095228.7076 73ad4v41elbtckgofeuab0dihk 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 = 'pll24071235269,428000001 ' 
20240723@095228.7394 73ad4v41elbtckgofeuab0dihk Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.938.00.01'
20240723@095228.7475 73ad4v41elbtckgofeuab0dihk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =054 and bo.boano =2024 and bo.obrano = 0000030 and bi.ref ='324.938.00.01' and bi.lordem =20000
20240723@095228.7762 73ad4v41elbtckgofeuab0dihk 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 = 'pll24071235706,562000002 ' 
20240723@095228.8079 73ad4v41elbtckgofeuab0dihk Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1706.00.1'
20240723@095228.8155 73ad4v41elbtckgofeuab0dihk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =054 and bo.boano =2024 and bo.obrano = 0000030 and bi.ref ='324.1706.00.1' and bi.lordem =30000
20240723@095228.8435 73ad4v41elbtckgofeuab0dihk 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 = 'pll24071235775,555000003 ' 
20240723@095228.8727 73ad4v41elbtckgofeuab0dihk Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1461.00.1'
20240723@095228.8864 73ad4v41elbtckgofeuab0dihk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =054 and bo.boano =2024 and bo.obrano = 0000030 and bi.ref ='324.1461.00.1' and bi.lordem =40000
20240723@095228.9303 73ad4v41elbtckgofeuab0dihk 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 = 'pll24071235812,210000004 ' 
20240723@095228.9653 73ad4v41elbtckgofeuab0dihk Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1670.00.1'
20240723@095228.9736 73ad4v41elbtckgofeuab0dihk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =054 and bo.boano =2024 and bo.obrano = 0000030 and bi.ref ='324.1670.00.1' and bi.lordem =50000
20240723@095229.7900 73ad4v41elbtckgofeuab0dihk 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 = 'pll24071235838,664000005 ' 
20240723@095229.3900 73ad4v41elbtckgofeuab0dihk Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1643.00.1'
20240723@095229.4730 73ad4v41elbtckgofeuab0dihk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =054 and bo.boano =2024 and bo.obrano = 0000030 and bi.ref ='324.1643.00.1' and bi.lordem =55000
20240723@095229.8370 73ad4v41elbtckgofeuab0dihk 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 = 'pll24071235901,776000008 ' 
20240723@095229.1358 73ad4v41elbtckgofeuab0dihk Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1643.00.1'
20240723@095229.1371 73ad4v41elbtckgofeuab0dihk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =054 and bo.boano =2024 and bo.obrano = 0000030 and bi.ref ='324.1643.00.1' and bi.lordem =55000
20240723@095229.1386 73ad4v41elbtckgofeuab0dihk 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 = 'pll24071235901,776000008 ' 
20240723@095229.1399 73ad4v41elbtckgofeuab0dihk Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.497.00.01'
20240723@095229.1494 73ad4v41elbtckgofeuab0dihk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =054 and bo.boano =2024 and bo.obrano = 0000030 and bi.ref ='324.497.00.01' and bi.lordem =60000
20240723@095229.1806 73ad4v41elbtckgofeuab0dihk 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 = 'pll24071235855,454000006 ' 
20240723@095229.2249 73ad4v41elbtckgofeuab0dihk Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.4970.00.1'
20240723@095229.2260 73ad4v41elbtckgofeuab0dihk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =054 and bo.boano =2024 and bo.obrano = 0000030 and bi.ref ='324.4970.00.1' and bi.lordem =70000
20240723@095229.2528 73ad4v41elbtckgofeuab0dihk 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 = 'pll24071235877,001000007 ' 
20240723@095229.2844 73ad4v41elbtckgofeuab0dihk Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '304.4211.00.1'
20240723@095229.2923 73ad4v41elbtckgofeuab0dihk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =054 and bo.boano =2024 and bo.obrano = 0000030 and bi.ref ='304.4211.00.1' and bi.lordem =80000
20240723@095229.3242 73ad4v41elbtckgofeuab0dihk 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 = 'pll24071235925,064000009 ' 
20240723@095229.3511 73ad4v41elbtckgofeuab0dihk Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '304.4020.00.1'
20240723@095229.3611 73ad4v41elbtckgofeuab0dihk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =054 and bo.boano =2024 and bo.obrano = 0000030 and bi.ref ='304.4020.00.1' and bi.lordem =90000
20240723@095229.4082 73ad4v41elbtckgofeuab0dihk 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 = 'pll24071235972,162000010 ' 
20240723@095229.4349 73ad4v41elbtckgofeuab0dihk Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '328.9902.00.1'
20240723@095229.4419 73ad4v41elbtckgofeuab0dihk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =054 and bo.boano =2024 and bo.obrano = 0000030 and bi.ref ='328.9902.00.1' and bi.lordem =100000
20240723@095229.4694 73ad4v41elbtckgofeuab0dihk 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 = 'pll24071236028,940000011 ' 
20240723@095229.4938 73ad4v41elbtckgofeuab0dihk Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '304.2186.00.1'
20240723@095229.5009 73ad4v41elbtckgofeuab0dihk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =054 and bo.boano =2024 and bo.obrano = 0000030 and bi.ref ='304.2186.00.1' and bi.lordem =110000
20240723@095229.5279 73ad4v41elbtckgofeuab0dihk 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 = 'pll24071236362,818000012 ' 
20240723@095229.5525 73ad4v41elbtckgofeuab0dihk Query : use flama_phc
20240723@095229.5529 73ad4v41elbtckgofeuab0dihk Query : select top 1 1 valor from ts where ts.ndos = 5
20240723@095229.5543 73ad4v41elbtckgofeuab0dihk Query : use flama_phc
20240723@095229.5546 73ad4v41elbtckgofeuab0dihk 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')
20240723@095229.5569 73ad4v41elbtckgofeuab0dihk Query : select top 1 assinadoc issigned ,ts.stocks ,ts.bdempresas origin ,case when (cmstocks between 1 and 50 or cm2stocks between 1 and 50 ) then 1 else 0 end entrada ,case when cmstocks>50 or (cm2stocks>50 and trfa =1) then 1 else 0 end saida ,stneg validatestock ,tiposaft ,veserie useserialnumber ,foserie assetin ,ftserie assetout ,veserie assets ,trfarm assetstransfer ,grelha usegridfields from ts inner join ts2 on ts.tsstamp=ts2.ts2stamp where ts.ndos =5
20240723@095229.5588 73ad4v41elbtckgofeuab0dihk Query : use flama_phc
20240723@095229.5591 73ad4v41elbtckgofeuab0dihk Query : select top 1 ~inactivo valor from fl where no = '100999' and estab = 0 order by inactivo desc
20240723@095229.5659 73ad4v41elbtckgofeuab0dihk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1115';
20240723@095229.5677 73ad4v41elbtckgofeuab0dihk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1115';

20240723@103936.7993 ss6grd4h8v7kr0uvdd3sudmf58 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1116';
20240723@103936.8013 ss6grd4h8v7kr0uvdd3sudmf58 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1116';
20240723@103936.8026 ss6grd4h8v7kr0uvdd3sudmf58 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1116';
20240723@103936.8042 ss6grd4h8v7kr0uvdd3sudmf58 Query : use flama_phc
20240723@103936.8045 ss6grd4h8v7kr0uvdd3sudmf58 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240723@103936.8063 ss6grd4h8v7kr0uvdd3sudmf58 Query : use flama_phc
20240723@103936.8068 ss6grd4h8v7kr0uvdd3sudmf58 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4799
20240723@103936.8133 ss6grd4h8v7kr0uvdd3sudmf58 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.958.00.01'
20240723@103936.8234 ss6grd4h8v7kr0uvdd3sudmf58 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1705.00.1'
20240723@103936.8316 ss6grd4h8v7kr0uvdd3sudmf58 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2907.00.1'
20240723@103936.8403 ss6grd4h8v7kr0uvdd3sudmf58 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1705.00.1'
20240723@103936.8415 ss6grd4h8v7kr0uvdd3sudmf58 Query : use flama_phc
20240723@103936.8419 ss6grd4h8v7kr0uvdd3sudmf58 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240723@103936.8554 ss6grd4h8v7kr0uvdd3sudmf58 Query : use flama_phc
20240723@103936.8559 ss6grd4h8v7kr0uvdd3sudmf58 Query : select top 1 1 valor from td where td.ndoc = 39
20240723@103936.8605 ss6grd4h8v7kr0uvdd3sudmf58 Query : use flama_phc
20240723@103936.8610 ss6grd4h8v7kr0uvdd3sudmf58 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')
20240723@103936.8630 ss6grd4h8v7kr0uvdd3sudmf58 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240723@103936.8708 ss6grd4h8v7kr0uvdd3sudmf58 Query : use flama_phc
20240723@103936.8711 ss6grd4h8v7kr0uvdd3sudmf58 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240723@103936.8749 ss6grd4h8v7kr0uvdd3sudmf58 Query : use flama_phc
20240723@103936.8752 ss6grd4h8v7kr0uvdd3sudmf58 Query : select szadrsstamp valor from szadrs where szadrsdesc='comercial prieto cerdan, s.l.-entrega'
20240723@103936.8764 ss6grd4h8v7kr0uvdd3sudmf58 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1116';
20240723@103936.8782 ss6grd4h8v7kr0uvdd3sudmf58 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1116';

20240723@125438.5295 saodumcvprplgdu5c63ommg8r6 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1117';
20240723@125438.5315 saodumcvprplgdu5c63ommg8r6 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1117';
20240723@125438.5331 saodumcvprplgdu5c63ommg8r6 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1117';
20240723@125438.5347 saodumcvprplgdu5c63ommg8r6 Query : use flama_phc
20240723@125438.5350 saodumcvprplgdu5c63ommg8r6 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240723@125438.5415 saodumcvprplgdu5c63ommg8r6 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1871.00.1'
20240723@125438.5505 saodumcvprplgdu5c63ommg8r6 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 = 2400437 and bi.ref ='324.1871.00.1' and bi.lordem =20000
20240723@125438.5820 saodumcvprplgdu5c63ommg8r6 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 = 'cps24071633469,496000003 ' 
20240723@125438.6121 saodumcvprplgdu5c63ommg8r6 Query : use flama_phc
20240723@125438.6126 saodumcvprplgdu5c63ommg8r6 Query : select top 1 1 valor from ts where ts.ndos = 61
20240723@125438.6982 saodumcvprplgdu5c63ommg8r6 Query : use flama_phc
20240723@125438.6986 saodumcvprplgdu5c63ommg8r6 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')
20240723@125438.7074 saodumcvprplgdu5c63ommg8r6 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
20240723@125438.7217 saodumcvprplgdu5c63ommg8r6 Query : use flama_phc
20240723@125438.7222 saodumcvprplgdu5c63ommg8r6 Query : select top 1 ~inactivo valor from fl where no = '202241' and estab = 00 order by inactivo desc
20240723@125438.7306 saodumcvprplgdu5c63ommg8r6 Query : use flama_phc
20240723@125438.7310 saodumcvprplgdu5c63ommg8r6 Query : select 1 valor from ts where ndos = 61
20240723@125438.7395 saodumcvprplgdu5c63ommg8r6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@125438.7773 saodumcvprplgdu5c63ommg8r6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240723@125438.7844 saodumcvprplgdu5c63ommg8r6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@125438.7860 saodumcvprplgdu5c63ommg8r6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240723@125438.7869 saodumcvprplgdu5c63ommg8r6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@125438.7883 saodumcvprplgdu5c63ommg8r6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240723@125438.7891 saodumcvprplgdu5c63ommg8r6 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
20240723@125438.8030 saodumcvprplgdu5c63ommg8r6 Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240723@125438.8139 saodumcvprplgdu5c63ommg8r6 Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240723@125438.8156 saodumcvprplgdu5c63ommg8r6 Query : use flama_phc
20240723@125438.8160 saodumcvprplgdu5c63ommg8r6 Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202241' and estab=00
20240723@125438.8242 saodumcvprplgdu5c63ommg8r6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@125438.8258 saodumcvprplgdu5c63ommg8r6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240723@125438.8295 saodumcvprplgdu5c63ommg8r6 Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut669f910154669f99fec7',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240723@125438.8366 saodumcvprplgdu5c63ommg8r6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@125438.8385 saodumcvprplgdu5c63ommg8r6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240723@125438.8395 saodumcvprplgdu5c63ommg8r6 Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut669f910154669f99fec7','--','bo',7.8654140266550142014 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240723@125438.8572 saodumcvprplgdu5c63ommg8r6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@125438.8591 saodumcvprplgdu5c63ommg8r6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240723@125438.8600 saodumcvprplgdu5c63ommg8r6 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 ('aut669f910154669f99fec7','guia r. fornecedor','2024-07-23',61,2402175,?,?,?,?,?,?,?,?,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')
20240723@125442.2810 saodumcvprplgdu5c63ommg8r6 Query : use flama_phc
20240723@125442.2814 saodumcvprplgdu5c63ommg8r6 Query : select st.usalote valor from st where st.ref = '324.1871.00.1'
20240723@125442.2903 saodumcvprplgdu5c63ommg8r6 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.1871.00.1'
20240723@125442.4183 saodumcvprplgdu5c63ommg8r6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@125442.4197 saodumcvprplgdu5c63ommg8r6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240723@125442.4211 saodumcvprplgdu5c63ommg8r6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@125442.4224 saodumcvprplgdu5c63ommg8r6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240723@125442.4231 saodumcvprplgdu5c63ommg8r6 Query : select sestamp valor from se where ref ='324.1871.00.1' and lote = 'r2400437200a'
20240723@125442.4291 saodumcvprplgdu5c63ommg8r6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@125442.4334 saodumcvprplgdu5c63ommg8r6 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240723@125442.4342 saodumcvprplgdu5c63ommg8r6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@125442.4355 saodumcvprplgdu5c63ommg8r6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240723@125442.4363 saodumcvprplgdu5c63ommg8r6 Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut669f938199669f9a026a',?,?,'20240723',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240723@125442.4936 saodumcvprplgdu5c63ommg8r6 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240723@125442.4990 saodumcvprplgdu5c63ommg8r6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@125442.5012 saodumcvprplgdu5c63ommg8r6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240723@125442.5023 saodumcvprplgdu5c63ommg8r6 Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut669f912549669f9a0279','aut669f910154669f99fec7',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 = 'aut669f910154669f99fec7'
20240723@125442.5238 saodumcvprplgdu5c63ommg8r6 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@125442.5261 saodumcvprplgdu5c63ommg8r6 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240723@125442.5288 saodumcvprplgdu5c63ommg8r6 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 'aut669f912549669f9a0279',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 721, 721*.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 ,45.77,45.77*200.48,45.77,45.77*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,45.77*721,45.77*721*200.48 ,39.639000,39.639000*200.48 ,39.639000,39.639000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,45.77,45.77*200.48,45.77*721,45.77*721*200.48,'cps24071633469,496000003 ',360,360*721,360,360*721,?,?,?,4 from bo bo where bo.bostamp = 'aut669f910154669f99fec7'
20240723@125455.4600 saodumcvprplgdu5c63ommg8r6 Query : use flama_phc
20240723@125455.4740 saodumcvprplgdu5c63ommg8r6 Query : declare @bostamp varchar(25) = 'aut669f910154669f99fec7' ,@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 
20240723@125506.4571 saodumcvprplgdu5c63ommg8r6 Query : use flama_phc
20240723@125506.4575 saodumcvprplgdu5c63ommg8r6 Query : select 1 valor from bo where bo.bostamp = 'aut669f910154669f99fec7'
20240723@125506.4911 saodumcvprplgdu5c63ommg8r6 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) = 'aut669f910154669f99fec7' 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 
20240723@125508.8780 saodumcvprplgdu5c63ommg8r6 Query : use flama_phc
20240723@125508.8786 saodumcvprplgdu5c63ommg8r6 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240723@125508.8802 saodumcvprplgdu5c63ommg8r6 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1117';
20240723@125508.8824 saodumcvprplgdu5c63ommg8r6 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1117';

20240723@142506.3404 bleb49l57hlmhblaa1msr5en78 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1118';
20240723@142506.3429 bleb49l57hlmhblaa1msr5en78 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1118';
20240723@142506.3450 bleb49l57hlmhblaa1msr5en78 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1118';
20240723@142506.3471 bleb49l57hlmhblaa1msr5en78 Query : use flama_phc
20240723@142506.3475 bleb49l57hlmhblaa1msr5en78 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240723@142506.3496 bleb49l57hlmhblaa1msr5en78 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1884.00.1'
20240723@142506.3587 bleb49l57hlmhblaa1msr5en78 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 = 2400213 and bi.ref ='324.1884.00.1' and bi.lordem =10000
20240723@142506.3978 bleb49l57hlmhblaa1msr5en78 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 = 'cps24022742389,691000003 ' 
20240723@142506.4387 bleb49l57hlmhblaa1msr5en78 Query : use flama_phc
20240723@142506.4391 bleb49l57hlmhblaa1msr5en78 Query : select top 1 1 valor from ts where ts.ndos = 61
20240723@142506.4404 bleb49l57hlmhblaa1msr5en78 Query : use flama_phc
20240723@142506.4407 bleb49l57hlmhblaa1msr5en78 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')
20240723@142506.4429 bleb49l57hlmhblaa1msr5en78 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
20240723@142506.4452 bleb49l57hlmhblaa1msr5en78 Query : use flama_phc
20240723@142506.4456 bleb49l57hlmhblaa1msr5en78 Query : select top 1 ~inactivo valor from fl where no = '202241' and estab = 00 order by inactivo desc
20240723@142506.4478 bleb49l57hlmhblaa1msr5en78 Query : use flama_phc
20240723@142506.4481 bleb49l57hlmhblaa1msr5en78 Query : select 1 valor from ts where ndos = 61
20240723@142506.4493 bleb49l57hlmhblaa1msr5en78 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@142506.4508 bleb49l57hlmhblaa1msr5en78 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240723@142506.4518 bleb49l57hlmhblaa1msr5en78 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@142506.4532 bleb49l57hlmhblaa1msr5en78 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240723@142506.4539 bleb49l57hlmhblaa1msr5en78 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@142506.4553 bleb49l57hlmhblaa1msr5en78 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240723@142506.4559 bleb49l57hlmhblaa1msr5en78 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
20240723@142506.4573 bleb49l57hlmhblaa1msr5en78 Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240723@142506.4591 bleb49l57hlmhblaa1msr5en78 Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240723@142506.4609 bleb49l57hlmhblaa1msr5en78 Query : use flama_phc
20240723@142506.4616 bleb49l57hlmhblaa1msr5en78 Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202241' and estab=00
20240723@142506.4628 bleb49l57hlmhblaa1msr5en78 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@142506.4643 bleb49l57hlmhblaa1msr5en78 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240723@142506.4650 bleb49l57hlmhblaa1msr5en78 Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut669fa02292669faf3270',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240723@142506.4662 bleb49l57hlmhblaa1msr5en78 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@142506.4679 bleb49l57hlmhblaa1msr5en78 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240723@142506.4687 bleb49l57hlmhblaa1msr5en78 Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut669fa02292669faf3270','--','bo',7.7933310177144841959 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240723@142506.4693 bleb49l57hlmhblaa1msr5en78 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@142506.4709 bleb49l57hlmhblaa1msr5en78 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240723@142506.4716 bleb49l57hlmhblaa1msr5en78 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 ('aut669fa02292669faf3270','guia r. fornecedor','2024-07-23',61,2402177,?,?,?,?,?,?,?,?,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')
20240723@142506.5223 bleb49l57hlmhblaa1msr5en78 Query : use flama_phc
20240723@142506.5229 bleb49l57hlmhblaa1msr5en78 Query : select st.usalote valor from st where st.ref = '324.1884.00.1'
20240723@142506.5250 bleb49l57hlmhblaa1msr5en78 Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1884.00.1'
20240723@142506.5378 bleb49l57hlmhblaa1msr5en78 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@142506.5394 bleb49l57hlmhblaa1msr5en78 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240723@142506.5405 bleb49l57hlmhblaa1msr5en78 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@142506.5420 bleb49l57hlmhblaa1msr5en78 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240723@142506.5427 bleb49l57hlmhblaa1msr5en78 Query : select sestamp valor from se where ref ='324.1884.00.1' and lote = 'r2400213100a'
20240723@142506.5438 bleb49l57hlmhblaa1msr5en78 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@142506.5454 bleb49l57hlmhblaa1msr5en78 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240723@142506.5462 bleb49l57hlmhblaa1msr5en78 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@142506.5479 bleb49l57hlmhblaa1msr5en78 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240723@142506.5487 bleb49l57hlmhblaa1msr5en78 Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut669fa05083669faf3285',?,?,'20240723',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240723@142506.5561 bleb49l57hlmhblaa1msr5en78 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240723@142506.5580 bleb49l57hlmhblaa1msr5en78 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@142506.5598 bleb49l57hlmhblaa1msr5en78 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240723@142506.5607 bleb49l57hlmhblaa1msr5en78 Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut669fa37895669faf3288','aut669fa02292669faf3270',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 = 'aut669fa02292669faf3270'
20240723@142506.5766 bleb49l57hlmhblaa1msr5en78 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@142506.5786 bleb49l57hlmhblaa1msr5en78 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240723@142506.5800 bleb49l57hlmhblaa1msr5en78 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 'aut669fa37895669faf3288',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1470, 1470*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,10000 ,28.79,28.79*200.48,28.79,28.79*200.48 ,0,0,'un',' ' ,bo.marcada,1 ,28.79*1470,28.79*1470*200.48 ,31.005000,31.005000*200.48 ,31.005000,31.005000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,28.79,28.79*200.48,28.79*1470,28.79*1470*200.48,'cps24022742389,691000003 ',224.37,224.37*1470,224.37,224.37*1470,?,?,?,4 from bo bo where bo.bostamp = 'aut669fa02292669faf3270'
20240723@142506.7971 bleb49l57hlmhblaa1msr5en78 Query : use flama_phc
20240723@142506.7977 bleb49l57hlmhblaa1msr5en78 Query : declare @bostamp varchar(25) = 'aut669fa02292669faf3270' ,@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 
20240723@142506.9488 bleb49l57hlmhblaa1msr5en78 Query : use flama_phc
20240723@142506.9493 bleb49l57hlmhblaa1msr5en78 Query : select 1 valor from bo where bo.bostamp = 'aut669fa02292669faf3270'
20240723@142506.9509 bleb49l57hlmhblaa1msr5en78 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) = 'aut669fa02292669faf3270' 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 
20240723@142507.1552 bleb49l57hlmhblaa1msr5en78 Query : use flama_phc
20240723@142507.1557 bleb49l57hlmhblaa1msr5en78 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240723@142507.1570 bleb49l57hlmhblaa1msr5en78 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1118';
20240723@142507.1590 bleb49l57hlmhblaa1msr5en78 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1118';

20240723@161307.3151 hbpmfv7b48smopb3k78vevcpj9 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1119';
20240723@161307.3282 hbpmfv7b48smopb3k78vevcpj9 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1119';
20240723@161307.3306 hbpmfv7b48smopb3k78vevcpj9 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1119';
20240723@161307.3368 hbpmfv7b48smopb3k78vevcpj9 Query : use flama_phc
20240723@161307.3453 hbpmfv7b48smopb3k78vevcpj9 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240723@161307.3894 hbpmfv7b48smopb3k78vevcpj9 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '304.4320.00.1'
20240723@161307.4129 hbpmfv7b48smopb3k78vevcpj9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =005 and bo.boano =2024 and bo.obrano = 0000393 and bi.ref ='304.4320.00.1' and bi.lordem =80000
20240723@161307.4847 hbpmfv7b48smopb3k78vevcpj9 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 = 'az24072347252,210000008 ' 
20240723@161307.5428 hbpmfv7b48smopb3k78vevcpj9 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '326.595.00.01'
20240723@161307.5581 hbpmfv7b48smopb3k78vevcpj9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =005 and bo.boano =2024 and bo.obrano = 0000393 and bi.ref ='326.595.00.01' and bi.lordem =100000
20240723@161307.6172 hbpmfv7b48smopb3k78vevcpj9 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 = 'az24072347289,208000010 ' 
20240723@161307.6749 hbpmfv7b48smopb3k78vevcpj9 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '304.4860.00.1'
20240723@161307.6911 hbpmfv7b48smopb3k78vevcpj9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =005 and bo.boano =2024 and bo.obrano = 0000393 and bi.ref ='304.4860.00.1' and bi.lordem =20000
20240723@161307.8033 hbpmfv7b48smopb3k78vevcpj9 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 = 'az24072347222,338000002 ' 
20240723@161307.8775 hbpmfv7b48smopb3k78vevcpj9 Query : use flama_phc
20240723@161307.8780 hbpmfv7b48smopb3k78vevcpj9 Query : select top 1 1 valor from ts where ts.ndos = 61
20240723@161307.8863 hbpmfv7b48smopb3k78vevcpj9 Query : use flama_phc
20240723@161307.8867 hbpmfv7b48smopb3k78vevcpj9 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')
20240723@161307.8976 hbpmfv7b48smopb3k78vevcpj9 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
20240723@161307.9008 hbpmfv7b48smopb3k78vevcpj9 Query : use flama_phc
20240723@161307.9149 hbpmfv7b48smopb3k78vevcpj9 Query : select top 1 ~inactivo valor from fl where no = '2' and estab = 2 order by inactivo desc
20240723@161307.9656 hbpmfv7b48smopb3k78vevcpj9 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1119';
20240723@161307.9751 hbpmfv7b48smopb3k78vevcpj9 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1119';
20240723@161308.1813 pp1qcbqm16qmgjqbdt5m8m0ihv Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240723@161308.2168 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240723@161308.2643 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1120';
20240723@161308.3463 pp1qcbqm16qmgjqbdt5m8m0ihv Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1120';
20240723@161308.3606 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1120';
20240723@161308.4148 pp1qcbqm16qmgjqbdt5m8m0ihv Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1120';
20240723@161308.4358 pp1qcbqm16qmgjqbdt5m8m0ihv Query : use flama_phc
20240723@161308.4443 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240723@161308.4875 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1847.00.1'
20240723@161308.5565 pp1qcbqm16qmgjqbdt5m8m0ihv 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 = 2400288 and bi.ref ='324.1847.00.1' and bi.lordem =10000
20240723@161308.7559 pp1qcbqm16qmgjqbdt5m8m0ihv 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 = 'cps24031443319,123000004 ' 
20240723@161308.8568 pp1qcbqm16qmgjqbdt5m8m0ihv Query : use flama_phc
20240723@161308.8616 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select top 1 1 valor from ts where ts.ndos = 61
20240723@161308.8962 pp1qcbqm16qmgjqbdt5m8m0ihv Query : use flama_phc
20240723@161308.9070 pp1qcbqm16qmgjqbdt5m8m0ihv 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')
20240723@161309.1170 pp1qcbqm16qmgjqbdt5m8m0ihv 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
20240723@161309.8250 pp1qcbqm16qmgjqbdt5m8m0ihv Query : use flama_phc
20240723@161309.9000 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select top 1 ~inactivo valor from fl where no = '202241' and estab = 00 order by inactivo desc
20240723@161309.1233 pp1qcbqm16qmgjqbdt5m8m0ihv Query : use flama_phc
20240723@161309.1279 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select 1 valor from ts where ndos = 61
20240723@161309.1680 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@161309.2330 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240723@161309.3084 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@161309.3486 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240723@161309.3631 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@161309.3888 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240723@161309.4043 pp1qcbqm16qmgjqbdt5m8m0ihv 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
20240723@161309.4399 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240723@161309.4698 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240723@161309.5043 pp1qcbqm16qmgjqbdt5m8m0ihv Query : use flama_phc
20240723@161309.5163 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202241' and estab=00
20240723@161309.5404 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@161309.5749 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240723@161309.5910 pp1qcbqm16qmgjqbdt5m8m0ihv Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut669fc06825669fc8857b',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240723@161309.5964 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@161309.6213 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240723@161309.6359 pp1qcbqm16qmgjqbdt5m8m0ihv Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut669fc06825669fc8857b','--','bo',7.8614173228346456692 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240723@161309.6413 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@161309.6726 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240723@161309.6872 pp1qcbqm16qmgjqbdt5m8m0ihv 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 ('aut669fc06825669fc8857b','guia r. fornecedor','2024-07-23',61,2402178,?,?,?,?,?,?,?,?,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')
20240723@161309.8726 pp1qcbqm16qmgjqbdt5m8m0ihv Query : use flama_phc
20240723@161309.8912 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select st.usalote valor from st where st.ref = '324.1847.00.1'
20240723@161309.9442 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1847.00.1'
20240723@161310.3900 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@161310.4070 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240723@161310.8630 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@161310.1142 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240723@161310.1314 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select sestamp valor from se where ref ='324.1847.00.1' and lote = 'r2400288100a'
20240723@161310.1603 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@161310.1877 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240723@161310.2057 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@161310.2349 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240723@161310.2513 pp1qcbqm16qmgjqbdt5m8m0ihv Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut669fc80440669fc88632',?,?,'20240723',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240723@161310.2815 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240723@161310.3128 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@161310.3430 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240723@161310.3642 pp1qcbqm16qmgjqbdt5m8m0ihv Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut669fc61784669fc8864c','aut669fc06825669fc8857b',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 = 'aut669fc06825669fc8857b'
20240723@161310.4137 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@161310.6460 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240723@161310.7467 pp1qcbqm16qmgjqbdt5m8m0ihv 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 'aut669fc61784669fc8864c',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1336, 1336*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,10000 ,25.4,25.4*200.48,25.4,25.4*200.48 ,0,0,'un ','' ,bo.marcada,1 ,25.4*1336,25.4*1336*200.48 ,27.265000,27.265000*200.48 ,27.265000,27.265000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,25.4,25.4*200.48,25.4*1336,25.4*1336*200.48,'cps24031443319,123000004 ',199.68,199.68*1336,199.68,199.68*1336,?,?,?,4 from bo bo where bo.bostamp = 'aut669fc06825669fc8857b'
20240723@161311.4662 pp1qcbqm16qmgjqbdt5m8m0ihv Query : use flama_phc
20240723@161311.4861 pp1qcbqm16qmgjqbdt5m8m0ihv Query : declare @bostamp varchar(25) = 'aut669fc06825669fc8857b' ,@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 
20240723@161312.5044 pp1qcbqm16qmgjqbdt5m8m0ihv Query : use flama_phc
20240723@161312.5760 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select 1 valor from bo where bo.bostamp = 'aut669fc06825669fc8857b'
20240723@161312.7011 pp1qcbqm16qmgjqbdt5m8m0ihv 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) = 'aut669fc06825669fc8857b' 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 
20240723@161314.2226 pp1qcbqm16qmgjqbdt5m8m0ihv Query : use flama_phc
20240723@161314.2438 pp1qcbqm16qmgjqbdt5m8m0ihv Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240723@161314.2615 pp1qcbqm16qmgjqbdt5m8m0ihv Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1120';
20240723@161314.3465 pp1qcbqm16qmgjqbdt5m8m0ihv Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1120';

20240723@172829.9800 tdhe77u1og7p6kpfnr82l8i9hi Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1121';
20240723@172829.9821 tdhe77u1og7p6kpfnr82l8i9hi Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1121';
20240723@172829.9837 tdhe77u1og7p6kpfnr82l8i9hi Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1121';
20240723@172829.9854 tdhe77u1og7p6kpfnr82l8i9hi Query : use flama_phc
20240723@172829.9858 tdhe77u1og7p6kpfnr82l8i9hi Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240723@172829.9924 tdhe77u1og7p6kpfnr82l8i9hi Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.728.00.01'
20240723@172830.1500 tdhe77u1og7p6kpfnr82l8i9hi 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 = 2400238 and bi.ref ='324.728.00.01' and bi.lordem =20000
20240723@172830.1725 tdhe77u1og7p6kpfnr82l8i9hi 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 = 'cps24022944617,430000002 ' 
20240723@172830.2008 tdhe77u1og7p6kpfnr82l8i9hi Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.729.00.01'
20240723@172830.2105 tdhe77u1og7p6kpfnr82l8i9hi 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 = 2400238 and bi.ref ='324.729.00.01' and bi.lordem =10000
20240723@172830.2402 tdhe77u1og7p6kpfnr82l8i9hi 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 = 'cps24022944618,000000003 ' 
20240723@172830.2732 tdhe77u1og7p6kpfnr82l8i9hi Query : use flama_phc
20240723@172830.2738 tdhe77u1og7p6kpfnr82l8i9hi Query : select top 1 1 valor from ts where ts.ndos = 61
20240723@172830.2814 tdhe77u1og7p6kpfnr82l8i9hi Query : use flama_phc
20240723@172830.2818 tdhe77u1og7p6kpfnr82l8i9hi 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')
20240723@172830.2910 tdhe77u1og7p6kpfnr82l8i9hi 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
20240723@172830.3067 tdhe77u1og7p6kpfnr82l8i9hi Query : use flama_phc
20240723@172830.3071 tdhe77u1og7p6kpfnr82l8i9hi Query : select top 1 ~inactivo valor from fl where no = '202315' and estab = 00 order by inactivo desc
20240723@172830.3146 tdhe77u1og7p6kpfnr82l8i9hi Query : use flama_phc
20240723@172830.3170 tdhe77u1og7p6kpfnr82l8i9hi Query : select 1 valor from ts where ndos = 61
20240723@172830.3256 tdhe77u1og7p6kpfnr82l8i9hi Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@172830.3663 tdhe77u1og7p6kpfnr82l8i9hi Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240723@172830.3756 tdhe77u1og7p6kpfnr82l8i9hi Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@172830.3773 tdhe77u1og7p6kpfnr82l8i9hi Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240723@172830.3780 tdhe77u1og7p6kpfnr82l8i9hi Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@172830.3793 tdhe77u1og7p6kpfnr82l8i9hi Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240723@172830.3812 tdhe77u1og7p6kpfnr82l8i9hi 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
20240723@172830.3951 tdhe77u1og7p6kpfnr82l8i9hi Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240723@172830.4047 tdhe77u1og7p6kpfnr82l8i9hi Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240723@172830.4066 tdhe77u1og7p6kpfnr82l8i9hi Query : use flama_phc
20240723@172830.4069 tdhe77u1og7p6kpfnr82l8i9hi Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202315' and estab=00
20240723@172830.4151 tdhe77u1og7p6kpfnr82l8i9hi Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@172830.4165 tdhe77u1og7p6kpfnr82l8i9hi Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240723@172830.4201 tdhe77u1og7p6kpfnr82l8i9hi Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut669fd44285669fda2e63',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240723@172830.4254 tdhe77u1og7p6kpfnr82l8i9hi Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@172830.4268 tdhe77u1og7p6kpfnr82l8i9hi Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240723@172830.4276 tdhe77u1og7p6kpfnr82l8i9hi Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut669fd44285669fda2e63','--','bo',7.8135888501742160278 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240723@172830.4428 tdhe77u1og7p6kpfnr82l8i9hi Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@172830.4446 tdhe77u1og7p6kpfnr82l8i9hi Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240723@172830.4509 tdhe77u1og7p6kpfnr82l8i9hi 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 ('aut669fd44285669fda2e63','guia r. fornecedor','2024-07-23',61,2402180,?,?,?,?,?,?,?,?,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')
20240723@172830.6123 tdhe77u1og7p6kpfnr82l8i9hi Query : use flama_phc
20240723@172830.6128 tdhe77u1og7p6kpfnr82l8i9hi Query : select st.usalote valor from st where st.ref = '324.728.00.01'
20240723@172830.6154 tdhe77u1og7p6kpfnr82l8i9hi 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.728.00.01'
20240723@172830.6304 tdhe77u1og7p6kpfnr82l8i9hi Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@172830.6324 tdhe77u1og7p6kpfnr82l8i9hi Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240723@172830.6414 tdhe77u1og7p6kpfnr82l8i9hi Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@172830.6431 tdhe77u1og7p6kpfnr82l8i9hi Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240723@172830.6439 tdhe77u1og7p6kpfnr82l8i9hi Query : select sestamp valor from se where ref ='324.728.00.01' and lote = 'r2400238200a'
20240723@172830.6449 tdhe77u1og7p6kpfnr82l8i9hi Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@172830.6469 tdhe77u1og7p6kpfnr82l8i9hi Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240723@172830.6476 tdhe77u1og7p6kpfnr82l8i9hi Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@172830.6490 tdhe77u1og7p6kpfnr82l8i9hi Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240723@172830.6498 tdhe77u1og7p6kpfnr82l8i9hi Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut669fd19010669fda2e9e',?,?,'20240723',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240723@172830.7095 tdhe77u1og7p6kpfnr82l8i9hi Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240723@172830.7140 tdhe77u1og7p6kpfnr82l8i9hi Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@172830.7154 tdhe77u1og7p6kpfnr82l8i9hi Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240723@172830.7162 tdhe77u1og7p6kpfnr82l8i9hi Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut669fd85750669fda2eae','aut669fd44285669fda2e63',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 = 'aut669fd44285669fda2e63'
20240723@172830.7418 tdhe77u1og7p6kpfnr82l8i9hi Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@172830.7438 tdhe77u1og7p6kpfnr82l8i9hi Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240723@172830.7454 tdhe77u1og7p6kpfnr82l8i9hi 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 'aut669fd85750669fda2eae',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 3000, 3000*.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 ,5.74,5.74*200.48,5.74,5.74*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,5.74*3000,5.74*3000*200.48 ,.000000,.000000*200.48 ,.000000,.000000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,5.74,5.74*200.48,5.74*3000,5.74*3000*200.48,'cps24022944617,430000002 ',44.85,44.85*3000,44.85,44.85*3000,?,?,?,4 from bo bo where bo.bostamp = 'aut669fd44285669fda2e63'
20240723@172837.3452 tdhe77u1og7p6kpfnr82l8i9hi Query : use flama_phc
20240723@172837.3458 tdhe77u1og7p6kpfnr82l8i9hi Query : select st.usalote valor from st where st.ref = '324.729.00.01'
20240723@172837.3472 tdhe77u1og7p6kpfnr82l8i9hi 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.729.00.01'
20240723@172837.3593 tdhe77u1og7p6kpfnr82l8i9hi Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@172837.3608 tdhe77u1og7p6kpfnr82l8i9hi Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240723@172837.3629 tdhe77u1og7p6kpfnr82l8i9hi Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@172837.3644 tdhe77u1og7p6kpfnr82l8i9hi Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240723@172837.3652 tdhe77u1og7p6kpfnr82l8i9hi Query : select sestamp valor from se where ref ='324.729.00.01' and lote = 'r2400238100a'
20240723@172837.3661 tdhe77u1og7p6kpfnr82l8i9hi Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@172837.3673 tdhe77u1og7p6kpfnr82l8i9hi Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240723@172837.3680 tdhe77u1og7p6kpfnr82l8i9hi Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@172837.3694 tdhe77u1og7p6kpfnr82l8i9hi Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240723@172837.3701 tdhe77u1og7p6kpfnr82l8i9hi Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut669fd73278669fda3559',?,?,'20240723',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240723@172837.3753 tdhe77u1og7p6kpfnr82l8i9hi Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240723@172837.3765 tdhe77u1og7p6kpfnr82l8i9hi Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@172837.3779 tdhe77u1og7p6kpfnr82l8i9hi Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240723@172837.3786 tdhe77u1og7p6kpfnr82l8i9hi Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut669fd96283669fda355b','aut669fd44285669fda2e63',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 = 'aut669fd44285669fda2e63'
20240723@172837.3934 tdhe77u1og7p6kpfnr82l8i9hi Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240723@172837.3953 tdhe77u1og7p6kpfnr82l8i9hi Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240723@172837.3965 tdhe77u1og7p6kpfnr82l8i9hi 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 'aut669fd96283669fda355b',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 2500, 2500*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,20000 ,5.74,5.74*200.48,5.74,5.74*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,5.74*2500,5.74*2500*200.48 ,.000000,.000000*200.48 ,.000000,.000000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,5.74,5.74*200.48,5.74*2500,5.74*2500*200.48,'cps24022944618,000000003 ',44.85,44.85*2500,44.85,44.85*2500,?,?,?,4 from bo bo where bo.bostamp = 'aut669fd44285669fda2e63'
20240723@172837.6069 tdhe77u1og7p6kpfnr82l8i9hi Query : use flama_phc
20240723@172837.6075 tdhe77u1og7p6kpfnr82l8i9hi Query : declare @bostamp varchar(25) = 'aut669fd44285669fda2e63' ,@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 
20240723@172837.8515 tdhe77u1og7p6kpfnr82l8i9hi Query : use flama_phc
20240723@172837.8520 tdhe77u1og7p6kpfnr82l8i9hi Query : select 1 valor from bo where bo.bostamp = 'aut669fd44285669fda2e63'
20240723@172837.8568 tdhe77u1og7p6kpfnr82l8i9hi 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) = 'aut669fd44285669fda2e63' 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 
20240723@172838.1104 tdhe77u1og7p6kpfnr82l8i9hi Query : use flama_phc
20240723@172838.1109 tdhe77u1og7p6kpfnr82l8i9hi Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240723@172838.1124 tdhe77u1og7p6kpfnr82l8i9hi Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1121';
20240723@172838.1150 tdhe77u1og7p6kpfnr82l8i9hi Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1121';

20240723@185908.7348 a57g5h2715hejh0ts3ugs26f1s Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1122';
20240723@185908.7367 a57g5h2715hejh0ts3ugs26f1s Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1122';
20240723@185908.7382 a57g5h2715hejh0ts3ugs26f1s Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1122';
20240723@185908.7398 a57g5h2715hejh0ts3ugs26f1s Query : use flama_phc
20240723@185908.7401 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240723@185908.7420 a57g5h2715hejh0ts3ugs26f1s Query : use flama_phc
20240723@185908.7423 a57g5h2715hejh0ts3ugs26f1s Query : select no, estab,szadrsdesc from szadrs where u_coddest=2427
20240723@185908.7494 a57g5h2715hejh0ts3ugs26f1s 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'
20240723@185908.7602 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404893 and bi.ref ='324.4930.00.1' and bi.lordem =1
20240723@185908.7912 a57g5h2715hejh0ts3ugs26f1s 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'
20240723@185908.7923 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404893 and bi.ref ='324.4930.00.1' and bi.lordem =1
20240723@185908.7929 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.958.00.01'
20240723@185908.8037 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404893 and bi.ref ='324.958.00.01' and bi.lordem =2
20240723@185908.9473 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.958.00.01'
20240723@185908.9487 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404893 and bi.ref ='324.958.00.01' and bi.lordem =2
20240723@185908.9495 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.958.00.01'
20240723@185908.9505 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404893 and bi.ref ='324.958.00.01' and bi.lordem =2
20240723@185908.9512 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.958.00.01'
20240723@185908.9521 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404893 and bi.ref ='324.958.00.01' and bi.lordem =2
20240723@185908.9527 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.958.00.01'
20240723@185908.9537 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404893 and bi.ref ='324.958.00.01' and bi.lordem =3
20240723@185908.9927 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.958.00.01'
20240723@185909.2010 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404893 and bi.ref ='324.958.00.01' and bi.lordem =3
20240723@185909.2110 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.958.00.01'
20240723@185909.2210 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404893 and bi.ref ='324.958.00.01' and bi.lordem =3
20240723@185909.2290 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.958.00.01'
20240723@185909.2390 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404893 and bi.ref ='324.958.00.01' and bi.lordem =3
20240723@185909.2460 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.958.00.01'
20240723@185909.2550 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404893 and bi.ref ='324.958.00.01' and bi.lordem =3
20240723@185909.2630 a57g5h2715hejh0ts3ugs26f1s Query : use flama_phc
20240723@185909.2660 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240723@185909.4180 a57g5h2715hejh0ts3ugs26f1s Query : use flama_phc
20240723@185909.4220 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 1 valor from td where td.ndoc = 39
20240723@185909.4710 a57g5h2715hejh0ts3ugs26f1s Query : use flama_phc
20240723@185909.4740 a57g5h2715hejh0ts3ugs26f1s 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')
20240723@185909.5010 a57g5h2715hejh0ts3ugs26f1s Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240723@185909.6120 a57g5h2715hejh0ts3ugs26f1s Query : use flama_phc
20240723@185909.6170 a57g5h2715hejh0ts3ugs26f1s Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240723@185909.6760 a57g5h2715hejh0ts3ugs26f1s Query : use flama_phc
20240723@185909.6800 a57g5h2715hejh0ts3ugs26f1s Query : select szadrsstamp valor from szadrs where szadrsdesc='electrodomesticos divelsa,s.a'
20240723@185909.6950 a57g5h2715hejh0ts3ugs26f1s Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1122';
20240723@185909.7160 a57g5h2715hejh0ts3ugs26f1s Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1122';
20240723@185909.1338 3n5187q9bgvmmassjivbgkne4d Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240723@185909.1375 3n5187q9bgvmmassjivbgkne4d Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240723@185909.1398 3n5187q9bgvmmassjivbgkne4d Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1123';
20240723@185909.1447 3n5187q9bgvmmassjivbgkne4d Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1123';
20240723@185909.1466 3n5187q9bgvmmassjivbgkne4d Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1123';
20240723@185909.1487 3n5187q9bgvmmassjivbgkne4d Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1123';
20240723@185909.1502 3n5187q9bgvmmassjivbgkne4d Query : use flama_phc
20240723@185909.1506 3n5187q9bgvmmassjivbgkne4d Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240723@185909.1522 3n5187q9bgvmmassjivbgkne4d Query : use flama_phc
20240723@185909.1525 3n5187q9bgvmmassjivbgkne4d Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240723@185909.1599 3n5187q9bgvmmassjivbgkne4d Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1667.00.1'
20240723@185909.1712 3n5187q9bgvmmassjivbgkne4d Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404894 and bi.ref ='324.1667.00.1' and bi.lordem =1
20240723@185909.2011 3n5187q9bgvmmassjivbgkne4d Query : use flama_phc
20240723@185909.2015 3n5187q9bgvmmassjivbgkne4d Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240723@185909.2030 3n5187q9bgvmmassjivbgkne4d Query : use flama_phc
20240723@185909.2033 3n5187q9bgvmmassjivbgkne4d Query : select top 1 1 valor from td where td.ndoc = 39
20240723@185909.2044 3n5187q9bgvmmassjivbgkne4d Query : use flama_phc
20240723@185909.2047 3n5187q9bgvmmassjivbgkne4d 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')
20240723@185909.2067 3n5187q9bgvmmassjivbgkne4d Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240723@185909.2083 3n5187q9bgvmmassjivbgkne4d Query : use flama_phc
20240723@185909.2086 3n5187q9bgvmmassjivbgkne4d Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240723@185909.2097 3n5187q9bgvmmassjivbgkne4d Query : use flama_phc
20240723@185909.2100 3n5187q9bgvmmassjivbgkne4d Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240723@185909.2112 3n5187q9bgvmmassjivbgkne4d Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1123';
20240723@185909.2129 3n5187q9bgvmmassjivbgkne4d Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1123';
20240723@185909.2612 arj91qqv8hsrv7fgcveql6uj39 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240723@185909.2626 arj91qqv8hsrv7fgcveql6uj39 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240723@185909.2648 arj91qqv8hsrv7fgcveql6uj39 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1124';
20240723@185909.2698 arj91qqv8hsrv7fgcveql6uj39 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1124';
20240723@185909.2718 arj91qqv8hsrv7fgcveql6uj39 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1124';
20240723@185909.2732 arj91qqv8hsrv7fgcveql6uj39 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1124';
20240723@185909.2747 arj91qqv8hsrv7fgcveql6uj39 Query : use flama_phc
20240723@185909.2750 arj91qqv8hsrv7fgcveql6uj39 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240723@185909.2766 arj91qqv8hsrv7fgcveql6uj39 Query : use flama_phc
20240723@185909.2769 arj91qqv8hsrv7fgcveql6uj39 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240723@185909.2803 arj91qqv8hsrv7fgcveql6uj39 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '326.595.00.01'
20240723@185909.2919 arj91qqv8hsrv7fgcveql6uj39 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404896 and bi.ref ='326.595.00.01' and bi.lordem =1
20240723@185909.3241 arj91qqv8hsrv7fgcveql6uj39 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '326.595.00.01'
20240723@185909.3253 arj91qqv8hsrv7fgcveql6uj39 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404896 and bi.ref ='326.595.00.01' and bi.lordem =1
20240723@185909.3261 arj91qqv8hsrv7fgcveql6uj39 Query : use flama_phc
20240723@185909.3264 arj91qqv8hsrv7fgcveql6uj39 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240723@185909.3278 arj91qqv8hsrv7fgcveql6uj39 Query : use flama_phc
20240723@185909.3281 arj91qqv8hsrv7fgcveql6uj39 Query : select top 1 1 valor from td where td.ndoc = 39
20240723@185909.3294 arj91qqv8hsrv7fgcveql6uj39 Query : use flama_phc
20240723@185909.3297 arj91qqv8hsrv7fgcveql6uj39 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')
20240723@185909.3317 arj91qqv8hsrv7fgcveql6uj39 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240723@185909.3334 arj91qqv8hsrv7fgcveql6uj39 Query : use flama_phc
20240723@185909.3337 arj91qqv8hsrv7fgcveql6uj39 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240723@185909.3349 arj91qqv8hsrv7fgcveql6uj39 Query : use flama_phc
20240723@185909.3352 arj91qqv8hsrv7fgcveql6uj39 Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240723@185909.3364 arj91qqv8hsrv7fgcveql6uj39 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1124';
20240723@185909.3383 arj91qqv8hsrv7fgcveql6uj39 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1124';
20240723@185909.3913 67rcv384sk5kppvle8optb3gcb Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240723@185909.3930 67rcv384sk5kppvle8optb3gcb Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240723@185909.3958 67rcv384sk5kppvle8optb3gcb Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1125';
20240723@185909.4008 67rcv384sk5kppvle8optb3gcb Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1125';
20240723@185909.4029 67rcv384sk5kppvle8optb3gcb Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1125';
20240723@185909.4047 67rcv384sk5kppvle8optb3gcb Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1125';
20240723@185909.4062 67rcv384sk5kppvle8optb3gcb Query : use flama_phc
20240723@185909.4066 67rcv384sk5kppvle8optb3gcb Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240723@185909.4082 67rcv384sk5kppvle8optb3gcb Query : use flama_phc
20240723@185909.4086 67rcv384sk5kppvle8optb3gcb Query : select no, estab,szadrsdesc from szadrs where u_coddest=4743
20240723@185909.4160 67rcv384sk5kppvle8optb3gcb Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.958.00.01'
20240723@185909.4173 67rcv384sk5kppvle8optb3gcb Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404897 and bi.ref ='324.958.00.01' and bi.lordem =1
20240723@185909.4489 67rcv384sk5kppvle8optb3gcb Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.958.00.01'
20240723@185909.4501 67rcv384sk5kppvle8optb3gcb Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404897 and bi.ref ='324.958.00.01' and bi.lordem =1
20240723@185909.4509 67rcv384sk5kppvle8optb3gcb Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.958.00.01'
20240723@185909.4521 67rcv384sk5kppvle8optb3gcb Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404897 and bi.ref ='324.958.00.01' and bi.lordem =1
20240723@185909.4529 67rcv384sk5kppvle8optb3gcb Query : use flama_phc
20240723@185909.4533 67rcv384sk5kppvle8optb3gcb Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240723@185909.4547 67rcv384sk5kppvle8optb3gcb Query : use flama_phc
20240723@185909.4550 67rcv384sk5kppvle8optb3gcb Query : select top 1 1 valor from td where td.ndoc = 39
20240723@185909.4560 67rcv384sk5kppvle8optb3gcb Query : use flama_phc
20240723@185909.4563 67rcv384sk5kppvle8optb3gcb 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')
20240723@185909.4585 67rcv384sk5kppvle8optb3gcb Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240723@185909.4602 67rcv384sk5kppvle8optb3gcb Query : use flama_phc
20240723@185909.4605 67rcv384sk5kppvle8optb3gcb Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240723@185909.4617 67rcv384sk5kppvle8optb3gcb Query : use flama_phc
20240723@185909.4621 67rcv384sk5kppvle8optb3gcb Query : select szadrsstamp valor from szadrs where szadrsdesc='101597 - auchan retail portugal , sa'
20240723@185909.4635 67rcv384sk5kppvle8optb3gcb Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1125';
20240723@185909.4655 67rcv384sk5kppvle8optb3gcb Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1125';
20240723@185909.5147 p83bbqhsmfdsd14ei621vk2agc Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240723@185909.5163 p83bbqhsmfdsd14ei621vk2agc Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240723@185909.5187 p83bbqhsmfdsd14ei621vk2agc Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1126';
20240723@185909.5235 p83bbqhsmfdsd14ei621vk2agc Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1126';
20240723@185909.5257 p83bbqhsmfdsd14ei621vk2agc Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1126';
20240723@185909.5271 p83bbqhsmfdsd14ei621vk2agc Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1126';
20240723@185909.5287 p83bbqhsmfdsd14ei621vk2agc Query : use flama_phc
20240723@185909.5290 p83bbqhsmfdsd14ei621vk2agc Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240723@185909.5306 p83bbqhsmfdsd14ei621vk2agc Query : use flama_phc
20240723@185909.5309 p83bbqhsmfdsd14ei621vk2agc Query : select no, estab,szadrsdesc from szadrs where u_coddest=6737
20240723@185909.5382 p83bbqhsmfdsd14ei621vk2agc Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '327.8152.00.1'
20240723@185909.5494 p83bbqhsmfdsd14ei621vk2agc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404898 and bi.ref ='327.8152.00.1' and bi.lordem =1
20240723@185909.5780 p83bbqhsmfdsd14ei621vk2agc Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '327.8152.00.1'
20240723@185909.5792 p83bbqhsmfdsd14ei621vk2agc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404898 and bi.ref ='327.8152.00.1' and bi.lordem =1
20240723@185909.5800 p83bbqhsmfdsd14ei621vk2agc Query : use flama_phc
20240723@185909.5803 p83bbqhsmfdsd14ei621vk2agc Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240723@185909.5816 p83bbqhsmfdsd14ei621vk2agc Query : use flama_phc
20240723@185909.5819 p83bbqhsmfdsd14ei621vk2agc Query : select top 1 1 valor from td where td.ndoc = 39
20240723@185909.5830 p83bbqhsmfdsd14ei621vk2agc Query : use flama_phc
20240723@185909.5833 p83bbqhsmfdsd14ei621vk2agc 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')
20240723@185909.5855 p83bbqhsmfdsd14ei621vk2agc Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240723@185909.5871 p83bbqhsmfdsd14ei621vk2agc Query : use flama_phc
20240723@185909.5874 p83bbqhsmfdsd14ei621vk2agc Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240723@185909.5887 p83bbqhsmfdsd14ei621vk2agc Query : use flama_phc
20240723@185909.5890 p83bbqhsmfdsd14ei621vk2agc Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-plaza large formats rainha'
20240723@185909.5902 p83bbqhsmfdsd14ei621vk2agc Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1126';
20240723@185909.5920 p83bbqhsmfdsd14ei621vk2agc Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1126';
20240723@185909.6424 b0mu3po9rr08rgal1p7nl57lb3 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240723@185909.6441 b0mu3po9rr08rgal1p7nl57lb3 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240723@185909.6466 b0mu3po9rr08rgal1p7nl57lb3 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1127';
20240723@185909.6514 b0mu3po9rr08rgal1p7nl57lb3 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1127';
20240723@185909.6535 b0mu3po9rr08rgal1p7nl57lb3 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1127';
20240723@185909.6551 b0mu3po9rr08rgal1p7nl57lb3 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1127';
20240723@185909.6566 b0mu3po9rr08rgal1p7nl57lb3 Query : use flama_phc
20240723@185909.6570 b0mu3po9rr08rgal1p7nl57lb3 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240723@185909.6588 b0mu3po9rr08rgal1p7nl57lb3 Query : use flama_phc
20240723@185909.6592 b0mu3po9rr08rgal1p7nl57lb3 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4804
20240723@185909.6668 b0mu3po9rr08rgal1p7nl57lb3 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'
20240723@185909.6793 b0mu3po9rr08rgal1p7nl57lb3 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404899 and bi.ref ='304.422.00.07' and bi.lordem =1
20240723@185909.7072 b0mu3po9rr08rgal1p7nl57lb3 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'
20240723@185909.7340 b0mu3po9rr08rgal1p7nl57lb3 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404899 and bi.ref ='304.421.00.04' and bi.lordem =2
20240723@185909.7665 b0mu3po9rr08rgal1p7nl57lb3 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'
20240723@185909.7792 b0mu3po9rr08rgal1p7nl57lb3 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2048 and bo.obrano = 2404899 and bi.ref ='324.4960.00.1' and bi.lordem =3
20240723@185909.8112 b0mu3po9rr08rgal1p7nl57lb3 Query : use flama_phc
20240723@185909.8115 b0mu3po9rr08rgal1p7nl57lb3 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240723@185909.8130 b0mu3po9rr08rgal1p7nl57lb3 Query : use flama_phc
20240723@185909.8133 b0mu3po9rr08rgal1p7nl57lb3 Query : select top 1 1 valor from td where td.ndoc = 39
20240723@185909.8146 b0mu3po9rr08rgal1p7nl57lb3 Query : use flama_phc
20240723@185909.8149 b0mu3po9rr08rgal1p7nl57lb3 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')
20240723@185909.8171 b0mu3po9rr08rgal1p7nl57lb3 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240723@185909.8190 b0mu3po9rr08rgal1p7nl57lb3 Query : use flama_phc
20240723@185909.8193 b0mu3po9rr08rgal1p7nl57lb3 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240723@185909.8206 b0mu3po9rr08rgal1p7nl57lb3 Query : use flama_phc
20240723@185909.8209 b0mu3po9rr08rgal1p7nl57lb3 Query : select szadrsstamp valor from szadrs where szadrsdesc='101900 - pd - alfena n/p'
20240723@185909.8224 b0mu3po9rr08rgal1p7nl57lb3 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1127';
20240723@185909.8242 b0mu3po9rr08rgal1p7nl57lb3 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1127';
20240723@185909.9712 4nmbiomcdl3jgfe5382239tcgk Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240723@185909.9933 4nmbiomcdl3jgfe5382239tcgk Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240723@185909.9959 4nmbiomcdl3jgfe5382239tcgk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1128';
20240723@185910.3000 4nmbiomcdl3jgfe5382239tcgk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1128';
20240723@185910.5100 4nmbiomcdl3jgfe5382239tcgk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1128';
20240723@185910.7000 4nmbiomcdl3jgfe5382239tcgk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1128';
20240723@185910.2150 4nmbiomcdl3jgfe5382239tcgk Query : use flama_phc
20240723@185910.8190 4nmbiomcdl3jgfe5382239tcgk Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240723@185910.2125 4nmbiomcdl3jgfe5382239tcgk Query : use flama_phc
20240723@185910.2129 4nmbiomcdl3jgfe5382239tcgk Query : select no, estab,szadrsdesc from szadrs where u_coddest=5483
20240723@185910.2205 4nmbiomcdl3jgfe5382239tcgk 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'
20240723@185910.2323 4nmbiomcdl3jgfe5382239tcgk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2049 and bo.obrano = 2404900 and bi.ref ='324.642.00.01' and bi.lordem =1
20240723@185910.2618 4nmbiomcdl3jgfe5382239tcgk Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.966.00.01'
20240723@185910.2729 4nmbiomcdl3jgfe5382239tcgk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2049 and bo.obrano = 2404900 and bi.ref ='324.966.00.01' and bi.lordem =3
20240723@185910.3029 4nmbiomcdl3jgfe5382239tcgk Query : use flama_phc
20240723@185910.3033 4nmbiomcdl3jgfe5382239tcgk Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240723@185910.3049 4nmbiomcdl3jgfe5382239tcgk Query : use flama_phc
20240723@185910.3053 4nmbiomcdl3jgfe5382239tcgk Query : select top 1 1 valor from td where td.ndoc = 39
20240723@185910.3066 4nmbiomcdl3jgfe5382239tcgk Query : use flama_phc
20240723@185910.3069 4nmbiomcdl3jgfe5382239tcgk 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')
20240723@185910.3090 4nmbiomcdl3jgfe5382239tcgk Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240723@185910.3107 4nmbiomcdl3jgfe5382239tcgk Query : use flama_phc
20240723@185910.3110 4nmbiomcdl3jgfe5382239tcgk Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240723@185910.3122 4nmbiomcdl3jgfe5382239tcgk Query : use flama_phc
20240723@185910.3125 4nmbiomcdl3jgfe5382239tcgk Query : select szadrsstamp valor from szadrs where szadrsdesc='manuel gomes do couto-uti.domesticas,lda-entrega'
20240723@185910.3138 4nmbiomcdl3jgfe5382239tcgk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1128';
20240723@185910.3158 4nmbiomcdl3jgfe5382239tcgk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1128';
20240723@185910.3706 jmk9rnme822lccjcrrl6i0g5u4 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240723@185910.3723 jmk9rnme822lccjcrrl6i0g5u4 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240723@185910.3752 jmk9rnme822lccjcrrl6i0g5u4 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1129';
20240723@185910.3814 jmk9rnme822lccjcrrl6i0g5u4 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1129';
20240723@185910.3833 jmk9rnme822lccjcrrl6i0g5u4 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1129';
20240723@185910.3849 jmk9rnme822lccjcrrl6i0g5u4 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1129';
20240723@185910.3865 jmk9rnme822lccjcrrl6i0g5u4 Query : use flama_phc
20240723@185910.3869 jmk9rnme822lccjcrrl6i0g5u4 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240723@185910.3886 jmk9rnme822lccjcrrl6i0g5u4 Query : use flama_phc
20240723@185910.3890 jmk9rnme822lccjcrrl6i0g5u4 Query : select no, estab,szadrsdesc from szadrs where u_coddest=6737
20240723@185910.3922 jmk9rnme822lccjcrrl6i0g5u4 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '327.8410.00.1'
20240723@185910.4036 jmk9rnme822lccjcrrl6i0g5u4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2049 and bo.obrano = 2404901 and bi.ref ='327.8410.00.1' and bi.lordem =1
20240723@185910.4334 jmk9rnme822lccjcrrl6i0g5u4 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '327.8410.00.1'
20240723@185910.4346 jmk9rnme822lccjcrrl6i0g5u4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2049 and bo.obrano = 2404901 and bi.ref ='327.8410.00.1' and bi.lordem =1
20240723@185910.4353 jmk9rnme822lccjcrrl6i0g5u4 Query : use flama_phc
20240723@185910.4357 jmk9rnme822lccjcrrl6i0g5u4 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240723@185910.4370 jmk9rnme822lccjcrrl6i0g5u4 Query : use flama_phc
20240723@185910.4373 jmk9rnme822lccjcrrl6i0g5u4 Query : select top 1 1 valor from td where td.ndoc = 39
20240723@185910.4384 jmk9rnme822lccjcrrl6i0g5u4 Query : use flama_phc
20240723@185910.4387 jmk9rnme822lccjcrrl6i0g5u4 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')
20240723@185910.4409 jmk9rnme822lccjcrrl6i0g5u4 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240723@185910.4425 jmk9rnme822lccjcrrl6i0g5u4 Query : use flama_phc
20240723@185910.4428 jmk9rnme822lccjcrrl6i0g5u4 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240723@185910.4441 jmk9rnme822lccjcrrl6i0g5u4 Query : use flama_phc
20240723@185910.4444 jmk9rnme822lccjcrrl6i0g5u4 Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-plaza large formats rainha'
20240723@185910.4464 jmk9rnme822lccjcrrl6i0g5u4 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1129';
20240723@185910.4483 jmk9rnme822lccjcrrl6i0g5u4 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1129';
20240723@185910.4975 ks6sk1g79f9hpkb6npqug2dt76 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240723@185910.4990 ks6sk1g79f9hpkb6npqug2dt76 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240723@185910.5014 ks6sk1g79f9hpkb6npqug2dt76 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1130';
20240723@185910.5066 ks6sk1g79f9hpkb6npqug2dt76 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1130';
20240723@185910.5094 ks6sk1g79f9hpkb6npqug2dt76 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1130';
20240723@185910.5111 ks6sk1g79f9hpkb6npqug2dt76 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1130';
20240723@185910.5128 ks6sk1g79f9hpkb6npqug2dt76 Query : use flama_phc
20240723@185910.5132 ks6sk1g79f9hpkb6npqug2dt76 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240723@185910.5149 ks6sk1g79f9hpkb6npqug2dt76 Query : use flama_phc
20240723@185910.5153 ks6sk1g79f9hpkb6npqug2dt76 Query : select no, estab,szadrsdesc from szadrs where u_coddest=2459
20240723@185910.5227 ks6sk1g79f9hpkb6npqug2dt76 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.958.00.01'
20240723@185910.5248 ks6sk1g79f9hpkb6npqug2dt76 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2049 and bo.obrano = 2404903 and bi.ref ='324.958.00.01' and bi.lordem =1
20240723@185910.5545 ks6sk1g79f9hpkb6npqug2dt76 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.958.00.01'
20240723@185910.5557 ks6sk1g79f9hpkb6npqug2dt76 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2049 and bo.obrano = 2404903 and bi.ref ='324.958.00.01' and bi.lordem =1
20240723@185910.5564 ks6sk1g79f9hpkb6npqug2dt76 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.958.00.01'
20240723@185910.5575 ks6sk1g79f9hpkb6npqug2dt76 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2049 and bo.obrano = 2404903 and bi.ref ='324.958.00.01' and bi.lordem =2
20240723@185910.5868 ks6sk1g79f9hpkb6npqug2dt76 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.958.00.01'
20240723@185910.5881 ks6sk1g79f9hpkb6npqug2dt76 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2049 and bo.obrano = 2404903 and bi.ref ='324.958.00.01' and bi.lordem =2
20240723@185910.5888 ks6sk1g79f9hpkb6npqug2dt76 Query : use flama_phc
20240723@185910.5892 ks6sk1g79f9hpkb6npqug2dt76 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240723@185910.5907 ks6sk1g79f9hpkb6npqug2dt76 Query : use flama_phc
20240723@185910.5910 ks6sk1g79f9hpkb6npqug2dt76 Query : select top 1 1 valor from td where td.ndoc = 39
20240723@185910.5921 ks6sk1g79f9hpkb6npqug2dt76 Query : use flama_phc
20240723@185910.5924 ks6sk1g79f9hpkb6npqug2dt76 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')
20240723@185910.5944 ks6sk1g79f9hpkb6npqug2dt76 Query : select top 1 manternumero ,assinadoc issigned ,tiposaft ,assinaimp ,nmdos ,td.assinadoc ,'cl' origin ,lancasl stocks ,case when cmsl<50 and td.lancasl=1 then 1 else 0 end entrada ,case when cmsl>50 and td.lancasl=1 then 1 else 0 end saida ,temserie assets ,~semgre usegridfields from td inner join td2 on td.tdstamp=td2.td2stamp where td.ndoc = 1
20240723@185910.5963 ks6sk1g79f9hpkb6npqug2dt76 Query : use flama_phc
20240723@185910.5966 ks6sk1g79f9hpkb6npqug2dt76 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240723@185910.5977 ks6sk1g79f9hpkb6npqug2dt76 Query : use flama_phc
20240723@185910.5980 ks6sk1g79f9hpkb6npqug2dt76 Query : select szadrsstamp valor from szadrs where szadrsdesc='eldisser, s.a.'
20240723@185910.5994 ks6sk1g79f9hpkb6npqug2dt76 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1130';
20240723@185910.6012 ks6sk1g79f9hpkb6npqug2dt76 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1130';
20240723@185910.6512 4f5qtq5i139ccufnd9nugp3vfp Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240723@185910.6528 4f5qtq5i139ccufnd9nugp3vfp Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240723@185910.6555 4f5qtq5i139ccufnd9nugp3vfp Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1131';
20240723@185910.6761 4f5qtq5i139ccufnd9nugp3vfp Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1131';
20240723@185910.6815 4f5qtq5i139ccufnd9nugp3vfp Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='1131';
20240723@185910.6834 4f5qtq5i139ccufnd9nugp3vfp Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='1131';
20240723@185910.6850 4f5qtq5i139ccufnd9nugp3vfp Query : use flama_phc
20240723@185910.6853 4f5qtq5i139ccufnd9nugp3vfp Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240723@185910.6869 4f5qtq5i139ccufnd9nugp3vfp Query : use flama_phc
20240723@185910.6872 4f5qtq5i139ccufnd9nugp3vfp Query : select no, estab,szadrsdesc from szadrs where u_coddest=6917
