DELETE FROM t_tctb_formula WHERE FID = 1119581888181198848;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1119581888181198848,{ts'2021-11-08  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#1#ybxm',' ','增值税汇总一般企业税额计算总览表#1#一般项目','1','1','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','ybxm',' ',' ','{S[select sum(ftaxamount) from t_tcvat_hz_account_summar where ftaxpayertype = ''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate = to_date(''#endDate'') and ftaxmethod=''一般计税'' and fjzjt=''0'']}'); 
DELETE FROM t_tctb_formula WHERE FID = 1119583658403979264;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1119583658403979264,{ts'2021-11-08  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#2#ybxm',' ','增值税汇总一般企业税额计算总览表#2#一般项目','1','2','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','ybxm',' ',' ','{S[select sum(ftaxamount) from t_tcvat_hz_account_summar  where  ftaxpayertype = ''#taxpayertype'' and  forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate = to_date(''#endDate'')  and (ftaxmethod=''按3%简易征收'' or ftaxmethod=''按5%简易征收'') and fjzjt=''0'']}'); 
DELETE FROM t_tctb_formula WHERE FID = 1119586824894137344;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1119586824894137344,{ts'2021-11-08  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#1#jzjtxm',' ','增值税汇总一般企业税额计算总览表#1#即征即退项目','1','1','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','jzjtxm',' ',' ','{S[select sum(ftaxamount) from t_tcvat_hz_account_summar where ftaxpayertype = ''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate = to_date(''#endDate'')  and ftaxmethod=''一般计税'' and fjzjt=''1'']}'); 
DELETE FROM t_tctb_formula WHERE FID = 1119587139156205568;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1119587139156205568,{ts'2021-11-08  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#2#jzjtxm',' ','增值税汇总一般企业税额计算总览表#2#即征即退项目','1','2','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','jzjtxm',' ',' ','{S[select sum(ftaxamount) from t_tcvat_hz_account_summar where ftaxpayertype = ''#taxpayertype'' and  forgid=''#orgid''  and fstartdate=to_date(''#startDate'') and fenddate = to_date(''#endDate'')  and (ftaxmethod=''按3%简易征收'' or ftaxmethod=''按5%简易征收'') and fjzjt=''1'']}'); 
DELETE FROM t_tctb_formula WHERE FID = 1119590823500301312;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1119590823500301312,{ts'2021-11-08  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#4#ybxm',' ','增值税汇总一般企业税额计算总览表#4#一般项目','1','4','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','ybxm',' ',' ','{S[select sum(ftaxamount) from t_tcvat_hz_account_summar where  ftaxpayertype = ''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate = to_date(''#endDate'') and ftaxmethod in (''免税'',''出口免税'') and fjzjt=''0'']}'); 
DELETE FROM t_tctb_formula WHERE FID = 1119592829057090560;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1119592829057090560,{ts'2021-09-14  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#6#ybxm',' ','增值税汇总一般企业税额计算总览表#6#一般项目','1','6','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','ybxm',' ',' ','{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 (''9%'',''10%'',''11%'',''13%'',''16%'',''17%'') and (t2.flongnumber like ''1%'' or t2.flongnumber like ''2%'')]}'); 
--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'2022-12-06  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]}=1,({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 fdifftypeid=859352590188589056]}+{S[select sum(s.fqmye) from t_tcvat_ybnsr_fb3 s, t_tctb_declare_main t where s.fsbbid=CONCAT(t.fid,'''') and s.fewblxh=''1'' and t.forgid=''#orgid'' and t.fskssqq=to_date(''#prestartDate'') and t.fskssqz=to_date(''#preendDate'') and t.fnsrtype=''#taxpayertype'']}))/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 fdifftypeid=859352590188589057]}+{S[select sum(s.fqmye) from t_tcvat_ybnsr_fb3 s ,t_tctb_declare_main t where s.fsbbid=CONCAT(t.fid,'''') and s.fewblxh=''2'' and t.forgid=''#orgid'' and t.fskssqq=to_date(''#prestartDate'') and t.fskssqz=to_date(''#preendDate'') and t.fnsrtype=''#taxpayertype'']}))/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 fdifftypeid in(859352590188589058,859352590188589059)]}+{S[select sum(s.fqmye) from t_tcvat_ybnsr_fb3 s, t_tctb_declare_main t where s.fsbbid=CONCAT(t.fid,'''') and s.fewblxh in(''3'',''4'') and t.forgid=''#orgid'' and t.fskssqq=to_date(''#prestartDate'') and t.fskssqz=to_date(''#preendDate'') and t.fnsrtype=''#taxpayertype'']}))/1.06*0.06,{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%'')]})');
DELETE FROM t_tctb_formula WHERE FID = 1119594271108784128;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1119594271108784128,{ts'2021-11-08  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#9#ybxm',' ','增值税汇总一般企业税额计算总览表#9#一般项目','1','9','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','ybxm',' ',' ','{S[select sum(ftaxamount-finputtaxamount) from t_tcvat_hz_deduction_sum where ftaxpayertype = ''#taxpayertype'' and  forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate = to_date(''#endDate'')]}'); 
DELETE FROM t_tctb_formula WHERE FID = 1119594407356908544;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1119594407356908544,{ts'2021-11-08  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#10#ybxm',' ','增值税汇总一般企业税额计算总览表#10#一般项目','1','10','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','ybxm',' ',' ','{S[select sum(faccountingamount-fjzjtrolloutamount) from t_tcvat_hz_roll_out_sum where ftaxpayertype = ''#taxpayertype'' and forgid=''#orgid'' and fstartdate= to_date(''#startDate'') and fenddate = to_date(''#endDate'')]}'); 
DELETE FROM t_tctb_formula WHERE FID = 1120056162679899136;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1120056162679899136,{ts'2022-12-06  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#12#ybxm',' ','增值税汇总一般企业税额计算总览表#12#一般项目','1','12','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','ybxm',' ',' ','{S[SELECT fqmldse from t_tcvat_ybnsr_zb t1  where t1.fewblxh=''1'' AND t1.fsbbid IN (select CONCAT(fid , '''') from t_tctb_declare_main where FNSRTYPE = ''#taxpayertype'' and FSKSSQQ  = to_date(''#prestartDate'') and FSKSSQZ  = to_date(''#preendDate'') and FTAXLIMIT = ''month'' and  FORGID = ''#orgid'') ]}'); 
DELETE FROM t_tctb_formula WHERE FID = 1120059425689027584;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1120059425689027584,{ts'2022-12-06  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#16#ybxm',' ','增值税汇总一般企业税额计算总览表#16#一般项目','1','16','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','ybxm',' ',' ','{S[SELECT fqmye from t_tcvat_ybnsr_jjdj t1  where t1.fewblxh=''1'' AND t1.fsbbid IN (select CONCAT(fid , '''') from t_tctb_declare_main where FNSRTYPE = ''#taxpayertype'' and FSKSSQQ  = to_date(''#prestartDate'') and FSKSSQZ  = to_date(''#preendDate'') and FTAXLIMIT = ''month'' and  FORGID = ''#orgid'') ]}'); 
DELETE FROM t_tctb_formula WHERE FID = 1120059931655954432;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1120059931655954432,{ts'2021-11-08  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#17#ybxm',' ','增值税汇总一般企业税额计算总览表#17#一般项目','1','17','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','ybxm',' ',' ','{S[select sum(fcurrentamount) from t_tcvat_hz_income_add_tem where ftaxpayertype = ''#taxpayertype'' and  forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate = to_date(''#endDate'') and fservicetype=''一般计税项目'']}'); 
DELETE FROM t_tctb_formula WHERE FID = 1120060112271426560;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1120060112271426560,{ts'2021-11-08  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#18#ybxm',' ','增值税汇总一般企业税额计算总览表#18#一般项目','1','18','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','ybxm',' ',' ','{S[select sum(fcurrentdecrease) from t_tcvat_hz_income_add_tem where ftaxpayertype = ''#taxpayertype'' and  forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate = to_date(''#endDate'')  and fservicetype=''一般计税项目'']}'); 
DELETE FROM t_tctb_formula WHERE FID = 1120083752115187712;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1120083752115187712,{ts'2022-12-06  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#21#ybxm',' ','增值税汇总一般企业税额计算总览表#21#一般项目','1','21','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','ybxm',' ',' ','{S[SELECT t1.fqmye from t_tcvat_ybnsr_jsxm t1  where t1.fewblxh=''1'' AND t1.fsbbid IN (select CONCAT(fid , '''') from t_tctb_declare_main where FNSRTYPE =''#taxpayertype'' and FSKSSQQ  = to_date(''#prestartDate'') and FSKSSQZ  = to_date(''#preendDate'') and FTAXLIMIT = ''month'' and  FORGID = ''#orgid'') ]}'); 
DELETE FROM t_tctb_formula WHERE FID = 1120088023309402112;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1120088023309402112,{ts'2021-03-26  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#22#ybxm',' ','增值税汇总一般企业税额计算总览表#22#一般项目','1','22','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','ybxm',' ',' ','{S[select sum(fbqfse) from t_tcvat_hz_taxre_summary where ftaxpayertype = ''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate = to_date(''#endDate'')]}'); 
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'2022-12-06  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]} = 1,({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 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 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,{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%'') ]})'); 
DELETE FROM t_tctb_formula WHERE FID = 1120101537583382528;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1120101537583382528,{ts'2022-04-28  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#30#ybxm',' ','增值税汇总一般企业税额计算总览表#30#一般项目','1','30','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','ybxm',' ',' ','{S[SELECT sum(fyjsjje) FROM t_tctb_declare_entry WHERE fid IN (SELECT fid FROM t_tcvat_prepay_declare WHERE fskssqq>=to_date(''#prestartDate'') AND fskssqz<=to_date(''#endDate'') AND forgid in(select forgid from  t_tctb_org_group_detail where fcollectorg = ''#orgid'' and fid  in (select fid from t_tctb_org_group where ftaxtype=''zzs'' and feffectdate<=to_date(''#startDate'') and (finvaliddate>=to_date(''#endDate'') or finvaliddate is null) and fstatus = ''2'')) AND fpaystatus=''1'' AND  fdeductionperiod=''0'') AND ftaxtype=''1'']}'); 
DELETE FROM t_tctb_formula WHERE FID = 1120106605166407680;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1120106605166407680,{ts'2022-10-14  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#6#jzjtxm',' ','增值税汇总一般企业税额计算总览表#6#即征即退项目','1','6','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','jzjtxm',' ',' ','{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 ''1%'' or t2.flongnumber like ''2%'')]}'); 
DELETE FROM t_tctb_formula WHERE FID = 1120107439984132096;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1120107439984132096,{ts'2021-11-08  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#9#jzjtxm',' ','增值税汇总一般企业税额计算总览表#9#即征即退项目','1','9','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','jzjtxm',' ',' ','{S[select sum(finputtaxamount) from t_tcvat_hz_deduction_sum  where ftaxpayertype = ''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate = to_date(''#endDate'')]}'); 
DELETE FROM t_tctb_formula WHERE FID = 1120107578504982528;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1120107578504982528,{ts'2021-11-08  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#10#jzjtxm',' ','增值税汇总一般企业税额计算总览表#10#即征即退项目','1','10','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','jzjtxm',' ',' ','{S[select sum(fjzjtrolloutamount) from t_tcvat_hz_roll_out_sum where ftaxpayertype = ''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate = to_date(''#endDate'') ]}'); 
DELETE FROM t_tctb_formula WHERE FID = 1120110384075161600;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1120110384075161600,{ts'2022-12-06  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#12#jzjtxm',' ','增值税汇总一般企业税额计算总览表#12#即征即退项目','1','12','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','jzjtxm',' ',' ','{S[SELECT fqmldse from t_tcvat_ybnsr_zb t1  where t1.fewblxh=''3'' AND t1.fsbbid IN (select CONCAT(fid , '''') from t_tctb_declare_main where FNSRTYPE = ''#taxpayertype'' and FSKSSQQ  = to_date(''#prestartDate'') and FSKSSQZ  = to_date(''#preendDate'') and FTAXLIMIT = ''month'' and  FORGID = ''#orgid'') ]}'); 
DELETE FROM t_tctb_formula WHERE FID = 1120116307665534976;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1120116307665534976,{ts'2022-12-06  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#16#jzjtxm',' ','增值税汇总一般企业税额计算总览表#16#即征即退项目','1','16','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','jzjtxm',' ',' ','{S[SELECT fqmye from t_tcvat_ybnsr_jjdj t1  where t1.fewblxh=''2'' AND t1.fsbbid IN (select CONCAT(fid , '''') from t_tctb_declare_main where FNSRTYPE = ''#taxpayertype'' and FSKSSQQ  = to_date(''#prestartDate'') and FSKSSQZ  = to_date(''#preendDate'') and FTAXLIMIT = ''month'' and  FORGID = ''#orgid'') ]}'); 
DELETE FROM t_tctb_formula WHERE FID = 1120116617431429120;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1120116617431429120,{ts'2021-11-08  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#17#jzjtxm',' ','增值税汇总一般企业税额计算总览表#17#即征即退项目','1','17','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','jzjtxm',' ',' ','{S[select sum(fcurrentamount) from t_tcvat_hz_income_add_tem where ftaxpayertype = ''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate = to_date(''#endDate'') and fservicetype=''即征即退项目'']}'); 
DELETE FROM t_tctb_formula WHERE FID = 1120116774248300544;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1120116774248300544,{ts'2021-11-08  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#18#jzjtxm',' ','增值税汇总一般企业税额计算总览表#18#即征即退项目','1','18','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','jzjtxm',' ',' ','{S[select sum(fcurrentdecrease) from t_tcvat_hz_income_add_tem where ftaxpayertype = ''#taxpayertype'' and  forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate = to_date(''#endDate'') and fservicetype=''即征即退项目'']}'); 
DELETE FROM t_tctb_formula WHERE FID = 1120119240255782912;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1120119240255782912,{ts'2021-09-14  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#27#jzjtxm',' ','增值税汇总一般企业税额计算总览表#27#即征即退项目','1','27','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','jzjtxm',' ',' ','{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.ftaxrate in (''3%'',''5%'') ]}'); 
DELETE FROM t_tctb_formula WHERE FID = 1122453353990043648;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1122453353990043648,{ts'2021-03-29  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_dg_ybnsr_ybhz#1#mainid',' ','底稿单据表#1#底稿主数据ID','4','1','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_dg_ybnsr_ybhz','mainid','4',' ','{S[select fid from t_tctb_draft_main where forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate=to_date(''#endDate'') and ftemplatetype=''#templatetype'']}'); 
DELETE FROM t_tctb_formula WHERE FID = 1226740020363163648;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1226740020363163648,{ts'2021-11-08  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_YBHZ_01','tcvat_zlb_zzsybnsr_ybhz#3#ybxm',' ','增值税汇总一般企业税额计算总览表#3#一般项目','1','3','1119375361449286656','draft_zzsybnsr_ybhz','tcvat_zlb_zzsybnsr_ybhz','ybxm',' ',' ','{S[select sum(ftaxamount) from t_tcvat_hz_account_summar where  ftaxpayertype = ''#taxpayertype'' and forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate = to_date(''#endDate'') and ftaxmethod = ''免抵退税'' and fjzjt=''0'']}'); 
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'2022-10-14  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',' ',' ','{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%'')]}'); 
DELETE FROM t_tctb_formula WHERE FID = 1102698204035716096;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1102698204035716096,{ts'2021-07-26  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_01','tcvat_zlb_ybnsr#12#ybxm',' ','增值税一般纳税人总览表#12#一般项目','1','12','1102685677520327680','draft_zzsybnsr','tcvat_zlb_ybnsr','ybxm',' ',' ','{S[select t1.fqmldse from t_tcvat_ybnsr_zb t1 left join t_tctb_declare_main t2 on t1.fsbbid = CONCAT(t2.fid , '''') where t1.fewblxh=''1'' and t2.forgid=''#orgid'' and t2.fskssqq=to_date(''#prestartDate'') and t2.fskssqz=to_date(''#preendDate'') and t2.fnsrtype=''zzsybnsr'']}');
DELETE FROM t_tctb_formula WHERE FID = 1102698405119037440;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1102698405119037440,{ts'2021-07-26  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_01','tcvat_zlb_ybnsr#12#jzjtxm',' ','增值税一般纳税人总览表#12#即征即退项目','1','12','1102685677520327680','draft_zzsybnsr','tcvat_zlb_ybnsr','jzjtxm',' ',' ','{S[select t1.fqmldse from t_tcvat_ybnsr_zb t1 left join t_tctb_declare_main t2 on t1.fsbbid = CONCAT(t2.fid , '''') where t1.fewblxh=''3'' and t2.forgid=''#orgid'' and t2.fskssqq=to_date(''#prestartDate'') and t2.fskssqz=to_date(''#preendDate'') and t2.fnsrtype=''zzsybnsr'']}');
DELETE FROM t_tctb_formula WHERE FID = 1102702432355521536;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1102702432355521536,{ts'2021-07-26  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_01','tcvat_zlb_ybnsr#16#ybxm',' ','增值税一般纳税人总览表#16#一般项目','1','16','1102685677520327680','draft_zzsybnsr','tcvat_zlb_ybnsr','ybxm',' ',' ','{S[select t1.fqmye from t_tcvat_ybnsr_jjdj t1 left join t_tctb_declare_main t2 on t1.fsbbid = CONCAT(t2.fid , '''') where t1.fewblxh=''1'' and t2.forgid=''#orgid'' and t2.fskssqq=to_date(''#prestartDate'') and t2.fskssqz=to_date(''#preendDate'') and t2.fnsrtype=''zzsybnsr'']}');
DELETE FROM t_tctb_formula WHERE FID = 1102702679534243840;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1102702679534243840,{ts'2021-07-26  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_01','tcvat_zlb_ybnsr#16#jzjtxm',' ','增值税一般纳税人总览表#16#即征即退项目','1','16','1102685677520327680','draft_zzsybnsr','tcvat_zlb_ybnsr','jzjtxm',' ',' ','{S[select t1.fqmye from t_tcvat_ybnsr_jjdj t1 left join t_tctb_declare_main t2 on t1.fsbbid = CONCAT(t2.fid , '''') where t1.fewblxh=''2'' and t2.forgid=''#orgid'' and t2.fskssqq=to_date(''#prestartDate'') and t2.fskssqz=to_date(''#preendDate'') and t2.fnsrtype=''zzsybnsr'']}');
DELETE FROM t_tctb_formula WHERE FID = 1102868649745833984;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1102868649745833984,{ts'2021-07-26  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_01','tcvat_zlb_ybnsr#21#ybxm',' ','增值税一般纳税人总览表#21#一般项目','1','21','1102685677520327680','draft_zzsybnsr','tcvat_zlb_ybnsr','ybxm',' ',' ','{S[select t1.fqmye from t_tcvat_ybnsr_fb4 t1 left join t_tctb_declare_main t2 on t1.fsbbid = CONCAT(t2.fid , '''') where t1.fewblxh=''1'' and t2.forgid=''#orgid'' and t2.fskssqq=to_date(''#prestartDate'') and t2.fskssqz=to_date(''#preendDate'') and t2.fnsrtype=''zzsybnsr'']}');
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]} = 1,({S[select sum(t1.fpricetaxamount) from t_tcvat_income_summary t1 where t1.forgid=''#orgid'' and t1.ftaxperiod=''#taxperiod'' 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=''#taxperiod'' and t1.fjzjt=''0'' and t1.ftaxrate=''5%'']}, {S[select sum(fcurrentamount) from t_tcvat_diffdeduct where forgid=''#orgid'' and ftaxperiod=''#taxperiod'' 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=''#taxperiod'' 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=''#taxperiod'' and t1.fjzjt=''0'' and t1.ftaxrate=''3%'']}, {S[select sum(fcurrentamount) from t_tcvat_diffdeduct where forgid=''#orgid'' and ftaxperiod=''#taxperiod'' 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,{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=''#taxperiod'' and t1.fjzjt=''0'' and t1.ftaxrate in (''3%'',''5%'') ]})');
DELETE FROM t_tctb_formula WHERE FID = 1102887885847388160;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1102887885847388160,{ts'2021-03-02  00:00:00'},' ',' ','VAT_DRAFT_YBNSR_01','tcvat_dg_ybnsr#1#mainid',' ','底稿单据表#1#底稿主数据ID','4','1','1102685677520327680','draft_zzsybnsr','tcvat_dg_ybnsr','mainid',' ',' ','{S[select fid from t_tctb_draft_main where forgid=''#orgid'' and fstartdate=to_date(''#startDate'') and fenddate=to_date(''#endDate'') and ftemplatetype=''draft_zzsybnsr'']}');
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'2022-07-29  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]} = 1,({S[select sum(t1.fpricetaxamount) from t_tcvat_income_summary t1 left join t_tpo_taxitemrateentry t2 on t1.fbusinesstypeid=t2.fentryid where t1.forgid=''#orgid'' and t1.ftaxperiod=''#taxperiod'' and t1.fjzjt=''0'' and t1.ftaxrate=''13%'' and (t2.flongnumber like ''3%'' or t2.flongnumber like ''4%'' or t2.flongnumber like ''5%'')]} - min({S[select sum(t1.fpricetaxamount) from t_tcvat_income_summary t1 left join t_tpo_taxitemrateentry t2 on t1.fbusinesstypeid=t2.fentryid where t1.forgid=''#orgid'' and t1.ftaxperiod=''#taxperiod'' and t1.fjzjt=''0'' and t1.ftaxrate=''13%'' and (t2.flongnumber like ''3%'' or t2.flongnumber like ''4%'' or t2.flongnumber like ''5%'')]}, {S[select sum(fcurrentamount) from t_tcvat_diffdeduct where forgid=''#orgid'' and ftaxperiod=''#taxperiod'' and fdifftypeid=859352590188589056]} + {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=''1'' and t2.forgid=''#orgid'' and t2.fskssqq=to_date(''#prestartDate'') and t2.fskssqz=to_date(''#preendDate'') and t2.fnsrtype=''zzsybnsr'']}))/1.13*0.13  +  ({S[select sum(t1.fpricetaxamount) from t_tcvat_income_summary t1 left join t_tpo_taxitemrateentry t2 on t1.fbusinesstypeid=t2.fentryid where t1.forgid=''#orgid'' and t1.ftaxperiod=''#taxperiod'' and t1.fjzjt=''0'' and t1.ftaxrate=''9%'' and (t2.flongnumber like ''3%'' or t2.flongnumber like ''4%'' or t2.flongnumber like ''5%'')]} - min({S[select sum(t1.fpricetaxamount) from t_tcvat_income_summary t1 left join t_tpo_taxitemrateentry t2 on t1.fbusinesstypeid=t2.fentryid where t1.forgid=''#orgid'' and t1.ftaxperiod=''#taxperiod'' and t1.fjzjt=''0'' and t1.ftaxrate=''9%'' and (t2.flongnumber like ''3%'' or t2.flongnumber like ''4%'' or t2.flongnumber like ''5%'')]}, {S[select sum(fcurrentamount) from t_tcvat_diffdeduct where forgid=''#orgid'' and ftaxperiod=''#taxperiod'' and fdifftypeid=859352590188589057]} + {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=''2'' and t2.forgid=''#orgid'' and t2.fskssqq=to_date(''#prestartDate'') and t2.fskssqz=to_date(''#preendDate'') and t2.fnsrtype=''zzsybnsr'']}))/1.09*0.09  +  ({S[select sum(t1.fpricetaxamount) from t_tcvat_income_summary t1 left join t_tpo_taxitemrateentry t2 on t1.fbusinesstypeid=t2.fentryid where t1.forgid=''#orgid'' and t1.ftaxperiod=''#taxperiod'' and t1.fjzjt=''0'' and t1.ftaxrate=''6%'' and (t2.flongnumber like ''3%'' or t2.flongnumber like ''4%'' or t2.flongnumber like ''5%'')]} - min({S[select sum(t1.fpricetaxamount) from t_tcvat_income_summary t1 left join t_tpo_taxitemrateentry t2 on t1.fbusinesstypeid=t2.fentryid where t1.forgid=''#orgid'' and t1.ftaxperiod=''#taxperiod'' and t1.fjzjt=''0'' and t1.ftaxrate=''6%'' and (t2.flongnumber like ''3%'' or t2.flongnumber like ''4%'' or t2.flongnumber like ''5%'')]}, {S[select sum(fcurrentamount) from t_tcvat_diffdeduct where forgid=''#orgid'' and ftaxperiod=''#taxperiod'' and fdifftypeid in(859352590188589058,859352590188589059)]} + {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 in(''3'', ''4'') and t2.forgid=''#orgid'' and t2.fskssqq=to_date(''#prestartDate'') and t2.fskssqz=to_date(''#preendDate'') and t2.fnsrtype=''zzsybnsr'']}))/1.06*0.06 , {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=''#taxperiod'' and t1.fjzjt=''0'' and t1.ftaxrate in (''6%'',''9%'',''10%'',''11%'',''13%'',''16%'',''17%'') and (t2.flongnumber like ''3%'' or t2.flongnumber like ''4%'' or t2.flongnumber like ''5%'')]})');
DELETE FROM t_tctb_formula WHERE FID = 1012959473620370432;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1012959473620370432,{ts'2020-12-23  00:00:00'},' ',' ','VAT_PRE_201904','tcvat_prepay#1#advancescale','{S[SELECT e.fprepayrate FROM T_TCVAT_PROJECT_ACCOUNT a LEFT JOIN t_tcvat_account_entry e ON e.fid = a.fid WHERE a.forgid = ''#orgid'' AND a.fprojectid= ''#projectid'' and a.fprepaytype IN (''VAT_YJXMLX_001'',''VAT_YJXMLX_002'') AND e.ftaxtype = ''增值税'']}','增值税预缴税款表#1#预征率','4','1','1012120395395992576','zzsyjskb','tcvat_prepay','advancescale',' ',' ','{S[SELECT e.fprepayrate FROM  t_tcvat_account_entry e  WHERE  e.ftaxtype = ''增值税'' and e.fid = (select fid from T_TCVAT_PROJECT_ACCOUNT a where a.forgid = ''#orgid'' AND a.fprojectid= ''#projectid'' and a.fprepaytype IN (''VAT_YJXMLX_001'',''VAT_YJXMLX_002'') and a.fstartdate= to_date(''#startDate'') AND a.fenddate = to_date(''#endDate'') and a.fdeclareserialno = ''#declareserialno'')]}');
DELETE FROM t_tctb_formula WHERE FID = 1012960922953849856;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1012960922953849856,{ts'2020-12-23  00:00:00'},' ',' ','VAT_PRE_201904','tcvat_prepay#2#advancescale',' ','增值税预缴税款表#2#预征率','4','2','1012120395395992576','zzsyjskb','tcvat_prepay','advancescale',' ',' ','{S[SELECT e.fprepayrate FROM  t_tcvat_account_entry e  WHERE  e.ftaxtype = ''增值税'' and e.fid = (select fid from T_TCVAT_PROJECT_ACCOUNT a where a.forgid = ''#orgid'' AND a.fprojectid= ''#projectid'' and a.fprepaytype IN (''VAT_YJXMLX_003'',''VAT_YJXMLX_004'') and a.fstartdate= to_date(''#startDate'') AND a.fenddate = to_date(''#endDate'') and a.fdeclareserialno = ''#declareserialno'')]}');
DELETE FROM t_tctb_formula WHERE FID = 1012961128541733888;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1012961128541733888,{ts'2020-12-23  00:00:00'},' ',' ','VAT_PRE_201904','tcvat_prepay#3#advancescale',' ','增值税预缴税款表#3#预征率','4','3','1012120395395992576','zzsyjskb','tcvat_prepay','advancescale',' ',' ','{S[SELECT e.fprepayrate FROM  t_tcvat_account_entry e  WHERE  e.ftaxtype = ''增值税'' and e.fid = (select fid from T_TCVAT_PROJECT_ACCOUNT a where a.forgid = ''#orgid'' AND a.fprojectid= ''#projectid'' and a.fprepaytype = ''VAT_YJXMLX_005'' and a.fstartdate= to_date(''#startDate'') AND a.fenddate = to_date(''#endDate'') and a.fdeclareserialno = ''#declareserialno'')]}');
DELETE FROM t_tctb_formula WHERE FID = 1107052779463092224;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1107052779463092224,{ts'2022-05-27  00:00:00'},' ',' ','VAT_DRAFT_XGMNSR_01','tcvat_zlb_xgmnsr#4#hj',' ','增值税小规模纳税人总览表#4#合计','1','4','1105045617790692352','draft_zzsxgmnsr','tcvat_zlb_xgmnsr','hj',' ',' ','if({C[#type]} = 0, {S[select fqmye from t_tcvat_ybnsr_jsxm  where FEWBLXH = ''1'' and FSBBID in (select CONCAT(fid , '''')  from t_tctb_declare_main where FNSRTYPE = ''zzsxgmnsr'' and FSKSSQQ  = to_date(''#prestartDate'') and FSKSSQZ  = to_date(''#preendDate'') and FTAXLIMIT = ''month'' and  FORGID = ''#orgid'' )]}, {S[select fqmye from t_tcvat_ybnsr_jsxm  where FEWBLXH = ''1'' and FSBBID in (select CONCAT(fid , '''')  from t_tctb_declare_main where FNSRTYPE = ''zzsxgmnsr'' and FSKSSQQ  = to_date(''#prestartDate'') and FSKSSQZ  = to_date(''#preendDate'') and FTAXLIMIT = ''season'' and  FORGID = ''#orgid'' )]})');
DELETE FROM t_tctb_formula WHERE FID = 1117971652504854528;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1117971652504854528,{ts'2021-03-23  00:00:00'},' ',' ','VAT_DRAFT_XGMNSR_01','tcvat_dg_xgmnsr#1#mainid',' ','底稿单据表#1#底稿主数据ID','1','1','1105045617790692352','draft_zzsxgmnsr','tcvat_dg_xgmnsr','mainid','1',' ','{S[select fid from t_tctb_draft_main where forgid=''#orgid'' and fstartdate=to_date(''#start'') and fenddate=to_date(''#end'') and ftemplatetype=''draft_zzsxgmnsr'']}');
DELETE FROM t_tctb_formula WHERE FID = 1327545448013157376;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1327545448013157376,{ts'2022-01-06  00:00:00'},' ',' ','VAT_PRE_202108','tcvat_prepay#1#advancescale',' ',' ','4','1','1327514460772141056','zzsyjskb','tcvat_prepay','advancescale',' ',' ','{S[SELECT e.fprepayrate FROM  t_tcvat_account_entry e  WHERE  e.ftaxtype = ''增值税'' and e.fid = (select fid from T_TCVAT_PROJECT_ACCOUNT a where a.forgid = ''#orgid'' AND a.fprojectid= ''#projectid'' and a.fprepaytype IN (''VAT_YJXMLX_001'',''VAT_YJXMLX_002'') and a.fstartdate= ''#startDate'' AND a.fenddate = ''#endDate'' and a.fdeclareserialno = ''#declareserialno'')]}');
DELETE FROM t_tctb_formula WHERE FID = 1327545606725620736;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1327545606725620736,{ts'2022-01-06  00:00:00'},' ',' ','VAT_PRE_202108','tcvat_prepay#2#advancescale',' ',' ','4','2','1327514460772141056','zzsyjskb','tcvat_prepay','advancescale',' ',' ','{S[SELECT e.fprepayrate FROM  t_tcvat_account_entry e  WHERE  e.ftaxtype = ''增值税'' and e.fid = (select fid from T_TCVAT_PROJECT_ACCOUNT a where a.forgid = ''#orgid'' AND a.fprojectid= ''#projectid'' and a.fprepaytype IN (''VAT_YJXMLX_003'',''VAT_YJXMLX_004'') and a.fstartdate= ''#startDate'' AND a.fenddate = ''#endDate'' and a.fdeclareserialno = ''#declareserialno'')]}');
DELETE FROM t_tctb_formula WHERE FID = 1327545764062352384;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1327545764062352384,{ts'2022-01-06  00:00:00'},' ',' ','VAT_PRE_202108','tcvat_prepay#3#advancescale',' ',' ','4','3','1327514460772141056','zzsyjskb','tcvat_prepay','advancescale',' ',' ','{S[SELECT e.fprepayrate FROM  t_tcvat_account_entry e  WHERE  e.ftaxtype = ''增值税'' and e.fid = (select fid from T_TCVAT_PROJECT_ACCOUNT a where a.forgid = ''#orgid'' AND a.fprojectid= ''#projectid'' and a.fprepaytype = ''VAT_YJXMLX_005'' and a.fstartdate= ''#startDate'' AND a.fenddate = ''#endDate'' and a.fdeclareserialno = ''#declareserialno'')]}');
DELETE FROM t_tctb_formula WHERE FID = 1327550967599780864;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1327550967599780864,{ts'2022-01-06  00:00:00'},' ',' ','VAT_PRE_202108','tcvat_prepay_flzl#1#sl',' ',' ','4','1','1327514460772141056','zzsyjskb','tcvat_prepay_flzl','sl',' ',' ','{S[SELECT e.fprepayrate FROM  t_tcvat_account_entry e  WHERE  e.ftaxtype = ''城市建设维护税'' and e.fid = (select fid from T_TCVAT_PROJECT_ACCOUNT a where a.forgid = ''#orgid'' AND a.fprojectid= ''#projectid'' and a.fstartdate= ''#startDate'' AND a.fenddate = ''#endDate'' and a.fdeclareserialno = ''#declareserialno'')]}');
DELETE FROM t_tctb_formula WHERE FID = 1327553244267992064;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1327553244267992064,{ts'2022-01-06  00:00:00'},' ',' ','VAT_PRE_202108','tcvat_prepay_flzl#2#sl',' ',' ','4','2','1327514460772141056','zzsyjskb','tcvat_prepay_flzl','sl',' ',' ','{S[SELECT e.fprepayrate FROM  t_tcvat_account_entry e  WHERE  e.ftaxtype = ''教育附加税'' and e.fid = (select fid from T_TCVAT_PROJECT_ACCOUNT a where a.forgid = ''#orgid'' AND a.fprojectid= ''#projectid'' and a.fstartdate= ''#startDate'' AND a.fenddate = ''#endDate'' and a.fdeclareserialno = ''#declareserialno'')]}');
DELETE FROM t_tctb_formula WHERE FID = 1327553327055164416;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1327553327055164416,{ts'2022-01-06  00:00:00'},' ',' ','VAT_PRE_202108','tcvat_prepay_flzl#3#sl',' ',' ','4','3','1327514460772141056','zzsyjskb','tcvat_prepay_flzl','sl',' ',' ','{S[SELECT e.fprepayrate FROM  t_tcvat_account_entry e  WHERE  e.ftaxtype = ''地方教育附加税'' and e.fid = (select fid from T_TCVAT_PROJECT_ACCOUNT a where a.forgid = ''#orgid'' AND a.fprojectid= ''#projectid'' and a.fstartdate= ''#startDate'' AND a.fenddate = ''#endDate'' and a.fdeclareserialno = ''#declareserialno'')]}');
DELETE FROM t_tctb_formula WHERE FID = 1386788771537664013;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1386788771537664013,{ts'2022-03-29  00:00:00'},' ',' ','VAT_PRE_202206','tcvat_prepay#1#advancescale',' ',' ','4','1','1386788769012694016','zzsyjskb','tcvat_prepay','advancescale',' ',' ','{S[SELECT e.fprepayrate FROM  t_tcvat_account_entry e  WHERE  e.ftaxtype = ''增值税'' and e.fid = (select fid from T_TCVAT_PROJECT_ACCOUNT a where a.forgid = ''#orgid'' AND a.fprojectid= ''#projectid'' and a.fprepaytype IN (''VAT_YJXMLX_001'',''VAT_YJXMLX_002'') and a.fstartdate= to_date(''#startDate'') AND a.fenddate = to_date(''#endDate'') and a.fdeclareserialno = ''#declareserialno'')]}');
DELETE FROM t_tctb_formula WHERE FID = 1386788771537664014;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1386788771537664014,{ts'2022-03-29  00:00:00'},' ',' ','VAT_PRE_202206','tcvat_prepay#2#advancescale',' ',' ','4','2','1386788769012694016','zzsyjskb','tcvat_prepay','advancescale',' ',' ','{S[SELECT e.fprepayrate FROM  t_tcvat_account_entry e  WHERE  e.ftaxtype = ''增值税'' and e.fid = (select fid from T_TCVAT_PROJECT_ACCOUNT a where a.forgid = ''#orgid'' AND a.fprojectid= ''#projectid'' and a.fprepaytype IN (''VAT_YJXMLX_003'',''VAT_YJXMLX_004'') and a.fstartdate= to_date(''#startDate'') AND a.fenddate = to_date(''#endDate'') and a.fdeclareserialno = ''#declareserialno'')]}');
DELETE FROM t_tctb_formula WHERE FID = 1386788771537664015;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1386788771537664015,{ts'2022-03-29  00:00:00'},' ',' ','VAT_PRE_202206','tcvat_prepay#3#advancescale',' ',' ','4','3','1386788769012694016','zzsyjskb','tcvat_prepay','advancescale',' ',' ','{S[SELECT e.fprepayrate FROM  t_tcvat_account_entry e  WHERE  e.ftaxtype = ''增值税'' and e.fid = (select fid from T_TCVAT_PROJECT_ACCOUNT a where a.forgid = ''#orgid'' AND a.fprojectid= ''#projectid'' and a.fprepaytype = ''VAT_YJXMLX_005'' and a.fstartdate= to_date(''#startDate'') AND a.fenddate = to_date(''#endDate'') and a.fdeclareserialno = ''#declareserialno'')]}');
DELETE FROM t_tctb_formula WHERE FID = 1386788771537664023;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1386788771537664023,{ts'2022-03-29  00:00:00'},' ',' ','VAT_PRE_202206','tcvat_prepay_flzl#1#sl',' ',' ','4','1','1386788769012694016','zzsyjskb','tcvat_prepay_flzl','sl',' ',' ','{S[SELECT e.fprepayrate FROM  t_tcvat_account_entry e  WHERE  e.ftaxtype = ''城市建设维护税'' and e.fid = (select fid from T_TCVAT_PROJECT_ACCOUNT a where a.forgid = ''#orgid'' AND a.fprojectid= ''#projectid'' and a.fstartdate= to_date(''#startDate'') AND a.fenddate = to_date(''#endDate'') and a.fdeclareserialno = ''#declareserialno'')]}');
DELETE FROM t_tctb_formula WHERE FID = 1386788771537664024;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1386788771537664024,{ts'2022-03-29  00:00:00'},' ',' ','VAT_PRE_202206','tcvat_prepay_flzl#2#sl',' ',' ','4','2','1386788769012694016','zzsyjskb','tcvat_prepay_flzl','sl',' ',' ','{S[SELECT e.fprepayrate FROM  t_tcvat_account_entry e  WHERE  e.ftaxtype = ''教育附加税'' and e.fid = (select fid from T_TCVAT_PROJECT_ACCOUNT a where a.forgid = ''#orgid'' AND a.fprojectid= ''#projectid'' and a.fstartdate= to_date(''#startDate'') AND a.fenddate = to_date(''#endDate'') and a.fdeclareserialno = ''#declareserialno'')]}');
DELETE FROM t_tctb_formula WHERE FID = 1386788771537664025;
INSERT INTO t_tctb_formula(FID,FUPDATETIME,FCONTENT,FTITLE,FTEMPLATENUM,FFORMULAKEY,FFORMULANAME,FNAME,FFORMULATYPE,FROW,FTEMPLATEID,FTAXTYPE,FTABLE,FCOLUMN,FCELLTYPE,FDESCRIBE,FFORMULA) VALUES (1386788771537664025,{ts'2022-03-29  00:00:00'},' ',' ','VAT_PRE_202206','tcvat_prepay_flzl#3#sl',' ',' ','4','3','1386788769012694016','zzsyjskb','tcvat_prepay_flzl','sl',' ',' ','{S[SELECT e.fprepayrate FROM  t_tcvat_account_entry e  WHERE  e.ftaxtype = ''地方教育附加税'' and e.fid = (select fid from T_TCVAT_PROJECT_ACCOUNT a where a.forgid = ''#orgid'' AND a.fprojectid= ''#projectid'' and a.fstartdate= to_date(''#startDate'') AND a.fenddate = to_date(''#endDate'') and a.fdeclareserialno = ''#declareserialno'')]}');
