📄 settle.ec
字号:
/* 系统轧帐 */#include </u/ebcsav/include/sav.h>$include sqlca;$include sqlda;void type_op();char edit_op();void addspace();char y_n();void mess();char readch();char readdv();char readst();void mess();#include </u/ebcsav/include/begin>short i,j,h,n,l,p=0;$ char sav[2],se[2],te1[2],st1[2],saf[2],tef1[2],tef2[2],tef3[2];$ char sas[2],saq[2],teq1[2],teq2[2],sac[2],tec1[2],tec2[2];$ char sah[2],teh[2],sae[2],sat[2],cu_type[2],c_type[2];$ char sa[8]={1,2,3,4,5,6,7,100};$ char tef[7]={3,6,12,24,36,60,100};$ char teu[5]={1,3,6,12,24};$ char ted[4]={12,36,60,100};$ char tel[6]={1,3,6,9,12,100};$ char teb[4]={12,36,60,100};$ char st[3]={'D','E','P'};$ char ss[5]={'C','I','O','R','T'};$ long voud,vouc,ur,y_ur,uro,urc,vou,y_chx,chx;$ short y_urh,y_urf,y_ch,ch,urh,urf,uruh,uruf,t_urh,t_urf,t_ch;$ double amoun,amound,amounc,balat,y_balat;$ long voudx,voucx,urx,urox,urcx;$ short t_urfx,t_urhx,t_urhz,t_urfz,t_chx,urhz,urfz,urufz,uruhz,urhx,uruhx;$ short urfx,urufx;$ double amoundx,amouncx,balatx,y_balax;$ long voudz,voucz,urz,uroz,urcz;$ double amoundz,amouncz,balatz,y_balaz;$ double y_inte,t_inte,inte,d_inte;$ double y_intex,t_intex,d_intex;$ char cu[3]={'U','J','H'};$ database saving;se[0]=op.num&0x7f;st1[1]='\0';te1[1]='\0';tef1[1]='\0';tef2[1]='\0';tef3[1]='\0';se[1]='\0';sav[1]='\0';sat[1]='\0';sas[1]='\0';saq[1]='\0';sah[1]='\0';saf[1]='\0';cu_type[1]='\0';c_type[1]='\0';amoundz=amouncz=balatz=0.0;voudz=voucz=urz=uroz=urcz=t_urhz=t_urfz=urhz=urfz=uruhz=urufz=0;move(0,33);printw("系 统 轧 帐");move(14,29);printw("正 在 统 计 , 请 等 待");refresh();$ begin work;for(h=0;h<7;h++){ amoundx=amouncx=balatx=0.0; voudx=voucx=urx=urox=urcx=t_urhx=t_urfx=0; sav[0]=sa[h]; switch(h) { case 0: n=6; break; case 1: n=1; break; case 2: n=3; break; case 3: n=3; break; case 4: n=1; break; case 5: n=5; break; case 6: n=1; break; } for(i=0;i<n;i++) { amound=0.0; amounc=0.0; voud=0; vouc=0; switch(h) { case 0: te1[0]=tef[i]; $ select sum(amount),count(*) into $balat,$ur from r_fix where sec_num=$se and term=$te1 and status!="E" and status!="B"; break; case 1: te1[0]=0; $ select sum(amount),count(*) into $balat,$ur from r_demand where sec_num=$se and status!="E" and status!="B"; break; case 2: te1[0]=ted[i]; $ select sum(balance),count(*) into $balat,$ur from r_dated where sec_num=$se and term=$te1 and status!="E" and status!="B"; break; case 3: te1[0]=teb[i]; balat=0.0; ur=0; break; case 4: te1[0]=0; balat=0.0; ur=0; break; case 5: te1[0]=tel[i]; $ select sum(amount),count(*) into $balat,$ur from l_fix where sec_num=$se and term=$te1 and status!="E" and status!="B"; break; case 6: te1[0]=0; $ select sum(amount),count(*) into $balat,$ur from r_call where sec_num=$se and status!="E" and status!="B"; break; } if(ur==0) balat=0.0; if(sqlca.sqlcode!=0) { move(20,20); printw("select错(%d), ",sqlca.sqlcode); getch(); } for(j=0;j<5;j++) { st1[0]=ss[j]; if(sav[0]==2||sav[0]==5||sav[0]==7) $ select sum(amount),count(*) into $amoun,$vou from r_blot where sec_num=$se and sav_type=$sav and status=$st1 and cre_num>0; else $ select sum(amount),count(*) into $amoun,$vou from r_blot where sec_num=$se and sav_type=$sav and term=$te1 and status=$st1 and cre_num>0; if(sqlca.sqlcode!=0) { move(20,20); printw("select错(%d), ",sqlca.sqlcode); getch(); } if(vou==0)amoun=0.0; amounc+=amoun; vouc+=vou; } for(j=0;j<3;j++) { st1[0]=st[j]; if(sav[0]==2||sav[0]==5||sav[0]==7) $ select sum(amount),count(*) into $amoun,$vou from r_blot where sec_num=$se and sav_type=$sav and status=$st1 and cre_num>0; else $ select sum(amount),count(*) into $amoun,$vou from r_blot where sec_num=$se and sav_type=$sav and term=$te1 and status=$st1 and cre_num>0; if(sqlca.sqlcode!=0) { move(20,20); printw("select错(%d), ",sqlca.sqlcode); getch(); } if(vou==0)amoun=0.0; amound+=amoun; voud+=vou; } if(sav[0]==2||sav[0]==5||sav[0]==7) $ select count(*) into $uro from r_blot where sec_num=$se and sav_type=$sav and ( status="O"or status="R") and cre_num>0; else $ select count(*) into $uro from r_blot where sec_num=$se and sav_type=$sav and term=$te1 and ( status="O"or status="R") and cre_num>0; if(sav[0]==2||sav[0]==5||sav[0]==7) $ select count(*) into $urc from r_blot where sec_num=$se and sav_type=$sav and ( status="E"or status="P") and cre_num>0; else $ select count(*) into $urc from r_blot where sec_num=$se and sav_type=$sav and term=$te1 and ( status="E"or status="P") and cre_num>0; if(sav[0]==2||sav[0]==5||sav[0]==7) { $ select count(*) into $urh from r_blot where sec_num=$se and sav_type=$sav and cur_type="R" and status="H" and cre_num>0; $ select count(*) into $uruh from r_blot where sec_num=$se and sav_type=$sav and cur_type="R" and status="L" and cre_num>0; $ select count(*) into $urf from r_blot where sec_num=$se and sav_type=$sav and cur_type="R" and status="F" and cre_num>0; $ select count(*) into $uruf from r_blot where sec_num=$se and sav_type=$sav and cur_type="R" and status="U" and cre_num>0; } else { $ select count(*) into $urh from r_blot where sec_num=$se and sav_type=$sav and term=$te1 and cur_type="R" and status="H" and cre_num>0; $ select count(*) into $uruh from r_blot where sec_num=$se and sav_type=$sav and term=$te1 and cur_type="R" and status="L" and cre_num>0; $ select count(*) into $urf from r_blot where sec_num=$se and sav_type=$sav and term=$te1 and cur_type="R" and status="F" and cre_num>0; $ select count(*) into $uruf from r_blot where sec_num=$se and sav_type=$sav and term=$te1 and cur_type="R" and status="U" and cre_num>0; } if(sav[0]==2||sav[0]==5||sav[0]==7) $ select yest_hang,yest_free,yest_chan into $y_urh,$y_urf,$y_ch from r_dai where sav_type=$sav; else $ select yest_hang,yest_free,yest_chan into $y_urh,$y_urf,$y_ch from r_dai where sav_type=$sav and term=$te1; t_urh=y_urh+urh-uruh; t_urf=y_urf+urf-uruf; if(sav[0]==2||sav[0]==5||sav[0]==7) $ update r_dai set debi_amoun=$amound,cred_amoun=$amounc,today_bala=$balat, open_user=$uro,canc_user=$urc,today_user=$ur,debi_vouch=$voud, cred_vouch=$vouc,hang_up=$urh,lift_hang=$uruh,today_hang=$t_urh, freeze=$urf,unfreeze=$uruf,today_free=$t_urf where sav_type=$sav; else $ update r_dai set debi_amoun=$amound,cred_amoun=$amounc,today_bala=$balat, open_user=$uro,canc_user=$urc,today_user=$ur,debi_vouch=$voud, cred_vouch=$vouc,hang_up=$urh,lift_hang=$uruh,today_hang=$t_urh, freeze=$urf,unfreeze=$uruf,today_free=$t_urf where sav_type=$sav and term=$te1; if(sqlca.sqlerrd[2]!=1) { move(20,20); printw("update错(%d), ",sqlca.sqlcode); getch(); p=1; break; } amoundx+=amound; amouncx+=amounc; balatx+=balat; voudx+=voud; voucx+=vouc; urx+=ur; urox+=uro; urcx+=urc; t_urhx+=t_urh; t_urfx+=t_urf; urhz+=urh; urfz+=urf; uruhz+=uruh; urufz+=uruf; }amoundz+=amoundx;amouncz+=amouncx;balatz+=balatx;voudz+=voudx;voucz+=voucx;urz+=urx;uroz+=urox;urcz+=urcx;t_urhz+=t_urhx;t_urfz+=t_urfx;if((h==1)||(h==4)||(h==6))continue;te1[0]=100;$ update r_dai set debi_amoun=$amoundx,cred_amoun=$amouncx,today_bala=$balatx, open_user=$urox,canc_user=$urcx,today_user=$urx,debi_vouch=$voudx, cred_vouch=$voucx,today_hang=$t_urhx,today_free=$t_urfx where sav_type=$sav and term=$te1;if(sqlca.sqlerrd[2]!=1) { move(20,20); printw("update错(%d), ",sqlca.sqlcode); getch(); p=1; }}te1[0]=100;sav[0]=100;$ update r_dai set debi_amoun=$amoundz,cred_amoun=$amouncz,today_bala=$balatz, open_user=$uroz,canc_user=$urcz,today_user=$urz,debi_vouch=$voudz, cred_vouch=$voucz,hang_up=$urhz,lift_hang=$uruhz,today_hang=$t_urhz, freeze=$urfz,unfreeze=$urufz,today_free=$t_urfz where sav_type=$sav and term=$te1;if(sqlca.sqlerrd[2]!=1) { move(20,20); printw("update错(%d), ",sqlca.sqlcode); getch(); p=1; }sav[0]=101;d_intex=t_intex=0.0;for(i=1;i<5;i++){d_inte=inte=0.0;te1[0]=i;$ select yest_bala into $y_inte from r_dai where sav_type=$sav and term=$te1;switch(i) { case 1: saf[0]=1; tef1[0]=3; tef2[0]=6; tef3[0]=12; saq[0]=3; teq1[0]=12; sac[0]=4; tec1[0]=12; sae[0]=6; $ select sum(interest),count(*) into $inte,$vou from r_blot where sec_num=$se and sav_type=$saf and ( term=$tef1 or term=$tef2 or term=$tef3 ) and ( status="E" or status="P" ) and cre_num>0; if(vou==0)inte=0.0; d_inte+=inte; $ select sum(interest),count(*) into $inte,$vou from r_blot where sec_num=$se and sav_type=$saq and term=$teq1 and ( status="E" or status="P" ) and cre_num>0; if(vou==0)inte=0.0; d_inte+=inte; $ select sum(interest),count(*) into $inte,$vou from r_blot where sec_num=$se and sav_type=$sac and term=$tec1 and ( status="E" or status="P" ) and cre_num>0; if(vou==0)inte=0.0; d_inte+=inte; $ select sum(interest),count(*) into $inte,$vou from r_blot where sec_num=$se and sav_type=$sae and status="E" and cre_num>0; if(vou==0)inte=0.0; d_inte+=inte; break; case 2: saf[0]=1; tef1[0]=24; tef2[0]=36; tef3[0]=60; saq[0]=3; teq1[0]=36; teq2[0]=60; sac[0]=4; tec1[0]=36; tec2[0]=60; $ select sum(interest),count(*) into $inte,$vou from r_blot where sec_num=$se and sav_type=$saf and ( term=$tef1 or term=$tef2 or term=$tef3 ) and ( status="E" or status="P" ) and cre_num>0; if(vou==0)inte=0.0; d_inte+=inte; $ select sum(interest),count(*) into $inte,$vou from r_blot where sec_num=$se and sav_type=$saq and ( term=$teq1 or term=$teq2 ) and ( status="E" or status="P" ) and cre_num>0; if(vou==0)inte=0.0; d_inte+=inte; $ select sum(interest),count(*) into $inte,$vou from r_blot where sec_num=$se and sav_type=$sac and ( term=$tec1 or term=$tec2 ) and ( status="E" or status="P" ) and cre_num>0; if(vou==0)inte=0.0; d_inte+=inte; break; case 3: $ select sum(amount),count(*) into $inte,$vou from r_blot where sec_num=$se and status="M" and cre_num>0; if(vou==0)inte=0.0; d_inte+=inte; break; case 4: sas[0]=2; sah[0]=5; sat[0]=7; $ select sum(interest),count(*) into $inte,$vou from r_blot where sec_num=$se and ( sav_type=$sas or sav_type=$sah ) and status="E" and cre_num>0; if(vou==0)inte=0.0; d_inte+=inte; $ select sum(amount),count(*) into $inte,$vou from r_blot where sec_num=$se and sav_type=$sas and status="I" and cre_num>0; if(vou==0)inte=0.0; d_inte+=inte; $ select sum(interest),count(*) into $inte,$vou from r_blot where sec_num=$se and sav_type=$sat and ( status="E" or status="D" ) and cre_num>0; if(vou==0)inte=0.0; d_inte+=inte; break; } t_inte=y_inte-d_inte; $ update r_dai set debi_amoun=$d_inte,today_bala=$t_inte where sav_type=$sav and term=$te1; if(sqlca.sqlerrd[2]!=1) { move(20,20); printw("update inte mx错(%d), ",sqlca.sqlcode); getch(); p=1; } d_intex+=d_inte; t_intex+=t_inte;}te1[0]=100;$ update r_dai set debi_amoun=$d_intex,today_bala=$t_intex where sav_type=$sav and term=$te1; if(sqlca.sqlerrd[2]!=1) { move(20,20); printw("1111update inte错(%d), ",sqlca.sqlcode); getch(); p=1; }te1[0]=100;sav[0]=100;$ select debi_amoun,cred_amoun,today_bala into $amoundx,$amouncx,$balatx from r_dai where sav_type=$sav and term=$te1;balatz=0.0-balatx-t_intex;amoundz=amoundx+d_intex;amouncz=amouncx;te1[0]=100;sav[0]=108;$ select yest_bala,debi_amoun,cred_amoun,today_bala into $y_inte,$amoundx, $amouncx,$balatx from r_dai where sav_type=$sav and term=$te1;balatx=y_inte-amoundx+amouncx;$ update r_dai set today_bala=$balatx where sav_type=$sav and term=$te1;balatz-=balatx;amoundz+=amoundx;amouncz+=amouncx;te1[0]=100;sav[0]=109;$ select yest_bala,debi_amoun,cred_amoun,today_bala into $y_inte,$amoundx, $amouncx,$balatx from r_dai where sav_type=$sav and term=$te1;balatx=y_inte-amoundx+amouncx;$ update r_dai set today_bala=$balatx where sav_type=$sav and term=$te1;balatz-=balatx;amoundz+=amoundx;amouncz+=amouncx;te1[0]=100;sav[0]=110;$ select yest_bala,debi_amoun,cred_amoun,today_bala into $y_inte,$amoundx, $amouncx,$balatx from r_dai where sav_type=$sav and term=$te1;balatx=y_inte-amoundx+amouncx;$ update r_dai set today_bala=$balatx where sav_type=$sav and term=$te1;balatz-=balatx;amoundz+=amoundx;amouncz+=amouncx;sav[0]=111;$ update r_dai set debi_amoun=$amouncz,cred_amoun=$amoundz,today_bala=$balatz where sav_type=$sav and term=$te1; if(sqlca.sqlerrd[2]!=1) { move(20,20); printw("update cash错(%d), ",sqlca.sqlcode); getch(); p=1; }te1[0]=100;sav[0]=100;$ select today_bala into $balatx from r_dai where sav_type=$sav and term=$te1;balatz=balatx;amoundz+=amouncz;te1[0]=100;sav[0]=108;$ select today_bala into $balatx from r_dai where sav_type=$sav and term=$te1;balatz+=balatx;te1[0]=100;sav[0]=110;$ select today_bala into $balatx from r_dai where sav_type=$sav and term=$te1;balatz+=balatx;te1[0]=100;sav[0]=120;$ update r_dai set debi_amoun=$amoundz,cred_amoun=$amoundz,today_bala=$balatz, open_user=$uroz,canc_user=$urcz,today_user=$urz,debi_vouch=$voudz, cred_vouch=$voucz,hang_up=$urhz,lift_hang=$uruhz,today_hang=$t_urhz, freeze=$urfz,unfreeze=$urufz,today_free=$t_urfz where sav_type=$sav and term=$te1; if(sqlca.sqlerrd[2]!=1) { move(20,20); printw("222222update zongji错(%d), ",sqlca.sqlcode); getch(); p=1; }/*统计外币*/for(h=0;h<3;h++){amoundz=amouncz=balatz=0.0;voudz=voucz=urz=uroz=urcz=t_urhz=t_urfz=urhz=urfz=uruhz=urufz=0;cu_type[0]=cu[h];c_type[0]=tolower(cu[h]);for(l=11;l<13;l++){ amoundx=amouncx=balatx=0.0; voudx=voucx=urx=urox=urcx=t_urhx=t_urfx=0; sav[0]=l; switch(l) { case 11: n=5; break; case 12:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -