20240627@181644.2559 c43bkbkvgatl8aft53hi8enagd INICIO DE FICHEIRO DE LOG :: /var/www/webservices/logs/website.sql.log
20240627@181644.2556 c43bkbkvgatl8aft53hi8enagd Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.649.00.01'
20240627@181644.2572 c43bkbkvgatl8aft53hi8enagd Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404364 and bi.ref ='324.649.00.01' and bi.lordem =1
20240627@181644.2581 c43bkbkvgatl8aft53hi8enagd Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.649.00.01'
20240627@181644.2590 c43bkbkvgatl8aft53hi8enagd Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404364 and bi.ref ='324.649.00.01' and bi.lordem =1
20240627@181644.2599 c43bkbkvgatl8aft53hi8enagd Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.649.00.01'
20240627@181644.2626 c43bkbkvgatl8aft53hi8enagd Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404364 and bi.ref ='324.649.00.01' and bi.lordem =1
20240627@181644.2633 c43bkbkvgatl8aft53hi8enagd Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.649.00.01'
20240627@181644.2668 c43bkbkvgatl8aft53hi8enagd Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404364 and bi.ref ='324.649.00.01' and bi.lordem =1
20240627@181644.2675 c43bkbkvgatl8aft53hi8enagd Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.649.00.01'
20240627@181644.2684 c43bkbkvgatl8aft53hi8enagd Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404364 and bi.ref ='324.649.00.01' and bi.lordem =1
20240627@181644.2691 c43bkbkvgatl8aft53hi8enagd Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.649.00.01'
20240627@181644.2753 c43bkbkvgatl8aft53hi8enagd Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404364 and bi.ref ='324.649.00.01' and bi.lordem =1
20240627@181644.2759 c43bkbkvgatl8aft53hi8enagd Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.649.00.01'
20240627@181644.2768 c43bkbkvgatl8aft53hi8enagd Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404364 and bi.ref ='324.649.00.01' and bi.lordem =1
20240627@181644.2775 c43bkbkvgatl8aft53hi8enagd Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.649.00.01'
20240627@181644.2784 c43bkbkvgatl8aft53hi8enagd Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404364 and bi.ref ='324.649.00.01' and bi.lordem =1
20240627@181644.2790 c43bkbkvgatl8aft53hi8enagd Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.649.00.01'
20240627@181644.2799 c43bkbkvgatl8aft53hi8enagd Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404364 and bi.ref ='324.649.00.01' and bi.lordem =1
20240627@181644.2805 c43bkbkvgatl8aft53hi8enagd Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.649.00.01'
20240627@181644.2815 c43bkbkvgatl8aft53hi8enagd Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404364 and bi.ref ='324.649.00.01' and bi.lordem =1
20240627@181644.2822 c43bkbkvgatl8aft53hi8enagd Query : use flama_phc
20240627@181644.2825 c43bkbkvgatl8aft53hi8enagd Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240627@181644.2837 c43bkbkvgatl8aft53hi8enagd Query : use flama_phc
20240627@181644.2840 c43bkbkvgatl8aft53hi8enagd Query : select top 1 1 valor from td where td.ndoc = 39
20240627@181644.2850 c43bkbkvgatl8aft53hi8enagd Query : use flama_phc
20240627@181644.2852 c43bkbkvgatl8aft53hi8enagd 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')
20240627@181644.3432 co6t6qi1t34oi1lsf4fgpnti10 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240627@181644.3448 co6t6qi1t34oi1lsf4fgpnti10 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240627@181644.3465 co6t6qi1t34oi1lsf4fgpnti10 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='676';
20240627@181644.3510 co6t6qi1t34oi1lsf4fgpnti10 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='676';
20240627@181644.3524 co6t6qi1t34oi1lsf4fgpnti10 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='676';
20240627@181644.3536 co6t6qi1t34oi1lsf4fgpnti10 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='676';
20240627@181644.3549 co6t6qi1t34oi1lsf4fgpnti10 Query : use flama_phc
20240627@181644.3552 co6t6qi1t34oi1lsf4fgpnti10 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240627@181644.3569 co6t6qi1t34oi1lsf4fgpnti10 Query : use flama_phc
20240627@181644.3572 co6t6qi1t34oi1lsf4fgpnti10 Query : select no, estab,szadrsdesc from szadrs where u_coddest=2264
20240627@181644.3652 co6t6qi1t34oi1lsf4fgpnti10 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'
20240627@181644.3827 co6t6qi1t34oi1lsf4fgpnti10 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404397 and bi.ref ='324.938.00.01' and bi.lordem =1
20240627@181644.4163 co6t6qi1t34oi1lsf4fgpnti10 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'
20240627@181644.4336 co6t6qi1t34oi1lsf4fgpnti10 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404397 and bi.ref ='324.939.00.01' and bi.lordem =2
20240627@181644.4691 co6t6qi1t34oi1lsf4fgpnti10 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1462.00.1'
20240627@181644.4865 co6t6qi1t34oi1lsf4fgpnti10 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404397 and bi.ref ='324.1462.00.1' and bi.lordem =3
20240627@181644.5199 co6t6qi1t34oi1lsf4fgpnti10 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'
20240627@181644.5366 co6t6qi1t34oi1lsf4fgpnti10 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404397 and bi.ref ='324.1834.00.1' and bi.lordem =4
20240627@181644.5701 co6t6qi1t34oi1lsf4fgpnti10 Query : use flama_phc
20240627@181644.5705 co6t6qi1t34oi1lsf4fgpnti10 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240627@181644.5720 co6t6qi1t34oi1lsf4fgpnti10 Query : use flama_phc
20240627@181644.5723 co6t6qi1t34oi1lsf4fgpnti10 Query : select top 1 1 valor from td where td.ndoc = 39
20240627@181644.5735 co6t6qi1t34oi1lsf4fgpnti10 Query : use flama_phc
20240627@181644.5738 co6t6qi1t34oi1lsf4fgpnti10 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')
20240627@181644.6296 ok6j561m93cdl2kfi3am3ua9rq Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240627@181644.6311 ok6j561m93cdl2kfi3am3ua9rq Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240627@181644.6329 ok6j561m93cdl2kfi3am3ua9rq Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='677';
20240627@181644.6375 ok6j561m93cdl2kfi3am3ua9rq Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='677';
20240627@181644.6390 ok6j561m93cdl2kfi3am3ua9rq Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='677';
20240627@181644.6403 ok6j561m93cdl2kfi3am3ua9rq Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='677';
20240627@181644.6417 ok6j561m93cdl2kfi3am3ua9rq Query : use flama_phc
20240627@181644.6420 ok6j561m93cdl2kfi3am3ua9rq Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240627@181644.6436 ok6j561m93cdl2kfi3am3ua9rq Query : use flama_phc
20240627@181644.6440 ok6j561m93cdl2kfi3am3ua9rq Query : select no, estab,szadrsdesc from szadrs where u_coddest=1492
20240627@181644.6583 ok6j561m93cdl2kfi3am3ua9rq 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'
20240627@181644.6595 ok6j561m93cdl2kfi3am3ua9rq Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404411 and bi.ref ='324.1834.00.1' and bi.lordem =1
20240627@181644.7264 ok6j561m93cdl2kfi3am3ua9rq Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4723.00.2'
20240627@181644.7277 ok6j561m93cdl2kfi3am3ua9rq Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404411 and bi.ref ='324.4723.00.2' and bi.lordem =2
20240627@181644.7781 ok6j561m93cdl2kfi3am3ua9rq Query : use flama_phc
20240627@181644.7817 ok6j561m93cdl2kfi3am3ua9rq Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240627@181644.7850 ok6j561m93cdl2kfi3am3ua9rq Query : use flama_phc
20240627@181644.7853 ok6j561m93cdl2kfi3am3ua9rq Query : select top 1 1 valor from td where td.ndoc = 39
20240627@181644.7864 ok6j561m93cdl2kfi3am3ua9rq Query : use flama_phc
20240627@181644.7867 ok6j561m93cdl2kfi3am3ua9rq 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')
20240627@181644.8660 prlmtcjlt1840lthci1bivpbh1 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240627@181644.8675 prlmtcjlt1840lthci1bivpbh1 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240627@181644.8693 prlmtcjlt1840lthci1bivpbh1 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='678';
20240627@181644.8736 prlmtcjlt1840lthci1bivpbh1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='678';
20240627@181644.8751 prlmtcjlt1840lthci1bivpbh1 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='678';
20240627@181644.8763 prlmtcjlt1840lthci1bivpbh1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='678';
20240627@181644.8776 prlmtcjlt1840lthci1bivpbh1 Query : use flama_phc
20240627@181644.8779 prlmtcjlt1840lthci1bivpbh1 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240627@181644.8795 prlmtcjlt1840lthci1bivpbh1 Query : use flama_phc
20240627@181644.8798 prlmtcjlt1840lthci1bivpbh1 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4743
20240627@181644.8874 prlmtcjlt1840lthci1bivpbh1 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '328.9005.00.1'
20240627@181644.9043 prlmtcjlt1840lthci1bivpbh1 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404413 and bi.ref ='328.9005.00.1' and bi.lordem =1
20240627@181644.9373 prlmtcjlt1840lthci1bivpbh1 Query : use flama_phc
20240627@181644.9376 prlmtcjlt1840lthci1bivpbh1 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240627@181644.9389 prlmtcjlt1840lthci1bivpbh1 Query : use flama_phc
20240627@181644.9392 prlmtcjlt1840lthci1bivpbh1 Query : select top 1 1 valor from td where td.ndoc = 39
20240627@181644.9404 prlmtcjlt1840lthci1bivpbh1 Query : use flama_phc
20240627@181644.9406 prlmtcjlt1840lthci1bivpbh1 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')
20240627@181644.9865 5o5k8oqjir752k5kjukm75jpl1 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240627@181644.9879 5o5k8oqjir752k5kjukm75jpl1 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240627@181644.9895 5o5k8oqjir752k5kjukm75jpl1 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='679';
20240627@181644.9936 5o5k8oqjir752k5kjukm75jpl1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='679';
20240627@181644.9958 5o5k8oqjir752k5kjukm75jpl1 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='679';
20240627@181644.9970 5o5k8oqjir752k5kjukm75jpl1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='679';

20240628@093345.9506 o2gae86tt460e7pvum716o79vd Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='680';
20240628@093345.9535 o2gae86tt460e7pvum716o79vd Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='680';
20240628@093345.9548 o2gae86tt460e7pvum716o79vd Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='680';

20240628@104846.3455 lurdkfeppev4k44253o6ijbnfa Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='681';
20240628@104846.3470 lurdkfeppev4k44253o6ijbnfa Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='681';
20240628@104846.3482 lurdkfeppev4k44253o6ijbnfa Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='681';
20240628@104846.4974 qe7qa8a7vs4jdcm1g48pf437k4 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240628@104846.4988 qe7qa8a7vs4jdcm1g48pf437k4 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240628@104846.5003 qe7qa8a7vs4jdcm1g48pf437k4 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='682';
20240628@104846.5044 qe7qa8a7vs4jdcm1g48pf437k4 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='682';
20240628@104846.5062 qe7qa8a7vs4jdcm1g48pf437k4 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='682';
20240628@104846.5076 qe7qa8a7vs4jdcm1g48pf437k4 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='682';
20240628@104846.5092 qe7qa8a7vs4jdcm1g48pf437k4 Query : use flama_phc
20240628@104846.5095 qe7qa8a7vs4jdcm1g48pf437k4 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240628@104846.5111 qe7qa8a7vs4jdcm1g48pf437k4 Query : select no, estab,szadrsdesc from szadrs where u_coddest=2
20240628@104846.5181 qe7qa8a7vs4jdcm1g48pf437k4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1871.00.1'
20240628@104846.5296 qe7qa8a7vs4jdcm1g48pf437k4 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.682.00.01'
20240628@104846.5420 qe7qa8a7vs4jdcm1g48pf437k4 Query : use flama_phc
20240628@104846.5423 qe7qa8a7vs4jdcm1g48pf437k4 Query : select top 1 1 valor from ts where ts.ndos = 5
20240628@104846.5506 qe7qa8a7vs4jdcm1g48pf437k4 Query : use flama_phc
20240628@104846.5509 qe7qa8a7vs4jdcm1g48pf437k4 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')
20240628@104846.5546 qe7qa8a7vs4jdcm1g48pf437k4 Query : select top 1 assinadoc issigned ,ts.stocks ,ts.bdempresas origin ,case when (cmstocks between 1 and 50 or cm2stocks between 1 and 50 ) then 1 else 0 end entrada ,case when cmstocks>50 or (cm2stocks>50 and trfa =1) then 1 else 0 end saida ,stneg validatestock ,tiposaft ,veserie useserialnumber ,foserie assetin ,ftserie assetout ,veserie assets ,trfarm assetstransfer ,grelha usegridfields from ts inner join ts2 on ts.tsstamp=ts2.ts2stamp where ts.ndos =5
20240628@104846.5731 qe7qa8a7vs4jdcm1g48pf437k4 Query : use flama_phc
20240628@104846.5734 qe7qa8a7vs4jdcm1g48pf437k4 Query : select top 1 ~inactivo valor from fl where no = '100500' and estab = 0 order by inactivo desc
20240628@104846.5833 qe7qa8a7vs4jdcm1g48pf437k4 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='682';
20240628@104846.5845 qe7qa8a7vs4jdcm1g48pf437k4 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='682';
20240628@104846.6454 6r4gle9tltck5hck2etcil98mh Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240628@104846.6467 6r4gle9tltck5hck2etcil98mh Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240628@104846.6482 6r4gle9tltck5hck2etcil98mh Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='683';
20240628@104846.6529 6r4gle9tltck5hck2etcil98mh Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='683';
20240628@104846.6544 6r4gle9tltck5hck2etcil98mh Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='683';
20240628@104846.6556 6r4gle9tltck5hck2etcil98mh Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='683';
20240628@104846.6778 79f6t2nvh8ikav59l2glcnvck7 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240628@104846.6791 79f6t2nvh8ikav59l2glcnvck7 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240628@104846.6806 79f6t2nvh8ikav59l2glcnvck7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='684';
20240628@104846.6846 79f6t2nvh8ikav59l2glcnvck7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='684';
20240628@104846.6862 79f6t2nvh8ikav59l2glcnvck7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='684';
20240628@104846.6874 79f6t2nvh8ikav59l2glcnvck7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='684';
20240628@104846.6887 79f6t2nvh8ikav59l2glcnvck7 Query : use flama_phc
20240628@104846.6890 79f6t2nvh8ikav59l2glcnvck7 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240628@104846.6906 79f6t2nvh8ikav59l2glcnvck7 Query : select no, estab,szadrsdesc from szadrs where u_coddest=2
20240628@104846.6965 79f6t2nvh8ikav59l2glcnvck7 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1816.00.1'
20240628@104846.7088 79f6t2nvh8ikav59l2glcnvck7 Query : use flama_phc
20240628@104846.7091 79f6t2nvh8ikav59l2glcnvck7 Query : select top 1 1 valor from ts where ts.ndos = 5
20240628@104846.7101 79f6t2nvh8ikav59l2glcnvck7 Query : use flama_phc
20240628@104846.7104 79f6t2nvh8ikav59l2glcnvck7 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')
20240628@104846.7123 79f6t2nvh8ikav59l2glcnvck7 Query : select top 1 assinadoc issigned ,ts.stocks ,ts.bdempresas origin ,case when (cmstocks between 1 and 50 or cm2stocks between 1 and 50 ) then 1 else 0 end entrada ,case when cmstocks>50 or (cm2stocks>50 and trfa =1) then 1 else 0 end saida ,stneg validatestock ,tiposaft ,veserie useserialnumber ,foserie assetin ,ftserie assetout ,veserie assets ,trfarm assetstransfer ,grelha usegridfields from ts inner join ts2 on ts.tsstamp=ts2.ts2stamp where ts.ndos =5
20240628@104846.7141 79f6t2nvh8ikav59l2glcnvck7 Query : use flama_phc
20240628@104846.7144 79f6t2nvh8ikav59l2glcnvck7 Query : select top 1 ~inactivo valor from fl where no = '100500' and estab = 0 order by inactivo desc
20240628@104846.7156 79f6t2nvh8ikav59l2glcnvck7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='684';
20240628@104846.7170 79f6t2nvh8ikav59l2glcnvck7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='684';

20240628@144548.1081 akptobeto0vd62ahm665d59iuv Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='685';
20240628@144548.1111 akptobeto0vd62ahm665d59iuv Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='685';
20240628@144548.1124 akptobeto0vd62ahm665d59iuv Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='685';
20240628@144548.1944 m54giet71vaq4i60nor655c7b1 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240628@144548.1959 m54giet71vaq4i60nor655c7b1 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240628@144548.1975 m54giet71vaq4i60nor655c7b1 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='686';
20240628@144548.2060 m54giet71vaq4i60nor655c7b1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='686';
20240628@144548.2080 m54giet71vaq4i60nor655c7b1 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='686';
20240628@144548.2092 m54giet71vaq4i60nor655c7b1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='686';
20240628@144548.2109 m54giet71vaq4i60nor655c7b1 Query : use flama_phc
20240628@144548.2112 m54giet71vaq4i60nor655c7b1 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240628@144548.2209 m54giet71vaq4i60nor655c7b1 Query : select no, estab,szadrsdesc from szadrs where u_coddest=2
20240628@144548.2279 m54giet71vaq4i60nor655c7b1 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '304.421.00.04'
20240628@144548.2448 m54giet71vaq4i60nor655c7b1 Query : use flama_phc
20240628@144548.2451 m54giet71vaq4i60nor655c7b1 Query : select top 1 1 valor from ts where ts.ndos = 5
20240628@144548.2580 m54giet71vaq4i60nor655c7b1 Query : use flama_phc
20240628@144548.2583 m54giet71vaq4i60nor655c7b1 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')
20240628@144548.2701 m54giet71vaq4i60nor655c7b1 Query : select top 1 assinadoc issigned ,ts.stocks ,ts.bdempresas origin ,case when (cmstocks between 1 and 50 or cm2stocks between 1 and 50 ) then 1 else 0 end entrada ,case when cmstocks>50 or (cm2stocks>50 and trfa =1) then 1 else 0 end saida ,stneg validatestock ,tiposaft ,veserie useserialnumber ,foserie assetin ,ftserie assetout ,veserie assets ,trfarm assetstransfer ,grelha usegridfields from ts inner join ts2 on ts.tsstamp=ts2.ts2stamp where ts.ndos =5
20240628@144548.2927 m54giet71vaq4i60nor655c7b1 Query : use flama_phc
20240628@144548.2932 m54giet71vaq4i60nor655c7b1 Query : select top 1 ~inactivo valor from fl where no = '100500' and estab = 0 order by inactivo desc
20240628@144548.3026 m54giet71vaq4i60nor655c7b1 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='686';
20240628@144548.3039 m54giet71vaq4i60nor655c7b1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='686';

