DELETE FROM t_tctb_formula WHERE FID = 1102877010436426752;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1102877010436426752,{ts'2021-09-14  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_01','tcvat_zlb_ybnsr#27#ybxm','{Q[销售额 - 免、抵、退办法出口销售额#一般项目]}','增值税一般纳税人总览表#27#一般项目','1','27','1102685677520327680','draft_zzsybnsr','tcvat_zlb_ybnsr','ybxm',' ',' ','if({C[#diff]}=0 || ({C[#diff]}=1 && {C[#cekcdgBqfseHjJzjtF]}=0 && {C[#sqsbbFb3Qmye]}=0),{S[select sum(t1.ftotaltaxamount) from t_tcvat_income_summary t1 , t_tpo_taxitemrateentry t2  where t1.fbusinesstypeid=t2.fentryid  and  t1.forgid=''#orgid'' and t1.ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and t1.fdeadline=''#deadline'' and t1.fjzjt=''0'' and t1.ftaxrate in (''3%'',''5%'') ]},({S[select sum(t1.fpricetaxamount) from t_tcvat_income_summary t1 where t1.forgid=''#orgid'' and t1.ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and t1.fdeadline=''#deadline'' and t1.fjzjt=''0'' and t1.ftaxrate=''5%'']} - min({S[select sum(t1.fpricetaxamount) from t_tcvat_income_summary t1 where t1.forgid=''#orgid'' and t1.ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and t1.fdeadline=''#deadline'' and t1.fjzjt=''0'' and t1.ftaxrate=''5%'']}, {S[select sum(fcurrentamount) from t_tcvat_diffdeduct where forgid=''#orgid'' and ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and fdeadline=''#deadline'' and fjzjt=''0''  and fdifftypeid=859352590188589060]} + {S[select sum(t1.fqmye) from t_tcvat_ybnsr_fb3 t1 left join t_tctb_declare_main t2 on t1.fsbbid = CONCAT(t2.fid , '''') where t1.fewblxh=''5'' and t2.forgid=''#orgid'' and t2.fskssqq=to_date(''#prestartDate'') and t2.fskssqz=to_date(''#preendDate'') and t2.fnsrtype=''zzsybnsr'']}))/1.05*0.05  +  ({S[select sum(t1.fpricetaxamount) from t_tcvat_income_summary t1 where t1.forgid=''#orgid'' and t1.ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and t1.fdeadline=''#deadline'' and t1.fjzjt=''0'' and t1.ftaxrate=''3%'']} - min({S[select sum(t1.fpricetaxamount) from t_tcvat_income_summary t1 where t1.forgid=''#orgid'' and t1.ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and t1.fdeadline=''#deadline'' and t1.fjzjt=''0'' and t1.ftaxrate=''3%'']}, {S[select sum(fcurrentamount) from t_tcvat_diffdeduct where forgid=''#orgid'' and ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and fdeadline=''#deadline'' and fjzjt=''0''  and fdifftypeid=859352590188589061]} + {S[select sum(t1.fqmye) from t_tcvat_ybnsr_fb3 t1 left join t_tctb_declare_main t2 on t1.fsbbid = CONCAT(t2.fid , '''') where t1.fewblxh=''6'' and t2.forgid=''#orgid'' and t2.fskssqq=to_date(''#prestartDate'') and t2.fskssqz=to_date(''#preendDate'') and t2.fnsrtype=''zzsybnsr'']}))/1.03*0.03)');
DELETE FROM t_tctb_formula WHERE FID = 1808077454846207002;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1808077454846207002,{ts'2023-10-31  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_02','tcvat_zlb_ybnsr#27#ybxm','{Q[销售额 - 免、抵、退办法出口销售额#一般项目]}','增值税一般纳税人总览表#27#一般项目','1','27','1808077452505784320','draft_zzsybnsr','tcvat_zlb_ybnsr','ybxm',' ',' ','if({C[#diff]}=0 || ({C[#diff]}=1 && {C[#cekcdgBqfseHjJzjtF]}=0 && {C[#sqsbbFb3Qmye]}=0),{S[select sum(t1.ftotaltaxamount) from t_tcvat_income_summary t1 , t_tpo_taxitemrateentry t2  where t1.fbusinesstypeid=t2.fentryid  and  t1.forgid=''#orgid'' and t1.ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and t1.fdeadline=''#deadline'' and t1.fjzjt=''0'' and t1.ftaxrate in (''3%'',''5%'') ]},({S[select sum(t1.fpricetaxamount) from t_tcvat_income_summary t1 where t1.forgid=''#orgid'' and t1.ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and t1.fdeadline=''#deadline'' and t1.fjzjt=''0'' and t1.ftaxrate=''5%'']} - min({S[select sum(t1.fpricetaxamount) from t_tcvat_income_summary t1 where t1.forgid=''#orgid'' and t1.ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and t1.fdeadline=''#deadline'' and t1.fjzjt=''0'' and t1.ftaxrate=''5%'']}, {S[select sum(fcurrentamount) from t_tcvat_diffdeduct where forgid=''#orgid'' and ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and fdeadline=''#deadline'' and fjzjt=''0''  and fdifftypeid=859352590188589060]} + {S[select sum(t1.fqmye) from t_tcvat_ybnsr_fb3 t1 left join t_tctb_declare_main t2 on t1.fsbbid = CONCAT(t2.fid , '''') where t1.fewblxh=''5'' and t2.forgid=''#orgid'' and t2.fskssqq=to_date(''#prestartDate'') and t2.fskssqz=to_date(''#preendDate'') and t2.fnsrtype=''zzsybnsr'']}))/1.05*0.05  +  ({S[select sum(t1.fpricetaxamount) from t_tcvat_income_summary t1 where t1.forgid=''#orgid'' and t1.ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and t1.fdeadline=''#deadline'' and t1.fjzjt=''0'' and t1.ftaxrate=''3%'']} - min({S[select sum(t1.fpricetaxamount) from t_tcvat_income_summary t1 where t1.forgid=''#orgid'' and t1.ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and t1.fdeadline=''#deadline'' and t1.fjzjt=''0'' and t1.ftaxrate=''3%'']}, {S[select sum(fcurrentamount) from t_tcvat_diffdeduct where forgid=''#orgid'' and ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and fdeadline=''#deadline'' and fjzjt=''0''  and fdifftypeid=859352590188589061]} + {S[select sum(t1.fqmye) from t_tcvat_ybnsr_fb3 t1 left join t_tctb_declare_main t2 on t1.fsbbid = CONCAT(t2.fid , '''') where t1.fewblxh=''6'' and t2.forgid=''#orgid'' and t2.fskssqq=to_date(''#prestartDate'') and t2.fskssqz=to_date(''#preendDate'') and t2.fnsrtype=''zzsybnsr'']}))/1.03*0.03)');
DELETE FROM t_tctb_formula WHERE FID = 1230462228940064768;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1230462228940064768,{ts'2024-01-16  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_01','tcvat_zlb_ybnsr#7#jzjtxm',' ','增值税一般纳税人总览表#7#即征即退项目','1','7','1102685677520327680','draft_zzsybnsr','tcvat_zlb_ybnsr','jzjtxm',' ',' ','if({C[#diff]}=0 || ({C[#diff]}=1 && {C[#cekcdgBqfseHjJzjtS]}=0 && {C[#sqsbbFb3Qmye]}=0),{S[select sum(t1.ftotaltaxamount) from t_tcvat_income_summary t1 , t_tpo_taxitemrateentry t2  where t1.fbusinesstypeid=t2.fentryid  and  t1.forgid=''#orgid'' and t1.ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and t1.fjzjt=''1'' and t1.FTAXMETHOD = ''一般计税'' and (t2.flongnumber like ''3%''  or t2.flongnumber like ''4%'' or t2.flongnumber like ''5%'')]},({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''1'' and a.ftaxrate=''13%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]}-min({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''1'' and a.ftaxrate=''13%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]},{S[select sum(fdeductamount) from t_tcvat_diffdeduct where forgid=''#orgid'' and ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and fjzjt=''1''  and fdifftypeid =859352590188589056]}))/1.13*0.13+({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''1'' and a.ftaxrate=''6%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]}-min({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''1'' and a.ftaxrate=''6%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]},{S[select sum(fdeductamount) from t_tcvat_diffdeduct where forgid=''#orgid'' and ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and fjzjt=''1'' and fdifftypeid in (859352590188589059,859352590188589058)]}))/1.06*0.06+({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''1'' and a.ftaxrate=''9%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]}-min({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''1'' and a.ftaxrate=''9%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]},{S[select sum(fdeductamount) from t_tcvat_diffdeduct where forgid=''#orgid'' and ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and fjzjt=''1'' and fdifftypeid = 859352590188589057]}))/1.09*0.09)');
DELETE FROM t_tctb_formula WHERE FID = 1808077454846206992;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1808077454846206992,{ts'2024-01-16  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_02','tcvat_zlb_ybnsr#7#jzjtxm',' ','增值税一般纳税人总览表#7#即征即退项目','1','7','1808077452505784320','draft_zzsybnsr','tcvat_zlb_ybnsr','jzjtxm',' ',' ','if({C[#diff]}=0 || ({C[#diff]}=1 && {C[#cekcdgBqfseHjJzjtS]}=0 && {C[#sqsbbFb3Qmye]}=0),{S[select sum(t1.ftotaltaxamount) from t_tcvat_income_summary t1 , t_tpo_taxitemrateentry t2  where t1.fbusinesstypeid=t2.fentryid  and  t1.forgid=''#orgid'' and t1.ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and t1.fjzjt=''1'' and t1.FTAXMETHOD = ''一般计税'' and (t2.flongnumber like ''3%''  or t2.flongnumber like ''4%'' or t2.flongnumber like ''5%'')]},({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''1'' and a.ftaxrate=''13%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]}-min({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''1'' and a.ftaxrate=''13%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]},{S[select sum(fdeductamount) from t_tcvat_diffdeduct where forgid=''#orgid'' and ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and fjzjt=''1''  and fdifftypeid =859352590188589056]}))/1.13*0.13+({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''1'' and a.ftaxrate=''6%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]}-min({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''1'' and a.ftaxrate=''6%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]},{S[select sum(fdeductamount) from t_tcvat_diffdeduct where forgid=''#orgid'' and ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and fjzjt=''1'' and fdifftypeid in (859352590188589059,859352590188589058)]}))/1.06*0.06+({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''1'' and a.ftaxrate=''9%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]}-min({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''1'' and a.ftaxrate=''9%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]},{S[select sum(fdeductamount) from t_tcvat_diffdeduct where forgid=''#orgid'' and ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and fjzjt=''1'' and fdifftypeid = 859352590188589057]}))/1.09*0.09)');
DELETE FROM t_tctb_formula WHERE FID = 1808077454846207006;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1808077454846207006,{ts'2023-12-13  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_02','tcvat_zlb_ybnsr#7#ybxm',' ','增值税一般纳税人总览表#7#一般项目','1','7','1808077452505784320','draft_zzsybnsr','tcvat_zlb_ybnsr','ybxm',' ',' ','if({C[#diff]}=0 || ({C[#diff]}=1 && {C[#cekcdgBqfseHjJzjtF]}=0 && {C[#sqsbbFb3Qmye]}=0),{S[select sum(a.ftotaltaxamount) from t_tcvat_income_summary a inner join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''0'' and a.ftaxrate in (''6%'',''9%'',''10%'',''11%'',''13%'',''16%'',''17%'') and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]},({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''0'' and a.ftaxrate=''13%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]}-min({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''0'' and a.ftaxrate=''13%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]},{S[select sum(fcurrentamount) from t_tcvat_diffdeduct where forgid=''#orgid'' and ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and fjzjt=''0''  and fdifftypeid=859352590188589056]}+{S[select sum(a.fqmye) from t_tcvat_ybnsr_fb3 a left join t_tctb_declare_main b on a.fsbbid=CONCAT(b.fid,'''') where a.fewblxh=''1'' and b.forgid=''#orgid'' and b.fskssqq=to_date(''#prestartDate'') and b.fskssqz=to_date(''#preendDate'') and b.fnsrtype=''zzsybnsr'']}))/1.13*0.13+({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''0'' and a.ftaxrate=''9%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]}-min({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''0'' and a.ftaxrate=''9%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]},{S[select sum(fcurrentamount) from t_tcvat_diffdeduct where forgid=''#orgid'' and ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and fjzjt=''0''  and fdifftypeid=859352590188589057]}+{S[select sum(a.fqmye) from t_tcvat_ybnsr_fb3 a left join t_tctb_declare_main b on a.fsbbid=CONCAT(b.fid,'''') where a.fewblxh=''2'' and b.forgid=''#orgid'' and b.fskssqq=to_date(''#prestartDate'') and b.fskssqz=to_date(''#preendDate'') and b.fnsrtype=''zzsybnsr'']}))/1.09*0.09+({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''0'' and a.ftaxrate=''6%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]}-min({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''0'' and a.ftaxrate=''6%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]},{S[select sum(fcurrentamount) from t_tcvat_diffdeduct where forgid=''#orgid'' and ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and fjzjt=''0''  and fdifftypeid in(859352590188589058,859352590188589059)]}+{S[select sum(a.fqmye) from t_tcvat_ybnsr_fb3 a left join t_tctb_declare_main b on a.fsbbid=CONCAT(b.fid,'''') where a.fewblxh in(''3'', ''4'') and b.forgid=''#orgid'' and b.fskssqq=to_date(''#prestartDate'') and b.fskssqz=to_date(''#preendDate'') and b.fnsrtype=''zzsybnsr'']}))/1.06*0.06)');
DELETE FROM t_tctb_formula WHERE FID = 1103368218732634112;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1103368218732634112,{ts'2023-11-09  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_01','tcvat_zlb_ybnsr#7#ybxm',' ','增值税一般纳税人总览表#7#一般项目','1','7','1102685677520327680','draft_zzsybnsr','tcvat_zlb_ybnsr','ybxm',' ',' ','if({C[#diff]}=0 || ({C[#diff]}=1 && {C[#cekcdgBqfseHjJzjtF]}=0 && {C[#sqsbbFb3Qmye]}=0),{S[select sum(a.ftotaltaxamount) from t_tcvat_income_summary a inner join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''0'' and a.ftaxrate in (''6%'',''9%'',''10%'',''11%'',''13%'',''16%'',''17%'') and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]},({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''0'' and a.ftaxrate=''13%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]}-min({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''0'' and a.ftaxrate=''13%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]},{S[select sum(fcurrentamount) from t_tcvat_diffdeduct where forgid=''#orgid'' and ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and fjzjt=''0''  and fdifftypeid=859352590188589056]}+{S[select sum(a.fqmye) from t_tcvat_ybnsr_fb3 a left join t_tctb_declare_main b on a.fsbbid=CONCAT(b.fid,'''') where a.fewblxh=''1'' and b.forgid=''#orgid'' and b.fskssqq=to_date(''#prestartDate'') and b.fskssqz=to_date(''#preendDate'') and b.fnsrtype=''zzsybnsr'']}))/1.13*0.13+({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''0'' and a.ftaxrate=''9%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]}-min({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''0'' and a.ftaxrate=''9%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]},{S[select sum(fcurrentamount) from t_tcvat_diffdeduct where forgid=''#orgid'' and ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and fjzjt=''0''  and fdifftypeid=859352590188589057]}+{S[select sum(a.fqmye) from t_tcvat_ybnsr_fb3 a left join t_tctb_declare_main b on a.fsbbid=CONCAT(b.fid,'''') where a.fewblxh=''2'' and b.forgid=''#orgid'' and b.fskssqq=to_date(''#prestartDate'') and b.fskssqz=to_date(''#preendDate'') and b.fnsrtype=''zzsybnsr'']}))/1.09*0.09+({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''0'' and a.ftaxrate=''6%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]}-min({S[select sum(a.fpricetaxamount) from t_tcvat_income_summary a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''0'' and a.ftaxrate=''6%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]},{S[select sum(fcurrentamount) from t_tcvat_diffdeduct where forgid=''#orgid'' and ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and fjzjt=''0''  and fdifftypeid in(859352590188589058,859352590188589059)]}+{S[select sum(a.fqmye) from t_tcvat_ybnsr_fb3 a left join t_tctb_declare_main b on a.fsbbid=CONCAT(b.fid,'''') where a.fewblxh in(''3'', ''4'') and b.forgid=''#orgid'' and b.fskssqq=to_date(''#prestartDate'') and b.fskssqz=to_date(''#preendDate'') and b.fnsrtype=''zzsybnsr'']}))/1.06*0.06)');
DELETE FROM t_tctb_formula WHERE FID = 1611554578313296934;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1611554578313296934,{ts'2023-02-02  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_01','tcvat_zlb_ybnsr#27#ybxm','{Q[销售额 - 免、抵、退办法出口销售额#一般项目]}','增值税一般纳税人总览表#27#一般项目','1','27','1611554577046620160','draft_zzsybnsr_sjjt','tcvat_zlb_ybnsr','ybxm',' ',' ','if({C[#diff]}=0 || ({C[#diff]}=1 && {C[#cekcdgBqfseHjJzjtF]}=0 && {C[#sqsbbFb3Qmye]}=0),{S[select sum(t1.ftotaltaxamount) from t_tcvat_income_sum_sjjt t1 , t_tpo_taxitemrateentry t2  where t1.fbusinesstypeid=t2.fentryid  and  t1.forgid=''#orgid'' and t1.ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and t1.fdeadline=''#deadline'' and t1.fjzjt=''0'' and t1.ftaxrate in (''3%'',''5%'') ]},({S[select sum(t1.fpricetaxamount) from t_tcvat_income_sum_sjjt t1 where t1.forgid=''#orgid'' and t1.ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and t1.fdeadline=''#deadline'' and t1.fjzjt=''0'' and t1.ftaxrate=''5%'']} - min({S[select sum(t1.fpricetaxamount) from t_tcvat_income_sum_sjjt t1 where t1.forgid=''#orgid'' and t1.ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and t1.fdeadline=''#deadline'' and t1.fjzjt=''0'' and t1.ftaxrate=''5%'']}, {S[select sum(fcurrentamount) from t_tcvat_diffdeduct_sjjt where forgid=''#orgid'' and ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and fdeadline=''#deadline'' and fdifftypeid=859352590188589060]} + {S[select sum(t1.fqmye) from t_tcvat_ybnsr_fb3 t1 left join t_tctb_declare_main t2 on t1.fsbbid = CONCAT(t2.fid , '''') where t1.fewblxh=''5'' and t2.forgid=''#orgid'' and t2.fskssqq=to_date(''#prestartDate'') and t2.fskssqz=to_date(''#preendDate'') and t2.fnsrtype=''zzsybnsr'']}))/1.05*0.05  +  ({S[select sum(t1.fpricetaxamount) from t_tcvat_income_sum_sjjt t1 where t1.forgid=''#orgid'' and t1.ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and t1.fdeadline=''#deadline'' and t1.fjzjt=''0'' and t1.ftaxrate=''3%'']} - min({S[select sum(t1.fpricetaxamount) from t_tcvat_income_sum_sjjt t1 where t1.forgid=''#orgid'' and t1.ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and t1.fdeadline=''#deadline'' and t1.fjzjt=''0'' and t1.ftaxrate=''3%'']}, {S[select sum(fcurrentamount) from t_tcvat_diffdeduct_sjjt where forgid=''#orgid'' and ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and fdeadline=''#deadline'' and fdifftypeid=859352590188589061]} + {S[select sum(t1.fqmye) from t_tcvat_ybnsr_fb3 t1 left join t_tctb_declare_main t2 on t1.fsbbid = CONCAT(t2.fid , '''') where t1.fewblxh=''6'' and t2.forgid=''#orgid'' and t2.fskssqq=to_date(''#prestartDate'') and t2.fskssqz=to_date(''#preendDate'') and t2.fnsrtype=''zzsybnsr'']}))/1.03*0.03)');
DELETE FROM t_tctb_formula WHERE FID = 1611554578313296962;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1611554578313296962,{ts'2024-01-16  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_01','tcvat_zlb_ybnsr#7#jzjtxm',' ','增值税一般纳税人总览表#7#即征即退项目','1','7','1611554577046620160','draft_zzsybnsr_sjjt','tcvat_zlb_ybnsr','jzjtxm',' ',' ','if({C[#diff]}=0 || ({C[#diff]}=1 && {C[#cekcdgBqfseHjJzjtS]}=0 && {C[#sqsbbFb3Qmye]}=0),{S[select sum(t1.ftotaltaxamount) from t_tcvat_income_sum_sjjt t1 , t_tpo_taxitemrateentry t2  where t1.fbusinesstypeid=t2.fentryid  and  t1.forgid=''#orgid'' and t1.ftaxperiod in (''#startPeriod'',''#middlePeriod'',''#endPeriod'') and t1.fjzjt=''1'' and t1.FTAXMETHOD = ''一般计税'' and (t2.flongnumber like ''3%''  or t2.flongnumber like ''4%'' or t2.flongnumber like ''5%'')]},({S[select sum(a.fpricetaxamount) from t_tcvat_income_sum_sjjt a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''1'' and a.ftaxrate=''13%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]}-min({S[select sum(a.fpricetaxamount) from t_tcvat_income_sum_sjjt a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''1'' and a.ftaxrate=''13%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]},{S[select sum(fdeductamount) from t_tcvat_diffdeduct_sjjt where forgid=''#orgid'' and ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and fjzjt=''1''  and fdifftypeid =859352590188589056]}))/1.13*0.13+({S[select sum(a.fpricetaxamount) from t_tcvat_income_sum_sjjt a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''1'' and a.ftaxrate=''6%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]}-min({S[select sum(a.fpricetaxamount) from t_tcvat_income_sum_sjjt a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''1'' and a.ftaxrate=''6%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]},{S[select sum(fdeductamount) from t_tcvat_diffdeduct_sjjt where forgid=''#orgid'' and ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and fjzjt=''1'' and fdifftypeid in (859352590188589059,859352590188589058)]}))/1.06*0.06+({S[select sum(a.fpricetaxamount) from t_tcvat_income_sum_sjjt a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''1'' and a.ftaxrate=''9%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]}-min({S[select sum(a.fpricetaxamount) from t_tcvat_income_sum_sjjt a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''1'' and a.ftaxrate=''9%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]},{S[select sum(fdeductamount) from t_tcvat_diffdeduct_sjjt where forgid=''#orgid'' and ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and fjzjt=''1'' and fdifftypeid = 859352590188589057]}))/1.09*0.09)');
DELETE FROM t_tctb_formula WHERE FID = 1611554578313296957;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1611554578313296957,{ts'2023-11-09  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_01','tcvat_zlb_ybnsr#7#ybxm',' ','增值税一般纳税人总览表#7#一般项目','1','7','1611554577046620160','draft_zzsybnsr_sjjt','tcvat_zlb_ybnsr','ybxm',' ',' ','if({C[#diff]}=0 || ({C[#diff]}=1 && {C[#cekcdgBqfseHjJzjtF]}=0 && {C[#sqsbbFb3Qmye]}=0),{S[select sum(a.ftotaltaxamount) from t_tcvat_income_sum_sjjt a inner join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''0'' and a.ftaxrate in (''6%'',''9%'',''10%'',''11%'',''13%'',''16%'',''17%'') and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]},({S[select sum(a.fpricetaxamount) from t_tcvat_income_sum_sjjt a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''0'' and a.ftaxrate=''13%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]}-min({S[select sum(a.fpricetaxamount) from t_tcvat_income_sum_sjjt a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''0'' and a.ftaxrate=''13%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]}, {S[select sum(fcurrentamount) from t_tcvat_diffdeduct_sjjt where forgid=''#orgid'' and ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and fjzjt=''0''  and fdifftypeid=859352590188589056]}+{S[select sum(a.fqmye) from t_tcvat_ybnsr_fb3 a left join t_tctb_declare_main b on a.fsbbid=CONCAT(b.fid,'''') where a.fewblxh=''1'' and b.forgid=''#orgid'' and b.fskssqq=to_date(''#prestartDate'') and b.fskssqz=to_date(''#preendDate'') and b.fnsrtype=''zzsybnsr'']}))/1.13*0.13+({S[select sum(a.fpricetaxamount) from t_tcvat_income_sum_sjjt a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''0'' and a.ftaxrate=''9%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]}-min({S[select sum(a.fpricetaxamount) from t_tcvat_income_sum_sjjt a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''0'' and a.ftaxrate=''9%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]},{S[select sum(fcurrentamount) from t_tcvat_diffdeduct_sjjt where forgid=''#orgid'' and ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and fjzjt=''0''  and fdifftypeid=859352590188589057]}+{S[select sum(a.fqmye) from t_tcvat_ybnsr_fb3 a left join t_tctb_declare_main b on a.fsbbid=CONCAT(b.fid,'''') where a.fewblxh=''2'' and b.forgid=''#orgid'' and b.fskssqq=to_date(''#prestartDate'') and b.fskssqz=to_date(''#preendDate'') and b.fnsrtype=''zzsybnsr'']}))/1.09*0.09+({S[select sum(a.fpricetaxamount) from t_tcvat_income_sum_sjjt a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''0'' and a.ftaxrate=''6%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]}-min({S[select sum(a.fpricetaxamount) from t_tcvat_income_sum_sjjt a left join t_tpo_taxitemrateentry b on a.fbusinesstypeid=b.fentryid where a.forgid=''#orgid'' and a.ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and a.fjzjt=''0'' and a.ftaxrate=''6%'' and (b.flongnumber like ''3%'' or b.flongnumber like ''4%'' or b.flongnumber like ''5%'')]},{S[select sum(fcurrentamount) from t_tcvat_diffdeduct_sjjt where forgid=''#orgid'' and ftaxperiod in (''#sPeriod'',''#mPeriod'',''#ePeriod'') and fjzjt=''0''  and fdifftypeid in(859352590188589058,859352590188589059)]}+{S[select sum(a.fqmye) from t_tcvat_ybnsr_fb3 a left join t_tctb_declare_main b on a.fsbbid=CONCAT(b.fid,'''') where a.fewblxh in (''3'',''4'') and b.forgid=''#orgid'' and b.fskssqq=to_date(''#prestartDate'') and b.fskssqz=to_date(''#preendDate'') and b.fnsrtype=''zzsybnsr'']}))/1.06*0.06)');

DELETE FROM t_tctb_formula WHERE FID = 1120094676742225920;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1120094676742225920,{ts'2024-01-16  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#27#ybxm',' ','增值税汇总一般企业税额计算总览表#27#一般项目','1','27','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','ybxm',' ',' ','if({C[#diff]}=0 || ({C[#diff]}=1 && {C[#cekcdgBqfseHjJzjtF]}=0 && {C[#sqsbbFb3Qmye]}=0),{S[select sum(t1.ftotaltaxamount) from t_tcvat_hz_account_summar t1 , t_tpo_taxitemrateentry t2  where t1.ftaxpayertype = ''#taxpayertype'' and t1.fbusinesstypeid=t2.fentryid  and  t1.forgid=''#orgid'' and t1.fstartdate=to_date(''#startDate'') and t1.fenddate = to_date(''#endDate'') and t1.fjzjt=''0'' and t1.ftaxrate in (''3%'',''5%'') ]},({S[select sum(t1.fpricetaxamount) from t_tcvat_hz_account_summar t1 where t1.ftaxpayertype = ''#taxpayertype'' and t1.forgid=''#orgid'' and t1.fstartdate=to_date(''#startDate'') and t1.fenddate = to_date(''#endDate'') and t1.fjzjt=''0'' and t1.ftaxrate=''5%'']} - min({S[select sum(t1.fpricetaxamount) from t_tcvat_hz_account_summar t1 where t1.ftaxpayertype = ''#taxpayertype'' and t1.forgid=''#orgid'' and t1.fstartdate=to_date(''#startDate'') and t1.fenddate = to_date(''#endDate'') and t1.fjzjt=''0'' and t1.ftaxrate=''5%'']}, {S[select sum(fcurrentamount) from t_tcvat_hz_diff_temp where forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate = to_date(''#endDate'') and fjzjt=''0''  and fdifftypeid=859352590188589060]} + {S[select sum(t1.fqmye) from t_tcvat_ybnsr_fb3 t1 left join t_tctb_declare_main t2 on t1.fsbbid = CONCAT(t2.fid , '''') where t1.fewblxh=''5'' and t2.forgid=''#orgid'' and t2.fskssqq=to_date(''#prestartDate'') and t2.fskssqz=to_date(''#preendDate'') and t2.fnsrtype=''#taxpayertype'']}))/1.05*0.05  +  ({S[select sum(t1.fpricetaxamount) from t_tcvat_hz_account_summar t1 where t1.ftaxpayertype = ''#taxpayertype'' and t1.forgid=''#orgid''  and t1.fstartdate=to_date(''#startDate'') and t1.fenddate = to_date(''#endDate'') and t1.fjzjt=''0'' and t1.ftaxrate=''3%'']} - min({S[select sum(t1.fpricetaxamount) from t_tcvat_hz_account_summar t1 where t1.ftaxpayertype = ''#taxpayertype'' and  t1.forgid=''#orgid'' and t1.fstartdate=to_date(''#startDate'') and t1.fenddate = to_date(''#endDate'') and t1.fjzjt=''0'' and t1.ftaxrate=''3%'']}, {S[select sum(fcurrentamount) from t_tcvat_hz_diff_temp where forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate = to_date(''#endDate'') and fjzjt=''0''  and fdifftypeid=859352590188589061]} + {S[select sum(t1.fqmye) from t_tcvat_ybnsr_fb3 t1 left join t_tctb_declare_main t2 on t1.fsbbid = CONCAT(t2.fid , '''') where t1.fewblxh=''6'' and t2.forgid=''#orgid'' and t2.fskssqq=to_date(''#prestartDate'') and t2.fskssqz=to_date(''#preendDate'') and t2.fnsrtype=''#taxpayertype'']}))/1.03*0.03)');
DELETE FROM t_tctb_formula WHERE FID = 1808078374355084301;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1808078374355084301,{ts'2024-01-16  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_02','tcvat_zlb_zzsybnsr_ybhz#27#ybxm',' ','增值税汇总一般企业税额计算总览表#27#一般项目','1','27','1808078373642051584','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','ybxm',' ',' ','if({C[#diff]}=0 || ({C[#diff]}=1 && {C[#cekcdgBqfseHjJzjtF]}=0 && {C[#sqsbbFb3Qmye]}=0),{S[select sum(t1.ftotaltaxamount) from t_tcvat_hz_account_summar t1 , t_tpo_taxitemrateentry t2  where t1.ftaxpayertype = ''#taxpayertype'' and t1.fbusinesstypeid=t2.fentryid  and  t1.forgid=''#orgid'' and t1.fstartdate=to_date(''#startDate'') and t1.fenddate = to_date(''#endDate'') and t1.fjzjt=''0'' and t1.ftaxrate in (''3%'',''5%'') ]},({S[select sum(t1.fpricetaxamount) from t_tcvat_hz_account_summar t1 where t1.ftaxpayertype = ''#taxpayertype'' and t1.forgid=''#orgid'' and t1.fstartdate=to_date(''#startDate'') and t1.fenddate = to_date(''#endDate'') and t1.fjzjt=''0'' and t1.ftaxrate=''5%'']} - min({S[select sum(t1.fpricetaxamount) from t_tcvat_hz_account_summar t1 where t1.ftaxpayertype = ''#taxpayertype'' and t1.forgid=''#orgid'' and t1.fstartdate=to_date(''#startDate'') and t1.fenddate = to_date(''#endDate'') and t1.fjzjt=''0'' and t1.ftaxrate=''5%'']}, {S[select sum(fcurrentamount) from t_tcvat_hz_diff_temp where forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate = to_date(''#endDate'') and fjzjt=''0''  and fdifftypeid=859352590188589060]} + {S[select sum(t1.fqmye) from t_tcvat_ybnsr_fb3 t1 left join t_tctb_declare_main t2 on t1.fsbbid = CONCAT(t2.fid , '''') where t1.fewblxh=''5'' and t2.forgid=''#orgid'' and t2.fskssqq=to_date(''#prestartDate'') and t2.fskssqz=to_date(''#preendDate'') and t2.fnsrtype=''#taxpayertype'']}))/1.05*0.05  +  ({S[select sum(t1.fpricetaxamount) from t_tcvat_hz_account_summar t1 where t1.ftaxpayertype = ''#taxpayertype'' and t1.forgid=''#orgid''  and t1.fstartdate=to_date(''#startDate'') and t1.fenddate = to_date(''#endDate'') and t1.fjzjt=''0'' and t1.ftaxrate=''3%'']} - min({S[select sum(t1.fpricetaxamount) from t_tcvat_hz_account_summar t1 where t1.ftaxpayertype = ''#taxpayertype'' and  t1.forgid=''#orgid'' and t1.fstartdate=to_date(''#startDate'') and t1.fenddate = to_date(''#endDate'') and t1.fjzjt=''0'' and t1.ftaxrate=''3%'']}, {S[select sum(fcurrentamount) from t_tcvat_hz_diff_temp where forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate = to_date(''#endDate'') and fjzjt=''0''  and fdifftypeid=859352590188589061]} + {S[select sum(t1.fqmye) from t_tcvat_ybnsr_fb3 t1 left join t_tctb_declare_main t2 on t1.fsbbid = CONCAT(t2.fid , '''') where t1.fewblxh=''6'' and t2.forgid=''#orgid'' and t2.fskssqq=to_date(''#prestartDate'') and t2.fskssqz=to_date(''#preendDate'') and t2.fnsrtype=''#taxpayertype'']}))/1.03*0.03)');
DELETE FROM t_tctb_formula WHERE FID = 1244875012872094720;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1244875012872094720,{ts'2024-01-16  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#7#jzjtxm',' ','增值税汇总一般企业税额计算总览表#7#即征即退项目','1','7','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','jzjtxm',' ',' ','if({C[#diff]}=0 || ({C[#diff]}=1 && {C[#cekcdgBqfseHjJzjtS]}=0 && {C[#sqsbbFb3Qmye]}=0),{S[select sum(t1.ftotaltaxamount) from t_tcvat_hz_account_summar t1 , t_tpo_taxitemrateentry t2  where t1.ftaxpayertype = ''#taxpayertype'' and t1.fbusinesstypeid=t2.fentryid  and  t1.forgid=''#orgid'' and t1.fstartdate=to_date(''#startDate'') and t1.fenddate = to_date(''#endDate'') and t1.fjzjt=''1'' and t1.FTAXMETHOD = ''一般计税'' and (t2.flongnumber like ''3%''  or t2.flongnumber like ''4%''  or t2.flongnumber like ''5%'')]},({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''1'' and s.ftaxrate=''13%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]}-min({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''1'' and s.ftaxrate=''13%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]},{S[select sum(fdeductamount) from t_tcvat_hz_diff_temp where ftaxpayertype=''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate=to_date(''#endDate'') and fjzjt=''1''  and fdifftypeid=859352590188589056]}))/1.13*0.13 + ({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''1'' and s.ftaxrate=''6%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]}-min({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid''  and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''1'' and s.ftaxrate=''6%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]},{S[select sum(fdeductamount) from t_tcvat_hz_diff_temp where ftaxpayertype=''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate=to_date(''#endDate'') and fjzjt=''1''  and fdifftypeid in (859352590188589058,859352590188589059)]}))/1.06*0.06+ ({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''1'' and s.ftaxrate=''9%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]}-min({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid''  and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''1'' and s.ftaxrate=''9%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]},{S[select sum(fdeductamount) from t_tcvat_hz_diff_temp where ftaxpayertype=''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate=to_date(''#endDate'') and fjzjt=''1''  and fdifftypeid = 859352590188589057]}))/1.09*0.09)');
DELETE FROM t_tctb_formula WHERE FID = 1808078374355084312;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1808078374355084312,{ts'2023-10-31  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_02','tcvat_zlb_zzsybnsr_ybhz#7#jzjtxm',' ','增值税汇总一般企业税额计算总览表#7#即征即退项目','1','7','1808078373642051584','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','jzjtxm',' ',' ','if({C[#diff]}=0 || ({C[#diff]}=1 && {C[#cekcdgBqfseHjJzjtS]}=0 && {C[#sqsbbFb3Qmye]}=0),{S[select sum(t1.ftotaltaxamount) from t_tcvat_hz_account_summar t1 , t_tpo_taxitemrateentry t2  where t1.ftaxpayertype = ''#taxpayertype'' and t1.fbusinesstypeid=t2.fentryid  and  t1.forgid=''#orgid'' and t1.fstartdate=to_date(''#startDate'') and t1.fenddate = to_date(''#endDate'') and t1.fjzjt=''1'' and t1.FTAXMETHOD = ''一般计税'' and (t2.flongnumber like ''3%''  or t2.flongnumber like ''4%''  or t2.flongnumber like ''5%'')]},({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''1'' and s.ftaxrate=''13%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]}-min({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''1'' and s.ftaxrate=''13%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]},{S[select sum(fdeductamount) from t_tcvat_hz_diff_temp where ftaxpayertype=''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate=to_date(''#endDate'') and fjzjt=''1''  and fdifftypeid=859352590188589056]}))/1.13*0.13 + ({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''1'' and s.ftaxrate=''6%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]}-min({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid''  and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''1'' and s.ftaxrate=''6%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]},{S[select sum(fdeductamount) from t_tcvat_hz_diff_temp where ftaxpayertype=''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate=to_date(''#endDate'') and fjzjt=''1''  and fdifftypeid in (859352590188589058,859352590188589059)]}))/1.06*0.06+ ({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''1'' and s.ftaxrate=''9%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]}-min({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid''  and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''1'' and s.ftaxrate=''9%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]},{S[select sum(fdeductamount) from t_tcvat_hz_diff_temp where ftaxpayertype=''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate=to_date(''#endDate'') and fjzjt=''1''  and fdifftypeid = 859352590188589057]}))/1.09*0.09)');

DELETE FROM t_tctb_formula WHERE FID = 1119592992584261632;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1119592992584261632,{ts'2023-11-09  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#7#ybxm',' ','增值税汇总一般企业税额计算总览表#7#一般项目','1','7','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','ybxm',' ',' ','if({C[#diff]}=0 || ({C[#diff]}=1 && {C[#cekcdgBqfseHjJzjtF]}=0 && {C[#sqsbbFb3Qmye]}=0),{S[select sum(s.ftotaltaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.ftaxpayertype=''#taxpayertype'' and s.fbusinesstypeid=t.fentryid and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''0'' and s.ftaxrate in(''6%'',''9%'',''10%'',''11%'',''13%'',''16%'',''17%'') and(t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]},({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''0'' and s.ftaxrate=''13%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]}-min({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''0'' and s.ftaxrate=''13%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]},{S[select sum(fcurrentamount) from t_tcvat_hz_diff_temp where ftaxpayertype=''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate=to_date(''#endDate'') and fjzjt=''0''  and fdifftypeid=859352590188589056]}+{S[select sum(fqmye) from t_tcvat_ybnsr_fb3 where fsbbid=''#predeclaresbbid'' and fewblxh=''1'']}))/1.13*0.13+({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s left join t_tpo_taxitemrateentry t on s.fbusinesstypeid=t.fentryid where s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''0'' and s.ftaxrate=''9%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]}-min({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s left join t_tpo_taxitemrateentry t on s.fbusinesstypeid=t.fentryid where s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''0'' and s.ftaxrate=''9%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]},{S[select sum(fcurrentamount) from t_tcvat_hz_diff_temp where ftaxpayertype=''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate=to_date(''#endDate'') and fjzjt=''0''  and fdifftypeid=859352590188589057]}+{S[select sum(fqmye) from t_tcvat_ybnsr_fb3 where fsbbid=''#predeclaresbbid'' and fewblxh=''2'']}))/1.09*0.09+({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''0'' and s.ftaxrate=''6%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]}-min({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid''  and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''0'' and s.ftaxrate=''6%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]},{S[select sum(fcurrentamount) from t_tcvat_hz_diff_temp where ftaxpayertype=''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate=to_date(''#endDate'') and fjzjt=''0''  and fdifftypeid in(859352590188589058,859352590188589059)]}+{S[select sum(fqmye) from t_tcvat_ybnsr_fb3 where fsbbid=''#predeclaresbbid'' and fewblxh in (''3'',''4'')]}))/1.06*0.06)');
DELETE FROM t_tctb_formula WHERE FID = 1808078374355084367;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1808078374355084367,{ts'2023-11-09  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_02','tcvat_zlb_zzsybnsr_ybhz#7#ybxm',' ','增值税汇总一般企业税额计算总览表#7#一般项目','1','7','1808078373642051584','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','ybxm',' ',' ','if({C[#diff]}=0 || ({C[#diff]}=1 && {C[#cekcdgBqfseHjJzjtF]}=0 && {C[#sqsbbFb3Qmye]}=0),{S[select sum(s.ftotaltaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.ftaxpayertype=''#taxpayertype'' and s.fbusinesstypeid=t.fentryid and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''0'' and s.ftaxrate in(''6%'',''9%'',''10%'',''11%'',''13%'',''16%'',''17%'') and(t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]},({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''0'' and s.ftaxrate=''13%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]}-min({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''0'' and s.ftaxrate=''13%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]},{S[select sum(fcurrentamount) from t_tcvat_hz_diff_temp where ftaxpayertype=''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate=to_date(''#endDate'') and fjzjt=''0''  and fdifftypeid=859352590188589056]}+{S[select sum(fqmye) from t_tcvat_ybnsr_fb3 where fsbbid=''#predeclaresbbid'' and fewblxh=''1'']}))/1.13*0.13+({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s left join t_tpo_taxitemrateentry t on s.fbusinesstypeid=t.fentryid where s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''0'' and s.ftaxrate=''9%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]}-min({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s left join t_tpo_taxitemrateentry t on s.fbusinesstypeid=t.fentryid where s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''0'' and s.ftaxrate=''9%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]},{S[select sum(fcurrentamount) from t_tcvat_hz_diff_temp where ftaxpayertype=''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate=to_date(''#endDate'') and fjzjt=''0''  and fdifftypeid=859352590188589057]}+{S[select sum(fqmye) from t_tcvat_ybnsr_fb3 where fsbbid=''#predeclaresbbid'' and fewblxh=''2'']}))/1.09*0.09+({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''0'' and s.ftaxrate=''6%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]}-min({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_summar s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid''  and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''0'' and s.ftaxrate=''6%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]},{S[select sum(fcurrentamount) from t_tcvat_hz_diff_temp where ftaxpayertype=''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate=to_date(''#endDate'') and fjzjt=''0''  and fdifftypeid in(859352590188589058,859352590188589059)]}+{S[select sum(fqmye) from t_tcvat_ybnsr_fb3 where fsbbid=''#predeclaresbbid'' and fewblxh in (''3'',''4'')]}))/1.06*0.06)');
DELETE FROM t_tctb_formula WHERE FID = 1626005309807968291;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1626005309807968291,{ts'2024-01-16  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#27#ybxm',' ','增值税汇总一般企业税额计算总览表#27#一般项目','1','27','1626005309052994560','draft_zzsybnsr_ybhz_sjjt','tcvat_zlb_zzsybnsr_ybhz','ybxm',' ',' ','if({C[#diff]}=0 || ({C[#diff]}=1 && {C[#cekcdgBqfseHjJzjtF]}=0 && {C[#sqsbbFb3Qmye]}=0),{S[select sum(t1.ftotaltaxamount) from t_tcvat_hz_account_summar t1 , t_tpo_taxitemrateentry t2  where t1.ftaxpayertype = ''#taxpayertype'' and t1.fbusinesstypeid=t2.fentryid  and  t1.forgid=''#orgid'' and t1.fstartdate=to_date(''#startDate'') and t1.fenddate = to_date(''#endDate'') and t1.fjzjt=''0'' and t1.ftaxrate in (''3%'',''5%'') ]},({S[select sum(t1.fpricetaxamount) from t_tcvat_hz_account_summar t1 where t1.ftaxpayertype = ''#taxpayertype'' and t1.forgid=''#orgid'' and t1.fstartdate=to_date(''#startDate'') and t1.fenddate = to_date(''#endDate'') and t1.fjzjt=''0'' and t1.ftaxrate=''5%'']} - min({S[select sum(t1.fpricetaxamount) from t_tcvat_hz_account_summar t1 where t1.ftaxpayertype = ''#taxpayertype'' and t1.forgid=''#orgid'' and t1.fstartdate=to_date(''#startDate'') and t1.fenddate = to_date(''#endDate'') and t1.fjzjt=''0'' and t1.ftaxrate=''5%'']}, {S[select sum(fcurrentamount) from t_tcvat_hz_diff_temp where forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate = to_date(''#endDate'') and fjzjt=''0''  and fdifftypeid=859352590188589060]} + {S[select sum(t1.fqmye) from t_tcvat_ybnsr_fb3 t1 left join t_tctb_declare_main t2 on t1.fsbbid = CONCAT(t2.fid , '''') where t1.fewblxh=''5'' and t2.forgid=''#orgid'' and t2.fskssqq=to_date(''#prestartDate'') and t2.fskssqz=to_date(''#preendDate'') and t2.fnsrtype=''#taxpayertype'']}))/1.05*0.05  +  ({S[select sum(t1.fpricetaxamount) from t_tcvat_hz_account_summar t1 where t1.ftaxpayertype = ''#taxpayertype'' and t1.forgid=''#orgid''  and t1.fstartdate=to_date(''#startDate'') and t1.fenddate = to_date(''#endDate'') and t1.fjzjt=''0'' and t1.ftaxrate=''3%'']} - min({S[select sum(t1.fpricetaxamount) from t_tcvat_hz_account_summar t1 where t1.ftaxpayertype = ''#taxpayertype'' and  t1.forgid=''#orgid'' and t1.fstartdate=to_date(''#startDate'') and t1.fenddate = to_date(''#endDate'') and t1.fjzjt=''0'' and t1.ftaxrate=''3%'']}, {S[select sum(fcurrentamount) from t_tcvat_hz_diff_temp where forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate = to_date(''#endDate'') and fjzjt=''0''  and fdifftypeid=859352590188589061]} + {S[select sum(t1.fqmye) from t_tcvat_ybnsr_fb3 t1 left join t_tctb_declare_main t2 on t1.fsbbid = CONCAT(t2.fid , '''') where t1.fewblxh=''6'' and t2.forgid=''#orgid'' and t2.fskssqq=to_date(''#prestartDate'') and t2.fskssqz=to_date(''#preendDate'') and t2.fnsrtype=''#taxpayertype'']}))/1.03*0.03)');
DELETE FROM t_tctb_formula WHERE FID = 1626005309807968471;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1626005309807968471,{ts'2024-01-16  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#7#jzjtxm',' ','增值税汇总一般企业税额计算总览表#7#即征即退项目','1','7','1626005309052994560','draft_zzsybnsr_ybhz_sjjt','tcvat_zlb_zzsybnsr_ybhz','jzjtxm',' ',' ','if({C[#diff]}=0 || ({C[#diff]}=1 && {C[#cekcdgBqfseHjJzjtS]}=0 && {C[#sqsbbFb3Qmye]}=0),{S[select sum(t1.ftotaltaxamount) from t_tcvat_hz_account_sum_jt t1 , t_tpo_taxitemrateentry t2  where t1.ftaxpayertype = ''#taxpayertype'' and t1.fbusinesstypeid=t2.fentryid  and  t1.forgid=''#orgid'' and t1.fstartdate=to_date(''#startDate'') and t1.fenddate = to_date(''#endDate'') and t1.fjzjt=''1'' and t1.FTAXMETHOD = ''一般计税'' and (t2.flongnumber like ''3%''  or t2.flongnumber like ''4%''  or t2.flongnumber like ''5%'')]},({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_sum_jt s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''1'' and s.ftaxrate=''13%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]}-min({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_sum_jt s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''1'' and s.ftaxrate=''13%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]},{S[select sum(fdeductamount) from t_tcvat_hz_diff_temp_sjjt where ftaxpayertype=''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate=to_date(''#endDate'') and fjzjt=''1''  and fdifftypeid=859352590188589056]}))/1.13*0.13 + ({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_sum_jt s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''1'' and s.ftaxrate=''6%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]}-min({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_sum_jt s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid''  and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''1'' and s.ftaxrate=''6%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]},{S[select sum(fdeductamount) from t_tcvat_hz_diff_temp_sjjt where ftaxpayertype=''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate=to_date(''#endDate'') and fjzjt=''1''  and fdifftypeid in (859352590188589058,859352590188589059)]}))/1.06*0.06+ ({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_sum_jt s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''1'' and s.ftaxrate=''9%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]}-min({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_sum_jt s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid''  and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''1'' and s.ftaxrate=''9%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]},{S[select sum(fdeductamount) from t_tcvat_hz_diff_temp_sjjt where ftaxpayertype=''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate=to_date(''#endDate'') and fjzjt=''1''  and fdifftypeid = 859352590188589057]}))/1.09*0.09)');

DELETE FROM t_tctb_formula WHERE FID = 1626005309807968271;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1626005309807968271,{ts'2023-11-09  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#7#ybxm',' ','增值税汇总一般企业税额计算总览表#7#一般项目','1','7','1626005309052994560','draft_zzsybnsr_ybhz_sjjt','tcvat_zlb_zzsybnsr_ybhz','ybxm',' ',' ','if({C[#diff]}=0 || ({C[#diff]}=1 && {C[#cekcdgBqfseHjJzjtF]}=0 && {C[#sqsbbFb3Qmye]}=0),{S[select sum(s.ftotaltaxamount) from t_tcvat_hz_account_sum_jt s,t_tpo_taxitemrateentry t where s.ftaxpayertype=''#taxpayertype'' and s.fbusinesstypeid=t.fentryid and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''0'' and s.ftaxrate in(''6%'',''9%'',''10%'',''11%'',''13%'',''16%'',''17%'') and(t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]},({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_sum_jt s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''0'' and s.ftaxrate=''13%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]}-min({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_sum_jt s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''0'' and s.ftaxrate=''13%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]},{S[select sum(fcurrentamount) from t_tcvat_hz_diff_temp_sjjt where ftaxpayertype=''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate=to_date(''#endDate'') and fjzjt=''0''  and fdifftypeid=859352590188589056]}+{S[select sum(fqmye) from t_tcvat_ybnsr_fb3 where fsbbid=''#predeclaresbbid'' and fewblxh=''1'']}))/1.13*0.13+({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_sum_jt s left join t_tpo_taxitemrateentry t on s.fbusinesstypeid=t.fentryid where s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''0'' and s.ftaxrate=''9%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]}-min({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_sum_jt s left join t_tpo_taxitemrateentry t on s.fbusinesstypeid=t.fentryid where s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''0'' and s.ftaxrate=''9%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]},{S[select sum(fcurrentamount) from t_tcvat_hz_diff_temp_sjjt where ftaxpayertype=''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate=to_date(''#endDate'') and fjzjt=''0''  and fdifftypeid=859352590188589057]}+{S[select sum(fqmye) from t_tcvat_ybnsr_fb3 where fsbbid=''#predeclaresbbid'' and fewblxh=''2'']}))/1.09*0.09+({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_sum_jt s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid'' and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''0'' and s.ftaxrate=''6%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]}-min({S[select sum(s.fpricetaxamount) from t_tcvat_hz_account_sum_jt s,t_tpo_taxitemrateentry t where s.fbusinesstypeid=t.fentryid and s.ftaxpayertype=''#taxpayertype'' and s.forgid=''#orgid''  and s.fstartdate=to_date(''#startDate'') and s.fenddate=to_date(''#endDate'') and s.fjzjt=''0'' and s.ftaxrate=''6%'' and (t.flongnumber like ''3%'' or t.flongnumber like ''4%'' or t.flongnumber like ''5%'')]},{S[select sum(fcurrentamount) from t_tcvat_hz_diff_temp_sjjt where ftaxpayertype=''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate=to_date(''#endDate'') and fjzjt=''0''  and fdifftypeid in(859352590188589058,859352590188589059)]}+{S[select sum(fqmye) from t_tcvat_ybnsr_fb3 where fsbbid=''#predeclaresbbid'' and fewblxh in (''3'',''4'')]}))/1.06*0.06)');

