20240716@084858.8064 ampl82500lo57kb6mol3i804tn Query : use flama_phc
20240716@084858.8067 ampl82500lo57kb6mol3i804tn 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')
20240716@084858.8086 ampl82500lo57kb6mol3i804tn 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 = 39
20240716@084858.8125 ampl82500lo57kb6mol3i804tn Query : use flama_phc
20240716@084858.8127 ampl82500lo57kb6mol3i804tn Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240716@084858.8138 ampl82500lo57kb6mol3i804tn Query : use flama_phc
20240716@084858.8141 ampl82500lo57kb6mol3i804tn Query : select szadrsstamp valor from szadrs where szadrsdesc='vaga d`imagens unipessoal, lda.'
20240716@084858.8156 ampl82500lo57kb6mol3i804tn Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='966';
20240716@084858.8170 ampl82500lo57kb6mol3i804tn Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='966';
20240716@084858.8589 s68rv1jo5ik4ra2fhn6jn41lcg Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240716@084858.8601 s68rv1jo5ik4ra2fhn6jn41lcg Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240716@084858.8626 s68rv1jo5ik4ra2fhn6jn41lcg Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='967';
20240716@084858.8671 s68rv1jo5ik4ra2fhn6jn41lcg Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='967';
20240716@084858.8687 s68rv1jo5ik4ra2fhn6jn41lcg Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='967';
20240716@084858.8701 s68rv1jo5ik4ra2fhn6jn41lcg Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='967';
20240716@084858.8718 s68rv1jo5ik4ra2fhn6jn41lcg Query : use flama_phc
20240716@084858.8722 s68rv1jo5ik4ra2fhn6jn41lcg Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240716@084858.8738 s68rv1jo5ik4ra2fhn6jn41lcg Query : use flama_phc
20240716@084858.8742 s68rv1jo5ik4ra2fhn6jn41lcg Query : select no, estab,szadrsdesc from szadrs where u_coddest=5546
20240716@084858.8825 s68rv1jo5ik4ra2fhn6jn41lcg 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'
20240716@084858.8944 s68rv1jo5ik4ra2fhn6jn41lcg Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404722 and bi.ref ='324.4930.00.1' and bi.lordem =1
20240716@084858.9238 s68rv1jo5ik4ra2fhn6jn41lcg 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'
20240716@084858.9248 s68rv1jo5ik4ra2fhn6jn41lcg Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404722 and bi.ref ='324.4930.00.1' and bi.lordem =1
20240716@084858.9255 s68rv1jo5ik4ra2fhn6jn41lcg 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'
20240716@084858.9363 s68rv1jo5ik4ra2fhn6jn41lcg Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404722 and bi.ref ='324.727.00.01' and bi.lordem =2
20240716@084858.9641 s68rv1jo5ik4ra2fhn6jn41lcg 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'
20240716@084858.9827 s68rv1jo5ik4ra2fhn6jn41lcg Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404722 and bi.ref ='304.4320.00.1' and bi.lordem =3
20240716@084859.9800 s68rv1jo5ik4ra2fhn6jn41lcg Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.5343.00.1'
20240716@084859.1100 s68rv1jo5ik4ra2fhn6jn41lcg Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404722 and bi.ref ='324.5343.00.1' and bi.lordem =4
20240716@084859.4080 s68rv1jo5ik4ra2fhn6jn41lcg Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1608.00.1'
20240716@084859.5030 s68rv1jo5ik4ra2fhn6jn41lcg Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404722 and bi.ref ='324.1608.00.1' and bi.lordem =5
20240716@084859.7660 s68rv1jo5ik4ra2fhn6jn41lcg Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1684.00.1'
20240716@084859.8000 s68rv1jo5ik4ra2fhn6jn41lcg Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404722 and bi.ref ='324.1684.00.1' and bi.lordem =6
20240716@084859.1078 s68rv1jo5ik4ra2fhn6jn41lcg Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.939.00.01'
20240716@084859.1171 s68rv1jo5ik4ra2fhn6jn41lcg Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404722 and bi.ref ='324.939.00.01' and bi.lordem =7
20240716@084859.1469 s68rv1jo5ik4ra2fhn6jn41lcg Query : use flama_phc
20240716@084859.1473 s68rv1jo5ik4ra2fhn6jn41lcg Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240716@084859.1486 s68rv1jo5ik4ra2fhn6jn41lcg Query : use flama_phc
20240716@084859.1490 s68rv1jo5ik4ra2fhn6jn41lcg Query : select top 1 1 valor from td where td.ndoc = 39
20240716@084859.1502 s68rv1jo5ik4ra2fhn6jn41lcg Query : use flama_phc
20240716@084859.1514 s68rv1jo5ik4ra2fhn6jn41lcg 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')
20240716@084859.2923 s68rv1jo5ik4ra2fhn6jn41lcg 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 = 39
20240716@084859.2940 s68rv1jo5ik4ra2fhn6jn41lcg Query : use flama_phc
20240716@084859.2944 s68rv1jo5ik4ra2fhn6jn41lcg Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240716@084859.2954 s68rv1jo5ik4ra2fhn6jn41lcg Query : use flama_phc
20240716@084859.2957 s68rv1jo5ik4ra2fhn6jn41lcg Query : select szadrsstamp valor from szadrs where szadrsdesc='199506 - itmp alimentar, s.a.'
20240716@084859.2968 s68rv1jo5ik4ra2fhn6jn41lcg Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='967';
20240716@084859.2982 s68rv1jo5ik4ra2fhn6jn41lcg Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='967';
20240716@084859.3521 dfmjhrgrbrl4cq0v89l4mv8us4 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240716@084859.3533 dfmjhrgrbrl4cq0v89l4mv8us4 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240716@084859.3554 dfmjhrgrbrl4cq0v89l4mv8us4 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='968';
20240716@084859.3604 dfmjhrgrbrl4cq0v89l4mv8us4 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='968';
20240716@084859.3621 dfmjhrgrbrl4cq0v89l4mv8us4 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='968';
20240716@084859.3637 dfmjhrgrbrl4cq0v89l4mv8us4 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='968';
20240716@084859.3681 dfmjhrgrbrl4cq0v89l4mv8us4 Query : use flama_phc
20240716@084859.3691 dfmjhrgrbrl4cq0v89l4mv8us4 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240716@084859.3707 dfmjhrgrbrl4cq0v89l4mv8us4 Query : use flama_phc
20240716@084859.3710 dfmjhrgrbrl4cq0v89l4mv8us4 Query : select no, estab,szadrsdesc from szadrs where u_coddest=1223
20240716@084859.3780 dfmjhrgrbrl4cq0v89l4mv8us4 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'
20240716@084859.3879 dfmjhrgrbrl4cq0v89l4mv8us4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404734 and bi.ref ='324.5396.00.1' and bi.lordem =1
20240716@084859.4197 dfmjhrgrbrl4cq0v89l4mv8us4 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2066.00.1'
20240716@084859.4291 dfmjhrgrbrl4cq0v89l4mv8us4 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404734 and bi.ref ='324.2066.00.1' and bi.lordem =3
20240716@084859.4634 dfmjhrgrbrl4cq0v89l4mv8us4 Query : use flama_phc
20240716@084859.4661 dfmjhrgrbrl4cq0v89l4mv8us4 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240716@084859.4713 dfmjhrgrbrl4cq0v89l4mv8us4 Query : use flama_phc
20240716@084859.4717 dfmjhrgrbrl4cq0v89l4mv8us4 Query : select top 1 1 valor from td where td.ndoc = 39
20240716@084859.4728 dfmjhrgrbrl4cq0v89l4mv8us4 Query : use flama_phc
20240716@084859.4731 dfmjhrgrbrl4cq0v89l4mv8us4 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')
20240716@084859.4751 dfmjhrgrbrl4cq0v89l4mv8us4 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 = 39
20240716@084859.4768 dfmjhrgrbrl4cq0v89l4mv8us4 Query : use flama_phc
20240716@084859.4771 dfmjhrgrbrl4cq0v89l4mv8us4 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240716@084859.4783 dfmjhrgrbrl4cq0v89l4mv8us4 Query : use flama_phc
20240716@084859.4786 dfmjhrgrbrl4cq0v89l4mv8us4 Query : select szadrsstamp valor from szadrs where szadrsdesc='zacarias vicente alexandre-armaz.za za'
20240716@084859.4799 dfmjhrgrbrl4cq0v89l4mv8us4 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='968';
20240716@084859.4815 dfmjhrgrbrl4cq0v89l4mv8us4 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='968';
20240716@091909.1064 3mmcpm483luu34vuk611hgah79 Query : use flama_phc
20240716@091909.1070 3mmcpm483luu34vuk611hgah79 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@091909.1140 3mmcpm483luu34vuk611hgah79 Query : use flama_phc
20240716@091909.1144 3mmcpm483luu34vuk611hgah79 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@093609.4220 s6p27jr6mlvfodkh8lo5mlbcvj Query : use flama_phc
20240716@093609.4280 s6p27jr6mlvfodkh8lo5mlbcvj Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@093609.4480 s6p27jr6mlvfodkh8lo5mlbcvj Query : use flama_phc
20240716@093609.4510 s6p27jr6mlvfodkh8lo5mlbcvj Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@101909.3933 3u5o0pf05ngal04hpj1dk0ra8v Query : use flama_phc
20240716@101909.3938 3u5o0pf05ngal04hpj1dk0ra8v Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@101909.3956 3u5o0pf05ngal04hpj1dk0ra8v Query : use flama_phc
20240716@101909.3959 3u5o0pf05ngal04hpj1dk0ra8v Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@103609.4620 c1v41o0nvi1hj04c1dqg2k41mj Query : use flama_phc
20240716@103609.4625 c1v41o0nvi1hj04c1dqg2k41mj Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@103609.4642 c1v41o0nvi1hj04c1dqg2k41mj Query : use flama_phc
20240716@103609.4644 c1v41o0nvi1hj04c1dqg2k41mj Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@111910.7266 e16m1g8cilbleern640f40hmt0 Query : use flama_phc
20240716@111910.7271 e16m1g8cilbleern640f40hmt0 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@111910.7320 e16m1g8cilbleern640f40hmt0 Query : use flama_phc
20240716@111910.7323 e16m1g8cilbleern640f40hmt0 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@113610.9647 io518cbt5rdoa1vkrcs5m9ina2 Query : use flama_phc
20240716@113610.9655 io518cbt5rdoa1vkrcs5m9ina2 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@113610.9678 io518cbt5rdoa1vkrcs5m9ina2 Query : use flama_phc
20240716@113610.9681 io518cbt5rdoa1vkrcs5m9ina2 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@121909.2363 c0csj14dotnih3iq8gss5ej7no Query : use flama_phc
20240716@121909.2368 c0csj14dotnih3iq8gss5ej7no Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@121909.2386 c0csj14dotnih3iq8gss5ej7no Query : use flama_phc
20240716@121909.2389 c0csj14dotnih3iq8gss5ej7no Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@123609.5806 fhg2mu23ahu2nio8l0o8eiufh6 Query : use flama_phc
20240716@123609.5812 fhg2mu23ahu2nio8l0o8eiufh6 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@123609.5832 fhg2mu23ahu2nio8l0o8eiufh6 Query : use flama_phc
20240716@123609.5835 fhg2mu23ahu2nio8l0o8eiufh6 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@131909.7184 avep63udbarnujtiocfut1d0qn Query : use flama_phc
20240716@131909.7190 avep63udbarnujtiocfut1d0qn Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@131909.7209 avep63udbarnujtiocfut1d0qn Query : use flama_phc
20240716@131909.7213 avep63udbarnujtiocfut1d0qn Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@133609.6083 qreabqsv74pj1lgrj771nk51l8 Query : use flama_phc
20240716@133609.6089 qreabqsv74pj1lgrj771nk51l8 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@133609.6107 qreabqsv74pj1lgrj771nk51l8 Query : use flama_phc
20240716@133609.6109 qreabqsv74pj1lgrj771nk51l8 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@141911.6704 or71ab60vb6kgv11qkmdudb098 Query : use flama_phc
20240716@141911.6709 or71ab60vb6kgv11qkmdudb098 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@141911.6728 or71ab60vb6kgv11qkmdudb098 Query : use flama_phc
20240716@141911.6731 or71ab60vb6kgv11qkmdudb098 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@143611.6982 6sr7n9k52n15n8s7ee317dg284 Query : use flama_phc
20240716@143611.7021 6sr7n9k52n15n8s7ee317dg284 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@143611.7533 6sr7n9k52n15n8s7ee317dg284 Query : use flama_phc
20240716@143611.7613 6sr7n9k52n15n8s7ee317dg284 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@151910.5720 1jbfioj6j3pbvj8iiiei72paj1 Query : use flama_phc
20240716@151910.5780 1jbfioj6j3pbvj8iiiei72paj1 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@151910.5990 1jbfioj6j3pbvj8iiiei72paj1 Query : use flama_phc
20240716@151910.6040 1jbfioj6j3pbvj8iiiei72paj1 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@153611.1423 uh6m02qj0e3vbealie6a5n37gt Query : use flama_phc
20240716@153611.1429 uh6m02qj0e3vbealie6a5n37gt Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@153611.1451 uh6m02qj0e3vbealie6a5n37gt Query : use flama_phc
20240716@153611.1455 uh6m02qj0e3vbealie6a5n37gt Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@161909.1767 bucq5dhafiot9okc2qaudqde5a Query : use flama_phc
20240716@161909.1773 bucq5dhafiot9okc2qaudqde5a Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@161909.1802 bucq5dhafiot9okc2qaudqde5a Query : use flama_phc
20240716@161909.1805 bucq5dhafiot9okc2qaudqde5a Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@163609.9500 8qmbahm4r7iprt90ncjqrmsc8k Query : use flama_phc
20240716@163609.9560 8qmbahm4r7iprt90ncjqrmsc8k Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@163609.1013 8qmbahm4r7iprt90ncjqrmsc8k Query : use flama_phc
20240716@163609.1016 8qmbahm4r7iprt90ncjqrmsc8k Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@171916.2179 k0phqt68tgusa2stspi6mh420b Query : use flama_phc
20240716@171916.2186 k0phqt68tgusa2stspi6mh420b Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@171916.2204 k0phqt68tgusa2stspi6mh420b Query : use flama_phc
20240716@171916.2206 k0phqt68tgusa2stspi6mh420b Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@173616.1480 fqu9l80pe76bm81h2rmqad89ja Query : use flama_phc
20240716@173616.1485 fqu9l80pe76bm81h2rmqad89ja Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@173616.1503 fqu9l80pe76bm81h2rmqad89ja Query : use flama_phc
20240716@173616.1506 fqu9l80pe76bm81h2rmqad89ja Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@181910.7566 enb99nsc8cjbfcsp17gmgb3pm3 Query : use flama_phc
20240716@181910.7571 enb99nsc8cjbfcsp17gmgb3pm3 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@181910.7588 enb99nsc8cjbfcsp17gmgb3pm3 Query : use flama_phc
20240716@181910.7591 enb99nsc8cjbfcsp17gmgb3pm3 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@183610.7563 tknf8po8kr7b3semjen4cb4s51 Query : use flama_phc
20240716@183610.7568 tknf8po8kr7b3semjen4cb4s51 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@183610.7590 tknf8po8kr7b3semjen4cb4s51 Query : use flama_phc
20240716@183610.7593 tknf8po8kr7b3semjen4cb4s51 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@191910.7318 6s5euao1bhg4ujgsqnnvrc3p6g Query : use flama_phc
20240716@191910.7323 6s5euao1bhg4ujgsqnnvrc3p6g Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@191910.7340 6s5euao1bhg4ujgsqnnvrc3p6g Query : use flama_phc
20240716@191910.7343 6s5euao1bhg4ujgsqnnvrc3p6g Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@193611.3109 d5lbsg70agige1s1cc8nfn6lot Query : use flama_phc
20240716@193611.3114 d5lbsg70agige1s1cc8nfn6lot Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@193611.3132 d5lbsg70agige1s1cc8nfn6lot Query : use flama_phc
20240716@193611.3135 d5lbsg70agige1s1cc8nfn6lot Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@201916.3359 76lhovogj8mi9c78bv571tcih9 Query : use flama_phc
20240716@201916.3364 76lhovogj8mi9c78bv571tcih9 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@201916.3382 76lhovogj8mi9c78bv571tcih9 Query : use flama_phc
20240716@201916.3385 76lhovogj8mi9c78bv571tcih9 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@203616.3470 jucduhgog6dis3q6vgnnv3sudq Query : use flama_phc
20240716@203616.3499 jucduhgog6dis3q6vgnnv3sudq Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@203616.3823 jucduhgog6dis3q6vgnnv3sudq Query : use flama_phc
20240716@203616.3859 jucduhgog6dis3q6vgnnv3sudq Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@211911.2462 4n7vm6llu0ah8njrgrlpnflbl6 Query : use flama_phc
20240716@211911.2468 4n7vm6llu0ah8njrgrlpnflbl6 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@211911.2489 4n7vm6llu0ah8njrgrlpnflbl6 Query : use flama_phc
20240716@211911.2492 4n7vm6llu0ah8njrgrlpnflbl6 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@213611.6183 gagopg4o7nmmci6elgmnut7q7m Query : use flama_phc
20240716@213611.6189 gagopg4o7nmmci6elgmnut7q7m Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@213611.6211 gagopg4o7nmmci6elgmnut7q7m Query : use flama_phc
20240716@213611.6215 gagopg4o7nmmci6elgmnut7q7m Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@221909.2800 ccu0re15gmhfvgtlcah49nakfe Query : use flama_phc
20240716@221909.2842 ccu0re15gmhfvgtlcah49nakfe Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@221909.2875 ccu0re15gmhfvgtlcah49nakfe Query : use flama_phc
20240716@221909.2878 ccu0re15gmhfvgtlcah49nakfe Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@223609.1127 ihdpjbrvdjseqd4joe8pf25oi6 Query : use flama_phc
20240716@223609.1133 ihdpjbrvdjseqd4joe8pf25oi6 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@223609.1153 ihdpjbrvdjseqd4joe8pf25oi6 Query : use flama_phc
20240716@223609.1156 ihdpjbrvdjseqd4joe8pf25oi6 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@231909.4869 68750ll7ama2oma4jktd0fanra Query : use flama_phc
20240716@231909.4874 68750ll7ama2oma4jktd0fanra Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@231909.4892 68750ll7ama2oma4jktd0fanra Query : use flama_phc
20240716@231909.4981 68750ll7ama2oma4jktd0fanra Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240716@233609.4658 jabfgj237frksp613v2h5jkun7 Query : use flama_phc
20240716@233609.4664 jabfgj237frksp613v2h5jkun7 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240716@233609.4685 jabfgj237frksp613v2h5jkun7 Query : use flama_phc
20240716@233609.4688 jabfgj237frksp613v2h5jkun7 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240717@071927.7726 seb94vm69mq41li9bha2l11l70 Query : use flama_phc
20240717@071927.7760 seb94vm69mq41li9bha2l11l70 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240717@071927.8103 seb94vm69mq41li9bha2l11l70 Query : use flama_phc
20240717@071927.8106 seb94vm69mq41li9bha2l11l70 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240717@073612.5667 emoknvf16ev308siq8bpf2dl2p Query : use flama_phc
20240717@073612.5672 emoknvf16ev308siq8bpf2dl2p Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240717@073612.5690 emoknvf16ev308siq8bpf2dl2p Query : use flama_phc
20240717@073612.5693 emoknvf16ev308siq8bpf2dl2p Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240717@074547.7144 j6oiarm9n9ur87al7gh5jtfn2m Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240717@074547.7243 j6oiarm9n9ur87al7gh5jtfn2m Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240717@074547.7400 j6oiarm9n9ur87al7gh5jtfn2m Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='973';
20240717@074547.7447 j6oiarm9n9ur87al7gh5jtfn2m Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='973';
20240717@074547.7476 j6oiarm9n9ur87al7gh5jtfn2m Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='973';
20240717@074547.7489 j6oiarm9n9ur87al7gh5jtfn2m Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='973';
20240717@074547.7503 j6oiarm9n9ur87al7gh5jtfn2m Query : use flama_phc
20240717@074547.7507 j6oiarm9n9ur87al7gh5jtfn2m Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240717@074547.7550 j6oiarm9n9ur87al7gh5jtfn2m Query : use flama_phc
20240717@074547.7553 j6oiarm9n9ur87al7gh5jtfn2m Query : select no, estab,szadrsdesc from szadrs where u_coddest=416
20240717@074547.7632 j6oiarm9n9ur87al7gh5jtfn2m Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1690.00.1'
20240717@074547.7728 j6oiarm9n9ur87al7gh5jtfn2m Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404735 and bi.ref ='324.1690.00.1' and bi.lordem =1
20240717@074547.8012 j6oiarm9n9ur87al7gh5jtfn2m Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1690.00.1'
20240717@074547.8024 j6oiarm9n9ur87al7gh5jtfn2m Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404735 and bi.ref ='324.1690.00.1' and bi.lordem =1
20240717@074547.8032 j6oiarm9n9ur87al7gh5jtfn2m Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1690.00.1'
20240717@074547.8042 j6oiarm9n9ur87al7gh5jtfn2m Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404735 and bi.ref ='324.1690.00.1' and bi.lordem =2
20240717@074547.8547 j6oiarm9n9ur87al7gh5jtfn2m Query : use flama_phc
20240717@074547.8551 j6oiarm9n9ur87al7gh5jtfn2m Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240717@074547.9868 j6oiarm9n9ur87al7gh5jtfn2m Query : use flama_phc
20240717@074547.9873 j6oiarm9n9ur87al7gh5jtfn2m Query : select top 1 1 valor from td where td.ndoc = 39
20240717@074547.9994 j6oiarm9n9ur87al7gh5jtfn2m Query : use flama_phc
20240717@074547.9996 j6oiarm9n9ur87al7gh5jtfn2m 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')
20240717@074548.7100 j6oiarm9n9ur87al7gh5jtfn2m 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
20240717@074548.2350 j6oiarm9n9ur87al7gh5jtfn2m Query : use flama_phc
20240717@074548.2390 j6oiarm9n9ur87al7gh5jtfn2m Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240717@074548.2860 j6oiarm9n9ur87al7gh5jtfn2m Query : use flama_phc
20240717@074548.2890 j6oiarm9n9ur87al7gh5jtfn2m Query : select szadrsstamp valor from szadrs where szadrsdesc='bragajav, lda.'
20240717@074548.3020 j6oiarm9n9ur87al7gh5jtfn2m Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='973';
20240717@074548.3180 j6oiarm9n9ur87al7gh5jtfn2m Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='973';
20240717@074548.8650 hrcgr45l0fupv8phm72ru1bdh8 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240717@074548.9240 hrcgr45l0fupv8phm72ru1bdh8 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240717@074548.9430 hrcgr45l0fupv8phm72ru1bdh8 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='974';
20240717@074548.9840 hrcgr45l0fupv8phm72ru1bdh8 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='974';
20240717@074548.1000 hrcgr45l0fupv8phm72ru1bdh8 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='974';
20240717@074548.1011 hrcgr45l0fupv8phm72ru1bdh8 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='974';
20240717@074548.1025 hrcgr45l0fupv8phm72ru1bdh8 Query : use flama_phc
20240717@074548.1028 hrcgr45l0fupv8phm72ru1bdh8 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240717@074548.1042 hrcgr45l0fupv8phm72ru1bdh8 Query : use flama_phc
20240717@074548.1045 hrcgr45l0fupv8phm72ru1bdh8 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240717@074548.1184 hrcgr45l0fupv8phm72ru1bdh8 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'
20240717@074548.1286 hrcgr45l0fupv8phm72ru1bdh8 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404736 and bi.ref ='324.1667.00.1' and bi.lordem =1
20240717@074548.1542 hrcgr45l0fupv8phm72ru1bdh8 Query : use flama_phc
20240717@074548.1546 hrcgr45l0fupv8phm72ru1bdh8 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240717@074548.1560 hrcgr45l0fupv8phm72ru1bdh8 Query : use flama_phc
20240717@074548.1563 hrcgr45l0fupv8phm72ru1bdh8 Query : select top 1 1 valor from td where td.ndoc = 39
20240717@074548.1574 hrcgr45l0fupv8phm72ru1bdh8 Query : use flama_phc
20240717@074548.1577 hrcgr45l0fupv8phm72ru1bdh8 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')
20240717@074548.1596 hrcgr45l0fupv8phm72ru1bdh8 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
20240717@074548.1613 hrcgr45l0fupv8phm72ru1bdh8 Query : use flama_phc
20240717@074548.1616 hrcgr45l0fupv8phm72ru1bdh8 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240717@074548.1627 hrcgr45l0fupv8phm72ru1bdh8 Query : use flama_phc
20240717@074548.1630 hrcgr45l0fupv8phm72ru1bdh8 Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240717@074548.1643 hrcgr45l0fupv8phm72ru1bdh8 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='974';
20240717@074548.1659 hrcgr45l0fupv8phm72ru1bdh8 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='974';
20240717@074548.2170 tmrj4quig5hmab8gsfujiqa7gd Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240717@074548.2185 tmrj4quig5hmab8gsfujiqa7gd Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240717@074548.2204 tmrj4quig5hmab8gsfujiqa7gd Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='975';
20240717@074548.2247 tmrj4quig5hmab8gsfujiqa7gd Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='975';
20240717@074548.2264 tmrj4quig5hmab8gsfujiqa7gd Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='975';
20240717@074548.2276 tmrj4quig5hmab8gsfujiqa7gd Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='975';
20240717@074548.2289 tmrj4quig5hmab8gsfujiqa7gd Query : use flama_phc
20240717@074548.2292 tmrj4quig5hmab8gsfujiqa7gd Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240717@074548.2309 tmrj4quig5hmab8gsfujiqa7gd Query : use flama_phc
20240717@074548.2312 tmrj4quig5hmab8gsfujiqa7gd Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240717@074548.2343 tmrj4quig5hmab8gsfujiqa7gd Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1684.00.1'
20240717@074548.2441 tmrj4quig5hmab8gsfujiqa7gd Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404737 and bi.ref ='324.1684.00.1' and bi.lordem =1
20240717@074548.2816 tmrj4quig5hmab8gsfujiqa7gd Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.698.00.01'
20240717@074548.2926 tmrj4quig5hmab8gsfujiqa7gd Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404737 and bi.ref ='324.698.00.01' and bi.lordem =2
20240717@074548.3276 tmrj4quig5hmab8gsfujiqa7gd Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.698.00.01'
20240717@074548.3287 tmrj4quig5hmab8gsfujiqa7gd Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404737 and bi.ref ='324.698.00.01' and bi.lordem =2
20240717@074548.3295 tmrj4quig5hmab8gsfujiqa7gd Query : use flama_phc
20240717@074548.3298 tmrj4quig5hmab8gsfujiqa7gd Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240717@074548.3310 tmrj4quig5hmab8gsfujiqa7gd Query : use flama_phc
20240717@074548.3314 tmrj4quig5hmab8gsfujiqa7gd Query : select top 1 1 valor from td where td.ndoc = 39
20240717@074548.3324 tmrj4quig5hmab8gsfujiqa7gd Query : use flama_phc
20240717@074548.3326 tmrj4quig5hmab8gsfujiqa7gd 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')
20240717@074548.3345 tmrj4quig5hmab8gsfujiqa7gd 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
20240717@074548.3360 tmrj4quig5hmab8gsfujiqa7gd Query : use flama_phc
20240717@074548.3363 tmrj4quig5hmab8gsfujiqa7gd Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240717@074548.3374 tmrj4quig5hmab8gsfujiqa7gd Query : use flama_phc
20240717@074548.3376 tmrj4quig5hmab8gsfujiqa7gd Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240717@074548.3387 tmrj4quig5hmab8gsfujiqa7gd Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='975';
20240717@074548.3403 tmrj4quig5hmab8gsfujiqa7gd Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='975';
20240717@074548.4060 76ere097iu1g89ockgevpglkhr Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240717@074548.4075 76ere097iu1g89ockgevpglkhr Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240717@074548.4096 76ere097iu1g89ockgevpglkhr Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='976';
20240717@074548.4137 76ere097iu1g89ockgevpglkhr Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='976';
20240717@074548.4154 76ere097iu1g89ockgevpglkhr Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='976';
20240717@074548.4167 76ere097iu1g89ockgevpglkhr Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='976';
20240717@074548.4185 76ere097iu1g89ockgevpglkhr Query : use flama_phc
20240717@074548.4188 76ere097iu1g89ockgevpglkhr Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240717@074548.4206 76ere097iu1g89ockgevpglkhr Query : use flama_phc
20240717@074548.4209 76ere097iu1g89ockgevpglkhr Query : select no, estab,szadrsdesc from szadrs where u_coddest=5483
20240717@074548.4282 76ere097iu1g89ockgevpglkhr 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'
20240717@074548.4375 76ere097iu1g89ockgevpglkhr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404739 and bi.ref ='324.5540.00.1' and bi.lordem =1
20240717@074548.4850 76ere097iu1g89ockgevpglkhr 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'
20240717@074548.4892 76ere097iu1g89ockgevpglkhr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404739 and bi.ref ='324.5540.00.1' and bi.lordem =2
20240717@074548.5164 76ere097iu1g89ockgevpglkhr Query : use flama_phc
20240717@074548.5168 76ere097iu1g89ockgevpglkhr Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240717@074548.5182 76ere097iu1g89ockgevpglkhr Query : use flama_phc
20240717@074548.5185 76ere097iu1g89ockgevpglkhr Query : select top 1 1 valor from td where td.ndoc = 39
20240717@074548.5196 76ere097iu1g89ockgevpglkhr Query : use flama_phc
20240717@074548.5199 76ere097iu1g89ockgevpglkhr 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')
20240717@074548.5219 76ere097iu1g89ockgevpglkhr 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
20240717@074548.5235 76ere097iu1g89ockgevpglkhr Query : use flama_phc
20240717@074548.5238 76ere097iu1g89ockgevpglkhr Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240717@074548.5249 76ere097iu1g89ockgevpglkhr Query : use flama_phc
20240717@074548.5252 76ere097iu1g89ockgevpglkhr Query : select szadrsstamp valor from szadrs where szadrsdesc='manuel gomes do couto-uti.domesticas,lda-entrega'
20240717@074548.5265 76ere097iu1g89ockgevpglkhr Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='976';
20240717@074548.5280 76ere097iu1g89ockgevpglkhr Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='976';
20240717@074548.5809 m3p74kk2smd8osmq0d30jlo16l Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240717@074548.5823 m3p74kk2smd8osmq0d30jlo16l Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240717@074548.5844 m3p74kk2smd8osmq0d30jlo16l Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='977';
20240717@074548.5886 m3p74kk2smd8osmq0d30jlo16l Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='977';
20240717@074548.5903 m3p74kk2smd8osmq0d30jlo16l Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='977';
20240717@074548.5917 m3p74kk2smd8osmq0d30jlo16l Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='977';
20240717@074548.5930 m3p74kk2smd8osmq0d30jlo16l Query : use flama_phc
20240717@074548.5933 m3p74kk2smd8osmq0d30jlo16l Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240717@074548.5952 m3p74kk2smd8osmq0d30jlo16l Query : use flama_phc
20240717@074548.5955 m3p74kk2smd8osmq0d30jlo16l Query : select no, estab,szadrsdesc from szadrs where u_coddest=4804
20240717@074548.6023 m3p74kk2smd8osmq0d30jlo16l 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'
20240717@074548.6119 m3p74kk2smd8osmq0d30jlo16l Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404741 and bi.ref ='304.422.00.07' and bi.lordem =1
20240717@074548.6410 m3p74kk2smd8osmq0d30jlo16l Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4521.00.1'
20240717@074548.6610 m3p74kk2smd8osmq0d30jlo16l Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404741 and bi.ref ='324.4521.00.1' and bi.lordem =2
20240717@074548.6884 m3p74kk2smd8osmq0d30jlo16l 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'
20240717@074548.6976 m3p74kk2smd8osmq0d30jlo16l Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404741 and bi.ref ='324.4960.00.1' and bi.lordem =3
20240717@074548.7227 m3p74kk2smd8osmq0d30jlo16l Query : use flama_phc
20240717@074548.7257 m3p74kk2smd8osmq0d30jlo16l Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240717@074548.7294 m3p74kk2smd8osmq0d30jlo16l Query : use flama_phc
20240717@074548.7297 m3p74kk2smd8osmq0d30jlo16l Query : select top 1 1 valor from td where td.ndoc = 39
20240717@074548.7309 m3p74kk2smd8osmq0d30jlo16l Query : use flama_phc
20240717@074548.7311 m3p74kk2smd8osmq0d30jlo16l 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')
20240717@074548.7331 m3p74kk2smd8osmq0d30jlo16l 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
20240717@074548.7348 m3p74kk2smd8osmq0d30jlo16l Query : use flama_phc
20240717@074548.7350 m3p74kk2smd8osmq0d30jlo16l Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240717@074548.7362 m3p74kk2smd8osmq0d30jlo16l Query : use flama_phc
20240717@074548.7365 m3p74kk2smd8osmq0d30jlo16l Query : select szadrsstamp valor from szadrs where szadrsdesc='101900 - pd - alfena n/p'
20240717@074548.7378 m3p74kk2smd8osmq0d30jlo16l Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='977';
20240717@074548.7395 m3p74kk2smd8osmq0d30jlo16l Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='977';
20240717@074548.8823 p8gj27lectf1oslul59pm6r86l Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240717@074548.8898 p8gj27lectf1oslul59pm6r86l Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240717@074548.8922 p8gj27lectf1oslul59pm6r86l Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='978';
20240717@074548.8967 p8gj27lectf1oslul59pm6r86l Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='978';
20240717@074548.9092 p8gj27lectf1oslul59pm6r86l Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='978';
20240717@074548.9152 p8gj27lectf1oslul59pm6r86l Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='978';
20240717@074548.9174 p8gj27lectf1oslul59pm6r86l Query : use flama_phc
20240717@074548.9178 p8gj27lectf1oslul59pm6r86l Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240717@074548.9194 p8gj27lectf1oslul59pm6r86l Query : use flama_phc
20240717@074548.9198 p8gj27lectf1oslul59pm6r86l Query : select no, estab,szadrsdesc from szadrs where u_coddest=2064
20240717@074548.9302 p8gj27lectf1oslul59pm6r86l Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4902.00.1'
20240717@074548.9501 p8gj27lectf1oslul59pm6r86l Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404742 and bi.ref ='324.4902.00.1' and bi.lordem =1
20240717@074548.9778 p8gj27lectf1oslul59pm6r86l 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'
20240717@074548.9873 p8gj27lectf1oslul59pm6r86l Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404742 and bi.ref ='304.4320.00.1' and bi.lordem =2
20240717@074549.1290 p8gj27lectf1oslul59pm6r86l 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'
20240717@074549.1410 p8gj27lectf1oslul59pm6r86l Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404742 and bi.ref ='304.4320.00.1' and bi.lordem =2
20240717@074549.1490 p8gj27lectf1oslul59pm6r86l Query : use flama_phc
20240717@074549.1520 p8gj27lectf1oslul59pm6r86l Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240717@074549.1660 p8gj27lectf1oslul59pm6r86l Query : use flama_phc
20240717@074549.1690 p8gj27lectf1oslul59pm6r86l Query : select top 1 1 valor from td where td.ndoc = 39
20240717@074549.1800 p8gj27lectf1oslul59pm6r86l Query : use flama_phc
20240717@074549.1830 p8gj27lectf1oslul59pm6r86l 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')
20240717@074549.2040 p8gj27lectf1oslul59pm6r86l 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
20240717@074549.2210 p8gj27lectf1oslul59pm6r86l Query : use flama_phc
20240717@074549.2240 p8gj27lectf1oslul59pm6r86l Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240717@074549.2350 p8gj27lectf1oslul59pm6r86l Query : use flama_phc
20240717@074549.2380 p8gj27lectf1oslul59pm6r86l Query : select szadrsstamp valor from szadrs where szadrsdesc='macorlux - electrodomÉsticos, s.a.'
20240717@074549.2500 p8gj27lectf1oslul59pm6r86l Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='978';
20240717@074549.2660 p8gj27lectf1oslul59pm6r86l Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='978';
20240717@074549.9940 jnietoin965q92i3n99r5rhe93 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240717@074549.1008 jnietoin965q92i3n99r5rhe93 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240717@074549.1028 jnietoin965q92i3n99r5rhe93 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='979';
20240717@074549.1070 jnietoin965q92i3n99r5rhe93 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='979';
20240717@074549.1088 jnietoin965q92i3n99r5rhe93 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='979';
20240717@074549.1103 jnietoin965q92i3n99r5rhe93 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='979';
20240717@074549.1119 jnietoin965q92i3n99r5rhe93 Query : use flama_phc
20240717@074549.1122 jnietoin965q92i3n99r5rhe93 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240717@074549.1140 jnietoin965q92i3n99r5rhe93 Query : use flama_phc
20240717@074549.1143 jnietoin965q92i3n99r5rhe93 Query : select no, estab,szadrsdesc from szadrs where u_coddest=6917
20240717@074549.1219 jnietoin965q92i3n99r5rhe93 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.600.94.01'
20240717@074549.1328 jnietoin965q92i3n99r5rhe93 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404744 and bi.ref ='324.600.94.01' and bi.lordem =1
20240717@074549.1594 jnietoin965q92i3n99r5rhe93 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2000.94.1'
20240717@074549.1688 jnietoin965q92i3n99r5rhe93 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404744 and bi.ref ='324.2000.94.1' and bi.lordem =2
20240717@074549.1934 jnietoin965q92i3n99r5rhe93 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.900.94.01'
20240717@074549.2025 jnietoin965q92i3n99r5rhe93 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404744 and bi.ref ='324.900.94.01' and bi.lordem =3
20240717@074549.2457 jnietoin965q92i3n99r5rhe93 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.700.94.01'
20240717@074549.2597 jnietoin965q92i3n99r5rhe93 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404744 and bi.ref ='324.700.94.01' and bi.lordem =4
20240717@074549.2858 jnietoin965q92i3n99r5rhe93 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2200.94.1'
20240717@074549.2946 jnietoin965q92i3n99r5rhe93 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404744 and bi.ref ='324.2200.94.1' and bi.lordem =5
20240717@074549.3192 jnietoin965q92i3n99r5rhe93 Query : use flama_phc
20240717@074549.3195 jnietoin965q92i3n99r5rhe93 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240717@074549.3207 jnietoin965q92i3n99r5rhe93 Query : use flama_phc
20240717@074549.3210 jnietoin965q92i3n99r5rhe93 Query : select top 1 1 valor from td where td.ndoc = 39
20240717@074549.3220 jnietoin965q92i3n99r5rhe93 Query : use flama_phc
20240717@074549.3223 jnietoin965q92i3n99r5rhe93 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')
20240717@074549.3240 jnietoin965q92i3n99r5rhe93 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
20240717@074549.3254 jnietoin965q92i3n99r5rhe93 Query : use flama_phc
20240717@074549.3257 jnietoin965q92i3n99r5rhe93 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240717@074549.3267 jnietoin965q92i3n99r5rhe93 Query : use flama_phc
20240717@074549.3269 jnietoin965q92i3n99r5rhe93 Query : select szadrsstamp valor from szadrs where szadrsdesc='740 ent vnr bligeiro'
20240717@074549.3281 jnietoin965q92i3n99r5rhe93 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='979';
20240717@074549.3296 jnietoin965q92i3n99r5rhe93 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='979';
20240717@074549.3762 0aed3g13llqqfsqhqdkippvq5p Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240717@074549.3774 0aed3g13llqqfsqhqdkippvq5p Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240717@074549.3793 0aed3g13llqqfsqhqdkippvq5p Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='980';
20240717@074549.4029 0aed3g13llqqfsqhqdkippvq5p Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='980';
20240717@074549.4106 0aed3g13llqqfsqhqdkippvq5p Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='980';
20240717@074549.4121 0aed3g13llqqfsqhqdkippvq5p Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='980';
20240717@074549.4136 0aed3g13llqqfsqhqdkippvq5p Query : use flama_phc
20240717@074549.4140 0aed3g13llqqfsqhqdkippvq5p Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240717@074549.4157 0aed3g13llqqfsqhqdkippvq5p Query : use flama_phc
20240717@074549.4159 0aed3g13llqqfsqhqdkippvq5p Query : select no, estab,szadrsdesc from szadrs where u_coddest=4743
20240717@074549.4227 0aed3g13llqqfsqhqdkippvq5p 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'
20240717@074549.4328 0aed3g13llqqfsqhqdkippvq5p Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404746 and bi.ref ='324.1831.00.2' and bi.lordem =1
20240717@074549.4593 0aed3g13llqqfsqhqdkippvq5p 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'
20240717@074549.4685 0aed3g13llqqfsqhqdkippvq5p Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404746 and bi.ref ='304.4860.00.1' and bi.lordem =2
20240717@074549.4929 0aed3g13llqqfsqhqdkippvq5p 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'
20240717@074549.5020 0aed3g13llqqfsqhqdkippvq5p Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404746 and bi.ref ='324.4840.00.1' and bi.lordem =3
20240717@074549.5280 0aed3g13llqqfsqhqdkippvq5p Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.5500.00.1'
20240717@074549.5373 0aed3g13llqqfsqhqdkippvq5p Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404746 and bi.ref ='324.5500.00.1' and bi.lordem =4
20240717@074549.5674 0aed3g13llqqfsqhqdkippvq5p Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.5500.00.1'
20240717@074549.5685 0aed3g13llqqfsqhqdkippvq5p Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404746 and bi.ref ='324.5500.00.1' and bi.lordem =4
20240717@074549.5692 0aed3g13llqqfsqhqdkippvq5p Query : use flama_phc
20240717@074549.5695 0aed3g13llqqfsqhqdkippvq5p Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240717@074549.5709 0aed3g13llqqfsqhqdkippvq5p Query : use flama_phc
20240717@074549.5711 0aed3g13llqqfsqhqdkippvq5p Query : select top 1 1 valor from td where td.ndoc = 39
20240717@074549.5722 0aed3g13llqqfsqhqdkippvq5p Query : use flama_phc
20240717@074549.5725 0aed3g13llqqfsqhqdkippvq5p 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')
20240717@074549.5744 0aed3g13llqqfsqhqdkippvq5p 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
20240717@074549.5760 0aed3g13llqqfsqhqdkippvq5p Query : use flama_phc
20240717@074549.5762 0aed3g13llqqfsqhqdkippvq5p Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240717@074549.5774 0aed3g13llqqfsqhqdkippvq5p Query : use flama_phc
20240717@074549.5776 0aed3g13llqqfsqhqdkippvq5p Query : select szadrsstamp valor from szadrs where szadrsdesc='101597 - auchan retail portugal , sa'
20240717@074549.5788 0aed3g13llqqfsqhqdkippvq5p Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='980';
20240717@074549.5803 0aed3g13llqqfsqhqdkippvq5p Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='980';
20240717@074549.7699 lco7t9k0ho8d52g4o799pdt3md Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240717@074549.7713 lco7t9k0ho8d52g4o799pdt3md Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240717@074549.7732 lco7t9k0ho8d52g4o799pdt3md Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='981';
20240717@074549.7779 lco7t9k0ho8d52g4o799pdt3md Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='981';
20240717@074549.7805 lco7t9k0ho8d52g4o799pdt3md Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='981';
20240717@074549.7821 lco7t9k0ho8d52g4o799pdt3md Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='981';
20240717@074549.7834 lco7t9k0ho8d52g4o799pdt3md Query : use flama_phc
20240717@074549.7837 lco7t9k0ho8d52g4o799pdt3md Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240717@074549.7852 lco7t9k0ho8d52g4o799pdt3md Query : use flama_phc
20240717@074549.7855 lco7t9k0ho8d52g4o799pdt3md Query : select no, estab,szadrsdesc from szadrs where u_coddest=416
20240717@074549.7885 lco7t9k0ho8d52g4o799pdt3md Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1879.00.1'
20240717@074549.7987 lco7t9k0ho8d52g4o799pdt3md Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404752 and bi.ref ='324.1879.00.1' and bi.lordem =1
20240717@074549.8245 lco7t9k0ho8d52g4o799pdt3md Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1879.00.1'
20240717@074549.8256 lco7t9k0ho8d52g4o799pdt3md Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404752 and bi.ref ='324.1879.00.1' and bi.lordem =1
20240717@074549.8263 lco7t9k0ho8d52g4o799pdt3md Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1879.00.1'
20240717@074549.8273 lco7t9k0ho8d52g4o799pdt3md Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404752 and bi.ref ='324.1879.00.1' and bi.lordem =2
20240717@074549.8522 lco7t9k0ho8d52g4o799pdt3md Query : use flama_phc
20240717@074549.8525 lco7t9k0ho8d52g4o799pdt3md Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240717@074549.8539 lco7t9k0ho8d52g4o799pdt3md Query : use flama_phc
20240717@074549.8542 lco7t9k0ho8d52g4o799pdt3md Query : select top 1 1 valor from td where td.ndoc = 39
20240717@074549.8553 lco7t9k0ho8d52g4o799pdt3md Query : use flama_phc
20240717@074549.8557 lco7t9k0ho8d52g4o799pdt3md 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')
20240717@074549.8579 lco7t9k0ho8d52g4o799pdt3md 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
20240717@074549.8595 lco7t9k0ho8d52g4o799pdt3md Query : use flama_phc
20240717@074549.8597 lco7t9k0ho8d52g4o799pdt3md Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240717@074549.8608 lco7t9k0ho8d52g4o799pdt3md Query : use flama_phc
20240717@074549.8611 lco7t9k0ho8d52g4o799pdt3md Query : select szadrsstamp valor from szadrs where szadrsdesc='bragajav, lda.'
20240717@074549.8623 lco7t9k0ho8d52g4o799pdt3md Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='981';
20240717@074549.8638 lco7t9k0ho8d52g4o799pdt3md Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='981';
20240717@074549.9153 muabf29n1iaoq1d3k1cgp0j7p6 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240717@074549.9169 muabf29n1iaoq1d3k1cgp0j7p6 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240717@074549.9188 muabf29n1iaoq1d3k1cgp0j7p6 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='982';
20240717@074549.9308 muabf29n1iaoq1d3k1cgp0j7p6 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='982';
20240717@074549.9333 muabf29n1iaoq1d3k1cgp0j7p6 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='982';
20240717@074549.9345 muabf29n1iaoq1d3k1cgp0j7p6 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='982';
20240717@074549.9359 muabf29n1iaoq1d3k1cgp0j7p6 Query : use flama_phc
20240717@074549.9362 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240717@074549.9536 muabf29n1iaoq1d3k1cgp0j7p6 Query : use flama_phc
20240717@074549.9574 muabf29n1iaoq1d3k1cgp0j7p6 Query : select no, estab,szadrsdesc from szadrs where u_coddest=2138
20240717@074549.9651 muabf29n1iaoq1d3k1cgp0j7p6 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'
20240717@074549.9747 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.1416.00.1' and bi.lordem =1
20240717@074550.1200 muabf29n1iaoq1d3k1cgp0j7p6 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'
20240717@074550.1030 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.966.00.01' and bi.lordem =2
20240717@074550.3540 muabf29n1iaoq1d3k1cgp0j7p6 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'
20240717@074550.4430 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.4980.00.1' and bi.lordem =3
20240717@074550.6930 muabf29n1iaoq1d3k1cgp0j7p6 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'
20240717@074550.7040 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.4840.00.1' and bi.lordem =4
20240717@074550.1000 muabf29n1iaoq1d3k1cgp0j7p6 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'
20240717@074550.1123 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.1834.00.1' and bi.lordem =5
20240717@074550.1394 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1879.00.1'
20240717@074550.1406 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.1879.00.1' and bi.lordem =6
20240717@074550.1684 muabf29n1iaoq1d3k1cgp0j7p6 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'
20240717@074550.1780 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.1805.00.1' and bi.lordem =7
20240717@074550.2048 muabf29n1iaoq1d3k1cgp0j7p6 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'
20240717@074550.2059 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.1805.00.1' and bi.lordem =7
20240717@074550.2066 muabf29n1iaoq1d3k1cgp0j7p6 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'
20240717@074550.2174 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.692.00.01' and bi.lordem =8
20240717@074550.2769 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.5347.00.1'
20240717@074550.2997 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.5347.00.1' and bi.lordem =9
20240717@074550.3444 muabf29n1iaoq1d3k1cgp0j7p6 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'
20240717@074550.3535 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.4970.00.1' and bi.lordem =10
20240717@074550.3785 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.948.00.01'
20240717@074550.3871 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.948.00.01' and bi.lordem =11
20240717@074550.4144 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.948.00.01'
20240717@074550.4154 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.948.00.01' and bi.lordem =11
20240717@074550.4160 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1406.00.1'
20240717@074550.4296 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.1406.00.1' and bi.lordem =12
20240717@074550.4559 muabf29n1iaoq1d3k1cgp0j7p6 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'
20240717@074550.4649 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.727.00.01' and bi.lordem =13
20240717@074550.4910 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4910.00.1'
20240717@074550.5006 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.4910.00.1' and bi.lordem =14
20240717@074550.5254 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4910.00.1'
20240717@074550.5265 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.4910.00.1' and bi.lordem =14
20240717@074550.5272 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4988.00.1'
20240717@074550.5362 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.4988.00.1' and bi.lordem =15
20240717@074550.5612 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2041.00.1'
20240717@074550.5713 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.2041.00.1' and bi.lordem =16
20240717@074550.5979 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.711.00.01'
20240717@074550.6229 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.711.00.01' and bi.lordem =17
20240717@074550.6570 muabf29n1iaoq1d3k1cgp0j7p6 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'
20240717@074550.6663 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.2907.00.1' and bi.lordem =18
20240717@074550.6910 muabf29n1iaoq1d3k1cgp0j7p6 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'
20240717@074550.6998 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.945.00.01' and bi.lordem =19
20240717@074550.7248 muabf29n1iaoq1d3k1cgp0j7p6 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'
20240717@074550.7344 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.2231.00.1' and bi.lordem =20
20240717@074550.7597 muabf29n1iaoq1d3k1cgp0j7p6 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'
20240717@074550.7695 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.657.00.01' and bi.lordem =21
20240717@074550.8003 muabf29n1iaoq1d3k1cgp0j7p6 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'
20240717@074550.8097 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.682.00.01' and bi.lordem =22
20240717@074550.8347 muabf29n1iaoq1d3k1cgp0j7p6 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'
20240717@074550.8357 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='324.692.00.01' and bi.lordem =23
20240717@074550.8603 muabf29n1iaoq1d3k1cgp0j7p6 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'
20240717@074550.8614 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404753 and bi.ref ='304.4320.00.1' and bi.lordem =24
20240717@074551.3270 muabf29n1iaoq1d3k1cgp0j7p6 Query : use flama_phc
20240717@074551.3520 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240717@074551.3680 muabf29n1iaoq1d3k1cgp0j7p6 Query : use flama_phc
20240717@074551.3710 muabf29n1iaoq1d3k1cgp0j7p6 Query : select top 1 1 valor from td where td.ndoc = 39
20240717@074551.3810 muabf29n1iaoq1d3k1cgp0j7p6 Query : use flama_phc
20240717@074551.3830 muabf29n1iaoq1d3k1cgp0j7p6 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')
20240717@074551.4010 muabf29n1iaoq1d3k1cgp0j7p6 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
20240717@074551.4170 muabf29n1iaoq1d3k1cgp0j7p6 Query : use flama_phc
20240717@074551.4190 muabf29n1iaoq1d3k1cgp0j7p6 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240717@074551.4300 muabf29n1iaoq1d3k1cgp0j7p6 Query : use flama_phc
20240717@074551.4320 muabf29n1iaoq1d3k1cgp0j7p6 Query : select szadrsstamp valor from szadrs where szadrsdesc='bitranlis, agentes transitára'
20240717@074551.4440 muabf29n1iaoq1d3k1cgp0j7p6 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='982';
20240717@074551.4590 muabf29n1iaoq1d3k1cgp0j7p6 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='982';
20240717@074551.9430 0j8oac9af32og8jd6kgh17714h Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240717@074551.9570 0j8oac9af32og8jd6kgh17714h Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240717@074551.9770 0j8oac9af32og8jd6kgh17714h Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='983';
20240717@074551.1020 0j8oac9af32og8jd6kgh17714h Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='983';
20240717@074551.1036 0j8oac9af32og8jd6kgh17714h Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='983';
20240717@074551.1049 0j8oac9af32og8jd6kgh17714h Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='983';
20240717@074551.1063 0j8oac9af32og8jd6kgh17714h Query : use flama_phc
20240717@074551.1066 0j8oac9af32og8jd6kgh17714h Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240717@074551.1080 0j8oac9af32og8jd6kgh17714h Query : use flama_phc
20240717@074551.1083 0j8oac9af32og8jd6kgh17714h Query : select no, estab,szadrsdesc from szadrs where u_coddest=2588
20240717@074551.1152 0j8oac9af32og8jd6kgh17714h 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'
20240717@074551.1164 0j8oac9af32og8jd6kgh17714h Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404754 and bi.ref ='324.2231.00.1' and bi.lordem =1
20240717@074551.1427 0j8oac9af32og8jd6kgh17714h 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'
20240717@074551.1552 0j8oac9af32og8jd6kgh17714h Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404754 and bi.ref ='324.2232.00.1' and bi.lordem =2
20240717@074551.1802 0j8oac9af32og8jd6kgh17714h 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'
20240717@074551.1890 0j8oac9af32og8jd6kgh17714h Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404754 and bi.ref ='324.938.00.01' and bi.lordem =3
20240717@074551.2146 0j8oac9af32og8jd6kgh17714h Query : use flama_phc
20240717@074551.2149 0j8oac9af32og8jd6kgh17714h Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240717@074551.2163 0j8oac9af32og8jd6kgh17714h Query : use flama_phc
20240717@074551.2165 0j8oac9af32og8jd6kgh17714h Query : select top 1 1 valor from td where td.ndoc = 39
20240717@074551.2176 0j8oac9af32og8jd6kgh17714h Query : use flama_phc
20240717@074551.2179 0j8oac9af32og8jd6kgh17714h 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')
20240717@074551.2197 0j8oac9af32og8jd6kgh17714h 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
20240717@074551.2211 0j8oac9af32og8jd6kgh17714h Query : use flama_phc
20240717@074551.2213 0j8oac9af32og8jd6kgh17714h Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240717@074551.2223 0j8oac9af32og8jd6kgh17714h Query : use flama_phc
20240717@074551.2226 0j8oac9af32og8jd6kgh17714h Query : select szadrsstamp valor from szadrs where szadrsdesc='caisdis sociedade de distribuiÇÃo s a'
20240717@074551.2237 0j8oac9af32og8jd6kgh17714h Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='983';
20240717@074551.2252 0j8oac9af32og8jd6kgh17714h Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='983';
20240717@074551.2776 7s2t9r3i6cck12hcejpusehpr8 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240717@074551.2790 7s2t9r3i6cck12hcejpusehpr8 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240717@074551.2808 7s2t9r3i6cck12hcejpusehpr8 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='984';
20240717@074551.2849 7s2t9r3i6cck12hcejpusehpr8 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='984';
20240717@074551.2866 7s2t9r3i6cck12hcejpusehpr8 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='984';
20240717@074551.2877 7s2t9r3i6cck12hcejpusehpr8 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='984';
20240717@074551.2890 7s2t9r3i6cck12hcejpusehpr8 Query : use flama_phc
20240717@074551.2893 7s2t9r3i6cck12hcejpusehpr8 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240717@074551.2907 7s2t9r3i6cck12hcejpusehpr8 Query : use flama_phc
20240717@074551.2909 7s2t9r3i6cck12hcejpusehpr8 Query : select no, estab,szadrsdesc from szadrs where u_coddest=1474
20240717@074551.2978 7s2t9r3i6cck12hcejpusehpr8 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'
20240717@074551.3075 7s2t9r3i6cck12hcejpusehpr8 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404755 and bi.ref ='324.1832.00.2' and bi.lordem =1
20240717@074551.3482 7s2t9r3i6cck12hcejpusehpr8 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'
20240717@074551.3495 7s2t9r3i6cck12hcejpusehpr8 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2047 and bo.obrano = 2404755 and bi.ref ='324.1832.00.2' and bi.lordem =2
20240717@074551.3762 7s2t9r3i6cck12hcejpusehpr8 Query : use flama_phc
20240717@074551.3765 7s2t9r3i6cck12hcejpusehpr8 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240717@074551.3779 7s2t9r3i6cck12hcejpusehpr8 Query : use flama_phc
20240717@074551.3782 7s2t9r3i6cck12hcejpusehpr8 Query : select top 1 1 valor from td where td.ndoc = 39
20240717@074551.3793 7s2t9r3i6cck12hcejpusehpr8 Query : use flama_phc
20240717@074551.3795 7s2t9r3i6cck12hcejpusehpr8 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')
20240717@074551.3813 7s2t9r3i6cck12hcejpusehpr8 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
20240717@074551.3830 7s2t9r3i6cck12hcejpusehpr8 Query : use flama_phc
20240717@074551.3833 7s2t9r3i6cck12hcejpusehpr8 Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240717@074551.3846 7s2t9r3i6cck12hcejpusehpr8 Query : use flama_phc
20240717@074551.3848 7s2t9r3i6cck12hcejpusehpr8 Query : select szadrsstamp valor from szadrs where szadrsdesc='j.o.m.,lda - corroios'
20240717@074551.3862 7s2t9r3i6cck12hcejpusehpr8 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='984';
20240717@074551.3878 7s2t9r3i6cck12hcejpusehpr8 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='984';
20240717@081920.7991 hbqnl1pqtc0bcg0c4fpnda025l Query : use flama_phc
20240717@081920.7998 hbqnl1pqtc0bcg0c4fpnda025l Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240717@081920.8054 hbqnl1pqtc0bcg0c4fpnda025l Query : use flama_phc
20240717@081920.8058 hbqnl1pqtc0bcg0c4fpnda025l Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240717@083621.1360 jv58e6vfqie8nvvsjr51rlaa0g Query : use flama_phc
20240717@083621.1540 jv58e6vfqie8nvvsjr51rlaa0g Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240717@083621.4500 jv58e6vfqie8nvvsjr51rlaa0g Query : use flama_phc
20240717@083621.4990 jv58e6vfqie8nvvsjr51rlaa0g Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240717@090510.6233 cd7nh5ilqmer02sb2amcu0r9iu Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240717@090510.6260 cd7nh5ilqmer02sb2amcu0r9iu Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240717@090510.6306 cd7nh5ilqmer02sb2amcu0r9iu Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='985';
20240717@090510.6342 cd7nh5ilqmer02sb2amcu0r9iu Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='985';
20240717@090510.6373 cd7nh5ilqmer02sb2amcu0r9iu Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='985';
20240717@090510.7008 cd7nh5ilqmer02sb2amcu0r9iu Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='985';
20240717@090510.7298 cd7nh5ilqmer02sb2amcu0r9iu Query : use flama_phc
20240717@090510.7420 cd7nh5ilqmer02sb2amcu0r9iu Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240717@090510.7907 cd7nh5ilqmer02sb2amcu0r9iu Query : use flama_phc
20240717@090510.7911 cd7nh5ilqmer02sb2amcu0r9iu Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240717@090510.8119 cd7nh5ilqmer02sb2amcu0r9iu Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4902.00.1'
20240717@090510.8316 cd7nh5ilqmer02sb2amcu0r9iu Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4902.00.1'
20240717@090510.8327 cd7nh5ilqmer02sb2amcu0r9iu Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4902.00.1'
20240717@090510.8337 cd7nh5ilqmer02sb2amcu0r9iu Query : use flama_phc
20240717@090510.8341 cd7nh5ilqmer02sb2amcu0r9iu Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240717@090510.8637 cd7nh5ilqmer02sb2amcu0r9iu Query : use flama_phc
20240717@090510.8641 cd7nh5ilqmer02sb2amcu0r9iu Query : select top 1 1 valor from td where td.ndoc = 39
20240717@090510.8694 cd7nh5ilqmer02sb2amcu0r9iu Query : use flama_phc
20240717@090510.8718 cd7nh5ilqmer02sb2amcu0r9iu 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')
20240717@090510.8849 cd7nh5ilqmer02sb2amcu0r9iu 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
20240717@090510.9008 cd7nh5ilqmer02sb2amcu0r9iu Query : use flama_phc
20240717@090510.9011 cd7nh5ilqmer02sb2amcu0r9iu Query : select szadrsstamp valor from szadrs where szadrsdesc='espaÇotrans,lda'
20240717@090510.9072 cd7nh5ilqmer02sb2amcu0r9iu Query : use flama_phc
20240717@090510.9075 cd7nh5ilqmer02sb2amcu0r9iu Query : select szadrsstamp valor from szadrs where szadrsdesc='100810 - worten-equipamentos para o lar,sa.'
20240717@090510.9088 cd7nh5ilqmer02sb2amcu0r9iu Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='985';
20240717@090510.9106 cd7nh5ilqmer02sb2amcu0r9iu Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='985';
20240717@091911.9406 ud9249mpeqe2qhhcac4cjfsdi6 Query : use flama_phc
20240717@091911.9411 ud9249mpeqe2qhhcac4cjfsdi6 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240717@091911.9460 ud9249mpeqe2qhhcac4cjfsdi6 Query : use flama_phc
20240717@091911.9464 ud9249mpeqe2qhhcac4cjfsdi6 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240717@093612.1872 12v6k4onvi21avud3um096g9o0 Query : use flama_phc
20240717@093612.1878 12v6k4onvi21avud3um096g9o0 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240717@093612.1943 12v6k4onvi21avud3um096g9o0 Query : use flama_phc
20240717@093612.1946 12v6k4onvi21avud3um096g9o0 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240717@101911.8796 f2uqa1hv9bpqm7eegtak97u1d2 Query : use flama_phc
20240717@101911.8802 f2uqa1hv9bpqm7eegtak97u1d2 Query : select secretkey valor from u_wsusers u where u.userid = ? and u.username=? and u.password=? and u.inactivo=0
20240717@101911.8864 f2uqa1hv9bpqm7eegtak97u1d2 Query : use flama_phc
20240717@101911.8868 f2uqa1hv9bpqm7eegtak97u1d2 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240717@103111.4320 ba3gte5d9pcgbsh7tda6k3uchb Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240717@103111.4350 ba3gte5d9pcgbsh7tda6k3uchb Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240717@103111.4469 ba3gte5d9pcgbsh7tda6k3uchb Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='986';
20240717@103111.4520 ba3gte5d9pcgbsh7tda6k3uchb Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='986';
20240717@103111.4550 ba3gte5d9pcgbsh7tda6k3uchb Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='986';
20240717@103111.4563 ba3gte5d9pcgbsh7tda6k3uchb Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='986';
20240717@103111.4581 ba3gte5d9pcgbsh7tda6k3uchb Query : use flama_phc
20240717@103111.4584 ba3gte5d9pcgbsh7tda6k3uchb Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240717@103111.4630 ba3gte5d9pcgbsh7tda6k3uchb Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1824.00.1'
20240717@103111.4703 ba3gte5d9pcgbsh7tda6k3uchb 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 = 2400216 and bi.ref ='324.1824.00.1' and bi.lordem =20000
20240717@103111.5001 ba3gte5d9pcgbsh7tda6k3uchb 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 = 'cps24022744186,554000002 ' 
20240717@103111.5268 ba3gte5d9pcgbsh7tda6k3uchb Query : use flama_phc
20240717@103111.5271 ba3gte5d9pcgbsh7tda6k3uchb Query : select top 1 1 valor from ts where ts.ndos = 61
20240717@103111.5334 ba3gte5d9pcgbsh7tda6k3uchb Query : use flama_phc
20240717@103111.5337 ba3gte5d9pcgbsh7tda6k3uchb 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')
20240717@103111.5394 ba3gte5d9pcgbsh7tda6k3uchb 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
20240717@103111.5566 ba3gte5d9pcgbsh7tda6k3uchb Query : use flama_phc
20240717@103111.5569 ba3gte5d9pcgbsh7tda6k3uchb Query : select top 1 ~inactivo valor from fl where no = '202241' and estab = 00 order by inactivo desc
20240717@103111.7205 ba3gte5d9pcgbsh7tda6k3uchb Query : use flama_phc
20240717@103111.7245 ba3gte5d9pcgbsh7tda6k3uchb Query : select 1 valor from ts where ndos = 61
20240717@103111.7802 ba3gte5d9pcgbsh7tda6k3uchb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240717@103111.8306 ba3gte5d9pcgbsh7tda6k3uchb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240717@103111.8367 ba3gte5d9pcgbsh7tda6k3uchb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240717@103111.8381 ba3gte5d9pcgbsh7tda6k3uchb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240717@103111.8388 ba3gte5d9pcgbsh7tda6k3uchb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240717@103111.8400 ba3gte5d9pcgbsh7tda6k3uchb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240717@103111.8408 ba3gte5d9pcgbsh7tda6k3uchb 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
20240717@103111.8510 ba3gte5d9pcgbsh7tda6k3uchb Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240717@103111.8589 ba3gte5d9pcgbsh7tda6k3uchb Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240717@103111.8606 ba3gte5d9pcgbsh7tda6k3uchb Query : use flama_phc
20240717@103111.8609 ba3gte5d9pcgbsh7tda6k3uchb Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202241' and estab=00
20240717@103111.8672 ba3gte5d9pcgbsh7tda6k3uchb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240717@103111.8685 ba3gte5d9pcgbsh7tda6k3uchb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240717@103111.8716 ba3gte5d9pcgbsh7tda6k3uchb Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut669780548566978f5fd2',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240717@103111.8765 ba3gte5d9pcgbsh7tda6k3uchb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240717@103111.8779 ba3gte5d9pcgbsh7tda6k3uchb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240717@103111.8786 ba3gte5d9pcgbsh7tda6k3uchb Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut669780548566978f5fd2','--','bo',7.7919750681729645500 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240717@103111.8935 ba3gte5d9pcgbsh7tda6k3uchb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240717@103111.8949 ba3gte5d9pcgbsh7tda6k3uchb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240717@103111.8956 ba3gte5d9pcgbsh7tda6k3uchb 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 ('aut669780548566978f5fd2','guia r. fornecedor','2024-07-17',61,2402107,?,?,?,?,?,?,?,?,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')
20240717@103111.9514 ba3gte5d9pcgbsh7tda6k3uchb Query : use flama_phc
20240717@103111.9517 ba3gte5d9pcgbsh7tda6k3uchb Query : select st.usalote valor from st where st.ref = '324.1824.00.1'
20240717@103111.9598 ba3gte5d9pcgbsh7tda6k3uchb Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '324.1824.00.1'
20240717@103111.9714 ba3gte5d9pcgbsh7tda6k3uchb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240717@103111.9728 ba3gte5d9pcgbsh7tda6k3uchb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240717@103111.9741 ba3gte5d9pcgbsh7tda6k3uchb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240717@103111.9754 ba3gte5d9pcgbsh7tda6k3uchb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240717@103111.9762 ba3gte5d9pcgbsh7tda6k3uchb Query : select sestamp valor from se where ref ='324.1824.00.1' and lote = 'r2400216200a'
20240717@103111.9824 ba3gte5d9pcgbsh7tda6k3uchb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240717@103111.9837 ba3gte5d9pcgbsh7tda6k3uchb Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240717@103111.9844 ba3gte5d9pcgbsh7tda6k3uchb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240717@103111.9856 ba3gte5d9pcgbsh7tda6k3uchb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240717@103111.9863 ba3gte5d9pcgbsh7tda6k3uchb Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut669782928466978f5ff0',?,?,'20240717',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240717@103112.3260 ba3gte5d9pcgbsh7tda6k3uchb Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240717@103112.3590 ba3gte5d9pcgbsh7tda6k3uchb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240717@103112.3720 ba3gte5d9pcgbsh7tda6k3uchb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240717@103112.3790 ba3gte5d9pcgbsh7tda6k3uchb Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut669780333666978f6008','aut669780548566978f5fd2',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 = 'aut669780548566978f5fd2'
20240717@103112.5330 ba3gte5d9pcgbsh7tda6k3uchb Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240717@103112.5490 ba3gte5d9pcgbsh7tda6k3uchb Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240717@103112.5620 ba3gte5d9pcgbsh7tda6k3uchb 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 'aut669780333666978f6008',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1470, 1470*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,10000 ,25.67,25.67*200.48,25.67,25.67*200.48 ,0,0,'un',' ' ,bo.marcada,1 ,25.67*1470,25.67*1470*200.48 ,27.290000,27.290000*200.48 ,27.290000,27.290000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,25.67,25.67*200.48,25.67*1470,25.67*1470*200.48,'cps24022744186,554000002 ',200.02,200.02*1470,200.02,200.02*1470,?,?,?,4 from bo bo where bo.bostamp = 'aut669780548566978f5fd2'
20240717@103116.8837 ba3gte5d9pcgbsh7tda6k3uchb Query : use flama_phc
20240717@103116.8855 ba3gte5d9pcgbsh7tda6k3uchb Query : declare @bostamp varchar(25) = 'aut669780548566978f5fd2' ,@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 
20240717@103125.8281 ba3gte5d9pcgbsh7tda6k3uchb Query : use flama_phc
20240717@103125.8284 ba3gte5d9pcgbsh7tda6k3uchb Query : select 1 valor from bo where bo.bostamp = 'aut669780548566978f5fd2'
20240717@103125.8351 ba3gte5d9pcgbsh7tda6k3uchb 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) = 'aut669780548566978f5fd2' 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 