20240630@130055.4402 34u51hgl8kcdl7j0td1ggoj3sk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='687';
20240630@130055.4428 34u51hgl8kcdl7j0td1ggoj3sk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='687';
20240630@130055.4439 34u51hgl8kcdl7j0td1ggoj3sk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='687';
20240630@130055.4452 34u51hgl8kcdl7j0td1ggoj3sk Query : use flama_phc
20240630@130055.4455 34u51hgl8kcdl7j0td1ggoj3sk Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130055.4501 34u51hgl8kcdl7j0td1ggoj3sk Query : use flama_phc
20240630@130055.4503 34u51hgl8kcdl7j0td1ggoj3sk Query : select no, estab,szadrsdesc from szadrs where u_coddest=4790
20240630@130055.4585 34u51hgl8kcdl7j0td1ggoj3sk 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'
20240630@130055.4734 34u51hgl8kcdl7j0td1ggoj3sk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404372 and bi.ref ='324.2066.00.1' and bi.lordem =1
20240630@130055.5068 34u51hgl8kcdl7j0td1ggoj3sk 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'
20240630@130055.5217 34u51hgl8kcdl7j0td1ggoj3sk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404372 and bi.ref ='324.2907.00.1' and bi.lordem =2
20240630@130055.5531 34u51hgl8kcdl7j0td1ggoj3sk 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'
20240630@130055.5541 34u51hgl8kcdl7j0td1ggoj3sk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404372 and bi.ref ='324.2907.00.1' and bi.lordem =2
20240630@130055.5549 34u51hgl8kcdl7j0td1ggoj3sk Query : use flama_phc
20240630@130055.5552 34u51hgl8kcdl7j0td1ggoj3sk Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130055.5762 34u51hgl8kcdl7j0td1ggoj3sk Query : use flama_phc
20240630@130055.5765 34u51hgl8kcdl7j0td1ggoj3sk Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130055.5825 34u51hgl8kcdl7j0td1ggoj3sk Query : use flama_phc
20240630@130055.5828 34u51hgl8kcdl7j0td1ggoj3sk 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')
20240630@130055.6419 ec1764ta14b3oigh8ep46m8q08 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130055.6432 ec1764ta14b3oigh8ep46m8q08 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130055.6449 ec1764ta14b3oigh8ep46m8q08 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='688';
20240630@130055.6499 ec1764ta14b3oigh8ep46m8q08 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='688';
20240630@130055.6515 ec1764ta14b3oigh8ep46m8q08 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='688';
20240630@130055.6528 ec1764ta14b3oigh8ep46m8q08 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='688';
20240630@130055.6542 ec1764ta14b3oigh8ep46m8q08 Query : use flama_phc
20240630@130055.6546 ec1764ta14b3oigh8ep46m8q08 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130055.6562 ec1764ta14b3oigh8ep46m8q08 Query : use flama_phc
20240630@130055.6565 ec1764ta14b3oigh8ep46m8q08 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4779
20240630@130055.6664 ec1764ta14b3oigh8ep46m8q08 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'
20240630@130055.6859 ec1764ta14b3oigh8ep46m8q08 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404378 and bi.ref ='304.422.00.07' and bi.lordem =1
20240630@130055.8208 ec1764ta14b3oigh8ep46m8q08 Query : use flama_phc
20240630@130055.8212 ec1764ta14b3oigh8ep46m8q08 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130055.8225 ec1764ta14b3oigh8ep46m8q08 Query : use flama_phc
20240630@130055.8228 ec1764ta14b3oigh8ep46m8q08 Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130055.8238 ec1764ta14b3oigh8ep46m8q08 Query : use flama_phc
20240630@130055.8241 ec1764ta14b3oigh8ep46m8q08 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')
20240630@130055.8818 d6rvrq1r1asncop6ojb3o4kpbq Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130055.8830 d6rvrq1r1asncop6ojb3o4kpbq Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130055.8847 d6rvrq1r1asncop6ojb3o4kpbq Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='689';
20240630@130055.8890 d6rvrq1r1asncop6ojb3o4kpbq Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='689';
20240630@130055.8905 d6rvrq1r1asncop6ojb3o4kpbq Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='689';
20240630@130055.8918 d6rvrq1r1asncop6ojb3o4kpbq Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='689';
20240630@130055.8931 d6rvrq1r1asncop6ojb3o4kpbq Query : use flama_phc
20240630@130055.8934 d6rvrq1r1asncop6ojb3o4kpbq Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130055.8954 d6rvrq1r1asncop6ojb3o4kpbq Query : use flama_phc
20240630@130055.8958 d6rvrq1r1asncop6ojb3o4kpbq Query : select no, estab,szadrsdesc from szadrs where u_coddest=2448
20240630@130055.9033 d6rvrq1r1asncop6ojb3o4kpbq 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'
20240630@130055.9183 d6rvrq1r1asncop6ojb3o4kpbq Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404398 and bi.ref ='324.4970.00.1' and bi.lordem =1
20240630@130055.9516 d6rvrq1r1asncop6ojb3o4kpbq 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'
20240630@130055.9530 d6rvrq1r1asncop6ojb3o4kpbq Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404398 and bi.ref ='324.4970.00.1' and bi.lordem =2
20240630@130055.9851 d6rvrq1r1asncop6ojb3o4kpbq Query : use flama_phc
20240630@130055.9854 d6rvrq1r1asncop6ojb3o4kpbq Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130055.9867 d6rvrq1r1asncop6ojb3o4kpbq Query : use flama_phc
20240630@130055.9870 d6rvrq1r1asncop6ojb3o4kpbq Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130055.9880 d6rvrq1r1asncop6ojb3o4kpbq Query : use flama_phc
20240630@130055.9883 d6rvrq1r1asncop6ojb3o4kpbq 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')
20240630@130056.4770 kbkhmcuchhui8l27moes4jbuld Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130056.4900 kbkhmcuchhui8l27moes4jbuld Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130056.5050 kbkhmcuchhui8l27moes4jbuld Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='690';
20240630@130056.5450 kbkhmcuchhui8l27moes4jbuld Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='690';
20240630@130056.5600 kbkhmcuchhui8l27moes4jbuld Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='690';
20240630@130056.5720 kbkhmcuchhui8l27moes4jbuld Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='690';
20240630@130056.5850 kbkhmcuchhui8l27moes4jbuld Query : use flama_phc
20240630@130056.5880 kbkhmcuchhui8l27moes4jbuld Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130056.6020 kbkhmcuchhui8l27moes4jbuld Query : use flama_phc
20240630@130056.6050 kbkhmcuchhui8l27moes4jbuld Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240630@130056.6840 kbkhmcuchhui8l27moes4jbuld 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'
20240630@130056.8640 kbkhmcuchhui8l27moes4jbuld Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404399 and bi.ref ='324.692.00.01' and bi.lordem =1
20240630@130056.1191 kbkhmcuchhui8l27moes4jbuld 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'
20240630@130056.1202 kbkhmcuchhui8l27moes4jbuld Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404399 and bi.ref ='324.692.00.01' and bi.lordem =1
20240630@130056.1209 kbkhmcuchhui8l27moes4jbuld 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'
20240630@130056.1219 kbkhmcuchhui8l27moes4jbuld Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404399 and bi.ref ='324.692.00.01' and bi.lordem =1
20240630@130056.1225 kbkhmcuchhui8l27moes4jbuld 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'
20240630@130056.1235 kbkhmcuchhui8l27moes4jbuld Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404399 and bi.ref ='324.692.00.01' and bi.lordem =1
20240630@130056.1242 kbkhmcuchhui8l27moes4jbuld 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'
20240630@130056.1251 kbkhmcuchhui8l27moes4jbuld Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404399 and bi.ref ='324.692.00.01' and bi.lordem =1
20240630@130056.1258 kbkhmcuchhui8l27moes4jbuld 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'
20240630@130056.1268 kbkhmcuchhui8l27moes4jbuld Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404399 and bi.ref ='324.692.00.01' and bi.lordem =1
20240630@130056.1274 kbkhmcuchhui8l27moes4jbuld 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'
20240630@130056.1359 kbkhmcuchhui8l27moes4jbuld Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404399 and bi.ref ='324.692.00.01' and bi.lordem =1
20240630@130056.1405 kbkhmcuchhui8l27moes4jbuld 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'
20240630@130056.1416 kbkhmcuchhui8l27moes4jbuld Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404399 and bi.ref ='324.692.00.01' and bi.lordem =1
20240630@130056.1422 kbkhmcuchhui8l27moes4jbuld 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'
20240630@130056.1432 kbkhmcuchhui8l27moes4jbuld Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404399 and bi.ref ='324.692.00.01' and bi.lordem =1
20240630@130056.1439 kbkhmcuchhui8l27moes4jbuld 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'
20240630@130056.1448 kbkhmcuchhui8l27moes4jbuld Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404399 and bi.ref ='324.692.00.01' and bi.lordem =1
20240630@130056.1455 kbkhmcuchhui8l27moes4jbuld 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'
20240630@130056.1464 kbkhmcuchhui8l27moes4jbuld Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404399 and bi.ref ='324.692.00.01' and bi.lordem =2
20240630@130056.1800 kbkhmcuchhui8l27moes4jbuld 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'
20240630@130056.1811 kbkhmcuchhui8l27moes4jbuld Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404399 and bi.ref ='324.692.00.01' and bi.lordem =2
20240630@130056.1819 kbkhmcuchhui8l27moes4jbuld 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'
20240630@130056.1828 kbkhmcuchhui8l27moes4jbuld Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404399 and bi.ref ='324.692.00.01' and bi.lordem =2
20240630@130056.1835 kbkhmcuchhui8l27moes4jbuld 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'
20240630@130056.1845 kbkhmcuchhui8l27moes4jbuld Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404399 and bi.ref ='324.692.00.01' and bi.lordem =2
20240630@130056.1852 kbkhmcuchhui8l27moes4jbuld 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'
20240630@130056.1861 kbkhmcuchhui8l27moes4jbuld Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404399 and bi.ref ='324.692.00.01' and bi.lordem =2
20240630@130056.1868 kbkhmcuchhui8l27moes4jbuld 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'
20240630@130056.1877 kbkhmcuchhui8l27moes4jbuld Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404399 and bi.ref ='324.692.00.01' and bi.lordem =2
20240630@130056.1884 kbkhmcuchhui8l27moes4jbuld 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'
20240630@130056.1894 kbkhmcuchhui8l27moes4jbuld Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404399 and bi.ref ='324.692.00.01' and bi.lordem =2
20240630@130056.1900 kbkhmcuchhui8l27moes4jbuld 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'
20240630@130056.1910 kbkhmcuchhui8l27moes4jbuld Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404399 and bi.ref ='324.692.00.01' and bi.lordem =2
20240630@130056.1916 kbkhmcuchhui8l27moes4jbuld 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'
20240630@130056.1926 kbkhmcuchhui8l27moes4jbuld Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2043 and bo.obrano = 2404399 and bi.ref ='324.692.00.01' and bi.lordem =2
20240630@130056.1933 kbkhmcuchhui8l27moes4jbuld Query : use flama_phc
20240630@130056.1936 kbkhmcuchhui8l27moes4jbuld Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130056.1949 kbkhmcuchhui8l27moes4jbuld Query : use flama_phc
20240630@130056.1952 kbkhmcuchhui8l27moes4jbuld Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130056.1963 kbkhmcuchhui8l27moes4jbuld Query : use flama_phc
20240630@130056.1966 kbkhmcuchhui8l27moes4jbuld 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')
20240630@130056.2542 vnegb9sedlm688gn0po93ckdca Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130056.2555 vnegb9sedlm688gn0po93ckdca Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130056.2571 vnegb9sedlm688gn0po93ckdca Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='691';
20240630@130056.2609 vnegb9sedlm688gn0po93ckdca Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='691';
20240630@130056.2623 vnegb9sedlm688gn0po93ckdca Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='691';
20240630@130056.2635 vnegb9sedlm688gn0po93ckdca Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='691';
20240630@130056.2647 vnegb9sedlm688gn0po93ckdca Query : use flama_phc
20240630@130056.2650 vnegb9sedlm688gn0po93ckdca Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130056.2664 vnegb9sedlm688gn0po93ckdca Query : use flama_phc
20240630@130056.2667 vnegb9sedlm688gn0po93ckdca Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240630@130056.2696 vnegb9sedlm688gn0po93ckdca Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4743.00.1'
20240630@130056.2848 vnegb9sedlm688gn0po93ckdca Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404400 and bi.ref ='324.4743.00.1' and bi.lordem =1
20240630@130056.3161 vnegb9sedlm688gn0po93ckdca Query : use flama_phc
20240630@130056.3165 vnegb9sedlm688gn0po93ckdca Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130056.3178 vnegb9sedlm688gn0po93ckdca Query : use flama_phc
20240630@130056.3181 vnegb9sedlm688gn0po93ckdca Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130056.3192 vnegb9sedlm688gn0po93ckdca Query : use flama_phc
20240630@130056.3195 vnegb9sedlm688gn0po93ckdca 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')
20240630@130056.3673 bqjitv9gvv4msdh3lbbpngeurp Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130056.3687 bqjitv9gvv4msdh3lbbpngeurp Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130056.3703 bqjitv9gvv4msdh3lbbpngeurp Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='692';
20240630@130056.3746 bqjitv9gvv4msdh3lbbpngeurp Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='692';
20240630@130056.3761 bqjitv9gvv4msdh3lbbpngeurp Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='692';
20240630@130056.3773 bqjitv9gvv4msdh3lbbpngeurp Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='692';
20240630@130056.3787 bqjitv9gvv4msdh3lbbpngeurp Query : use flama_phc
20240630@130056.3791 bqjitv9gvv4msdh3lbbpngeurp Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130056.3805 bqjitv9gvv4msdh3lbbpngeurp Query : use flama_phc
20240630@130056.3808 bqjitv9gvv4msdh3lbbpngeurp Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240630@130056.3838 bqjitv9gvv4msdh3lbbpngeurp Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2224.00.1'
20240630@130056.5081 bqjitv9gvv4msdh3lbbpngeurp Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404401 and bi.ref ='324.2224.00.1' and bi.lordem =1
20240630@130056.5411 bqjitv9gvv4msdh3lbbpngeurp Query : use flama_phc
20240630@130056.5413 bqjitv9gvv4msdh3lbbpngeurp Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130056.5426 bqjitv9gvv4msdh3lbbpngeurp Query : use flama_phc
20240630@130056.5429 bqjitv9gvv4msdh3lbbpngeurp Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130056.5440 bqjitv9gvv4msdh3lbbpngeurp Query : use flama_phc
20240630@130056.5443 bqjitv9gvv4msdh3lbbpngeurp 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')
20240630@130056.6089 ku5ckpdhfb19qud2p6gt822lvc Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130056.6102 ku5ckpdhfb19qud2p6gt822lvc Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130056.6118 ku5ckpdhfb19qud2p6gt822lvc Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='693';
20240630@130056.6157 ku5ckpdhfb19qud2p6gt822lvc Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='693';
20240630@130056.6171 ku5ckpdhfb19qud2p6gt822lvc Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='693';
20240630@130056.6183 ku5ckpdhfb19qud2p6gt822lvc Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='693';
20240630@130056.6195 ku5ckpdhfb19qud2p6gt822lvc Query : use flama_phc
20240630@130056.6199 ku5ckpdhfb19qud2p6gt822lvc Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130056.6213 ku5ckpdhfb19qud2p6gt822lvc Query : use flama_phc
20240630@130056.6215 ku5ckpdhfb19qud2p6gt822lvc Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240630@130056.6243 ku5ckpdhfb19qud2p6gt822lvc Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4160.00.1'
20240630@130056.6392 ku5ckpdhfb19qud2p6gt822lvc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404402 and bi.ref ='324.4160.00.1' and bi.lordem =1
20240630@130056.6707 ku5ckpdhfb19qud2p6gt822lvc Query : use flama_phc
20240630@130056.6710 ku5ckpdhfb19qud2p6gt822lvc Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130056.6723 ku5ckpdhfb19qud2p6gt822lvc Query : use flama_phc
20240630@130056.6726 ku5ckpdhfb19qud2p6gt822lvc Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130056.6737 ku5ckpdhfb19qud2p6gt822lvc Query : use flama_phc
20240630@130056.6740 ku5ckpdhfb19qud2p6gt822lvc 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')
20240630@130056.7312 f5lrb5cujb07rfci7d2t31qn5s Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130056.7326 f5lrb5cujb07rfci7d2t31qn5s Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130056.7342 f5lrb5cujb07rfci7d2t31qn5s Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='694';
20240630@130056.7380 f5lrb5cujb07rfci7d2t31qn5s Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='694';
20240630@130056.7395 f5lrb5cujb07rfci7d2t31qn5s Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='694';
20240630@130056.7406 f5lrb5cujb07rfci7d2t31qn5s Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='694';
20240630@130056.7418 f5lrb5cujb07rfci7d2t31qn5s Query : use flama_phc
20240630@130056.7421 f5lrb5cujb07rfci7d2t31qn5s Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130056.7435 f5lrb5cujb07rfci7d2t31qn5s Query : use flama_phc
20240630@130056.7438 f5lrb5cujb07rfci7d2t31qn5s Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240630@130056.7466 f5lrb5cujb07rfci7d2t31qn5s Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2221.00.1'
20240630@130056.7614 f5lrb5cujb07rfci7d2t31qn5s Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404403 and bi.ref ='324.2221.00.1' and bi.lordem =1
20240630@130056.7965 f5lrb5cujb07rfci7d2t31qn5s Query : use flama_phc
20240630@130056.7968 f5lrb5cujb07rfci7d2t31qn5s Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130056.7981 f5lrb5cujb07rfci7d2t31qn5s Query : use flama_phc
20240630@130056.7984 f5lrb5cujb07rfci7d2t31qn5s Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130056.7994 f5lrb5cujb07rfci7d2t31qn5s Query : use flama_phc
20240630@130056.7997 f5lrb5cujb07rfci7d2t31qn5s 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')
20240630@130056.8602 oosa2fj9jd9g4r396p128k81j3 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130056.8615 oosa2fj9jd9g4r396p128k81j3 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130056.8630 oosa2fj9jd9g4r396p128k81j3 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='695';
20240630@130056.8668 oosa2fj9jd9g4r396p128k81j3 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='695';
20240630@130056.8683 oosa2fj9jd9g4r396p128k81j3 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='695';
20240630@130056.8694 oosa2fj9jd9g4r396p128k81j3 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='695';
20240630@130056.8707 oosa2fj9jd9g4r396p128k81j3 Query : use flama_phc
20240630@130056.8709 oosa2fj9jd9g4r396p128k81j3 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130056.8723 oosa2fj9jd9g4r396p128k81j3 Query : use flama_phc
20240630@130056.8726 oosa2fj9jd9g4r396p128k81j3 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240630@130056.8753 oosa2fj9jd9g4r396p128k81j3 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'
20240630@130056.8904 oosa2fj9jd9g4r396p128k81j3 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404404 and bi.ref ='324.966.00.01' and bi.lordem =1
20240630@130056.9217 oosa2fj9jd9g4r396p128k81j3 Query : use flama_phc
20240630@130056.9219 oosa2fj9jd9g4r396p128k81j3 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130056.9232 oosa2fj9jd9g4r396p128k81j3 Query : use flama_phc
20240630@130056.9235 oosa2fj9jd9g4r396p128k81j3 Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130056.9245 oosa2fj9jd9g4r396p128k81j3 Query : use flama_phc
20240630@130056.9247 oosa2fj9jd9g4r396p128k81j3 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')
20240630@130056.9811 5ev2o8vdc5lsqf50eh5h2b7jh5 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130056.9825 5ev2o8vdc5lsqf50eh5h2b7jh5 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130056.9842 5ev2o8vdc5lsqf50eh5h2b7jh5 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='696';
20240630@130056.9892 5ev2o8vdc5lsqf50eh5h2b7jh5 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='696';
20240630@130056.9906 5ev2o8vdc5lsqf50eh5h2b7jh5 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='696';
20240630@130057.3900 5ev2o8vdc5lsqf50eh5h2b7jh5 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='696';
20240630@130057.5500 5ev2o8vdc5lsqf50eh5h2b7jh5 Query : use flama_phc
20240630@130057.5800 5ev2o8vdc5lsqf50eh5h2b7jh5 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130057.7400 5ev2o8vdc5lsqf50eh5h2b7jh5 Query : use flama_phc
20240630@130057.7700 5ev2o8vdc5lsqf50eh5h2b7jh5 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240630@130057.1170 5ev2o8vdc5lsqf50eh5h2b7jh5 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'
20240630@130057.3050 5ev2o8vdc5lsqf50eh5h2b7jh5 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404405 and bi.ref ='324.4980.00.1' and bi.lordem =1
20240630@130057.7510 5ev2o8vdc5lsqf50eh5h2b7jh5 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'
20240630@130057.7620 5ev2o8vdc5lsqf50eh5h2b7jh5 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404405 and bi.ref ='324.4980.00.1' and bi.lordem =1
20240630@130057.7700 5ev2o8vdc5lsqf50eh5h2b7jh5 Query : use flama_phc
20240630@130057.7740 5ev2o8vdc5lsqf50eh5h2b7jh5 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130057.7890 5ev2o8vdc5lsqf50eh5h2b7jh5 Query : use flama_phc
20240630@130057.7920 5ev2o8vdc5lsqf50eh5h2b7jh5 Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130057.8030 5ev2o8vdc5lsqf50eh5h2b7jh5 Query : use flama_phc
20240630@130057.8070 5ev2o8vdc5lsqf50eh5h2b7jh5 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')
20240630@130057.2277 qfa5v08qq9mb6mqsivlqjokt0b Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130057.2291 qfa5v08qq9mb6mqsivlqjokt0b Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130057.2306 qfa5v08qq9mb6mqsivlqjokt0b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='697';
20240630@130057.2345 qfa5v08qq9mb6mqsivlqjokt0b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='697';
20240630@130057.2360 qfa5v08qq9mb6mqsivlqjokt0b Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='697';
20240630@130057.2371 qfa5v08qq9mb6mqsivlqjokt0b Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='697';
20240630@130057.2384 qfa5v08qq9mb6mqsivlqjokt0b Query : use flama_phc
20240630@130057.2387 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130057.2401 qfa5v08qq9mb6mqsivlqjokt0b Query : use flama_phc
20240630@130057.2404 qfa5v08qq9mb6mqsivlqjokt0b Query : select no, estab,szadrsdesc from szadrs where u_coddest=4790
20240630@130057.2431 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2224.00.1'
20240630@130057.2441 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404406 and bi.ref ='324.2224.00.1' and bi.lordem =1
20240630@130057.2762 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2221.00.1'
20240630@130057.2773 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404406 and bi.ref ='324.2221.00.1' and bi.lordem =2
20240630@130057.3113 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2221.00.1'
20240630@130057.3124 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404406 and bi.ref ='324.2221.00.1' and bi.lordem =2
20240630@130057.3132 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2223.00.1'
20240630@130057.3282 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404406 and bi.ref ='324.2223.00.1' and bi.lordem =3
20240630@130057.3601 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2223.00.1'
20240630@130057.3613 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404406 and bi.ref ='324.2223.00.1' and bi.lordem =3
20240630@130057.3620 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2222.00.1'
20240630@130057.3772 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404406 and bi.ref ='324.2222.00.1' and bi.lordem =4
20240630@130057.4090 qfa5v08qq9mb6mqsivlqjokt0b 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'
20240630@130057.4244 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404406 and bi.ref ='324.4840.00.1' and bi.lordem =5
20240630@130057.4574 qfa5v08qq9mb6mqsivlqjokt0b 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'
20240630@130057.4585 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404406 and bi.ref ='324.4840.00.1' and bi.lordem =5
20240630@130057.4593 qfa5v08qq9mb6mqsivlqjokt0b 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'
20240630@130057.4602 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404406 and bi.ref ='324.4840.00.1' and bi.lordem =5
20240630@130057.4609 qfa5v08qq9mb6mqsivlqjokt0b 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'
20240630@130057.4771 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404406 and bi.ref ='324.4521.00.1' and bi.lordem =6
20240630@130057.5117 qfa5v08qq9mb6mqsivlqjokt0b 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'
20240630@130057.5128 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404406 and bi.ref ='324.4521.00.1' and bi.lordem =6
20240630@130057.5135 qfa5v08qq9mb6mqsivlqjokt0b 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'
20240630@130057.5146 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404406 and bi.ref ='324.4521.00.1' and bi.lordem =6
20240630@130057.5153 qfa5v08qq9mb6mqsivlqjokt0b 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'
20240630@130057.5163 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404406 and bi.ref ='304.422.00.07' and bi.lordem =7
20240630@130057.5561 qfa5v08qq9mb6mqsivlqjokt0b 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'
20240630@130057.5572 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404406 and bi.ref ='304.422.00.07' and bi.lordem =7
20240630@130057.5580 qfa5v08qq9mb6mqsivlqjokt0b 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'
20240630@130057.5590 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404406 and bi.ref ='304.422.00.07' and bi.lordem =7
20240630@130057.5598 qfa5v08qq9mb6mqsivlqjokt0b 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'
20240630@130057.5608 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404406 and bi.ref ='304.422.00.07' and bi.lordem =7
20240630@130057.5615 qfa5v08qq9mb6mqsivlqjokt0b 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'
20240630@130057.5624 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404406 and bi.ref ='304.422.00.07' and bi.lordem =8
20240630@130057.5942 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.421.00.04'
20240630@130057.6093 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404406 and bi.ref ='304.421.00.04' and bi.lordem =9
20240630@130057.6414 qfa5v08qq9mb6mqsivlqjokt0b Query : use flama_phc
20240630@130057.6418 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130057.6431 qfa5v08qq9mb6mqsivlqjokt0b Query : use flama_phc
20240630@130057.6434 qfa5v08qq9mb6mqsivlqjokt0b Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130057.6446 qfa5v08qq9mb6mqsivlqjokt0b Query : use flama_phc
20240630@130057.6448 qfa5v08qq9mb6mqsivlqjokt0b 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')
20240630@130057.6982 okf7jcsauoc77trjc645n42kvq Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130057.6997 okf7jcsauoc77trjc645n42kvq Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130057.7013 okf7jcsauoc77trjc645n42kvq Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='698';
20240630@130057.7052 okf7jcsauoc77trjc645n42kvq Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='698';
20240630@130057.7067 okf7jcsauoc77trjc645n42kvq Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='698';
20240630@130057.7078 okf7jcsauoc77trjc645n42kvq Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='698';
20240630@130057.7091 okf7jcsauoc77trjc645n42kvq Query : use flama_phc
20240630@130057.7094 okf7jcsauoc77trjc645n42kvq Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130057.7108 okf7jcsauoc77trjc645n42kvq Query : use flama_phc
20240630@130057.7111 okf7jcsauoc77trjc645n42kvq Query : select no, estab,szadrsdesc from szadrs where u_coddest=6917
20240630@130057.7188 okf7jcsauoc77trjc645n42kvq 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'
20240630@130057.7338 okf7jcsauoc77trjc645n42kvq Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404412 and bi.ref ='324.2000.94.1' and bi.lordem =1
20240630@130057.7649 okf7jcsauoc77trjc645n42kvq 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'
20240630@130057.7797 okf7jcsauoc77trjc645n42kvq Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404412 and bi.ref ='324.900.94.01' and bi.lordem =2
20240630@130057.8593 okf7jcsauoc77trjc645n42kvq 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'
20240630@130057.9252 okf7jcsauoc77trjc645n42kvq Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404412 and bi.ref ='324.700.94.01' and bi.lordem =3
20240630@130057.9569 okf7jcsauoc77trjc645n42kvq 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'
20240630@130057.9719 okf7jcsauoc77trjc645n42kvq Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404412 and bi.ref ='324.600.94.01' and bi.lordem =4
20240630@130058.3300 okf7jcsauoc77trjc645n42kvq Query : use flama_phc
20240630@130058.3600 okf7jcsauoc77trjc645n42kvq Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130058.1670 okf7jcsauoc77trjc645n42kvq Query : use flama_phc
20240630@130058.1710 okf7jcsauoc77trjc645n42kvq Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130058.1810 okf7jcsauoc77trjc645n42kvq Query : use flama_phc
20240630@130058.1830 okf7jcsauoc77trjc645n42kvq 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')
20240630@130058.7380 skf5bqa09a9v2lt7b60rjquj1a Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130058.7520 skf5bqa09a9v2lt7b60rjquj1a Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130058.7670 skf5bqa09a9v2lt7b60rjquj1a Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='699';
20240630@130058.8080 skf5bqa09a9v2lt7b60rjquj1a Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='699';
20240630@130058.8220 skf5bqa09a9v2lt7b60rjquj1a Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='699';
20240630@130058.8330 skf5bqa09a9v2lt7b60rjquj1a Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='699';
20240630@130058.8450 skf5bqa09a9v2lt7b60rjquj1a Query : use flama_phc
20240630@130058.8490 skf5bqa09a9v2lt7b60rjquj1a Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130058.8630 skf5bqa09a9v2lt7b60rjquj1a Query : use flama_phc
20240630@130058.8660 skf5bqa09a9v2lt7b60rjquj1a Query : select no, estab,szadrsdesc from szadrs where u_coddest=416
20240630@130058.9390 skf5bqa09a9v2lt7b60rjquj1a Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.5501.00.1'
20240630@130058.1092 skf5bqa09a9v2lt7b60rjquj1a Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404420 and bi.ref ='324.5501.00.1' and bi.lordem =1
20240630@130058.1406 skf5bqa09a9v2lt7b60rjquj1a Query : use flama_phc
20240630@130058.1410 skf5bqa09a9v2lt7b60rjquj1a Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130058.1423 skf5bqa09a9v2lt7b60rjquj1a Query : use flama_phc
20240630@130058.1425 skf5bqa09a9v2lt7b60rjquj1a Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130058.1436 skf5bqa09a9v2lt7b60rjquj1a Query : use flama_phc
20240630@130058.1438 skf5bqa09a9v2lt7b60rjquj1a 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')
20240630@130058.1993 c09nvsmcfpmt49l4s34tc1rmtt Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130058.2006 c09nvsmcfpmt49l4s34tc1rmtt Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130058.2021 c09nvsmcfpmt49l4s34tc1rmtt Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='700';
20240630@130058.2060 c09nvsmcfpmt49l4s34tc1rmtt Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='700';
20240630@130058.2074 c09nvsmcfpmt49l4s34tc1rmtt Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='700';
20240630@130058.2085 c09nvsmcfpmt49l4s34tc1rmtt Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='700';
20240630@130058.2099 c09nvsmcfpmt49l4s34tc1rmtt Query : use flama_phc
20240630@130058.2102 c09nvsmcfpmt49l4s34tc1rmtt Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130058.2116 c09nvsmcfpmt49l4s34tc1rmtt Query : use flama_phc
20240630@130058.2119 c09nvsmcfpmt49l4s34tc1rmtt Query : select no, estab,szadrsdesc from szadrs where u_coddest=548
20240630@130058.2197 c09nvsmcfpmt49l4s34tc1rmtt Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240630@130058.2354 c09nvsmcfpmt49l4s34tc1rmtt Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404421 and bi.ref ='324.1816.00.1' and bi.lordem =1
20240630@130058.2668 c09nvsmcfpmt49l4s34tc1rmtt Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240630@130058.2679 c09nvsmcfpmt49l4s34tc1rmtt Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404421 and bi.ref ='324.1816.00.1' and bi.lordem =2
20240630@130058.2996 c09nvsmcfpmt49l4s34tc1rmtt Query : use flama_phc
20240630@130058.3000 c09nvsmcfpmt49l4s34tc1rmtt Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130058.3012 c09nvsmcfpmt49l4s34tc1rmtt Query : use flama_phc
20240630@130058.3015 c09nvsmcfpmt49l4s34tc1rmtt Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130058.3025 c09nvsmcfpmt49l4s34tc1rmtt Query : use flama_phc
20240630@130058.3027 c09nvsmcfpmt49l4s34tc1rmtt 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')
20240630@130058.3566 oojn4ilij7o1nmh9r6iq4r1290 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130058.3580 oojn4ilij7o1nmh9r6iq4r1290 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130058.3596 oojn4ilij7o1nmh9r6iq4r1290 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='701';
20240630@130058.3635 oojn4ilij7o1nmh9r6iq4r1290 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='701';
20240630@130058.3649 oojn4ilij7o1nmh9r6iq4r1290 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='701';
20240630@130058.3660 oojn4ilij7o1nmh9r6iq4r1290 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='701';
20240630@130058.3673 oojn4ilij7o1nmh9r6iq4r1290 Query : use flama_phc
20240630@130058.3676 oojn4ilij7o1nmh9r6iq4r1290 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130058.3691 oojn4ilij7o1nmh9r6iq4r1290 Query : use flama_phc
20240630@130058.3694 oojn4ilij7o1nmh9r6iq4r1290 Query : select no, estab,szadrsdesc from szadrs where u_coddest=435
20240630@130058.3773 oojn4ilij7o1nmh9r6iq4r1290 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240630@130058.3784 oojn4ilij7o1nmh9r6iq4r1290 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404422 and bi.ref ='324.1816.00.1' and bi.lordem =1
20240630@130058.4120 oojn4ilij7o1nmh9r6iq4r1290 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240630@130058.4131 oojn4ilij7o1nmh9r6iq4r1290 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404422 and bi.ref ='324.1816.00.1' and bi.lordem =1
20240630@130058.4140 oojn4ilij7o1nmh9r6iq4r1290 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240630@130058.4149 oojn4ilij7o1nmh9r6iq4r1290 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404422 and bi.ref ='324.1816.00.1' and bi.lordem =2
20240630@130058.4478 oojn4ilij7o1nmh9r6iq4r1290 Query : use flama_phc
20240630@130058.4481 oojn4ilij7o1nmh9r6iq4r1290 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130058.4495 oojn4ilij7o1nmh9r6iq4r1290 Query : use flama_phc
20240630@130058.4498 oojn4ilij7o1nmh9r6iq4r1290 Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130058.4508 oojn4ilij7o1nmh9r6iq4r1290 Query : use flama_phc
20240630@130058.4510 oojn4ilij7o1nmh9r6iq4r1290 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')
20240630@130058.6038 oba8jir4fhobqg7vbfq1a7fgsp Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130058.6053 oba8jir4fhobqg7vbfq1a7fgsp Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130058.6068 oba8jir4fhobqg7vbfq1a7fgsp Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='702';
20240630@130058.6108 oba8jir4fhobqg7vbfq1a7fgsp Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='702';
20240630@130058.6122 oba8jir4fhobqg7vbfq1a7fgsp Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='702';
20240630@130058.6133 oba8jir4fhobqg7vbfq1a7fgsp Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='702';
20240630@130058.6145 oba8jir4fhobqg7vbfq1a7fgsp Query : use flama_phc
20240630@130058.6148 oba8jir4fhobqg7vbfq1a7fgsp Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130058.6162 oba8jir4fhobqg7vbfq1a7fgsp Query : use flama_phc
20240630@130058.6165 oba8jir4fhobqg7vbfq1a7fgsp Query : select no, estab,szadrsdesc from szadrs where u_coddest=2794
20240630@130058.6233 oba8jir4fhobqg7vbfq1a7fgsp Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240630@130058.6244 oba8jir4fhobqg7vbfq1a7fgsp Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404423 and bi.ref ='324.1816.00.1' and bi.lordem =1
20240630@130058.6563 oba8jir4fhobqg7vbfq1a7fgsp Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240630@130058.6573 oba8jir4fhobqg7vbfq1a7fgsp Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404423 and bi.ref ='324.1816.00.1' and bi.lordem =1
20240630@130058.6579 oba8jir4fhobqg7vbfq1a7fgsp Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240630@130058.6591 oba8jir4fhobqg7vbfq1a7fgsp Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404423 and bi.ref ='324.1816.00.1' and bi.lordem =2
20240630@130058.6907 oba8jir4fhobqg7vbfq1a7fgsp Query : use flama_phc
20240630@130058.6910 oba8jir4fhobqg7vbfq1a7fgsp Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130058.6923 oba8jir4fhobqg7vbfq1a7fgsp Query : use flama_phc
20240630@130058.6925 oba8jir4fhobqg7vbfq1a7fgsp Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130058.6935 oba8jir4fhobqg7vbfq1a7fgsp Query : use flama_phc
20240630@130058.6938 oba8jir4fhobqg7vbfq1a7fgsp 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')
20240630@130058.7496 0dasqav3tfg6je2d0s3k3g0d1q Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130058.7510 0dasqav3tfg6je2d0s3k3g0d1q Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130058.7525 0dasqav3tfg6je2d0s3k3g0d1q Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='703';
20240630@130058.7564 0dasqav3tfg6je2d0s3k3g0d1q Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='703';
20240630@130058.7580 0dasqav3tfg6je2d0s3k3g0d1q Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='703';
20240630@130058.7591 0dasqav3tfg6je2d0s3k3g0d1q Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='703';
20240630@130058.7604 0dasqav3tfg6je2d0s3k3g0d1q Query : use flama_phc
20240630@130058.7607 0dasqav3tfg6je2d0s3k3g0d1q Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130058.7622 0dasqav3tfg6je2d0s3k3g0d1q Query : use flama_phc
20240630@130058.7625 0dasqav3tfg6je2d0s3k3g0d1q Query : select no, estab,szadrsdesc from szadrs where u_coddest=73
20240630@130058.7702 0dasqav3tfg6je2d0s3k3g0d1q Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240630@130058.7714 0dasqav3tfg6je2d0s3k3g0d1q Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404424 and bi.ref ='324.1816.00.1' and bi.lordem =1
20240630@130058.8064 0dasqav3tfg6je2d0s3k3g0d1q Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240630@130058.8075 0dasqav3tfg6je2d0s3k3g0d1q Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404424 and bi.ref ='324.1816.00.1' and bi.lordem =1
20240630@130058.8082 0dasqav3tfg6je2d0s3k3g0d1q Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240630@130058.8092 0dasqav3tfg6je2d0s3k3g0d1q Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404424 and bi.ref ='324.1816.00.1' and bi.lordem =2
20240630@130058.8420 0dasqav3tfg6je2d0s3k3g0d1q Query : use flama_phc
20240630@130058.8424 0dasqav3tfg6je2d0s3k3g0d1q Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130058.8438 0dasqav3tfg6je2d0s3k3g0d1q Query : use flama_phc
20240630@130058.8441 0dasqav3tfg6je2d0s3k3g0d1q Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130058.8452 0dasqav3tfg6je2d0s3k3g0d1q Query : use flama_phc
20240630@130058.8455 0dasqav3tfg6je2d0s3k3g0d1q 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')
20240630@130058.8932 qdb0upcgldg1k0trg1pe43irj8 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130058.8947 qdb0upcgldg1k0trg1pe43irj8 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130058.8962 qdb0upcgldg1k0trg1pe43irj8 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='704';
20240630@130058.9002 qdb0upcgldg1k0trg1pe43irj8 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='704';
20240630@130058.9017 qdb0upcgldg1k0trg1pe43irj8 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='704';
20240630@130058.9027 qdb0upcgldg1k0trg1pe43irj8 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='704';
20240630@130058.9040 qdb0upcgldg1k0trg1pe43irj8 Query : use flama_phc
20240630@130058.9043 qdb0upcgldg1k0trg1pe43irj8 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130058.9057 qdb0upcgldg1k0trg1pe43irj8 Query : use flama_phc
20240630@130058.9060 qdb0upcgldg1k0trg1pe43irj8 Query : select no, estab,szadrsdesc from szadrs where u_coddest=1086
20240630@130058.9132 qdb0upcgldg1k0trg1pe43irj8 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240630@130058.9143 qdb0upcgldg1k0trg1pe43irj8 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404425 and bi.ref ='324.1816.00.1' and bi.lordem =1
20240630@130058.9486 qdb0upcgldg1k0trg1pe43irj8 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240630@130058.9497 qdb0upcgldg1k0trg1pe43irj8 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404425 and bi.ref ='324.1816.00.1' and bi.lordem =2
20240630@130058.9819 qdb0upcgldg1k0trg1pe43irj8 Query : use flama_phc
20240630@130058.9822 qdb0upcgldg1k0trg1pe43irj8 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130058.9836 qdb0upcgldg1k0trg1pe43irj8 Query : use flama_phc
20240630@130058.9838 qdb0upcgldg1k0trg1pe43irj8 Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130058.9849 qdb0upcgldg1k0trg1pe43irj8 Query : use flama_phc
20240630@130058.9852 qdb0upcgldg1k0trg1pe43irj8 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')
20240630@130059.3780 uonq48vgrkbjopmu6fggucls1e Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130059.3930 uonq48vgrkbjopmu6fggucls1e Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130059.4120 uonq48vgrkbjopmu6fggucls1e Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='705';
20240630@130059.4610 uonq48vgrkbjopmu6fggucls1e Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='705';
20240630@130059.4780 uonq48vgrkbjopmu6fggucls1e Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='705';
20240630@130059.4910 uonq48vgrkbjopmu6fggucls1e Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='705';
20240630@130059.5060 uonq48vgrkbjopmu6fggucls1e Query : use flama_phc
20240630@130059.5090 uonq48vgrkbjopmu6fggucls1e Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130059.5250 uonq48vgrkbjopmu6fggucls1e Query : use flama_phc
20240630@130059.5280 uonq48vgrkbjopmu6fggucls1e Query : select no, estab,szadrsdesc from szadrs where u_coddest=2448
20240630@130059.5690 uonq48vgrkbjopmu6fggucls1e Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240630@130059.5810 uonq48vgrkbjopmu6fggucls1e Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404426 and bi.ref ='324.1816.00.1' and bi.lordem =1
20240630@130059.1030 uonq48vgrkbjopmu6fggucls1e Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240630@130059.1041 uonq48vgrkbjopmu6fggucls1e Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404426 and bi.ref ='324.1816.00.1' and bi.lordem =1
20240630@130059.1047 uonq48vgrkbjopmu6fggucls1e Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240630@130059.1057 uonq48vgrkbjopmu6fggucls1e Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404426 and bi.ref ='324.1816.00.1' and bi.lordem =1
20240630@130059.1063 uonq48vgrkbjopmu6fggucls1e Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240630@130059.1072 uonq48vgrkbjopmu6fggucls1e Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404426 and bi.ref ='324.1816.00.1' and bi.lordem =1
20240630@130059.1080 uonq48vgrkbjopmu6fggucls1e Query : use flama_phc
20240630@130059.1083 uonq48vgrkbjopmu6fggucls1e Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130059.1096 uonq48vgrkbjopmu6fggucls1e Query : use flama_phc
20240630@130059.1100 uonq48vgrkbjopmu6fggucls1e Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130059.1110 uonq48vgrkbjopmu6fggucls1e Query : use flama_phc
20240630@130059.1113 uonq48vgrkbjopmu6fggucls1e 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')
20240630@130059.1796 9obm5ge4tqd49ke2qfh95laf8a Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130059.1810 9obm5ge4tqd49ke2qfh95laf8a Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130059.1829 9obm5ge4tqd49ke2qfh95laf8a Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='706';
20240630@130059.1871 9obm5ge4tqd49ke2qfh95laf8a Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='706';
20240630@130059.1887 9obm5ge4tqd49ke2qfh95laf8a Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='706';
20240630@130059.1900 9obm5ge4tqd49ke2qfh95laf8a Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='706';
20240630@130059.1913 9obm5ge4tqd49ke2qfh95laf8a Query : use flama_phc
20240630@130059.1917 9obm5ge4tqd49ke2qfh95laf8a Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130059.1933 9obm5ge4tqd49ke2qfh95laf8a Query : use flama_phc
20240630@130059.1937 9obm5ge4tqd49ke2qfh95laf8a Query : select no, estab,szadrsdesc from szadrs where u_coddest=7958
20240630@130059.3445 9obm5ge4tqd49ke2qfh95laf8a 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'
20240630@130059.3606 9obm5ge4tqd49ke2qfh95laf8a Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404428 and bi.ref ='324.1805.00.1' and bi.lordem =1
20240630@130059.3924 9obm5ge4tqd49ke2qfh95laf8a 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'
20240630@130059.3935 9obm5ge4tqd49ke2qfh95laf8a Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404428 and bi.ref ='324.1805.00.1' and bi.lordem =1
20240630@130059.3943 9obm5ge4tqd49ke2qfh95laf8a Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1824.00.1'
20240630@130059.4114 9obm5ge4tqd49ke2qfh95laf8a Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404428 and bi.ref ='324.1824.00.1' and bi.lordem =2
20240630@130059.4442 9obm5ge4tqd49ke2qfh95laf8a Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1824.00.1'
20240630@130059.4455 9obm5ge4tqd49ke2qfh95laf8a Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404428 and bi.ref ='324.1824.00.1' and bi.lordem =2
20240630@130059.4462 9obm5ge4tqd49ke2qfh95laf8a Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '327.8261.00.1'
20240630@130059.4692 9obm5ge4tqd49ke2qfh95laf8a Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404428 and bi.ref ='327.8261.00.1' and bi.lordem =3
20240630@130059.5015 9obm5ge4tqd49ke2qfh95laf8a Query : use flama_phc
20240630@130059.5018 9obm5ge4tqd49ke2qfh95laf8a Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130059.5032 9obm5ge4tqd49ke2qfh95laf8a Query : use flama_phc
20240630@130059.5035 9obm5ge4tqd49ke2qfh95laf8a Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130059.5045 9obm5ge4tqd49ke2qfh95laf8a Query : use flama_phc
20240630@130059.5048 9obm5ge4tqd49ke2qfh95laf8a 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')
20240630@130059.5543 5aug1msao0uuq81vcvoeggrtua Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130059.5557 5aug1msao0uuq81vcvoeggrtua Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130059.5573 5aug1msao0uuq81vcvoeggrtua Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='707';
20240630@130059.5611 5aug1msao0uuq81vcvoeggrtua Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='707';
20240630@130059.5625 5aug1msao0uuq81vcvoeggrtua Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='707';
20240630@130059.5637 5aug1msao0uuq81vcvoeggrtua Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='707';
20240630@130059.5650 5aug1msao0uuq81vcvoeggrtua Query : use flama_phc
20240630@130059.5653 5aug1msao0uuq81vcvoeggrtua Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130059.5669 5aug1msao0uuq81vcvoeggrtua Query : use flama_phc
20240630@130059.5672 5aug1msao0uuq81vcvoeggrtua Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240630@130059.5700 5aug1msao0uuq81vcvoeggrtua Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1685.00.1'
20240630@130059.5850 5aug1msao0uuq81vcvoeggrtua Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404430 and bi.ref ='324.1685.00.1' and bi.lordem =1
20240630@130059.6164 5aug1msao0uuq81vcvoeggrtua Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2366.00.1'
20240630@130059.6315 5aug1msao0uuq81vcvoeggrtua Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404430 and bi.ref ='324.2366.00.1' and bi.lordem =2
20240630@130059.6639 5aug1msao0uuq81vcvoeggrtua Query : use flama_phc
20240630@130059.6644 5aug1msao0uuq81vcvoeggrtua Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130059.6658 5aug1msao0uuq81vcvoeggrtua Query : use flama_phc
20240630@130059.6661 5aug1msao0uuq81vcvoeggrtua Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130059.6672 5aug1msao0uuq81vcvoeggrtua Query : use flama_phc
20240630@130059.6675 5aug1msao0uuq81vcvoeggrtua 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')
20240630@130059.7175 2uoi46ccn51o8hht16aghk3uk2 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130059.7189 2uoi46ccn51o8hht16aghk3uk2 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130059.7205 2uoi46ccn51o8hht16aghk3uk2 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='708';
20240630@130059.7244 2uoi46ccn51o8hht16aghk3uk2 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='708';
20240630@130059.7260 2uoi46ccn51o8hht16aghk3uk2 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='708';
20240630@130059.7271 2uoi46ccn51o8hht16aghk3uk2 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='708';
20240630@130059.7290 2uoi46ccn51o8hht16aghk3uk2 Query : use flama_phc
20240630@130059.7307 2uoi46ccn51o8hht16aghk3uk2 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130059.7325 2uoi46ccn51o8hht16aghk3uk2 Query : use flama_phc
20240630@130059.7329 2uoi46ccn51o8hht16aghk3uk2 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240630@130059.7357 2uoi46ccn51o8hht16aghk3uk2 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'
20240630@130059.7508 2uoi46ccn51o8hht16aghk3uk2 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404431 and bi.ref ='324.1667.00.1' and bi.lordem =1
20240630@130059.7824 2uoi46ccn51o8hht16aghk3uk2 Query : use flama_phc
20240630@130059.7828 2uoi46ccn51o8hht16aghk3uk2 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130059.7846 2uoi46ccn51o8hht16aghk3uk2 Query : use flama_phc
20240630@130059.7850 2uoi46ccn51o8hht16aghk3uk2 Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130059.7861 2uoi46ccn51o8hht16aghk3uk2 Query : use flama_phc
20240630@130059.7864 2uoi46ccn51o8hht16aghk3uk2 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')
20240630@130059.8354 auuqj40eiut4mlnf97ar606quk Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130059.8368 auuqj40eiut4mlnf97ar606quk Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130059.8384 auuqj40eiut4mlnf97ar606quk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='709';
20240630@130059.8424 auuqj40eiut4mlnf97ar606quk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='709';
20240630@130059.8439 auuqj40eiut4mlnf97ar606quk Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='709';
20240630@130059.8451 auuqj40eiut4mlnf97ar606quk Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='709';
20240630@130059.8465 auuqj40eiut4mlnf97ar606quk Query : use flama_phc
20240630@130059.8468 auuqj40eiut4mlnf97ar606quk Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240630@130059.8485 auuqj40eiut4mlnf97ar606quk Query : use flama_phc
20240630@130059.8488 auuqj40eiut4mlnf97ar606quk Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240630@130059.8516 auuqj40eiut4mlnf97ar606quk 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'
20240630@130059.8678 auuqj40eiut4mlnf97ar606quk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404432 and bi.ref ='324.938.00.01' and bi.lordem =1
20240630@130059.9003 auuqj40eiut4mlnf97ar606quk 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'
20240630@130059.9013 auuqj40eiut4mlnf97ar606quk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404432 and bi.ref ='324.938.00.01' and bi.lordem =1
20240630@130059.9020 auuqj40eiut4mlnf97ar606quk 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'
20240630@130059.9030 auuqj40eiut4mlnf97ar606quk Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404432 and bi.ref ='324.938.00.01' and bi.lordem =1
20240630@130059.9037 auuqj40eiut4mlnf97ar606quk Query : use flama_phc
20240630@130059.9040 auuqj40eiut4mlnf97ar606quk Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240630@130059.9053 auuqj40eiut4mlnf97ar606quk Query : use flama_phc
20240630@130059.9056 auuqj40eiut4mlnf97ar606quk Query : select top 1 1 valor from td where td.ndoc = 39
20240630@130059.9066 auuqj40eiut4mlnf97ar606quk Query : use flama_phc
20240630@130059.9068 auuqj40eiut4mlnf97ar606quk 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')
20240630@130059.9600 r5qnvk2m4c2kila672aohrqeb0 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240630@130059.9613 r5qnvk2m4c2kila672aohrqeb0 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240630@130059.9630 r5qnvk2m4c2kila672aohrqeb0 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='710';
20240630@130059.9670 r5qnvk2m4c2kila672aohrqeb0 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='710';
20240630@130059.9685 r5qnvk2m4c2kila672aohrqeb0 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='710';
20240630@130059.9696 r5qnvk2m4c2kila672aohrqeb0 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='710';

20240701@105725.5748 beqhitqe1bm1vmcslbpll2iuk2 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='711';
20240701@105725.5775 beqhitqe1bm1vmcslbpll2iuk2 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='711';
20240701@105725.5787 beqhitqe1bm1vmcslbpll2iuk2 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='711';

20240701@112525.3436 mi54mtprgtau7uh546uhhpcith Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='712';
20240701@112525.3452 mi54mtprgtau7uh546uhhpcith Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='712';
20240701@112525.3464 mi54mtprgtau7uh546uhhpcith Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='712';

20240701@120925.6887 c6hutpfhg6pfff7210htn61qbh Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='713';
20240701@120925.6905 c6hutpfhg6pfff7210htn61qbh Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='713';
20240701@120925.6919 c6hutpfhg6pfff7210htn61qbh Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='713';

20240701@213552.4204 h69kcv1qenikn9k4eo4m7qna9k Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='714';
20240701@213552.4232 h69kcv1qenikn9k4eo4m7qna9k Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='714';
20240701@213552.4244 h69kcv1qenikn9k4eo4m7qna9k Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='714';
20240701@213552.4257 h69kcv1qenikn9k4eo4m7qna9k Query : use flama_phc
20240701@213552.4260 h69kcv1qenikn9k4eo4m7qna9k Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240701@213552.4321 h69kcv1qenikn9k4eo4m7qna9k Query : use flama_phc
20240701@213552.4324 h69kcv1qenikn9k4eo4m7qna9k Query : select no, estab,szadrsdesc from szadrs where u_coddest=227
20240701@213552.4399 h69kcv1qenikn9k4eo4m7qna9k 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'
20240701@213552.4558 h69kcv1qenikn9k4eo4m7qna9k Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404438 and bi.ref ='324.1667.00.1' and bi.lordem =1
20240701@213552.5854 h69kcv1qenikn9k4eo4m7qna9k 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'
20240701@213552.5865 h69kcv1qenikn9k4eo4m7qna9k Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404438 and bi.ref ='324.1667.00.1' and bi.lordem =1
20240701@213552.5872 h69kcv1qenikn9k4eo4m7qna9k 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'
20240701@213552.5882 h69kcv1qenikn9k4eo4m7qna9k Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404438 and bi.ref ='324.1667.00.1' and bi.lordem =1
20240701@213552.5888 h69kcv1qenikn9k4eo4m7qna9k 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'
20240701@213552.5898 h69kcv1qenikn9k4eo4m7qna9k Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404438 and bi.ref ='324.1667.00.1' and bi.lordem =1
20240701@213552.5905 h69kcv1qenikn9k4eo4m7qna9k Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '328.9902.00.1'
20240701@213552.6069 h69kcv1qenikn9k4eo4m7qna9k Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404438 and bi.ref ='328.9902.00.1' and bi.lordem =2
20240701@213552.6405 h69kcv1qenikn9k4eo4m7qna9k Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '328.9902.00.1'
20240701@213552.6417 h69kcv1qenikn9k4eo4m7qna9k Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404438 and bi.ref ='328.9902.00.1' and bi.lordem =2
20240701@213552.6424 h69kcv1qenikn9k4eo4m7qna9k Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '328.9902.00.1'
20240701@213552.6433 h69kcv1qenikn9k4eo4m7qna9k Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404438 and bi.ref ='328.9902.00.1' and bi.lordem =2
20240701@213552.6439 h69kcv1qenikn9k4eo4m7qna9k Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '328.9902.00.1'
20240701@213552.6449 h69kcv1qenikn9k4eo4m7qna9k Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404438 and bi.ref ='328.9902.00.1' and bi.lordem =2
20240701@213552.6455 h69kcv1qenikn9k4eo4m7qna9k Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '328.9903.00.1'
20240701@213552.6606 h69kcv1qenikn9k4eo4m7qna9k Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404438 and bi.ref ='328.9903.00.1' and bi.lordem =3
20240701@213552.6926 h69kcv1qenikn9k4eo4m7qna9k Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '328.9903.00.1'
20240701@213552.6936 h69kcv1qenikn9k4eo4m7qna9k Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404438 and bi.ref ='328.9903.00.1' and bi.lordem =3
20240701@213552.6943 h69kcv1qenikn9k4eo4m7qna9k Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '328.9903.00.1'
20240701@213552.6953 h69kcv1qenikn9k4eo4m7qna9k Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404438 and bi.ref ='328.9903.00.1' and bi.lordem =3
20240701@213552.6961 h69kcv1qenikn9k4eo4m7qna9k Query : use flama_phc
20240701@213552.6969 h69kcv1qenikn9k4eo4m7qna9k Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240701@213552.7148 h69kcv1qenikn9k4eo4m7qna9k Query : use flama_phc
20240701@213552.7152 h69kcv1qenikn9k4eo4m7qna9k Query : select top 1 1 valor from td where td.ndoc = 39
20240701@213552.7194 h69kcv1qenikn9k4eo4m7qna9k Query : use flama_phc
20240701@213552.7197 h69kcv1qenikn9k4eo4m7qna9k 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')
20240701@213552.7774 v91bt5konkh2j0in20jcpeb4b7 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240701@213552.7787 v91bt5konkh2j0in20jcpeb4b7 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240701@213552.7804 v91bt5konkh2j0in20jcpeb4b7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='715';
20240701@213552.7843 v91bt5konkh2j0in20jcpeb4b7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='715';
20240701@213552.7857 v91bt5konkh2j0in20jcpeb4b7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='715';
20240701@213552.7868 v91bt5konkh2j0in20jcpeb4b7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='715';
20240701@213552.7881 v91bt5konkh2j0in20jcpeb4b7 Query : use flama_phc
20240701@213552.7884 v91bt5konkh2j0in20jcpeb4b7 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240701@213552.7898 v91bt5konkh2j0in20jcpeb4b7 Query : use flama_phc
20240701@213552.7901 v91bt5konkh2j0in20jcpeb4b7 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4743
20240701@213552.7974 v91bt5konkh2j0in20jcpeb4b7 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'
20240701@213552.8130 v91bt5konkh2j0in20jcpeb4b7 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404439 and bi.ref ='324.4970.00.1' and bi.lordem =1
20240701@213552.8459 v91bt5konkh2j0in20jcpeb4b7 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'
20240701@213552.8471 v91bt5konkh2j0in20jcpeb4b7 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404439 and bi.ref ='324.4970.00.1' and bi.lordem =1
20240701@213552.8478 v91bt5konkh2j0in20jcpeb4b7 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'
20240701@213552.8488 v91bt5konkh2j0in20jcpeb4b7 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404439 and bi.ref ='324.4970.00.1' and bi.lordem =1
20240701@213552.8496 v91bt5konkh2j0in20jcpeb4b7 Query : use flama_phc
20240701@213552.8506 v91bt5konkh2j0in20jcpeb4b7 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240701@213552.8520 v91bt5konkh2j0in20jcpeb4b7 Query : use flama_phc
20240701@213552.8523 v91bt5konkh2j0in20jcpeb4b7 Query : select top 1 1 valor from td where td.ndoc = 39
20240701@213552.8534 v91bt5konkh2j0in20jcpeb4b7 Query : use flama_phc
20240701@213552.8537 v91bt5konkh2j0in20jcpeb4b7 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')
20240701@213552.9008 naurf816htoho100j5urk19ke7 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240701@213552.9021 naurf816htoho100j5urk19ke7 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240701@213552.9037 naurf816htoho100j5urk19ke7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='716';
20240701@213552.9077 naurf816htoho100j5urk19ke7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='716';
20240701@213552.9091 naurf816htoho100j5urk19ke7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='716';
20240701@213552.9104 naurf816htoho100j5urk19ke7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='716';
20240701@213552.9116 naurf816htoho100j5urk19ke7 Query : use flama_phc
20240701@213552.9119 naurf816htoho100j5urk19ke7 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240701@213552.9134 naurf816htoho100j5urk19ke7 Query : use flama_phc
20240701@213552.9137 naurf816htoho100j5urk19ke7 Query : select no, estab,szadrsdesc from szadrs where u_coddest=5546
20240701@213552.9208 naurf816htoho100j5urk19ke7 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'
20240701@213552.9363 naurf816htoho100j5urk19ke7 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404440 and bi.ref ='324.5343.00.1' and bi.lordem =1
20240701@213552.9684 naurf816htoho100j5urk19ke7 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'
20240701@213552.9834 naurf816htoho100j5urk19ke7 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404440 and bi.ref ='324.1608.00.1' and bi.lordem =2
20240701@213553.1500 naurf816htoho100j5urk19ke7 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'
20240701@213553.3020 naurf816htoho100j5urk19ke7 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404440 and bi.ref ='324.727.00.01' and bi.lordem =3
20240701@213553.6350 naurf816htoho100j5urk19ke7 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.4020.00.1'
20240701@213553.8050 naurf816htoho100j5urk19ke7 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404440 and bi.ref ='304.4020.00.1' and bi.lordem =4
20240701@213553.1149 naurf816htoho100j5urk19ke7 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'
20240701@213553.1308 naurf816htoho100j5urk19ke7 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404440 and bi.ref ='304.4320.00.1' and bi.lordem =5
20240701@213553.1641 naurf816htoho100j5urk19ke7 Query : use flama_phc
20240701@213553.1644 naurf816htoho100j5urk19ke7 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240701@213553.1657 naurf816htoho100j5urk19ke7 Query : use flama_phc
20240701@213553.1660 naurf816htoho100j5urk19ke7 Query : select top 1 1 valor from td where td.ndoc = 39
20240701@213553.1671 naurf816htoho100j5urk19ke7 Query : use flama_phc
20240701@213553.1674 naurf816htoho100j5urk19ke7 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')
20240701@213553.2162 79b4ahda656miv0b5vn1dt6n5c Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240701@213553.2176 79b4ahda656miv0b5vn1dt6n5c Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240701@213553.2193 79b4ahda656miv0b5vn1dt6n5c Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='717';
20240701@213553.2234 79b4ahda656miv0b5vn1dt6n5c Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='717';
20240701@213553.2250 79b4ahda656miv0b5vn1dt6n5c Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='717';
20240701@213553.2263 79b4ahda656miv0b5vn1dt6n5c Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='717';
20240701@213553.2277 79b4ahda656miv0b5vn1dt6n5c Query : use flama_phc
20240701@213553.2280 79b4ahda656miv0b5vn1dt6n5c Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240701@213553.2295 79b4ahda656miv0b5vn1dt6n5c Query : use flama_phc
20240701@213553.2297 79b4ahda656miv0b5vn1dt6n5c Query : select no, estab,szadrsdesc from szadrs where u_coddest=16
20240701@213553.2369 79b4ahda656miv0b5vn1dt6n5c Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '328.9902.00.1'
20240701@213553.2380 79b4ahda656miv0b5vn1dt6n5c Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404442 and bi.ref ='328.9902.00.1' and bi.lordem =1
20240701@213553.2711 79b4ahda656miv0b5vn1dt6n5c Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '328.9902.00.1'
20240701@213553.2722 79b4ahda656miv0b5vn1dt6n5c Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404442 and bi.ref ='328.9902.00.1' and bi.lordem =1
20240701@213553.2729 79b4ahda656miv0b5vn1dt6n5c Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '328.9902.00.1'
20240701@213553.2739 79b4ahda656miv0b5vn1dt6n5c Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404442 and bi.ref ='328.9902.00.1' and bi.lordem =1
20240701@213553.2747 79b4ahda656miv0b5vn1dt6n5c Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '328.9902.00.1'
20240701@213553.2757 79b4ahda656miv0b5vn1dt6n5c Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404442 and bi.ref ='328.9902.00.1' and bi.lordem =1
20240701@213553.2765 79b4ahda656miv0b5vn1dt6n5c Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '328.9903.00.1'
20240701@213553.2775 79b4ahda656miv0b5vn1dt6n5c Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404442 and bi.ref ='328.9903.00.1' and bi.lordem =2
20240701@213553.3108 79b4ahda656miv0b5vn1dt6n5c Query : use flama_phc
20240701@213553.3112 79b4ahda656miv0b5vn1dt6n5c Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240701@213553.3126 79b4ahda656miv0b5vn1dt6n5c Query : use flama_phc
20240701@213553.3128 79b4ahda656miv0b5vn1dt6n5c Query : select top 1 1 valor from td where td.ndoc = 39
20240701@213553.3139 79b4ahda656miv0b5vn1dt6n5c Query : use flama_phc
20240701@213553.3144 79b4ahda656miv0b5vn1dt6n5c 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')
20240701@213553.3609 f8tjh7214123fjdqsti1k3ug79 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240701@213553.3622 f8tjh7214123fjdqsti1k3ug79 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240701@213553.3638 f8tjh7214123fjdqsti1k3ug79 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='718';
20240701@213553.3678 f8tjh7214123fjdqsti1k3ug79 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='718';
20240701@213553.3693 f8tjh7214123fjdqsti1k3ug79 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='718';
20240701@213553.3705 f8tjh7214123fjdqsti1k3ug79 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='718';
20240701@213553.3717 f8tjh7214123fjdqsti1k3ug79 Query : use flama_phc
20240701@213553.3720 f8tjh7214123fjdqsti1k3ug79 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240701@213553.3734 f8tjh7214123fjdqsti1k3ug79 Query : use flama_phc
20240701@213553.3737 f8tjh7214123fjdqsti1k3ug79 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240701@213553.3808 f8tjh7214123fjdqsti1k3ug79 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'
20240701@213553.5106 f8tjh7214123fjdqsti1k3ug79 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404448 and bi.ref ='324.1832.00.2' and bi.lordem =1
20240701@213553.5427 f8tjh7214123fjdqsti1k3ug79 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'
20240701@213553.5438 f8tjh7214123fjdqsti1k3ug79 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404448 and bi.ref ='324.1832.00.2' and bi.lordem =1
20240701@213553.5445 f8tjh7214123fjdqsti1k3ug79 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'
20240701@213553.5454 f8tjh7214123fjdqsti1k3ug79 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404448 and bi.ref ='324.1832.00.2' and bi.lordem =1
20240701@213553.5461 f8tjh7214123fjdqsti1k3ug79 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'
20240701@213553.5471 f8tjh7214123fjdqsti1k3ug79 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404448 and bi.ref ='324.1832.00.2' and bi.lordem =1
20240701@213553.5478 f8tjh7214123fjdqsti1k3ug79 Query : use flama_phc
20240701@213553.5481 f8tjh7214123fjdqsti1k3ug79 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240701@213553.5494 f8tjh7214123fjdqsti1k3ug79 Query : use flama_phc
20240701@213553.5497 f8tjh7214123fjdqsti1k3ug79 Query : select top 1 1 valor from td where td.ndoc = 39
20240701@213553.5507 f8tjh7214123fjdqsti1k3ug79 Query : use flama_phc
20240701@213553.5510 f8tjh7214123fjdqsti1k3ug79 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')
20240701@213553.5984 a11k5v759tm2vnhjp7md8u5o9u Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240701@213553.5997 a11k5v759tm2vnhjp7md8u5o9u Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240701@213553.6013 a11k5v759tm2vnhjp7md8u5o9u Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='719';
20240701@213553.6052 a11k5v759tm2vnhjp7md8u5o9u Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='719';
20240701@213553.6068 a11k5v759tm2vnhjp7md8u5o9u Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='719';
20240701@213553.6089 a11k5v759tm2vnhjp7md8u5o9u Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='719';
20240701@213553.6102 a11k5v759tm2vnhjp7md8u5o9u Query : use flama_phc
20240701@213553.6105 a11k5v759tm2vnhjp7md8u5o9u Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240701@213553.6120 a11k5v759tm2vnhjp7md8u5o9u Query : use flama_phc
20240701@213553.6123 a11k5v759tm2vnhjp7md8u5o9u Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240701@213553.6151 a11k5v759tm2vnhjp7md8u5o9u Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1833.00.2'
20240701@213553.6306 a11k5v759tm2vnhjp7md8u5o9u Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404449 and bi.ref ='324.1833.00.2' and bi.lordem =1
20240701@213553.6626 a11k5v759tm2vnhjp7md8u5o9u Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1833.00.2'
20240701@213553.6638 a11k5v759tm2vnhjp7md8u5o9u Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404449 and bi.ref ='324.1833.00.2' and bi.lordem =1
20240701@213553.6645 a11k5v759tm2vnhjp7md8u5o9u Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1833.00.2'
20240701@213553.6655 a11k5v759tm2vnhjp7md8u5o9u Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404449 and bi.ref ='324.1833.00.2' and bi.lordem =1
20240701@213553.6662 a11k5v759tm2vnhjp7md8u5o9u Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1833.00.2'
20240701@213553.6671 a11k5v759tm2vnhjp7md8u5o9u Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404449 and bi.ref ='324.1833.00.2' and bi.lordem =1
20240701@213553.6678 a11k5v759tm2vnhjp7md8u5o9u Query : use flama_phc
20240701@213553.6681 a11k5v759tm2vnhjp7md8u5o9u Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240701@213553.6694 a11k5v759tm2vnhjp7md8u5o9u Query : use flama_phc
20240701@213553.6697 a11k5v759tm2vnhjp7md8u5o9u Query : select top 1 1 valor from td where td.ndoc = 39
20240701@213553.6708 a11k5v759tm2vnhjp7md8u5o9u Query : use flama_phc
20240701@213553.6711 a11k5v759tm2vnhjp7md8u5o9u 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')
20240701@213553.7207 p68pidtie4utou121hnpc5euhi Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240701@213553.7220 p68pidtie4utou121hnpc5euhi Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240701@213553.7237 p68pidtie4utou121hnpc5euhi Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='720';
20240701@213553.7277 p68pidtie4utou121hnpc5euhi Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='720';
20240701@213553.7291 p68pidtie4utou121hnpc5euhi Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='720';
20240701@213553.7305 p68pidtie4utou121hnpc5euhi Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='720';
20240701@213553.7319 p68pidtie4utou121hnpc5euhi Query : use flama_phc
20240701@213553.7322 p68pidtie4utou121hnpc5euhi Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240701@213553.7339 p68pidtie4utou121hnpc5euhi Query : use flama_phc
20240701@213553.7342 p68pidtie4utou121hnpc5euhi Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240701@213553.7372 p68pidtie4utou121hnpc5euhi Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1837.00.1'
20240701@213553.7531 p68pidtie4utou121hnpc5euhi Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404450 and bi.ref ='324.1837.00.1' and bi.lordem =1
20240701@213553.8866 p68pidtie4utou121hnpc5euhi Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1837.00.1'
20240701@213553.8878 p68pidtie4utou121hnpc5euhi Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404450 and bi.ref ='324.1837.00.1' and bi.lordem =1
20240701@213553.8886 p68pidtie4utou121hnpc5euhi Query : use flama_phc
20240701@213553.8889 p68pidtie4utou121hnpc5euhi Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240701@213553.8902 p68pidtie4utou121hnpc5euhi Query : use flama_phc
20240701@213553.8905 p68pidtie4utou121hnpc5euhi Query : select top 1 1 valor from td where td.ndoc = 39
20240701@213553.8914 p68pidtie4utou121hnpc5euhi Query : use flama_phc
20240701@213553.8917 p68pidtie4utou121hnpc5euhi 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')
20240701@213553.9366 qoovmbepdmeja4s3hqkm9r1ujv Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240701@213553.9378 qoovmbepdmeja4s3hqkm9r1ujv Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240701@213553.9398 qoovmbepdmeja4s3hqkm9r1ujv Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='721';
20240701@213553.9439 qoovmbepdmeja4s3hqkm9r1ujv Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='721';
20240701@213553.9456 qoovmbepdmeja4s3hqkm9r1ujv Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='721';
20240701@213553.9470 qoovmbepdmeja4s3hqkm9r1ujv Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='721';
20240701@213553.9482 qoovmbepdmeja4s3hqkm9r1ujv Query : use flama_phc
20240701@213553.9485 qoovmbepdmeja4s3hqkm9r1ujv Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240701@213553.9499 qoovmbepdmeja4s3hqkm9r1ujv Query : use flama_phc
20240701@213553.9502 qoovmbepdmeja4s3hqkm9r1ujv Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240701@213553.9530 qoovmbepdmeja4s3hqkm9r1ujv 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'
20240701@213553.9687 qoovmbepdmeja4s3hqkm9r1ujv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404451 and bi.ref ='324.1834.00.1' and bi.lordem =1
20240701@213554.1800 qoovmbepdmeja4s3hqkm9r1ujv 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'
20240701@213554.2800 qoovmbepdmeja4s3hqkm9r1ujv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404451 and bi.ref ='324.1834.00.1' and bi.lordem =1
20240701@213554.3500 qoovmbepdmeja4s3hqkm9r1ujv 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'
20240701@213554.4500 qoovmbepdmeja4s3hqkm9r1ujv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404451 and bi.ref ='324.1834.00.1' and bi.lordem =1
20240701@213554.5300 qoovmbepdmeja4s3hqkm9r1ujv 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'
20240701@213554.6300 qoovmbepdmeja4s3hqkm9r1ujv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404451 and bi.ref ='324.1834.00.1' and bi.lordem =1
20240701@213554.7000 qoovmbepdmeja4s3hqkm9r1ujv Query : use flama_phc
20240701@213554.7300 qoovmbepdmeja4s3hqkm9r1ujv Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240701@213554.8600 qoovmbepdmeja4s3hqkm9r1ujv Query : use flama_phc
20240701@213554.8900 qoovmbepdmeja4s3hqkm9r1ujv Query : select top 1 1 valor from td where td.ndoc = 39
20240701@213554.1000 qoovmbepdmeja4s3hqkm9r1ujv Query : use flama_phc
20240701@213554.1030 qoovmbepdmeja4s3hqkm9r1ujv 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')
20240701@213554.6040 6qaeisn9vtbjcqpsa19f7fkmv2 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240701@213554.6180 6qaeisn9vtbjcqpsa19f7fkmv2 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240701@213554.6340 6qaeisn9vtbjcqpsa19f7fkmv2 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='722';
20240701@213554.6770 6qaeisn9vtbjcqpsa19f7fkmv2 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='722';
20240701@213554.6920 6qaeisn9vtbjcqpsa19f7fkmv2 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='722';
20240701@213554.7030 6qaeisn9vtbjcqpsa19f7fkmv2 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='722';
20240701@213554.7160 6qaeisn9vtbjcqpsa19f7fkmv2 Query : use flama_phc
20240701@213554.7190 6qaeisn9vtbjcqpsa19f7fkmv2 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240701@213554.7330 6qaeisn9vtbjcqpsa19f7fkmv2 Query : use flama_phc
20240701@213554.7360 6qaeisn9vtbjcqpsa19f7fkmv2 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240701@213554.7650 6qaeisn9vtbjcqpsa19f7fkmv2 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1803.00.1'
20240701@213554.9180 6qaeisn9vtbjcqpsa19f7fkmv2 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404452 and bi.ref ='324.1803.00.1' and bi.lordem =1
20240701@213554.1241 6qaeisn9vtbjcqpsa19f7fkmv2 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1803.00.1'
20240701@213554.1251 6qaeisn9vtbjcqpsa19f7fkmv2 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404452 and bi.ref ='324.1803.00.1' and bi.lordem =1
20240701@213554.1258 6qaeisn9vtbjcqpsa19f7fkmv2 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1803.00.1'
20240701@213554.1268 6qaeisn9vtbjcqpsa19f7fkmv2 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404452 and bi.ref ='324.1803.00.1' and bi.lordem =1
20240701@213554.1274 6qaeisn9vtbjcqpsa19f7fkmv2 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1803.00.1'
20240701@213554.1284 6qaeisn9vtbjcqpsa19f7fkmv2 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404452 and bi.ref ='324.1803.00.1' and bi.lordem =1
20240701@213554.1291 6qaeisn9vtbjcqpsa19f7fkmv2 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1803.00.1'
20240701@213554.1301 6qaeisn9vtbjcqpsa19f7fkmv2 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404452 and bi.ref ='324.1803.00.1' and bi.lordem =1
20240701@213554.1308 6qaeisn9vtbjcqpsa19f7fkmv2 Query : use flama_phc
20240701@213554.1311 6qaeisn9vtbjcqpsa19f7fkmv2 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240701@213554.1324 6qaeisn9vtbjcqpsa19f7fkmv2 Query : use flama_phc
20240701@213554.1327 6qaeisn9vtbjcqpsa19f7fkmv2 Query : select top 1 1 valor from td where td.ndoc = 39
20240701@213554.1337 6qaeisn9vtbjcqpsa19f7fkmv2 Query : use flama_phc
20240701@213554.1340 6qaeisn9vtbjcqpsa19f7fkmv2 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')
20240701@213554.2098 vkbrv1l8ecmgp75c26vm7nmta3 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240701@213554.2112 vkbrv1l8ecmgp75c26vm7nmta3 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240701@213554.2131 vkbrv1l8ecmgp75c26vm7nmta3 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='723';
20240701@213554.2172 vkbrv1l8ecmgp75c26vm7nmta3 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='723';
20240701@213554.2187 vkbrv1l8ecmgp75c26vm7nmta3 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='723';
20240701@213554.2200 vkbrv1l8ecmgp75c26vm7nmta3 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='723';
20240701@213554.2212 vkbrv1l8ecmgp75c26vm7nmta3 Query : use flama_phc
20240701@213554.2215 vkbrv1l8ecmgp75c26vm7nmta3 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240701@213554.2230 vkbrv1l8ecmgp75c26vm7nmta3 Query : use flama_phc
20240701@213554.2233 vkbrv1l8ecmgp75c26vm7nmta3 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240701@213554.2261 vkbrv1l8ecmgp75c26vm7nmta3 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'
20240701@213554.2419 vkbrv1l8ecmgp75c26vm7nmta3 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404453 and bi.ref ='324.1831.00.2' and bi.lordem =1
20240701@213554.2745 vkbrv1l8ecmgp75c26vm7nmta3 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'
20240701@213554.2756 vkbrv1l8ecmgp75c26vm7nmta3 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404453 and bi.ref ='324.1831.00.2' and bi.lordem =1
20240701@213554.2763 vkbrv1l8ecmgp75c26vm7nmta3 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'
20240701@213554.2773 vkbrv1l8ecmgp75c26vm7nmta3 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404453 and bi.ref ='324.1831.00.2' and bi.lordem =1
20240701@213554.2779 vkbrv1l8ecmgp75c26vm7nmta3 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'
20240701@213554.2789 vkbrv1l8ecmgp75c26vm7nmta3 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404453 and bi.ref ='324.1831.00.2' and bi.lordem =1
20240701@213554.2796 vkbrv1l8ecmgp75c26vm7nmta3 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'
20240701@213554.2805 vkbrv1l8ecmgp75c26vm7nmta3 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404453 and bi.ref ='324.1831.00.2' and bi.lordem =1
20240701@213554.2812 vkbrv1l8ecmgp75c26vm7nmta3 Query : use flama_phc
20240701@213554.2815 vkbrv1l8ecmgp75c26vm7nmta3 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240701@213554.2828 vkbrv1l8ecmgp75c26vm7nmta3 Query : use flama_phc
20240701@213554.2831 vkbrv1l8ecmgp75c26vm7nmta3 Query : select top 1 1 valor from td where td.ndoc = 39
20240701@213554.2841 vkbrv1l8ecmgp75c26vm7nmta3 Query : use flama_phc
20240701@213554.2844 vkbrv1l8ecmgp75c26vm7nmta3 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')
20240701@213554.3335 cn7nj22utq3enk7tkab9dplpbc Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240701@213554.3348 cn7nj22utq3enk7tkab9dplpbc Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240701@213554.3364 cn7nj22utq3enk7tkab9dplpbc Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='724';
20240701@213554.3404 cn7nj22utq3enk7tkab9dplpbc Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='724';
20240701@213554.3419 cn7nj22utq3enk7tkab9dplpbc Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='724';
20240701@213554.3430 cn7nj22utq3enk7tkab9dplpbc Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='724';
20240701@213554.3444 cn7nj22utq3enk7tkab9dplpbc Query : use flama_phc
20240701@213554.3447 cn7nj22utq3enk7tkab9dplpbc Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240701@213554.3462 cn7nj22utq3enk7tkab9dplpbc Query : use flama_phc
20240701@213554.3465 cn7nj22utq3enk7tkab9dplpbc Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240701@213554.3493 cn7nj22utq3enk7tkab9dplpbc 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'
20240701@213554.3646 cn7nj22utq3enk7tkab9dplpbc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404454 and bi.ref ='324.1879.00.1' and bi.lordem =1
20240701@213554.3965 cn7nj22utq3enk7tkab9dplpbc 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'
20240701@213554.3975 cn7nj22utq3enk7tkab9dplpbc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404454 and bi.ref ='324.1879.00.1' and bi.lordem =1
20240701@213554.3983 cn7nj22utq3enk7tkab9dplpbc 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'
20240701@213554.3993 cn7nj22utq3enk7tkab9dplpbc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404454 and bi.ref ='324.1879.00.1' and bi.lordem =1
20240701@213554.4001 cn7nj22utq3enk7tkab9dplpbc 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'
20240701@213554.4011 cn7nj22utq3enk7tkab9dplpbc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404454 and bi.ref ='324.1879.00.1' and bi.lordem =1
20240701@213554.4019 cn7nj22utq3enk7tkab9dplpbc Query : use flama_phc
20240701@213554.4022 cn7nj22utq3enk7tkab9dplpbc Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240701@213554.4035 cn7nj22utq3enk7tkab9dplpbc Query : use flama_phc
20240701@213554.4038 cn7nj22utq3enk7tkab9dplpbc Query : select top 1 1 valor from td where td.ndoc = 39
20240701@213554.4048 cn7nj22utq3enk7tkab9dplpbc Query : use flama_phc
20240701@213554.4051 cn7nj22utq3enk7tkab9dplpbc 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')
20240701@213554.4516 4t50ffa1gb4g93c2gthp6qpb92 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240701@213554.4530 4t50ffa1gb4g93c2gthp6qpb92 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240701@213554.4546 4t50ffa1gb4g93c2gthp6qpb92 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='725';
20240701@213554.4585 4t50ffa1gb4g93c2gthp6qpb92 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='725';
20240701@213554.4600 4t50ffa1gb4g93c2gthp6qpb92 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='725';
20240701@213554.4631 4t50ffa1gb4g93c2gthp6qpb92 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='725';
20240701@213554.4644 4t50ffa1gb4g93c2gthp6qpb92 Query : use flama_phc
20240701@213554.4648 4t50ffa1gb4g93c2gthp6qpb92 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240701@213554.4665 4t50ffa1gb4g93c2gthp6qpb92 Query : use flama_phc
20240701@213554.4668 4t50ffa1gb4g93c2gthp6qpb92 Query : select no, estab,szadrsdesc from szadrs where u_coddest=2435
20240701@213554.4738 4t50ffa1gb4g93c2gthp6qpb92 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1884.00.1'
20240701@213554.4892 4t50ffa1gb4g93c2gthp6qpb92 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404456 and bi.ref ='324.1884.00.1' and bi.lordem =1
20240701@213554.5216 4t50ffa1gb4g93c2gthp6qpb92 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.670.00.01'
20240701@213554.5367 4t50ffa1gb4g93c2gthp6qpb92 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404456 and bi.ref ='324.670.00.01' and bi.lordem =2
20240701@213554.5685 4t50ffa1gb4g93c2gthp6qpb92 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240701@213554.5839 4t50ffa1gb4g93c2gthp6qpb92 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404456 and bi.ref ='324.1816.00.1' and bi.lordem =3
20240701@213554.6165 4t50ffa1gb4g93c2gthp6qpb92 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'
20240701@213554.6317 4t50ffa1gb4g93c2gthp6qpb92 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404456 and bi.ref ='324.1684.00.1' and bi.lordem =4
20240701@213554.6641 4t50ffa1gb4g93c2gthp6qpb92 Query : use flama_phc
20240701@213554.6644 4t50ffa1gb4g93c2gthp6qpb92 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240701@213554.6658 4t50ffa1gb4g93c2gthp6qpb92 Query : use flama_phc
20240701@213554.6661 4t50ffa1gb4g93c2gthp6qpb92 Query : select top 1 1 valor from td where td.ndoc = 39
20240701@213554.6673 4t50ffa1gb4g93c2gthp6qpb92 Query : use flama_phc
20240701@213554.6676 4t50ffa1gb4g93c2gthp6qpb92 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')
20240701@213554.7136 ckppgrtn4ecl7fo2tkf35ndnie Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240701@213554.7149 ckppgrtn4ecl7fo2tkf35ndnie Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240701@213554.7166 ckppgrtn4ecl7fo2tkf35ndnie Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='726';
20240701@213554.7205 ckppgrtn4ecl7fo2tkf35ndnie Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='726';
20240701@213554.7219 ckppgrtn4ecl7fo2tkf35ndnie Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='726';
20240701@213554.7231 ckppgrtn4ecl7fo2tkf35ndnie Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='726';
20240701@213554.7243 ckppgrtn4ecl7fo2tkf35ndnie Query : use flama_phc
20240701@213554.7246 ckppgrtn4ecl7fo2tkf35ndnie Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240701@213554.7263 ckppgrtn4ecl7fo2tkf35ndnie Query : use flama_phc
20240701@213554.7266 ckppgrtn4ecl7fo2tkf35ndnie Query : select no, estab,szadrsdesc from szadrs where u_coddest=3457
20240701@213554.7338 ckppgrtn4ecl7fo2tkf35ndnie Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1706.00.1'
20240701@213554.7498 ckppgrtn4ecl7fo2tkf35ndnie Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404463 and bi.ref ='324.1706.00.1' and bi.lordem =1
20240701@213554.7816 ckppgrtn4ecl7fo2tkf35ndnie 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'
20240701@213554.7828 ckppgrtn4ecl7fo2tkf35ndnie Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404463 and bi.ref ='324.1832.00.2' and bi.lordem =2
20240701@213554.8174 ckppgrtn4ecl7fo2tkf35ndnie 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'
20240701@213554.8185 ckppgrtn4ecl7fo2tkf35ndnie Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404463 and bi.ref ='324.1832.00.2' and bi.lordem =2
20240701@213554.8193 ckppgrtn4ecl7fo2tkf35ndnie 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'
20240701@213554.8205 ckppgrtn4ecl7fo2tkf35ndnie Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404463 and bi.ref ='324.1831.00.2' and bi.lordem =3
20240701@213554.8525 ckppgrtn4ecl7fo2tkf35ndnie 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'
20240701@213554.8536 ckppgrtn4ecl7fo2tkf35ndnie Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404463 and bi.ref ='324.1831.00.2' and bi.lordem =3
20240701@213554.8543 ckppgrtn4ecl7fo2tkf35ndnie 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'
20240701@213554.8553 ckppgrtn4ecl7fo2tkf35ndnie Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404463 and bi.ref ='324.1831.00.2' and bi.lordem =3
20240701@213554.8560 ckppgrtn4ecl7fo2tkf35ndnie Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2221.00.1'
20240701@213554.8713 ckppgrtn4ecl7fo2tkf35ndnie Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404463 and bi.ref ='324.2221.00.1' and bi.lordem =4
20240701@213554.9181 ckppgrtn4ecl7fo2tkf35ndnie Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2222.00.1'
20240701@213554.9334 ckppgrtn4ecl7fo2tkf35ndnie Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404463 and bi.ref ='324.2222.00.1' and bi.lordem =5
20240701@213554.9680 ckppgrtn4ecl7fo2tkf35ndnie Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2223.00.1'
20240701@213554.9845 ckppgrtn4ecl7fo2tkf35ndnie Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404463 and bi.ref ='324.2223.00.1' and bi.lordem =6
20240701@213555.1920 ckppgrtn4ecl7fo2tkf35ndnie Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2224.00.1'
20240701@213555.3480 ckppgrtn4ecl7fo2tkf35ndnie Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404463 and bi.ref ='324.2224.00.1' and bi.lordem =7
20240701@213555.7020 ckppgrtn4ecl7fo2tkf35ndnie Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4962.00.1'
20240701@213555.8620 ckppgrtn4ecl7fo2tkf35ndnie Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404463 and bi.ref ='324.4962.00.1' and bi.lordem =8
20240701@213555.1198 ckppgrtn4ecl7fo2tkf35ndnie Query : use flama_phc
20240701@213555.1202 ckppgrtn4ecl7fo2tkf35ndnie Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240701@213555.1215 ckppgrtn4ecl7fo2tkf35ndnie Query : use flama_phc
20240701@213555.1218 ckppgrtn4ecl7fo2tkf35ndnie Query : select top 1 1 valor from td where td.ndoc = 39
20240701@213555.1228 ckppgrtn4ecl7fo2tkf35ndnie Query : use flama_phc
20240701@213555.1230 ckppgrtn4ecl7fo2tkf35ndnie 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')
20240701@213555.1708 iloo8gevm68bumjt2bgh3e3283 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240701@213555.1756 iloo8gevm68bumjt2bgh3e3283 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240701@213555.2874 iloo8gevm68bumjt2bgh3e3283 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='727';
20240701@213555.2914 iloo8gevm68bumjt2bgh3e3283 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='727';
20240701@213555.2929 iloo8gevm68bumjt2bgh3e3283 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='727';
20240701@213555.2940 iloo8gevm68bumjt2bgh3e3283 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='727';

20240702@113938.3441 vnv3r32ktd57j9jj683knac6cq Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='728';
20240702@113938.3469 vnv3r32ktd57j9jj683knac6cq Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='728';
20240702@113938.3482 vnv3r32ktd57j9jj683knac6cq Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='728';
20240702@113938.3495 vnv3r32ktd57j9jj683knac6cq Query : use flama_phc
20240702@113938.3499 vnv3r32ktd57j9jj683knac6cq Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@113938.3548 vnv3r32ktd57j9jj683knac6cq Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '328.9036.00.1'
20240702@113938.3659 vnv3r32ktd57j9jj683knac6cq 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 = 2400212 and bi.ref ='328.9036.00.1' and bi.lordem =120000
20240702@113938.3993 vnv3r32ktd57j9jj683knac6cq 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 = 'cps24022741246,320000005 ' 
20240702@113938.4386 vnv3r32ktd57j9jj683knac6cq Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '328.9075.00.1'
20240702@113938.4500 vnv3r32ktd57j9jj683knac6cq 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 = 2400212 and bi.ref ='328.9075.00.1' and bi.lordem =2
20240702@113938.4818 vnv3r32ktd57j9jj683knac6cq Query : use flama_phc
20240702@113938.4821 vnv3r32ktd57j9jj683knac6cq Query : select top 1 1 valor from ts where ts.ndos = 61
20240702@113938.4902 vnv3r32ktd57j9jj683knac6cq Query : use flama_phc
20240702@113938.4905 vnv3r32ktd57j9jj683knac6cq 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')
20240702@113938.4970 vnv3r32ktd57j9jj683knac6cq 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
20240702@113938.5123 vnv3r32ktd57j9jj683knac6cq Query : use flama_phc
20240702@113938.5126 vnv3r32ktd57j9jj683knac6cq Query : select top 1 ~inactivo valor from fl where no = '202530' and estab = 00 order by inactivo desc
20240702@113938.5217 vnv3r32ktd57j9jj683knac6cq Query : use flama_phc
20240702@113938.5220 vnv3r32ktd57j9jj683knac6cq Query : select 1 valor from ts where ndos = 61
20240702@113938.5303 vnv3r32ktd57j9jj683knac6cq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@113938.5598 vnv3r32ktd57j9jj683knac6cq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240702@113938.5659 vnv3r32ktd57j9jj683knac6cq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@113938.5672 vnv3r32ktd57j9jj683knac6cq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240702@113938.5679 vnv3r32ktd57j9jj683knac6cq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@113938.5691 vnv3r32ktd57j9jj683knac6cq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240702@113938.5698 vnv3r32ktd57j9jj683knac6cq 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
20240702@113938.5834 vnv3r32ktd57j9jj683knac6cq Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240702@113938.5941 vnv3r32ktd57j9jj683knac6cq Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240702@113938.5958 vnv3r32ktd57j9jj683knac6cq Query : use flama_phc
20240702@113938.5961 vnv3r32ktd57j9jj683knac6cq Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202530' and estab=00
20240702@113938.6047 vnv3r32ktd57j9jj683knac6cq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@113938.6061 vnv3r32ktd57j9jj683knac6cq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240702@113938.6095 vnv3r32ktd57j9jj683knac6cq Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6683d907326683d8ea91',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240702@113938.6153 vnv3r32ktd57j9jj683knac6cq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@113938.6167 vnv3r32ktd57j9jj683knac6cq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240702@113938.6174 vnv3r32ktd57j9jj683knac6cq Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6683d907326683d8ea91','--','bo',7.7924865831842576028 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240702@113938.6366 vnv3r32ktd57j9jj683knac6cq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@113938.6380 vnv3r32ktd57j9jj683knac6cq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240702@113938.6388 vnv3r32ktd57j9jj683knac6cq 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 ('aut6683d907326683d8ea91','guia r. fornecedor','2024-07-02',61,2401917,?,?,?,?,?,?,?,?,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')
20240702@113938.7926 vnv3r32ktd57j9jj683knac6cq Query : use flama_phc
20240702@113938.7930 vnv3r32ktd57j9jj683knac6cq Query : select st.usalote valor from st where st.ref = '328.9036.00.1'
20240702@113938.8055 vnv3r32ktd57j9jj683knac6cq Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '328.9036.00.1'
20240702@113938.8195 vnv3r32ktd57j9jj683knac6cq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@113938.8208 vnv3r32ktd57j9jj683knac6cq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240702@113938.8219 vnv3r32ktd57j9jj683knac6cq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@113938.8231 vnv3r32ktd57j9jj683knac6cq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240702@113938.8314 vnv3r32ktd57j9jj683knac6cq Query : select sestamp valor from se where ref ='328.9036.00.1' and lote = 'r2400212120a'
20240702@113938.8373 vnv3r32ktd57j9jj683knac6cq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@113938.8402 vnv3r32ktd57j9jj683knac6cq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240702@113938.8410 vnv3r32ktd57j9jj683knac6cq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@113938.8422 vnv3r32ktd57j9jj683knac6cq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240702@113938.8428 vnv3r32ktd57j9jj683knac6cq Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6683d258046683d8eacd',?,?,'20240702',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240702@113938.8954 vnv3r32ktd57j9jj683knac6cq Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240702@113938.8992 vnv3r32ktd57j9jj683knac6cq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@113938.9005 vnv3r32ktd57j9jj683knac6cq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240702@113938.9013 vnv3r32ktd57j9jj683knac6cq Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut6683d599806683d8eadb','aut6683d907326683d8ea91',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 = 'aut6683d907326683d8ea91'
20240702@113938.9196 vnv3r32ktd57j9jj683knac6cq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@113938.9211 vnv3r32ktd57j9jj683knac6cq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240702@113938.9223 vnv3r32ktd57j9jj683knac6cq 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 'aut6683d599806683d8eadb',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 400, 400*.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 ,50.31,50.31*200.48,50.31,50.31*200.48 ,0,0,'un ','' ,bo.marcada,1 ,50.31*400,50.31*400*200.48 ,.000000,.000000*200.48 ,.000000,.000000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,50.31,50.31*200.48,50.31*400,50.31*400*200.48,'cps24022741246,320000005 ',392.04,392.04*400,392.04,392.04*400,?,?,?,4 from bo bo where bo.bostamp = 'aut6683d907326683d8ea91'
20240702@113946.4226 vnv3r32ktd57j9jj683knac6cq Query : use flama_phc
20240702@113946.4749 vnv3r32ktd57j9jj683knac6cq Query : select st.usalote valor from st where st.ref = '328.9075.00.1'
20240702@113946.5020 vnv3r32ktd57j9jj683knac6cq Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '328.9075.00.1'
20240702@113946.5253 vnv3r32ktd57j9jj683knac6cq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@113946.5267 vnv3r32ktd57j9jj683knac6cq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240702@113946.5277 vnv3r32ktd57j9jj683knac6cq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@113946.5289 vnv3r32ktd57j9jj683knac6cq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240702@113946.5296 vnv3r32ktd57j9jj683knac6cq Query : select sestamp valor from se where ref ='328.9075.00.1' and lote = 'r2400212150a'
20240702@113946.5304 vnv3r32ktd57j9jj683knac6cq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@113946.5315 vnv3r32ktd57j9jj683knac6cq Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240702@113946.5322 vnv3r32ktd57j9jj683knac6cq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@113946.5333 vnv3r32ktd57j9jj683knac6cq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240702@113946.5339 vnv3r32ktd57j9jj683knac6cq Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6683d706726683d8f281',?,?,'20240702',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240702@113946.5406 vnv3r32ktd57j9jj683knac6cq Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240702@113946.5416 vnv3r32ktd57j9jj683knac6cq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@113946.5429 vnv3r32ktd57j9jj683knac6cq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240702@113946.5435 vnv3r32ktd57j9jj683knac6cq Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut6683d471716683d8f284','aut6683d907326683d8ea91',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 = 'aut6683d907326683d8ea91'
20240702@113946.5676 vnv3r32ktd57j9jj683knac6cq Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@113946.5696 vnv3r32ktd57j9jj683knac6cq Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240702@113946.5711 vnv3r32ktd57j9jj683knac6cq Query : insert into bi (bistamp,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis ,obrano, qtt,uni2qtt ,no, estab,nmdos ,ndos, obranome,fechada, dataobra ,rdata ,dataopen, datafecho,local, morada ,codpost, nome,bostamp,lordem ,edebito,debito, epu,pu ,ivaincl,stns,unidade, unidad2 ,marcada,usalote ,ettdeb,ttdeb,epcusto, pcusto ,ecustoind,custoind ,vendedor,vendnm, ccusto,ncusto ,noserie,tabiva,iva ,ref,design,familia,eslvu,slvu,esltt,sltt,oobistamp,vumoeda,ttmoeda,slvumoeda,slttmoeda,lote,armazem,obistamp ,stipo) select 'aut6683d471716683d8f284',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 250, 250*.0000000 ,bo.no, bo.estab,bo.nmdos ,bo.ndos, bo.obranome,bo.fechada, bo.dataobra ,bo.dataobra ,bo.dataopen,bo.datafecho,bo.local, bo.morada ,bo.codpost, bo.nome,bo.bostamp,20000 ,0,0*200.48,0,0*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,0*250,0*250*200.48 ,.000000,.000000*200.48 ,.000000,.000000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0*200.48,0*250,0*250*200.48,'',0,0*250,0,0*250,?,?,?,4 from bo bo where bo.bostamp = 'aut6683d907326683d8ea91'
20240702@113946.6091 vnv3r32ktd57j9jj683knac6cq Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='728';
20240702@113946.6106 vnv3r32ktd57j9jj683knac6cq Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='728';

20240702@141708.5118 bnnh7240s5jc7v24n8rv016se2 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='729';
20240702@141708.5204 bnnh7240s5jc7v24n8rv016se2 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='729';
20240702@141708.5238 bnnh7240s5jc7v24n8rv016se2 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='729';
20240702@141708.5253 bnnh7240s5jc7v24n8rv016se2 Query : use flama_phc
20240702@141708.5256 bnnh7240s5jc7v24n8rv016se2 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@141708.5338 bnnh7240s5jc7v24n8rv016se2 Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1705.00.1'
20240702@141708.5455 bnnh7240s5jc7v24n8rv016se2 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 = 2400050 and bi.ref ='324.1705.00.1' and bi.lordem =50000
20240702@141708.5817 bnnh7240s5jc7v24n8rv016se2 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 = 'cps24011241198,134000002 ' 
20240702@141708.6140 bnnh7240s5jc7v24n8rv016se2 Query : use flama_phc
20240702@141708.6143 bnnh7240s5jc7v24n8rv016se2 Query : select top 1 1 valor from ts where ts.ndos = 61
20240702@141708.6371 bnnh7240s5jc7v24n8rv016se2 Query : use flama_phc
20240702@141708.6374 bnnh7240s5jc7v24n8rv016se2 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')
20240702@141708.6441 bnnh7240s5jc7v24n8rv016se2 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
20240702@141708.6623 bnnh7240s5jc7v24n8rv016se2 Query : use flama_phc
20240702@141708.6626 bnnh7240s5jc7v24n8rv016se2 Query : select top 1 ~inactivo valor from fl where no = '202307' and estab = 00 order by inactivo desc
20240702@141708.6722 bnnh7240s5jc7v24n8rv016se2 Query : use flama_phc
20240702@141708.6725 bnnh7240s5jc7v24n8rv016se2 Query : select 1 valor from ts where ndos = 61
20240702@141708.6805 bnnh7240s5jc7v24n8rv016se2 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@141708.7142 bnnh7240s5jc7v24n8rv016se2 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240702@141708.7180 bnnh7240s5jc7v24n8rv016se2 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@141708.7194 bnnh7240s5jc7v24n8rv016se2 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240702@141708.7201 bnnh7240s5jc7v24n8rv016se2 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@141708.7213 bnnh7240s5jc7v24n8rv016se2 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240702@141708.7219 bnnh7240s5jc7v24n8rv016se2 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
20240702@141708.7353 bnnh7240s5jc7v24n8rv016se2 Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240702@141708.7459 bnnh7240s5jc7v24n8rv016se2 Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240702@141708.7475 bnnh7240s5jc7v24n8rv016se2 Query : use flama_phc
20240702@141708.7478 bnnh7240s5jc7v24n8rv016se2 Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202307' and estab=00
20240702@141708.7568 bnnh7240s5jc7v24n8rv016se2 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@141708.7581 bnnh7240s5jc7v24n8rv016se2 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240702@141708.7612 bnnh7240s5jc7v24n8rv016se2 Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6683f271866683fdd4b6',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240702@141708.7694 bnnh7240s5jc7v24n8rv016se2 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@141708.7709 bnnh7240s5jc7v24n8rv016se2 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240702@141708.7716 bnnh7240s5jc7v24n8rv016se2 Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6683f271866683fdd4b6','--','bo',7.4142724745134383688 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240702@141708.7959 bnnh7240s5jc7v24n8rv016se2 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@141708.7974 bnnh7240s5jc7v24n8rv016se2 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240702@141708.7981 bnnh7240s5jc7v24n8rv016se2 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 ('aut6683f271866683fdd4b6','guia r. fornecedor','2024-07-02',61,2401920,?,?,?,?,?,?,?,?,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')
20240702@141708.8508 bnnh7240s5jc7v24n8rv016se2 Query : use flama_phc
20240702@141708.8512 bnnh7240s5jc7v24n8rv016se2 Query : select st.usalote valor from st where st.ref = '324.1705.00.1'
20240702@141708.8639 bnnh7240s5jc7v24n8rv016se2 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.1705.00.1'
20240702@141708.8793 bnnh7240s5jc7v24n8rv016se2 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@141708.8807 bnnh7240s5jc7v24n8rv016se2 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240702@141708.8822 bnnh7240s5jc7v24n8rv016se2 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@141708.8835 bnnh7240s5jc7v24n8rv016se2 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240702@141708.8842 bnnh7240s5jc7v24n8rv016se2 Query : select sestamp valor from se where ref ='324.1705.00.1' and lote = 'r2400050500a'
20240702@141708.8900 bnnh7240s5jc7v24n8rv016se2 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@141708.8914 bnnh7240s5jc7v24n8rv016se2 Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240702@141708.8921 bnnh7240s5jc7v24n8rv016se2 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@141708.8935 bnnh7240s5jc7v24n8rv016se2 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240702@141708.8943 bnnh7240s5jc7v24n8rv016se2 Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6683f876406683fdd4d9',?,?,'20240702',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240702@141708.9020 bnnh7240s5jc7v24n8rv016se2 Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240702@141708.9058 bnnh7240s5jc7v24n8rv016se2 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@141708.9073 bnnh7240s5jc7v24n8rv016se2 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240702@141708.9080 bnnh7240s5jc7v24n8rv016se2 Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut6683f673206683fdd4dd','aut6683f271866683fdd4b6',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 = 'aut6683f271866683fdd4b6'
20240702@141708.9385 bnnh7240s5jc7v24n8rv016se2 Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@141708.9400 bnnh7240s5jc7v24n8rv016se2 Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240702@141708.9686 bnnh7240s5jc7v24n8rv016se2 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 'aut6683f673206683fdd4dd',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 3200, 3200*.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 ,10.79,10.79*200.48,10.79,10.79*200.48 ,0,0,'un',' ' ,bo.marcada,1 ,10.79*3200,10.79*3200*200.48 ,10.399000,10.399000*200.48 ,10.399000,10.399000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,10.79,10.79*200.48,10.79*3200,10.79*3200*200.48,'cps24011241198,134000002 ',80,80*3200,80,80*3200,?,?,?,4 from bo bo where bo.bostamp = 'aut6683f271866683fdd4b6'
20240702@141709.4382 bnnh7240s5jc7v24n8rv016se2 Query : use flama_phc
20240702@141709.4387 bnnh7240s5jc7v24n8rv016se2 Query : declare @bostamp varchar(25) = 'aut6683f271866683fdd4b6' ,@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 
20240702@141717.7494 bnnh7240s5jc7v24n8rv016se2 Query : use flama_phc
20240702@141717.7498 bnnh7240s5jc7v24n8rv016se2 Query : select 1 valor from bo where bo.bostamp = 'aut6683f271866683fdd4b6'
20240702@141717.7599 bnnh7240s5jc7v24n8rv016se2 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) = 'aut6683f271866683fdd4b6' 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 
20240702@141718.3150 bnnh7240s5jc7v24n8rv016se2 Query : use flama_phc
20240702@141718.3190 bnnh7240s5jc7v24n8rv016se2 Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240702@141718.3330 bnnh7240s5jc7v24n8rv016se2 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='729';
20240702@141718.3480 bnnh7240s5jc7v24n8rv016se2 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='729';

20240702@144809.3546 b8f3ng0tg39tok64rossj1c2ra Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='730';
20240702@144809.3563 b8f3ng0tg39tok64rossj1c2ra Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='730';
20240702@144809.3574 b8f3ng0tg39tok64rossj1c2ra Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='730';

20240702@164542.5982 5i9sfpnqf353vsrcsn05b4ka3j Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='731';
20240702@164542.5998 5i9sfpnqf353vsrcsn05b4ka3j Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='731';
20240702@164542.6017 5i9sfpnqf353vsrcsn05b4ka3j Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='731';
20240702@164542.6031 5i9sfpnqf353vsrcsn05b4ka3j Query : use flama_phc
20240702@164542.6035 5i9sfpnqf353vsrcsn05b4ka3j Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@164542.6053 5i9sfpnqf353vsrcsn05b4ka3j Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '324.1816.00.1'
20240702@164542.6188 5i9sfpnqf353vsrcsn05b4ka3j 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 = 2400200 and bi.ref ='324.1816.00.1' and bi.lordem =20000
20240702@164542.7357 5i9sfpnqf353vsrcsn05b4ka3j 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 = 'cps24022241049,208000002 ' 
20240702@164542.7747 5i9sfpnqf353vsrcsn05b4ka3j Query : use flama_phc
20240702@164542.7751 5i9sfpnqf353vsrcsn05b4ka3j Query : select top 1 1 valor from ts where ts.ndos = 61
20240702@164542.7761 5i9sfpnqf353vsrcsn05b4ka3j Query : use flama_phc
20240702@164542.7764 5i9sfpnqf353vsrcsn05b4ka3j 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')
20240702@164542.7789 5i9sfpnqf353vsrcsn05b4ka3j 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
20240702@164542.7806 5i9sfpnqf353vsrcsn05b4ka3j Query : use flama_phc
20240702@164542.7809 5i9sfpnqf353vsrcsn05b4ka3j Query : select top 1 ~inactivo valor from fl where no = '202133' and estab = 00 order by inactivo desc
20240702@164542.7947 5i9sfpnqf353vsrcsn05b4ka3j Query : use flama_phc
20240702@164542.7950 5i9sfpnqf353vsrcsn05b4ka3j Query : select 1 valor from ts where ndos = 61
20240702@164542.7962 5i9sfpnqf353vsrcsn05b4ka3j Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@164542.7976 5i9sfpnqf353vsrcsn05b4ka3j Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240702@164542.7983 5i9sfpnqf353vsrcsn05b4ka3j Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@164542.7997 5i9sfpnqf353vsrcsn05b4ka3j Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240702@164542.8004 5i9sfpnqf353vsrcsn05b4ka3j Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@164542.8018 5i9sfpnqf353vsrcsn05b4ka3j Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240702@164542.8077 5i9sfpnqf353vsrcsn05b4ka3j 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
20240702@164542.8091 5i9sfpnqf353vsrcsn05b4ka3j Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240702@164542.8108 5i9sfpnqf353vsrcsn05b4ka3j Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240702@164542.8126 5i9sfpnqf353vsrcsn05b4ka3j Query : use flama_phc
20240702@164542.8129 5i9sfpnqf353vsrcsn05b4ka3j Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202133' and estab=00
20240702@164542.8258 5i9sfpnqf353vsrcsn05b4ka3j Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@164542.8272 5i9sfpnqf353vsrcsn05b4ka3j Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240702@164542.8278 5i9sfpnqf353vsrcsn05b4ka3j Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6684249923668420a6c6',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240702@164542.8291 5i9sfpnqf353vsrcsn05b4ka3j Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@164542.8304 5i9sfpnqf353vsrcsn05b4ka3j Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240702@164542.8310 5i9sfpnqf353vsrcsn05b4ka3j Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6684249923668420a6c6','--','bo',7.7717391304347826086 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240702@164542.8314 5i9sfpnqf353vsrcsn05b4ka3j Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@164542.8327 5i9sfpnqf353vsrcsn05b4ka3j Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240702@164542.8333 5i9sfpnqf353vsrcsn05b4ka3j 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 ('aut6684249923668420a6c6','guia r. fornecedor','2024-07-02',61,2401927,?,?,?,?,?,?,?,?,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')
20240702@164543.7445 5i9sfpnqf353vsrcsn05b4ka3j Query : use flama_phc
20240702@164543.7481 5i9sfpnqf353vsrcsn05b4ka3j Query : select st.usalote valor from st where st.ref = '324.1816.00.1'
20240702@164543.7501 5i9sfpnqf353vsrcsn05b4ka3j 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.1816.00.1'
20240702@164543.7662 5i9sfpnqf353vsrcsn05b4ka3j Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@164543.7676 5i9sfpnqf353vsrcsn05b4ka3j Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240702@164543.7687 5i9sfpnqf353vsrcsn05b4ka3j Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@164543.7699 5i9sfpnqf353vsrcsn05b4ka3j Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240702@164543.7705 5i9sfpnqf353vsrcsn05b4ka3j Query : select sestamp valor from se where ref ='324.1816.00.1' and lote = 'r2400200200a'
20240702@164543.7714 5i9sfpnqf353vsrcsn05b4ka3j Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@164543.7725 5i9sfpnqf353vsrcsn05b4ka3j Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240702@164543.7732 5i9sfpnqf353vsrcsn05b4ka3j Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@164543.7748 5i9sfpnqf353vsrcsn05b4ka3j Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240702@164543.7759 5i9sfpnqf353vsrcsn05b4ka3j Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6684285361668420a7bc',?,?,'20240702',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240702@164543.8937 5i9sfpnqf353vsrcsn05b4ka3j Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240702@164543.8950 5i9sfpnqf353vsrcsn05b4ka3j Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@164543.8964 5i9sfpnqf353vsrcsn05b4ka3j Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240702@164543.8970 5i9sfpnqf353vsrcsn05b4ka3j Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut6684295030668420a7da','aut6684249923668420a6c6',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 = 'aut6684249923668420a6c6'
20240702@164543.9150 5i9sfpnqf353vsrcsn05b4ka3j Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240702@164543.9166 5i9sfpnqf353vsrcsn05b4ka3j Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240702@164543.9177 5i9sfpnqf353vsrcsn05b4ka3j 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 'aut6684295030668420a7da',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 1404, 1404*.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 ,24.84,24.84*200.48,24.84,24.84*200.48 ,0,0,'un ','' ,bo.marcada,1 ,24.84*1404,24.84*1404*200.48 ,24.501000,24.501000*200.48 ,24.501000,24.501000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,24.84,24.84*200.48,24.84*1404,24.84*1404*200.48,'cps24022241049,208000002 ',193.05,193.05*1404,193.05,193.05*1404,?,?,?,4 from bo bo where bo.bostamp = 'aut6684249923668420a6c6'
20240702@164559.8355 5i9sfpnqf353vsrcsn05b4ka3j Query : use flama_phc
20240702@164559.8360 5i9sfpnqf353vsrcsn05b4ka3j Query : declare @bostamp varchar(25) = 'aut6684249923668420a6c6' ,@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 
20240702@164613.1070 5i9sfpnqf353vsrcsn05b4ka3j Query : use flama_phc
20240702@164613.5440 5i9sfpnqf353vsrcsn05b4ka3j Query : select 1 valor from bo where bo.bostamp = 'aut6684249923668420a6c6'
20240702@164613.7620 5i9sfpnqf353vsrcsn05b4ka3j 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) = 'aut6684249923668420a6c6' 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 
20240702@164613.5230 5i9sfpnqf353vsrcsn05b4ka3j Query : use flama_phc
20240702@164613.5268 5i9sfpnqf353vsrcsn05b4ka3j Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240702@164613.5353 5i9sfpnqf353vsrcsn05b4ka3j Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='731';
20240702@164613.5561 5i9sfpnqf353vsrcsn05b4ka3j Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='731';

20240702@222007.9730 tbjth13i8tgfolcd86389ptehu Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='732';
20240702@222007.9880 tbjth13i8tgfolcd86389ptehu Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='732';
20240702@222007.1000 tbjth13i8tgfolcd86389ptehu Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='732';
20240702@222007.1013 tbjth13i8tgfolcd86389ptehu Query : use flama_phc
20240702@222007.1016 tbjth13i8tgfolcd86389ptehu Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222007.1066 tbjth13i8tgfolcd86389ptehu Query : use flama_phc
20240702@222007.1070 tbjth13i8tgfolcd86389ptehu Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240702@222007.1144 tbjth13i8tgfolcd86389ptehu Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1685.00.1'
20240702@222007.1297 tbjth13i8tgfolcd86389ptehu Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404444 and bi.ref ='324.1685.00.1' and bi.lordem =1
20240702@222007.1687 tbjth13i8tgfolcd86389ptehu 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'
20240702@222007.1841 tbjth13i8tgfolcd86389ptehu Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404444 and bi.ref ='324.1684.00.1' and bi.lordem =2
20240702@222007.2169 tbjth13i8tgfolcd86389ptehu 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'
20240702@222007.2324 tbjth13i8tgfolcd86389ptehu Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404444 and bi.ref ='324.698.00.01' and bi.lordem =3
20240702@222007.2728 tbjth13i8tgfolcd86389ptehu Query : use flama_phc
20240702@222007.2732 tbjth13i8tgfolcd86389ptehu Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222007.2950 tbjth13i8tgfolcd86389ptehu Query : use flama_phc
20240702@222007.2954 tbjth13i8tgfolcd86389ptehu Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222007.3006 tbjth13i8tgfolcd86389ptehu Query : use flama_phc
20240702@222007.3009 tbjth13i8tgfolcd86389ptehu 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')
20240702@222007.4786 0d9vlkj0l689f62tecqlbu5snr Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222007.4800 0d9vlkj0l689f62tecqlbu5snr Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222007.4816 0d9vlkj0l689f62tecqlbu5snr Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='733';
20240702@222007.4860 0d9vlkj0l689f62tecqlbu5snr Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='733';
20240702@222007.4875 0d9vlkj0l689f62tecqlbu5snr Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='733';
20240702@222007.4887 0d9vlkj0l689f62tecqlbu5snr Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='733';
20240702@222007.4909 0d9vlkj0l689f62tecqlbu5snr Query : use flama_phc
20240702@222007.4913 0d9vlkj0l689f62tecqlbu5snr Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222007.5952 0d9vlkj0l689f62tecqlbu5snr Query : use flama_phc
20240702@222007.5956 0d9vlkj0l689f62tecqlbu5snr Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240702@222007.5985 0d9vlkj0l689f62tecqlbu5snr 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'
20240702@222007.6169 0d9vlkj0l689f62tecqlbu5snr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404445 and bi.ref ='324.1667.00.1' and bi.lordem =1
20240702@222007.6598 0d9vlkj0l689f62tecqlbu5snr Query : use flama_phc
20240702@222007.6601 0d9vlkj0l689f62tecqlbu5snr Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222007.6614 0d9vlkj0l689f62tecqlbu5snr Query : use flama_phc
20240702@222007.6617 0d9vlkj0l689f62tecqlbu5snr Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222007.6628 0d9vlkj0l689f62tecqlbu5snr Query : use flama_phc
20240702@222007.6633 0d9vlkj0l689f62tecqlbu5snr 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')
20240702@222007.7177 4bplqb9k0iv6lus3m0515e7h2e Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222007.7191 4bplqb9k0iv6lus3m0515e7h2e Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222007.7208 4bplqb9k0iv6lus3m0515e7h2e Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='734';
20240702@222007.7248 4bplqb9k0iv6lus3m0515e7h2e Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='734';
20240702@222007.7263 4bplqb9k0iv6lus3m0515e7h2e Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='734';
20240702@222007.7274 4bplqb9k0iv6lus3m0515e7h2e Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='734';
20240702@222007.7288 4bplqb9k0iv6lus3m0515e7h2e Query : use flama_phc
20240702@222007.7291 4bplqb9k0iv6lus3m0515e7h2e Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222007.7305 4bplqb9k0iv6lus3m0515e7h2e Query : use flama_phc
20240702@222007.7308 4bplqb9k0iv6lus3m0515e7h2e Query : select no, estab,szadrsdesc from szadrs where u_coddest=4804
20240702@222007.7404 4bplqb9k0iv6lus3m0515e7h2e 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'
20240702@222007.7593 4bplqb9k0iv6lus3m0515e7h2e Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404455 and bi.ref ='304.422.00.07' and bi.lordem =1
20240702@222007.7919 4bplqb9k0iv6lus3m0515e7h2e 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'
20240702@222007.8076 4bplqb9k0iv6lus3m0515e7h2e Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404455 and bi.ref ='324.4960.00.1' and bi.lordem =2
20240702@222007.8738 4bplqb9k0iv6lus3m0515e7h2e Query : use flama_phc
20240702@222007.8742 4bplqb9k0iv6lus3m0515e7h2e Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222007.8755 4bplqb9k0iv6lus3m0515e7h2e Query : use flama_phc
20240702@222007.8758 4bplqb9k0iv6lus3m0515e7h2e Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222007.8769 4bplqb9k0iv6lus3m0515e7h2e Query : use flama_phc
20240702@222007.8771 4bplqb9k0iv6lus3m0515e7h2e 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')
20240702@222007.9300 1bog64trqd5e14b7ge9ohhapml Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222007.9314 1bog64trqd5e14b7ge9ohhapml Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222007.9330 1bog64trqd5e14b7ge9ohhapml Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='735';
20240702@222007.9369 1bog64trqd5e14b7ge9ohhapml Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='735';
20240702@222007.9384 1bog64trqd5e14b7ge9ohhapml Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='735';
20240702@222007.9395 1bog64trqd5e14b7ge9ohhapml Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='735';
20240702@222007.9408 1bog64trqd5e14b7ge9ohhapml Query : use flama_phc
20240702@222007.9411 1bog64trqd5e14b7ge9ohhapml Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222007.9425 1bog64trqd5e14b7ge9ohhapml Query : use flama_phc
20240702@222007.9428 1bog64trqd5e14b7ge9ohhapml Query : select no, estab,szadrsdesc from szadrs where u_coddest=2448
20240702@222007.9497 1bog64trqd5e14b7ge9ohhapml 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'
20240702@222007.9651 1bog64trqd5e14b7ge9ohhapml Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404460 and bi.ref ='324.4970.00.1' and bi.lordem =1
20240702@222007.9984 1bog64trqd5e14b7ge9ohhapml Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4990.00.1'
20240702@222008.1580 1bog64trqd5e14b7ge9ohhapml Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404460 and bi.ref ='324.4990.00.1' and bi.lordem =2
20240702@222008.4860 1bog64trqd5e14b7ge9ohhapml Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.2028.00.2'
20240702@222008.6400 1bog64trqd5e14b7ge9ohhapml Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404460 and bi.ref ='324.2028.00.2' and bi.lordem =3
20240702@222008.9800 1bog64trqd5e14b7ge9ohhapml Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '325.551.00.15'
20240702@222008.1140 1bog64trqd5e14b7ge9ohhapml Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404460 and bi.ref ='325.551.00.15' and bi.lordem =4
20240702@222008.1506 1bog64trqd5e14b7ge9ohhapml Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.5342.00.1'
20240702@222008.1663 1bog64trqd5e14b7ge9ohhapml Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404460 and bi.ref ='324.5342.00.1' and bi.lordem =5
20240702@222008.1999 1bog64trqd5e14b7ge9ohhapml 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'
20240702@222008.2158 1bog64trqd5e14b7ge9ohhapml Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404460 and bi.ref ='324.5500.00.1' and bi.lordem =6
20240702@222008.2496 1bog64trqd5e14b7ge9ohhapml 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'
20240702@222008.2652 1bog64trqd5e14b7ge9ohhapml Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404460 and bi.ref ='324.4910.00.1' and bi.lordem =7
20240702@222008.3163 1bog64trqd5e14b7ge9ohhapml Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.642.00.01'
20240702@222008.3339 1bog64trqd5e14b7ge9ohhapml Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404460 and bi.ref ='324.642.00.01' and bi.lordem =8
20240702@222008.4860 1bog64trqd5e14b7ge9ohhapml Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.719.00.01'
20240702@222008.5022 1bog64trqd5e14b7ge9ohhapml Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404460 and bi.ref ='324.719.00.01' and bi.lordem =9
20240702@222008.7357 1bog64trqd5e14b7ge9ohhapml 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'
20240702@222008.7565 1bog64trqd5e14b7ge9ohhapml Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404460 and bi.ref ='324.1406.00.1' and bi.lordem =10
20240702@222008.7928 1bog64trqd5e14b7ge9ohhapml Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.5501.00.1'
20240702@222008.8090 1bog64trqd5e14b7ge9ohhapml Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404460 and bi.ref ='324.5501.00.1' and bi.lordem =11
20240702@222008.8431 1bog64trqd5e14b7ge9ohhapml 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'
20240702@222008.8585 1bog64trqd5e14b7ge9ohhapml Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404460 and bi.ref ='324.2066.00.1' and bi.lordem =12
20240702@222008.8911 1bog64trqd5e14b7ge9ohhapml Query : use flama_phc
20240702@222008.8914 1bog64trqd5e14b7ge9ohhapml Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222008.8926 1bog64trqd5e14b7ge9ohhapml Query : use flama_phc
20240702@222008.8929 1bog64trqd5e14b7ge9ohhapml Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222008.8939 1bog64trqd5e14b7ge9ohhapml Query : use flama_phc
20240702@222008.8942 1bog64trqd5e14b7ge9ohhapml 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')
20240702@222008.9485 qikif7pag7hlg0cnoeei1sj42q Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222008.9498 qikif7pag7hlg0cnoeei1sj42q Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222008.9514 qikif7pag7hlg0cnoeei1sj42q Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='736';
20240702@222008.9553 qikif7pag7hlg0cnoeei1sj42q Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='736';
20240702@222008.9569 qikif7pag7hlg0cnoeei1sj42q Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='736';
20240702@222008.9581 qikif7pag7hlg0cnoeei1sj42q Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='736';
20240702@222008.9594 qikif7pag7hlg0cnoeei1sj42q Query : use flama_phc
20240702@222008.9597 qikif7pag7hlg0cnoeei1sj42q Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222008.9611 qikif7pag7hlg0cnoeei1sj42q Query : use flama_phc
20240702@222008.9614 qikif7pag7hlg0cnoeei1sj42q Query : select no, estab,szadrsdesc from szadrs where u_coddest=729
20240702@222008.9688 qikif7pag7hlg0cnoeei1sj42q Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '327.8261.00.1'
20240702@222008.9849 qikif7pag7hlg0cnoeei1sj42q Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404468 and bi.ref ='327.8261.00.1' and bi.lordem =1
20240702@222009.5090 qikif7pag7hlg0cnoeei1sj42q Query : use flama_phc
20240702@222009.5120 qikif7pag7hlg0cnoeei1sj42q Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222009.5650 qikif7pag7hlg0cnoeei1sj42q Query : use flama_phc
20240702@222009.5870 qikif7pag7hlg0cnoeei1sj42q Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222009.5980 qikif7pag7hlg0cnoeei1sj42q Query : use flama_phc
20240702@222009.6000 qikif7pag7hlg0cnoeei1sj42q 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')
20240702@222009.1406 89is3v7v0404k1l8u22binbtfl Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222009.1418 89is3v7v0404k1l8u22binbtfl Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222009.1434 89is3v7v0404k1l8u22binbtfl Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='737';
20240702@222009.1473 89is3v7v0404k1l8u22binbtfl Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='737';
20240702@222009.1487 89is3v7v0404k1l8u22binbtfl Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='737';
20240702@222009.1498 89is3v7v0404k1l8u22binbtfl Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='737';
20240702@222009.1510 89is3v7v0404k1l8u22binbtfl Query : use flama_phc
20240702@222009.1513 89is3v7v0404k1l8u22binbtfl Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222009.1527 89is3v7v0404k1l8u22binbtfl Query : use flama_phc
20240702@222009.1530 89is3v7v0404k1l8u22binbtfl Query : select no, estab,szadrsdesc from szadrs where u_coddest=6917
20240702@222009.1614 89is3v7v0404k1l8u22binbtfl 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'
20240702@222009.1772 89is3v7v0404k1l8u22binbtfl Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404469 and bi.ref ='324.600.94.01' and bi.lordem =1
20240702@222009.2101 89is3v7v0404k1l8u22binbtfl 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'
20240702@222009.2112 89is3v7v0404k1l8u22binbtfl Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404469 and bi.ref ='324.600.94.01' and bi.lordem =1
20240702@222009.2119 89is3v7v0404k1l8u22binbtfl 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'
20240702@222009.2270 89is3v7v0404k1l8u22binbtfl Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404469 and bi.ref ='324.2000.94.1' and bi.lordem =2
20240702@222009.2595 89is3v7v0404k1l8u22binbtfl 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'
20240702@222009.2746 89is3v7v0404k1l8u22binbtfl Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404469 and bi.ref ='324.900.94.01' and bi.lordem =3
20240702@222009.3076 89is3v7v0404k1l8u22binbtfl 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'
20240702@222009.3237 89is3v7v0404k1l8u22binbtfl Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404469 and bi.ref ='324.700.94.01' and bi.lordem =4
20240702@222009.3570 89is3v7v0404k1l8u22binbtfl 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'
20240702@222009.3582 89is3v7v0404k1l8u22binbtfl Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404469 and bi.ref ='324.700.94.01' and bi.lordem =4
20240702@222009.3589 89is3v7v0404k1l8u22binbtfl 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'
20240702@222009.3830 89is3v7v0404k1l8u22binbtfl Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404469 and bi.ref ='324.2200.94.1' and bi.lordem =5
20240702@222009.4391 89is3v7v0404k1l8u22binbtfl Query : use flama_phc
20240702@222009.4420 89is3v7v0404k1l8u22binbtfl Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222009.4568 89is3v7v0404k1l8u22binbtfl Query : use flama_phc
20240702@222009.4572 89is3v7v0404k1l8u22binbtfl Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222009.4583 89is3v7v0404k1l8u22binbtfl Query : use flama_phc
20240702@222009.4586 89is3v7v0404k1l8u22binbtfl 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')
20240702@222009.5490 irs7tllltvc1hsornbpa4io032 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222009.5503 irs7tllltvc1hsornbpa4io032 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222009.5521 irs7tllltvc1hsornbpa4io032 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='738';
20240702@222009.5783 irs7tllltvc1hsornbpa4io032 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='738';
20240702@222009.5802 irs7tllltvc1hsornbpa4io032 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='738';
20240702@222009.5822 irs7tllltvc1hsornbpa4io032 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='738';
20240702@222009.5839 irs7tllltvc1hsornbpa4io032 Query : use flama_phc
20240702@222009.5842 irs7tllltvc1hsornbpa4io032 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222009.5859 irs7tllltvc1hsornbpa4io032 Query : use flama_phc
20240702@222009.5862 irs7tllltvc1hsornbpa4io032 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4743
20240702@222009.5969 irs7tllltvc1hsornbpa4io032 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.2187.00.1'
20240702@222009.6220 irs7tllltvc1hsornbpa4io032 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404472 and bi.ref ='304.2187.00.1' and bi.lordem =1
20240702@222009.6623 irs7tllltvc1hsornbpa4io032 Query : use flama_phc
20240702@222009.6627 irs7tllltvc1hsornbpa4io032 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222009.6645 irs7tllltvc1hsornbpa4io032 Query : use flama_phc
20240702@222009.6648 irs7tllltvc1hsornbpa4io032 Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222009.6661 irs7tllltvc1hsornbpa4io032 Query : use flama_phc
20240702@222009.6664 irs7tllltvc1hsornbpa4io032 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')
20240702@222009.7136 7fsro36nhv2j3cpadal764fh9r Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222009.7150 7fsro36nhv2j3cpadal764fh9r Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222009.7169 7fsro36nhv2j3cpadal764fh9r Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='739';
20240702@222009.7210 7fsro36nhv2j3cpadal764fh9r Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='739';
20240702@222009.7226 7fsro36nhv2j3cpadal764fh9r Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='739';
20240702@222009.7238 7fsro36nhv2j3cpadal764fh9r Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='739';
20240702@222009.7251 7fsro36nhv2j3cpadal764fh9r Query : use flama_phc
20240702@222009.7254 7fsro36nhv2j3cpadal764fh9r Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222009.7269 7fsro36nhv2j3cpadal764fh9r Query : use flama_phc
20240702@222009.7272 7fsro36nhv2j3cpadal764fh9r Query : select no, estab,szadrsdesc from szadrs where u_coddest=4743
20240702@222009.7301 7fsro36nhv2j3cpadal764fh9r Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240702@222009.7537 7fsro36nhv2j3cpadal764fh9r Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404474 and bi.ref ='324.645.00.01' and bi.lordem =1
20240702@222009.7873 7fsro36nhv2j3cpadal764fh9r Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240702@222009.7886 7fsro36nhv2j3cpadal764fh9r Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404474 and bi.ref ='324.645.00.01' and bi.lordem =1
20240702@222009.7893 7fsro36nhv2j3cpadal764fh9r Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.645.00.01'
20240702@222009.7903 7fsro36nhv2j3cpadal764fh9r Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404474 and bi.ref ='324.645.00.01' and bi.lordem =1
20240702@222009.7910 7fsro36nhv2j3cpadal764fh9r Query : use flama_phc
20240702@222009.7913 7fsro36nhv2j3cpadal764fh9r Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222009.7925 7fsro36nhv2j3cpadal764fh9r Query : use flama_phc
20240702@222009.7928 7fsro36nhv2j3cpadal764fh9r Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222009.7939 7fsro36nhv2j3cpadal764fh9r Query : use flama_phc
20240702@222009.7942 7fsro36nhv2j3cpadal764fh9r 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')
20240702@222009.8582 47oj5bh6b1qf1q4mk8ecgpjqg7 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222009.8596 47oj5bh6b1qf1q4mk8ecgpjqg7 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222009.8770 47oj5bh6b1qf1q4mk8ecgpjqg7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='740';
20240702@222009.8968 47oj5bh6b1qf1q4mk8ecgpjqg7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='740';
20240702@222009.8984 47oj5bh6b1qf1q4mk8ecgpjqg7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='740';
20240702@222009.8997 47oj5bh6b1qf1q4mk8ecgpjqg7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='740';
20240702@222009.9010 47oj5bh6b1qf1q4mk8ecgpjqg7 Query : use flama_phc
20240702@222009.9013 47oj5bh6b1qf1q4mk8ecgpjqg7 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222009.9028 47oj5bh6b1qf1q4mk8ecgpjqg7 Query : use flama_phc
20240702@222009.9031 47oj5bh6b1qf1q4mk8ecgpjqg7 Query : select no, estab,szadrsdesc from szadrs where u_coddest=3145
20240702@222009.9103 47oj5bh6b1qf1q4mk8ecgpjqg7 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'
20240702@222009.9262 47oj5bh6b1qf1q4mk8ecgpjqg7 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404478 and bi.ref ='324.5540.00.1' and bi.lordem =1
20240702@222010.7440 47oj5bh6b1qf1q4mk8ecgpjqg7 Query : use flama_phc
20240702@222010.7510 47oj5bh6b1qf1q4mk8ecgpjqg7 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222010.7700 47oj5bh6b1qf1q4mk8ecgpjqg7 Query : use flama_phc
20240702@222010.7730 47oj5bh6b1qf1q4mk8ecgpjqg7 Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222010.7830 47oj5bh6b1qf1q4mk8ecgpjqg7 Query : use flama_phc
20240702@222010.7860 47oj5bh6b1qf1q4mk8ecgpjqg7 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')
20240702@222010.1488 t0jjt6eehjslblepcpjfqavup9 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222010.1502 t0jjt6eehjslblepcpjfqavup9 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222010.1519 t0jjt6eehjslblepcpjfqavup9 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='741';
20240702@222010.1560 t0jjt6eehjslblepcpjfqavup9 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='741';
20240702@222010.1575 t0jjt6eehjslblepcpjfqavup9 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='741';
20240702@222010.1587 t0jjt6eehjslblepcpjfqavup9 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='741';
20240702@222010.1600 t0jjt6eehjslblepcpjfqavup9 Query : use flama_phc
20240702@222010.1603 t0jjt6eehjslblepcpjfqavup9 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222010.1618 t0jjt6eehjslblepcpjfqavup9 Query : use flama_phc
20240702@222010.1621 t0jjt6eehjslblepcpjfqavup9 Query : select no, estab,szadrsdesc from szadrs where u_coddest=7737
20240702@222010.1698 t0jjt6eehjslblepcpjfqavup9 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'
20240702@222010.1710 t0jjt6eehjslblepcpjfqavup9 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404479 and bi.ref ='324.5540.00.1' and bi.lordem =1
20240702@222010.2093 t0jjt6eehjslblepcpjfqavup9 Query : use flama_phc
20240702@222010.2097 t0jjt6eehjslblepcpjfqavup9 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222010.2110 t0jjt6eehjslblepcpjfqavup9 Query : use flama_phc
20240702@222010.2112 t0jjt6eehjslblepcpjfqavup9 Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222010.2184 t0jjt6eehjslblepcpjfqavup9 Query : use flama_phc
20240702@222010.2192 t0jjt6eehjslblepcpjfqavup9 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')
20240702@222010.2993 c33a2c6467j5rvm35i40ur7kla Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222010.3009 c33a2c6467j5rvm35i40ur7kla Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222010.3144 c33a2c6467j5rvm35i40ur7kla Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='742';
20240702@222010.3203 c33a2c6467j5rvm35i40ur7kla Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='742';
20240702@222010.3222 c33a2c6467j5rvm35i40ur7kla Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='742';
20240702@222010.3236 c33a2c6467j5rvm35i40ur7kla Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='742';
20240702@222010.3249 c33a2c6467j5rvm35i40ur7kla Query : use flama_phc
20240702@222010.3253 c33a2c6467j5rvm35i40ur7kla Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222010.3270 c33a2c6467j5rvm35i40ur7kla Query : use flama_phc
20240702@222010.3273 c33a2c6467j5rvm35i40ur7kla Query : select no, estab,szadrsdesc from szadrs where u_coddest=1161
20240702@222010.3351 c33a2c6467j5rvm35i40ur7kla 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'
20240702@222010.3363 c33a2c6467j5rvm35i40ur7kla Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404480 and bi.ref ='324.5540.00.1' and bi.lordem =1
20240702@222010.3801 c33a2c6467j5rvm35i40ur7kla Query : use flama_phc
20240702@222010.3804 c33a2c6467j5rvm35i40ur7kla Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222010.3820 c33a2c6467j5rvm35i40ur7kla Query : use flama_phc
20240702@222010.3823 c33a2c6467j5rvm35i40ur7kla Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222010.3835 c33a2c6467j5rvm35i40ur7kla Query : use flama_phc
20240702@222010.3838 c33a2c6467j5rvm35i40ur7kla 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')
20240702@222010.4374 6mudt7cqmuojood05dbjtjv3gn Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222010.4390 6mudt7cqmuojood05dbjtjv3gn Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222010.4410 6mudt7cqmuojood05dbjtjv3gn Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='743';
20240702@222010.4463 6mudt7cqmuojood05dbjtjv3gn Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='743';
20240702@222010.4484 6mudt7cqmuojood05dbjtjv3gn Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='743';
20240702@222010.4498 6mudt7cqmuojood05dbjtjv3gn Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='743';
20240702@222010.4514 6mudt7cqmuojood05dbjtjv3gn Query : use flama_phc
20240702@222010.4517 6mudt7cqmuojood05dbjtjv3gn Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222010.4534 6mudt7cqmuojood05dbjtjv3gn Query : use flama_phc
20240702@222010.4538 6mudt7cqmuojood05dbjtjv3gn Query : select no, estab,szadrsdesc from szadrs where u_coddest=233
20240702@222010.4617 6mudt7cqmuojood05dbjtjv3gn 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'
20240702@222010.4629 6mudt7cqmuojood05dbjtjv3gn Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404481 and bi.ref ='324.5540.00.1' and bi.lordem =1
20240702@222010.5970 6mudt7cqmuojood05dbjtjv3gn Query : use flama_phc
20240702@222010.5975 6mudt7cqmuojood05dbjtjv3gn Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222010.5991 6mudt7cqmuojood05dbjtjv3gn Query : use flama_phc
20240702@222010.5995 6mudt7cqmuojood05dbjtjv3gn Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222010.6033 6mudt7cqmuojood05dbjtjv3gn Query : use flama_phc
20240702@222010.6037 6mudt7cqmuojood05dbjtjv3gn 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')
20240702@222010.6570 2d874732b235fv2nu949n1i8hs Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222010.6587 2d874732b235fv2nu949n1i8hs Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222010.6604 2d874732b235fv2nu949n1i8hs Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='744';
20240702@222010.6649 2d874732b235fv2nu949n1i8hs Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='744';
20240702@222010.6665 2d874732b235fv2nu949n1i8hs Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='744';
20240702@222010.6681 2d874732b235fv2nu949n1i8hs Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='744';
20240702@222010.6695 2d874732b235fv2nu949n1i8hs Query : use flama_phc
20240702@222010.6698 2d874732b235fv2nu949n1i8hs Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222010.6716 2d874732b235fv2nu949n1i8hs Query : use flama_phc
20240702@222010.6719 2d874732b235fv2nu949n1i8hs Query : select no, estab,szadrsdesc from szadrs where u_coddest=3080
20240702@222010.6796 2d874732b235fv2nu949n1i8hs 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'
20240702@222010.6807 2d874732b235fv2nu949n1i8hs Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404482 and bi.ref ='324.5540.00.1' and bi.lordem =1
20240702@222010.7152 2d874732b235fv2nu949n1i8hs Query : use flama_phc
20240702@222010.7155 2d874732b235fv2nu949n1i8hs Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222010.7168 2d874732b235fv2nu949n1i8hs Query : use flama_phc
20240702@222010.7171 2d874732b235fv2nu949n1i8hs Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222010.7183 2d874732b235fv2nu949n1i8hs Query : use flama_phc
20240702@222010.7185 2d874732b235fv2nu949n1i8hs 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')
20240702@222010.7694 6kts5mohgfksq26i71pvfnjf3l Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222010.7708 6kts5mohgfksq26i71pvfnjf3l Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222010.7725 6kts5mohgfksq26i71pvfnjf3l Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='745';
20240702@222010.7765 6kts5mohgfksq26i71pvfnjf3l Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='745';
20240702@222010.7782 6kts5mohgfksq26i71pvfnjf3l Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='745';
20240702@222010.7795 6kts5mohgfksq26i71pvfnjf3l Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='745';
20240702@222010.7809 6kts5mohgfksq26i71pvfnjf3l Query : use flama_phc
20240702@222010.7811 6kts5mohgfksq26i71pvfnjf3l Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222010.7827 6kts5mohgfksq26i71pvfnjf3l Query : use flama_phc
20240702@222010.7830 6kts5mohgfksq26i71pvfnjf3l Query : select no, estab,szadrsdesc from szadrs where u_coddest=1453
20240702@222010.7910 6kts5mohgfksq26i71pvfnjf3l 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'
20240702@222010.7921 6kts5mohgfksq26i71pvfnjf3l Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404483 and bi.ref ='324.5540.00.1' and bi.lordem =1
20240702@222010.8252 6kts5mohgfksq26i71pvfnjf3l Query : use flama_phc
20240702@222010.8255 6kts5mohgfksq26i71pvfnjf3l Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222010.8268 6kts5mohgfksq26i71pvfnjf3l Query : use flama_phc
20240702@222010.8272 6kts5mohgfksq26i71pvfnjf3l Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222010.8283 6kts5mohgfksq26i71pvfnjf3l Query : use flama_phc
20240702@222010.8286 6kts5mohgfksq26i71pvfnjf3l 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')
20240702@222010.8857 dqku1hnb3907a9ujmsnu0bfjf1 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222010.8871 dqku1hnb3907a9ujmsnu0bfjf1 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222010.8890 dqku1hnb3907a9ujmsnu0bfjf1 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='746';
20240702@222010.8931 dqku1hnb3907a9ujmsnu0bfjf1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='746';
20240702@222010.8946 dqku1hnb3907a9ujmsnu0bfjf1 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='746';
20240702@222010.8960 dqku1hnb3907a9ujmsnu0bfjf1 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='746';
20240702@222010.8975 dqku1hnb3907a9ujmsnu0bfjf1 Query : use flama_phc
20240702@222010.8978 dqku1hnb3907a9ujmsnu0bfjf1 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222010.8994 dqku1hnb3907a9ujmsnu0bfjf1 Query : use flama_phc
20240702@222010.8997 dqku1hnb3907a9ujmsnu0bfjf1 Query : select no, estab,szadrsdesc from szadrs where u_coddest=829
20240702@222010.9071 dqku1hnb3907a9ujmsnu0bfjf1 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240702@222010.9235 dqku1hnb3907a9ujmsnu0bfjf1 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404484 and bi.ref ='324.1816.00.1' and bi.lordem =1
20240702@222010.9561 dqku1hnb3907a9ujmsnu0bfjf1 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1824.00.1'
20240702@222011.7490 dqku1hnb3907a9ujmsnu0bfjf1 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404484 and bi.ref ='324.1824.00.1' and bi.lordem =2
20240702@222011.1158 dqku1hnb3907a9ujmsnu0bfjf1 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'
20240702@222011.1317 dqku1hnb3907a9ujmsnu0bfjf1 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404484 and bi.ref ='324.1834.00.1' and bi.lordem =3
20240702@222011.1663 dqku1hnb3907a9ujmsnu0bfjf1 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1803.00.1'
20240702@222011.1821 dqku1hnb3907a9ujmsnu0bfjf1 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404484 and bi.ref ='324.1803.00.1' and bi.lordem =4
20240702@222011.2196 dqku1hnb3907a9ujmsnu0bfjf1 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'
20240702@222011.2692 dqku1hnb3907a9ujmsnu0bfjf1 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404484 and bi.ref ='324.1831.00.2' and bi.lordem =5
20240702@222011.3044 dqku1hnb3907a9ujmsnu0bfjf1 Query : use flama_phc
20240702@222011.3048 dqku1hnb3907a9ujmsnu0bfjf1 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222011.3062 dqku1hnb3907a9ujmsnu0bfjf1 Query : use flama_phc
20240702@222011.3065 dqku1hnb3907a9ujmsnu0bfjf1 Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222011.3078 dqku1hnb3907a9ujmsnu0bfjf1 Query : use flama_phc
20240702@222011.3081 dqku1hnb3907a9ujmsnu0bfjf1 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')
20240702@222011.3629 9kjmrmgcnkm0s4up1bd8ehdhg3 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222011.3647 9kjmrmgcnkm0s4up1bd8ehdhg3 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222011.4832 9kjmrmgcnkm0s4up1bd8ehdhg3 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='747';
20240702@222011.4880 9kjmrmgcnkm0s4up1bd8ehdhg3 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='747';
20240702@222011.4897 9kjmrmgcnkm0s4up1bd8ehdhg3 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='747';
20240702@222011.4910 9kjmrmgcnkm0s4up1bd8ehdhg3 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='747';
20240702@222011.4931 9kjmrmgcnkm0s4up1bd8ehdhg3 Query : use flama_phc
20240702@222011.4934 9kjmrmgcnkm0s4up1bd8ehdhg3 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222011.4950 9kjmrmgcnkm0s4up1bd8ehdhg3 Query : use flama_phc
20240702@222011.4953 9kjmrmgcnkm0s4up1bd8ehdhg3 Query : select no, estab,szadrsdesc from szadrs where u_coddest=4740
20240702@222011.4982 9kjmrmgcnkm0s4up1bd8ehdhg3 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1705.00.1'
20240702@222011.5148 9kjmrmgcnkm0s4up1bd8ehdhg3 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404485 and bi.ref ='324.1705.00.1' and bi.lordem =1
20240702@222011.5496 9kjmrmgcnkm0s4up1bd8ehdhg3 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1705.00.1'
20240702@222011.5509 9kjmrmgcnkm0s4up1bd8ehdhg3 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404485 and bi.ref ='324.1705.00.1' and bi.lordem =1
20240702@222011.5517 9kjmrmgcnkm0s4up1bd8ehdhg3 Query : use flama_phc
20240702@222011.5520 9kjmrmgcnkm0s4up1bd8ehdhg3 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222011.5533 9kjmrmgcnkm0s4up1bd8ehdhg3 Query : use flama_phc
20240702@222011.5535 9kjmrmgcnkm0s4up1bd8ehdhg3 Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222011.5548 9kjmrmgcnkm0s4up1bd8ehdhg3 Query : use flama_phc
20240702@222011.5550 9kjmrmgcnkm0s4up1bd8ehdhg3 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')
20240702@222011.6058 dvk1d6vt2scs5hudrt442llnsr Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222011.6073 dvk1d6vt2scs5hudrt442llnsr Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222011.6091 dvk1d6vt2scs5hudrt442llnsr Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='748';
20240702@222011.6135 dvk1d6vt2scs5hudrt442llnsr Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='748';
20240702@222011.6152 dvk1d6vt2scs5hudrt442llnsr Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='748';
20240702@222011.6167 dvk1d6vt2scs5hudrt442llnsr Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='748';
20240702@222011.6181 dvk1d6vt2scs5hudrt442llnsr Query : use flama_phc
20240702@222011.6185 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222011.6202 dvk1d6vt2scs5hudrt442llnsr Query : use flama_phc
20240702@222011.6205 dvk1d6vt2scs5hudrt442llnsr Query : select no, estab,szadrsdesc from szadrs where u_coddest=4743
20240702@222011.6236 dvk1d6vt2scs5hudrt442llnsr 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'
20240702@222011.6269 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404486 and bi.ref ='324.1831.00.2' and bi.lordem =1
20240702@222011.8114 dvk1d6vt2scs5hudrt442llnsr 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'
20240702@222011.8560 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404486 and bi.ref ='324.948.00.01' and bi.lordem =2
20240702@222011.8980 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1705.00.1'
20240702@222011.8992 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404486 and bi.ref ='324.1705.00.1' and bi.lordem =3
20240702@222011.9347 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1705.00.1'
20240702@222011.9359 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404486 and bi.ref ='324.1705.00.1' and bi.lordem =3
20240702@222011.9367 dvk1d6vt2scs5hudrt442llnsr 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'
20240702@222011.9538 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404486 and bi.ref ='304.4320.00.1' and bi.lordem =4
20240702@222011.9939 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.421.00.04'
20240702@222012.1090 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404486 and bi.ref ='304.421.00.04' and bi.lordem =5
20240702@222012.4700 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.421.00.04'
20240702@222012.4830 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404486 and bi.ref ='304.421.00.04' and bi.lordem =6
20240702@222012.8430 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.421.00.04'
20240702@222012.8550 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404486 and bi.ref ='304.421.00.04' and bi.lordem =6
20240702@222012.8630 dvk1d6vt2scs5hudrt442llnsr 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'
20240702@222012.8760 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404486 and bi.ref ='304.422.00.07' and bi.lordem =7
20240702@222012.1266 dvk1d6vt2scs5hudrt442llnsr 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'
20240702@222012.1505 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404486 and bi.ref ='324.4840.00.1' and bi.lordem =8
20240702@222012.1854 dvk1d6vt2scs5hudrt442llnsr 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'
20240702@222012.1868 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404486 and bi.ref ='324.5500.00.1' and bi.lordem =9
20240702@222012.2215 dvk1d6vt2scs5hudrt442llnsr 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'
20240702@222012.2227 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404486 and bi.ref ='324.5500.00.1' and bi.lordem =9
20240702@222012.2235 dvk1d6vt2scs5hudrt442llnsr 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'
20240702@222012.2246 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404486 and bi.ref ='324.1667.00.1' and bi.lordem =10
20240702@222012.2600 dvk1d6vt2scs5hudrt442llnsr 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'
20240702@222012.3872 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404486 and bi.ref ='324.1690.00.1' and bi.lordem =11
20240702@222012.4225 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.681.00.01'
20240702@222012.4589 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404486 and bi.ref ='324.681.00.01' and bi.lordem =12
20240702@222012.5264 dvk1d6vt2scs5hudrt442llnsr Query : use flama_phc
20240702@222012.5402 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222012.5481 dvk1d6vt2scs5hudrt442llnsr Query : use flama_phc
20240702@222012.5485 dvk1d6vt2scs5hudrt442llnsr Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222012.5496 dvk1d6vt2scs5hudrt442llnsr Query : use flama_phc
20240702@222012.5498 dvk1d6vt2scs5hudrt442llnsr 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')
20240702@222012.6043 45pv7i6u5blgvsvtklsc59llbv Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222012.6057 45pv7i6u5blgvsvtklsc59llbv Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222012.6076 45pv7i6u5blgvsvtklsc59llbv Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='749';
20240702@222012.6120 45pv7i6u5blgvsvtklsc59llbv Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='749';
20240702@222012.6143 45pv7i6u5blgvsvtklsc59llbv Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='749';
20240702@222012.6156 45pv7i6u5blgvsvtklsc59llbv Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='749';
20240702@222012.6172 45pv7i6u5blgvsvtklsc59llbv Query : use flama_phc
20240702@222012.6176 45pv7i6u5blgvsvtklsc59llbv Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222012.6194 45pv7i6u5blgvsvtklsc59llbv Query : use flama_phc
20240702@222012.6197 45pv7i6u5blgvsvtklsc59llbv Query : select no, estab,szadrsdesc from szadrs where u_coddest=201
20240702@222012.6271 45pv7i6u5blgvsvtklsc59llbv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1705.00.1'
20240702@222012.6284 45pv7i6u5blgvsvtklsc59llbv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404487 and bi.ref ='324.1705.00.1' and bi.lordem =1
20240702@222012.6656 45pv7i6u5blgvsvtklsc59llbv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1705.00.1'
20240702@222012.6669 45pv7i6u5blgvsvtklsc59llbv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404487 and bi.ref ='324.1705.00.1' and bi.lordem =1
20240702@222012.6677 45pv7i6u5blgvsvtklsc59llbv Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4421.00.1'
20240702@222012.6834 45pv7i6u5blgvsvtklsc59llbv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404487 and bi.ref ='324.4421.00.1' and bi.lordem =2
20240702@222012.7158 45pv7i6u5blgvsvtklsc59llbv 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'
20240702@222012.7315 45pv7i6u5blgvsvtklsc59llbv Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404487 and bi.ref ='324.2907.00.1' and bi.lordem =3
20240702@222012.7663 45pv7i6u5blgvsvtklsc59llbv Query : use flama_phc
20240702@222012.7666 45pv7i6u5blgvsvtklsc59llbv Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222012.7681 45pv7i6u5blgvsvtklsc59llbv Query : use flama_phc
20240702@222012.7684 45pv7i6u5blgvsvtklsc59llbv Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222012.7695 45pv7i6u5blgvsvtklsc59llbv Query : use flama_phc
20240702@222012.7698 45pv7i6u5blgvsvtklsc59llbv 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')
20240702@222012.8211 pokrv28o6ml4umkgdbnnhhvp4p Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222012.8233 pokrv28o6ml4umkgdbnnhhvp4p Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222012.8254 pokrv28o6ml4umkgdbnnhhvp4p Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='750';
20240702@222012.8308 pokrv28o6ml4umkgdbnnhhvp4p Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='750';
20240702@222012.8326 pokrv28o6ml4umkgdbnnhhvp4p Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='750';
20240702@222012.8341 pokrv28o6ml4umkgdbnnhhvp4p Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='750';
20240702@222012.8365 pokrv28o6ml4umkgdbnnhhvp4p Query : use flama_phc
20240702@222012.8368 pokrv28o6ml4umkgdbnnhhvp4p Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222012.8384 pokrv28o6ml4umkgdbnnhhvp4p Query : use flama_phc
20240702@222012.8387 pokrv28o6ml4umkgdbnnhhvp4p Query : select no, estab,szadrsdesc from szadrs where u_coddest=2064
20240702@222012.8461 pokrv28o6ml4umkgdbnnhhvp4p Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1705.00.1'
20240702@222012.8472 pokrv28o6ml4umkgdbnnhhvp4p Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404488 and bi.ref ='324.1705.00.1' and bi.lordem =1
20240702@222012.8808 pokrv28o6ml4umkgdbnnhhvp4p Query : use flama_phc
20240702@222012.8811 pokrv28o6ml4umkgdbnnhhvp4p Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222012.8825 pokrv28o6ml4umkgdbnnhhvp4p Query : use flama_phc
20240702@222012.8828 pokrv28o6ml4umkgdbnnhhvp4p Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222012.8838 pokrv28o6ml4umkgdbnnhhvp4p Query : use flama_phc
20240702@222012.8841 pokrv28o6ml4umkgdbnnhhvp4p 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')
20240702@222012.9545 slm8psd6mug71uqc970g5mu4o7 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222012.9724 slm8psd6mug71uqc970g5mu4o7 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222012.9756 slm8psd6mug71uqc970g5mu4o7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='751';
20240702@222013.2000 slm8psd6mug71uqc970g5mu4o7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='751';
20240702@222013.1670 slm8psd6mug71uqc970g5mu4o7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='751';
20240702@222013.1850 slm8psd6mug71uqc970g5mu4o7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='751';
20240702@222013.2050 slm8psd6mug71uqc970g5mu4o7 Query : use flama_phc
20240702@222013.2090 slm8psd6mug71uqc970g5mu4o7 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222013.2270 slm8psd6mug71uqc970g5mu4o7 Query : use flama_phc
20240702@222013.2300 slm8psd6mug71uqc970g5mu4o7 Query : select no, estab,szadrsdesc from szadrs where u_coddest=743
20240702@222013.3090 slm8psd6mug71uqc970g5mu4o7 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1705.00.1'
20240702@222013.3210 slm8psd6mug71uqc970g5mu4o7 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404489 and bi.ref ='324.1705.00.1' and bi.lordem =1
20240702@222013.6640 slm8psd6mug71uqc970g5mu4o7 Query : use flama_phc
20240702@222013.6680 slm8psd6mug71uqc970g5mu4o7 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222013.6830 slm8psd6mug71uqc970g5mu4o7 Query : use flama_phc
20240702@222013.6860 slm8psd6mug71uqc970g5mu4o7 Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222013.6980 slm8psd6mug71uqc970g5mu4o7 Query : use flama_phc
20240702@222013.7010 slm8psd6mug71uqc970g5mu4o7 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')
20240702@222013.1510 tnuov8uskj7ti9vjsmn5tepi2n Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222013.1531 tnuov8uskj7ti9vjsmn5tepi2n Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222013.1550 tnuov8uskj7ti9vjsmn5tepi2n Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='752';
20240702@222013.1591 tnuov8uskj7ti9vjsmn5tepi2n Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='752';
20240702@222013.1613 tnuov8uskj7ti9vjsmn5tepi2n Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='752';
20240702@222013.1627 tnuov8uskj7ti9vjsmn5tepi2n Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='752';
20240702@222013.1645 tnuov8uskj7ti9vjsmn5tepi2n Query : use flama_phc
20240702@222013.1649 tnuov8uskj7ti9vjsmn5tepi2n Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222013.1665 tnuov8uskj7ti9vjsmn5tepi2n Query : use flama_phc
20240702@222013.1669 tnuov8uskj7ti9vjsmn5tepi2n Query : select no, estab,szadrsdesc from szadrs where u_coddest=2307
20240702@222013.1746 tnuov8uskj7ti9vjsmn5tepi2n Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1705.00.1'
20240702@222013.1759 tnuov8uskj7ti9vjsmn5tepi2n Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404490 and bi.ref ='324.1705.00.1' and bi.lordem =1
20240702@222013.2102 tnuov8uskj7ti9vjsmn5tepi2n Query : use flama_phc
20240702@222013.2106 tnuov8uskj7ti9vjsmn5tepi2n Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222013.2120 tnuov8uskj7ti9vjsmn5tepi2n Query : use flama_phc
20240702@222013.2123 tnuov8uskj7ti9vjsmn5tepi2n Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222013.2136 tnuov8uskj7ti9vjsmn5tepi2n Query : use flama_phc
20240702@222013.2140 tnuov8uskj7ti9vjsmn5tepi2n 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')
20240702@222013.2715 m0nspii1jtnr1qn44oengp10fc Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222013.2735 m0nspii1jtnr1qn44oengp10fc Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222013.2754 m0nspii1jtnr1qn44oengp10fc Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='753';
20240702@222013.2799 m0nspii1jtnr1qn44oengp10fc Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='753';
20240702@222013.2816 m0nspii1jtnr1qn44oengp10fc Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='753';
20240702@222013.2831 m0nspii1jtnr1qn44oengp10fc Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='753';
20240702@222013.2850 m0nspii1jtnr1qn44oengp10fc Query : use flama_phc
20240702@222013.2854 m0nspii1jtnr1qn44oengp10fc Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222013.2872 m0nspii1jtnr1qn44oengp10fc Query : use flama_phc
20240702@222013.2875 m0nspii1jtnr1qn44oengp10fc Query : select no, estab,szadrsdesc from szadrs where u_coddest=410
20240702@222013.2954 m0nspii1jtnr1qn44oengp10fc Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1705.00.1'
20240702@222013.2966 m0nspii1jtnr1qn44oengp10fc Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404491 and bi.ref ='324.1705.00.1' and bi.lordem =1
20240702@222013.3573 m0nspii1jtnr1qn44oengp10fc Query : use flama_phc
20240702@222013.3577 m0nspii1jtnr1qn44oengp10fc Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222013.3591 m0nspii1jtnr1qn44oengp10fc Query : use flama_phc
20240702@222013.3595 m0nspii1jtnr1qn44oengp10fc Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222013.3606 m0nspii1jtnr1qn44oengp10fc Query : use flama_phc
20240702@222013.3609 m0nspii1jtnr1qn44oengp10fc 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')
20240702@222013.4402 q4mnt8v9qmh7gt04envsjvstk7 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222013.4514 q4mnt8v9qmh7gt04envsjvstk7 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222013.4624 q4mnt8v9qmh7gt04envsjvstk7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='754';
20240702@222013.4670 q4mnt8v9qmh7gt04envsjvstk7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='754';
20240702@222013.4687 q4mnt8v9qmh7gt04envsjvstk7 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='754';
20240702@222013.4700 q4mnt8v9qmh7gt04envsjvstk7 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='754';
20240702@222013.4713 q4mnt8v9qmh7gt04envsjvstk7 Query : use flama_phc
20240702@222013.4717 q4mnt8v9qmh7gt04envsjvstk7 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222013.4734 q4mnt8v9qmh7gt04envsjvstk7 Query : use flama_phc
20240702@222013.4737 q4mnt8v9qmh7gt04envsjvstk7 Query : select no, estab,szadrsdesc from szadrs where u_coddest=557
20240702@222013.4817 q4mnt8v9qmh7gt04envsjvstk7 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1705.00.1'
20240702@222013.4827 q4mnt8v9qmh7gt04envsjvstk7 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404492 and bi.ref ='324.1705.00.1' and bi.lordem =1
20240702@222013.5170 q4mnt8v9qmh7gt04envsjvstk7 Query : use flama_phc
20240702@222013.5176 q4mnt8v9qmh7gt04envsjvstk7 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222013.5206 q4mnt8v9qmh7gt04envsjvstk7 Query : use flama_phc
20240702@222013.5209 q4mnt8v9qmh7gt04envsjvstk7 Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222013.5219 q4mnt8v9qmh7gt04envsjvstk7 Query : use flama_phc
20240702@222013.5222 q4mnt8v9qmh7gt04envsjvstk7 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')
20240702@222013.5744 fm47k090tdo7n03bcaktrg6bbg Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222013.5759 fm47k090tdo7n03bcaktrg6bbg Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222013.5776 fm47k090tdo7n03bcaktrg6bbg Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='755';
20240702@222013.5823 fm47k090tdo7n03bcaktrg6bbg Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='755';
20240702@222013.5841 fm47k090tdo7n03bcaktrg6bbg Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='755';
20240702@222013.5854 fm47k090tdo7n03bcaktrg6bbg Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='755';
20240702@222013.5871 fm47k090tdo7n03bcaktrg6bbg Query : use flama_phc
20240702@222013.5874 fm47k090tdo7n03bcaktrg6bbg Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222013.5892 fm47k090tdo7n03bcaktrg6bbg Query : use flama_phc
20240702@222013.5896 fm47k090tdo7n03bcaktrg6bbg Query : select no, estab,szadrsdesc from szadrs where u_coddest=635
20240702@222013.5974 fm47k090tdo7n03bcaktrg6bbg Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1705.00.1'
20240702@222013.5987 fm47k090tdo7n03bcaktrg6bbg Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404493 and bi.ref ='324.1705.00.1' and bi.lordem =1
20240702@222013.6331 fm47k090tdo7n03bcaktrg6bbg 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'
20240702@222013.6343 fm47k090tdo7n03bcaktrg6bbg Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404493 and bi.ref ='324.4970.00.1' and bi.lordem =2
20240702@222013.6682 fm47k090tdo7n03bcaktrg6bbg Query : use flama_phc
20240702@222013.6686 fm47k090tdo7n03bcaktrg6bbg Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222013.6702 fm47k090tdo7n03bcaktrg6bbg Query : use flama_phc
20240702@222013.6705 fm47k090tdo7n03bcaktrg6bbg Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222013.6715 fm47k090tdo7n03bcaktrg6bbg Query : use flama_phc
20240702@222013.6718 fm47k090tdo7n03bcaktrg6bbg 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')
20240702@222013.7944 j84ouio2psk03mc9oivupp5msi Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222013.7958 j84ouio2psk03mc9oivupp5msi Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222013.7975 j84ouio2psk03mc9oivupp5msi Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='756';
20240702@222013.8014 j84ouio2psk03mc9oivupp5msi Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='756';
20240702@222013.8030 j84ouio2psk03mc9oivupp5msi Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='756';
20240702@222013.8042 j84ouio2psk03mc9oivupp5msi Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='756';
20240702@222013.8054 j84ouio2psk03mc9oivupp5msi Query : use flama_phc
20240702@222013.8057 j84ouio2psk03mc9oivupp5msi Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222013.8073 j84ouio2psk03mc9oivupp5msi Query : use flama_phc
20240702@222013.8077 j84ouio2psk03mc9oivupp5msi Query : select no, estab,szadrsdesc from szadrs where u_coddest=2945
20240702@222013.8282 j84ouio2psk03mc9oivupp5msi Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.681.00.01'
20240702@222013.8295 j84ouio2psk03mc9oivupp5msi Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404494 and bi.ref ='324.681.00.01' and bi.lordem =1
20240702@222013.8640 j84ouio2psk03mc9oivupp5msi Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1824.00.1'
20240702@222013.8655 j84ouio2psk03mc9oivupp5msi Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404494 and bi.ref ='324.1824.00.1' and bi.lordem =2
20240702@222013.9044 j84ouio2psk03mc9oivupp5msi Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1824.00.1'
20240702@222013.9198 j84ouio2psk03mc9oivupp5msi Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404494 and bi.ref ='324.1824.00.1' and bi.lordem =3
20240702@222013.9686 j84ouio2psk03mc9oivupp5msi Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1816.00.1'
20240702@222013.9699 j84ouio2psk03mc9oivupp5msi Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404494 and bi.ref ='324.1816.00.1' and bi.lordem =4
20240702@222014.3500 j84ouio2psk03mc9oivupp5msi Query : use flama_phc
20240702@222014.3800 j84ouio2psk03mc9oivupp5msi Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222014.5300 j84ouio2psk03mc9oivupp5msi Query : use flama_phc
20240702@222014.5600 j84ouio2psk03mc9oivupp5msi Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222014.6800 j84ouio2psk03mc9oivupp5msi Query : use flama_phc
20240702@222014.7100 j84ouio2psk03mc9oivupp5msi 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')
20240702@222014.5760 i8n80m8fs90hfht3ofthbh8h28 Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222014.5890 i8n80m8fs90hfht3ofthbh8h28 Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222014.6080 i8n80m8fs90hfht3ofthbh8h28 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='757';
20240702@222014.6490 i8n80m8fs90hfht3ofthbh8h28 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='757';
20240702@222014.6640 i8n80m8fs90hfht3ofthbh8h28 Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='757';
20240702@222014.6780 i8n80m8fs90hfht3ofthbh8h28 Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='757';
20240702@222014.6910 i8n80m8fs90hfht3ofthbh8h28 Query : use flama_phc
20240702@222014.6940 i8n80m8fs90hfht3ofthbh8h28 Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240702@222014.7110 i8n80m8fs90hfht3ofthbh8h28 Query : use flama_phc
20240702@222014.7140 i8n80m8fs90hfht3ofthbh8h28 Query : select no, estab,szadrsdesc from szadrs where u_coddest=3004
20240702@222014.7890 i8n80m8fs90hfht3ofthbh8h28 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'
20240702@222014.9760 i8n80m8fs90hfht3ofthbh8h28 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404495 and bi.ref ='324.1879.00.1' and bi.lordem =1
20240702@222014.1307 i8n80m8fs90hfht3ofthbh8h28 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'
20240702@222014.1319 i8n80m8fs90hfht3ofthbh8h28 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404495 and bi.ref ='324.1879.00.1' and bi.lordem =1
20240702@222014.1327 i8n80m8fs90hfht3ofthbh8h28 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.1837.00.1'
20240702@222014.1484 i8n80m8fs90hfht3ofthbh8h28 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404495 and bi.ref ='324.1837.00.1' and bi.lordem =2
20240702@222014.1814 i8n80m8fs90hfht3ofthbh8h28 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '324.4906.00.1'
20240702@222014.1977 i8n80m8fs90hfht3ofthbh8h28 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404495 and bi.ref ='324.4906.00.1' and bi.lordem =3
20240702@222014.2316 i8n80m8fs90hfht3ofthbh8h28 Query : select top 1 isnull(design,'') valor from st (nolock) left join stobs (nolock) on st.ref = stobs.ref where st.ref = '304.4211.00.1'
20240702@222014.2480 i8n80m8fs90hfht3ofthbh8h28 Query : select top 1 bistamp valor from bi inner join bo on bo.bostamp=bi.bostamp where bo.ndos =240 and bo.boano =2044 and bo.obrano = 2404495 and bi.ref ='304.4211.00.1' and bi.lordem =4
20240702@222014.2869 i8n80m8fs90hfht3ofthbh8h28 Query : use flama_phc
20240702@222014.2874 i8n80m8fs90hfht3ofthbh8h28 Query : select top 1 convert(date,fdata) valor from ft where ndoc = 39 and anulado= 0 and fno>0 order by fdata desc
20240702@222014.2892 i8n80m8fs90hfht3ofthbh8h28 Query : use flama_phc
20240702@222014.2895 i8n80m8fs90hfht3ofthbh8h28 Query : select top 1 1 valor from td where td.ndoc = 39
20240702@222014.2907 i8n80m8fs90hfht3ofthbh8h28 Query : use flama_phc
20240702@222014.2910 i8n80m8fs90hfht3ofthbh8h28 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')
20240702@222014.3450 f0hkig34s8pbr305jpdpqcm7cs Query : insert into uploadfiles ( name_original, name_new, option_type, relative_path, whencreated ) values ( ?, ?, ?, ?, getdate() )
20240702@222014.3464 f0hkig34s8pbr305jpdpqcm7cs Query : select uploadfile_id valor from uploadfiles where name_new = ? and option_type = ? 
20240702@222014.3483 f0hkig34s8pbr305jpdpqcm7cs Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='758';
20240702@222014.3527 f0hkig34s8pbr305jpdpqcm7cs Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='758';
20240702@222014.3544 f0hkig34s8pbr305jpdpqcm7cs Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='758';
20240702@222014.3557 f0hkig34s8pbr305jpdpqcm7cs Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='758';

20240703@080412.7590 vgme77citfq7foeoe910gjultf Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='759';
20240703@080412.7980 vgme77citfq7foeoe910gjultf Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='759';
20240703@080412.8140 vgme77citfq7foeoe910gjultf Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='759';
20240703@080412.8300 vgme77citfq7foeoe910gjultf Query : use flama_phc
20240703@080412.8330 vgme77citfq7foeoe910gjultf Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240703@080412.8920 vgme77citfq7foeoe910gjultf Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '328.9075.00.1'
20240703@080412.1065 vgme77citfq7foeoe910gjultf 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 = 2400212 and bi.ref ='328.9075.00.1' and bi.lordem =150000
20240703@080412.1871 vgme77citfq7foeoe910gjultf 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 = 'cps24022741246,565000006 ' 
20240703@080412.2764 vgme77citfq7foeoe910gjultf Query : use flama_phc
20240703@080412.2888 vgme77citfq7foeoe910gjultf Query : select top 1 1 valor from ts where ts.ndos = 61
20240703@080412.3099 vgme77citfq7foeoe910gjultf Query : use flama_phc
20240703@080412.3103 vgme77citfq7foeoe910gjultf 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')
20240703@080412.3158 vgme77citfq7foeoe910gjultf 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
20240703@080412.3911 vgme77citfq7foeoe910gjultf Query : use flama_phc
20240703@080412.3994 vgme77citfq7foeoe910gjultf Query : select top 1 ~inactivo valor from fl where no = '202530' and estab = 00 order by inactivo desc
20240703@080412.4823 vgme77citfq7foeoe910gjultf Query : use flama_phc
20240703@080412.4904 vgme77citfq7foeoe910gjultf Query : select 1 valor from ts where ndos = 61
20240703@080412.5781 vgme77citfq7foeoe910gjultf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@080412.6197 vgme77citfq7foeoe910gjultf Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240703@080412.6262 vgme77citfq7foeoe910gjultf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@080412.6278 vgme77citfq7foeoe910gjultf Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240703@080412.6287 vgme77citfq7foeoe910gjultf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@080412.6301 vgme77citfq7foeoe910gjultf Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240703@080412.6308 vgme77citfq7foeoe910gjultf 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
20240703@080412.6463 vgme77citfq7foeoe910gjultf Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240703@080412.6590 vgme77citfq7foeoe910gjultf Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240703@080412.6607 vgme77citfq7foeoe910gjultf Query : use flama_phc
20240703@080412.6610 vgme77citfq7foeoe910gjultf Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202530' and estab=00
20240703@080412.6706 vgme77citfq7foeoe910gjultf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@080412.6722 vgme77citfq7foeoe910gjultf Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240703@080412.6754 vgme77citfq7foeoe910gjultf Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6684f188386684f7eca1',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240703@080412.6827 vgme77citfq7foeoe910gjultf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@080412.6842 vgme77citfq7foeoe910gjultf Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240703@080412.6849 vgme77citfq7foeoe910gjultf Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6684f188386684f7eca1','--','bo',7.7918670747704416265 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240703@080412.7133 vgme77citfq7foeoe910gjultf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@080412.7161 vgme77citfq7foeoe910gjultf Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240703@080412.7172 vgme77citfq7foeoe910gjultf 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 ('aut6684f188386684f7eca1','guia r. fornecedor','2024-07-03',61,2401929,?,?,?,?,?,?,?,?,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')
20240703@080412.8119 vgme77citfq7foeoe910gjultf Query : use flama_phc
20240703@080412.8123 vgme77citfq7foeoe910gjultf Query : select st.usalote valor from st where st.ref = '328.9075.00.1'
20240703@080412.8281 vgme77citfq7foeoe910gjultf Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '328.9075.00.1'
20240703@080412.8454 vgme77citfq7foeoe910gjultf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@080412.8469 vgme77citfq7foeoe910gjultf Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240703@080412.8483 vgme77citfq7foeoe910gjultf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@080412.8496 vgme77citfq7foeoe910gjultf Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240703@080412.8504 vgme77citfq7foeoe910gjultf Query : select sestamp valor from se where ref ='328.9075.00.1' and lote = 'r2400212150a'
20240703@080412.8564 vgme77citfq7foeoe910gjultf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@080412.8577 vgme77citfq7foeoe910gjultf Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240703@080412.8585 vgme77citfq7foeoe910gjultf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@080412.8599 vgme77citfq7foeoe910gjultf Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240703@080412.8606 vgme77citfq7foeoe910gjultf Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6684f987626684f7ecd1',?,?,'20240703',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240703@080412.8694 vgme77citfq7foeoe910gjultf Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240703@080412.8744 vgme77citfq7foeoe910gjultf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@080412.8760 vgme77citfq7foeoe910gjultf Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240703@080412.8768 vgme77citfq7foeoe910gjultf Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut6684f456486684f7ecd5','aut6684f188386684f7eca1',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 = 'aut6684f188386684f7eca1'
20240703@080412.8977 vgme77citfq7foeoe910gjultf Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@080412.8994 vgme77citfq7foeoe910gjultf Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240703@080412.9007 vgme77citfq7foeoe910gjultf 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 'aut6684f456486684f7ecd5',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 250, 250*.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 ,68.61,68.61*200.48,68.61,68.61*200.48 ,0,0,'un ',' ' ,bo.marcada,1 ,68.61*250,68.61*250*200.48 ,.000000,.000000*200.48 ,.000000,.000000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,68.61,68.61*200.48,68.61*250,68.61*250*200.48,'cps24022741246,565000006 ',534.6,534.6*250,534.6,534.6*250,?,?,?,4 from bo bo where bo.bostamp = 'aut6684f188386684f7eca1'
20240703@080413.1746 vgme77citfq7foeoe910gjultf Query : use flama_phc
20240703@080413.1752 vgme77citfq7foeoe910gjultf Query : declare @bostamp varchar(25) = 'aut6684f188386684f7eca1' ,@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 
20240703@080413.4091 vgme77citfq7foeoe910gjultf Query : use flama_phc
20240703@080413.4096 vgme77citfq7foeoe910gjultf Query : select 1 valor from bo where bo.bostamp = 'aut6684f188386684f7eca1'
20240703@080413.4222 vgme77citfq7foeoe910gjultf 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) = 'aut6684f188386684f7eca1' 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 
20240703@080413.7742 vgme77citfq7foeoe910gjultf Query : use flama_phc
20240703@080413.7746 vgme77citfq7foeoe910gjultf Query : update u_wsusers set rqsttoken =? where userid ='userls001'
20240703@080413.7780 vgme77citfq7foeoe910gjultf Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='759';
20240703@080413.7795 vgme77citfq7foeoe910gjultf Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='759';

20240703@081911.7949 usld229th2cbiorqg2crg2mpft Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='760';
20240703@081911.7976 usld229th2cbiorqg2crg2mpft Query : select concat(rtrim(relative_path),ltrim(name_new)) as valor from uploadfiles where uploadfile_id='760';
20240703@081911.7988 usld229th2cbiorqg2crg2mpft Query : update uploadfiles set whenupdated=current_timestamp where uploadfile_id='760';
20240703@081911.8001 usld229th2cbiorqg2crg2mpft Query : use flama_phc
20240703@081911.8005 usld229th2cbiorqg2crg2mpft Query : select top 1 secretkey valor from u_wsusers u where u.userid = ? and u.inactivo=0
20240703@081911.8052 usld229th2cbiorqg2crg2mpft Query : select top 1 isnull(design,'') valor from st (nolock) where st.ref = '328.9036.00.1'
20240703@081911.8165 usld229th2cbiorqg2crg2mpft 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 = 2400212 and bi.ref ='328.9036.00.1' and bi.lordem =120000
20240703@081911.8490 usld229th2cbiorqg2crg2mpft 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 = 'cps24022741246,320000005 ' 
20240703@081911.8807 usld229th2cbiorqg2crg2mpft Query : use flama_phc
20240703@081911.8810 usld229th2cbiorqg2crg2mpft Query : select top 1 1 valor from ts where ts.ndos = 61
20240703@081911.8886 usld229th2cbiorqg2crg2mpft Query : use flama_phc
20240703@081911.8890 usld229th2cbiorqg2crg2mpft 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')
20240703@081911.8941 usld229th2cbiorqg2crg2mpft 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
20240703@081911.9084 usld229th2cbiorqg2crg2mpft Query : use flama_phc
20240703@081911.9087 usld229th2cbiorqg2crg2mpft Query : select top 1 ~inactivo valor from fl where no = '202530' and estab = 00 order by inactivo desc
20240703@081911.9241 usld229th2cbiorqg2crg2mpft Query : use flama_phc
20240703@081911.9244 usld229th2cbiorqg2crg2mpft Query : select 1 valor from ts where ndos = 61
20240703@081911.9324 usld229th2cbiorqg2crg2mpft Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@081911.9610 usld229th2cbiorqg2crg2mpft Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo' and documentnumber = 61
20240703@081911.9644 usld229th2cbiorqg2crg2mpft Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@081911.9658 usld229th2cbiorqg2crg2mpft Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo2' and documentnumber = 61
20240703@081911.9665 usld229th2cbiorqg2crg2mpft Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@081911.9678 usld229th2cbiorqg2crg2mpft Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bo3' and documentnumber = 61
20240703@081911.9685 usld229th2cbiorqg2crg2mpft 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
20240703@081911.9828 usld229th2cbiorqg2crg2mpft Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240703@081911.9940 usld229th2cbiorqg2crg2mpft Query : select top 1 bo.obrano valor from bo bo where bo.ndos = 61 and boano=2024 order by obrano desc
20240703@081911.9957 usld229th2cbiorqg2crg2mpft Query : use flama_phc
20240703@081911.9960 usld229th2cbiorqg2crg2mpft Query : select top 1 no,estab,nome, morada, local,codpost,ncont,pncont,pais,inactivo,motiseimp,codmotiseimp from fl where no='202530' and estab=00
20240703@081912.4900 usld229th2cbiorqg2crg2mpft Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@081912.6200 usld229th2cbiorqg2crg2mpft Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo3' and documentnumber = 61
20240703@081912.9600 usld229th2cbiorqg2crg2mpft Query : insert into bo3 (bo3stamp, ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6684f809856684fb6ff3',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240703@081912.1620 usld229th2cbiorqg2crg2mpft Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@081912.1770 usld229th2cbiorqg2crg2mpft Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo2' and documentnumber = 61
20240703@081912.1840 usld229th2cbiorqg2crg2mpft Query : insert into bo2 (bo2stamp, tiposaft, idserie,cambio,cambiofixo,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6684f809856684fb6ff3','--','bo',7.7924865831842576028 ,1,getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut')
20240703@081912.3870 usld229th2cbiorqg2crg2mpft Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@081912.4010 usld229th2cbiorqg2crg2mpft Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bo' and documentnumber = 61
20240703@081912.4090 usld229th2cbiorqg2crg2mpft 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 ('aut6684f809856684fb6ff3','guia r. fornecedor','2024-07-03',61,2401930,?,?,?,?,?,?,?,?,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')
20240703@081912.1154 usld229th2cbiorqg2crg2mpft Query : use flama_phc
20240703@081912.1159 usld229th2cbiorqg2crg2mpft Query : select st.usalote valor from st where st.ref = '328.9036.00.1'
20240703@081912.1285 usld229th2cbiorqg2crg2mpft Query : select top 1 st.tabiva ,st.ivaincl ,st.stns ,st.uni2 ,st.familia ,isnull(tx.taxa, 0) txiva ,unidade ,usalote ,epcpond ,noserie ,conversao ,st.texteis from st left join taxasiva tx on st.tabiva = tx.codigo where st.ref = '328.9036.00.1'
20240703@081912.1436 usld229th2cbiorqg2crg2mpft Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@081912.1450 usld229th2cbiorqg2crg2mpft Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi' and documentnumber = 61
20240703@081912.1463 usld229th2cbiorqg2crg2mpft Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@081912.1477 usld229th2cbiorqg2crg2mpft Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'bi2' and documentnumber = 61
20240703@081912.1485 usld229th2cbiorqg2crg2mpft Query : select sestamp valor from se where ref ='328.9036.00.1' and lote = 'r2400212120a'
20240703@081912.1549 usld229th2cbiorqg2crg2mpft Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@081912.1578 usld229th2cbiorqg2crg2mpft Query : select fieldkey,fieldname,fieldtype,mandatory from wstablefields where tablename = 'se' and documentnumber = 0
20240703@081912.1586 usld229th2cbiorqg2crg2mpft Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@081912.1602 usld229th2cbiorqg2crg2mpft Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'se' and documentnumber = 0
20240703@081912.1610 usld229th2cbiorqg2crg2mpft Query : insert into se (sestamp,ref, lote, data,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) values ('aut6684f820266684fb7026',?,?,'20240703',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut;','aut;')
20240703@081912.1681 usld229th2cbiorqg2crg2mpft Query : select top 1 convert(numeric(6,2),t.taxa) valor from taxasiva t where t.codigo='2'
20240703@081912.1849 usld229th2cbiorqg2crg2mpft Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@081912.1863 usld229th2cbiorqg2crg2mpft Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi2' and documentnumber = 61
20240703@081912.1871 usld229th2cbiorqg2crg2mpft Query : insert into bi2 (bi2stamp,bostamp,morada, local,codpost ,ousrdata, ousrhora, usrdata,usrhora,ousrinis,usrinis) select 'aut6684f479336684fb702d','aut6684f809856684fb6ff3',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 = 'aut6684f809856684fb6ff3'
20240703@081912.2058 usld229th2cbiorqg2crg2mpft Query : select 1 valor from information_schema.tables where table_type='base table' and table_name='wstablefields'
20240703@081912.2072 usld229th2cbiorqg2crg2mpft Query : select fieldkey,fieldname,fieldtype,calcformula from wstablefields where tablename = 'bi' and documentnumber = 61
20240703@081912.2087 usld229th2cbiorqg2crg2mpft 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 'aut6684f479336684fb702d',getdate(),convert(char(8),convert (time,getdate())),getdate(),convert(char(8),convert (time,getdate())),'aut','aut',bo.obrano, 400, 400*.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 ,50.31,50.31*200.48,50.31,50.31*200.48 ,0,0,'un ','' ,bo.marcada,1 ,50.31*400,50.31*400*200.48 ,.000000,.000000*200.48 ,.000000,.000000*200.48 ,bo.vendedor,bo.vendnm,bo.ccusto,bo.ncusto ,0,2,23.00,?,?,?,0,0,0,0,50.31,50.31*200.48,50.31*400,50.31*400*200.48,'cps24022741246,320000005 ',392.04,392.04*400,392.04,392.04*400,?,?,?,4 from bo bo where bo.bostamp = 'aut6684f809856684fb6ff3'
20240703@081912.2823 usld229th2cbiorqg2crg2mpft Query : use flama_phc
20240703@081912.2827 usld229th2cbiorqg2crg2mpft Query : declare @bostamp varchar(25) = 'aut6684f809856684fb6ff3' ,@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 
20240703@081912.4523 usld229th2cbiorqg2crg2mpft Query : use flama_phc
20240703@081912.4527 usld229th2cbiorqg2crg2mpft Query : select 1 valor from bo where bo.bostamp = 'aut6684f809856684fb6ff3'
20240703@081912.5198 usld229th2cbiorqg2crg2mpft 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) = 'aut6684f809856684fb6ff3' 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 
