📄 fix_pay.ec
字号:
/* fix_pay */#include </u/ebcsav/include/sav.h>$include sqlca;$include sqlda;void addspace();void addspacef();void mess();char y_n();char readdv();char fv_date();double get_inte();double get_rmb();void prt_inum();void prt_dnum();void prtf_inum();void prtf_dnum();void prtf_upper();void prtf_inte();void delay();short num_time();long ac_num();char ss[11];char st[7];short ti;char cu_t,te;char na[9];long s_n,a_n,b_n;#include </u/ebcsav/include/begin>short i,j,year1,month1,day1,year2,month2,flag;double x,y;long k,a_num1;unsigned char c;FILE *pf;$ char s_num[2],nam[9],ter[2],cu_type[2],addres[25],statu[2], s_type[2],ope_num[2];$ long a_num,pas,cr_num,ope_date,int_date,las_date,cred_num,b_num;$ double amoun,interes,maint_v,interes1,z;$ short cred_type;move(0,17);$ database saving;printw("整 存 整 取 储 蓄 部 分 提 前 支 取");s_num[1]='\0';ope_num[0]=op_num;ope_num[1]='\0';s_type[1]='\0';$ declare blot1 scroll cursor for select blot_num from r_blot;$ declare blot2 scroll cursor for select blot_num from f_blot;pf=fopen("/u/ebcsav/data/sav_sect.dat","r");fseek(pf,(op.num&0x7f)*34-10,0);fread(ss,10,1,pf);fclose(pf);ss[10]='\0';while(1) { move(2,0); clrtobot(); block(1,0,22,80); s_num[0]=op.num&0x7f; move(3,6); addstr("营业所编号: "); prt_inum((long)s_num[0],2); cred_type=op.type&3; if(cred_type==2) cred_type=11; else if(cred_type==3) { move(5,6); addstr("币种(0:返回, R:人民币, F:外币):"); c=y_n('0','R','F'); if(c=='0') break; cred_type=(c=='R')?1:11; } move(5,6); addstr("币种: "); if(cred_type==1) addstr("人民币 "); else addstr("外币 "); move(7,6); addstr("帐号( 按 0 返回 ): "); readdv(&x,9); a_num=x; if(a_num==0) break; a_num1=a_num; move(7,6); addstr("帐号: "); prt_inum(a_num,9); if(cred_type==1) { $ select * into $s_num,$a_num,$nam,$pas,$cu_type,$ter,$amoun,$addres, $cr_num,$ope_date,$int_date,$statu,$las_date,$interes,$maint_v from r_fix where sec_num=$s_num and acc_num=$a_num; } else { $ select * into $s_num,$a_num,$nam,$pas,$cu_type,$ter,$amoun,$addres, $cr_num,$ope_date,$int_date,$statu,$las_date,$interes,$maint_v from f_fix where sec_num=$s_num and acc_num=$a_num; } if(sqlca.sqlcode!=0||statu[0]=='E') { move(20,27); mess((short)29); mess((short)4); getch(); continue; } if(pas!=0) { for(i=0;i<4;i++) { move(9,6); addstr("密码: "); readdv(&x,7); k=x; if(k==pas) break; move(20,27); mess((short)20); mess((short)2); } } else k=pas; if(k!=pas) { move(20,27); mess((short)30); mess((short)3); getch(); continue; } move(20,27); addspace(30); if(toupper(statu[0])=='H') { move(20,27); mess((short)31); mess((short)3); getch(); continue; } if(toupper(statu[0])=='V'||toupper(statu[0])=='F') { c=fv_date(las_date,toupper(statu[0])); if(c=='N') continue; else { move(20,20); addspace(55); move(20,20); mess((short)68); mess((short)3); getch(); continue; } } k=(int_date%10000)/100+ter[0]-1; i=k/12+int_date/10000; j=(k%12)+1; k=int_date%100; if((j==4||j==6||j==9||j==11)&&k==31) k--; else if(j==2&&k>28) { if((i%400)==0||((i%4)==0&&(i%100)!=0)) k=29; else k=28; } k+=(i*10000+j*100); if(int_date!=ope_date) { move(20,18); addstr("不允许再次部份提前支取, "); mess((short)3); getch(); continue; } if(k<=year*10000+month*100+day&&cu_type[0]<'Z') { move(20,18); addstr("该帐户已到期限, 应正常办理销户, "); mess((short)3); getch(); continue; } while(1) { move(11,30); addspace(20); move(11,6); addstr("提前支取金额: "); readdv(&x,13); if(amoun-x<50.0) { move(20,26); addstr("提前支取金额太大, "); mess((short)2); } else break; } move(20,26); addspace(30); k=(cu_type[0]-64)*10000+cred_type*100+ter[0]; interes1=get_inte(k,int_date,x,&maint_v); move(2,0); clrtobot(); block(1,0,22,80); move(3,10); addstr("帐 号: "); move(3,48); prt_inum((long)s_num[0],2); addstr("-"); prt_inum(a_num,9); move(4,10); addstr("姓 名: "); move(4,48); addstr(nam); move(5,10); addstr("币 种: "); move(5,48); switch(toupper(cu_type[0])) { case 'C': addstr("加拿大元"); break; case 'F': addstr("法国法郎"); break; case 'H': addstr("港元"); break; case 'J': addstr("日元"); break; case 'M': addstr("德国马克"); break; case 'P': addstr("英镑"); break; case 'R': addstr("人民币"); break; case 'U': addstr("美元"); } if(cu_type[0]>'Z') addstr(" (自动转存)"); move(6,10); addstr("期 限: "); move(6,48); if(ter[0]<12) printw("%2d个月",ter[0]); else printw("%2d年",ter[0]/12); move(7,10); addstr("金 额: "); move(7,48); prt_dnum(amoun,16); move(8,10); addstr("地 址: "); move(8,48); addstr(addres); move(9,10); addstr("凭 证 号: "); move(9,48); prt_inum(cr_num,7); move(10,10); addstr("开户日期: "); move(10,48); printw("%4d年%2d月%2d日",ope_date/10000,(ope_date%10000)/100, ope_date%100); move(11,10); addstr("起息日期: "); move(11,48); printw("%4d年%2d月%2d日",int_date/10000,(int_date%10000)/100,int_date%100); move(13,10); addstr("利 息: "); move(13,48); prt_dnum(interes1,16); move(14,10); addstr("保 值: "); move(14,48); prt_dnum(maint_v,16); move(15,10); addstr("提前支取金额:"); move(15,48); prt_dnum(x,16); if(statu[0]>'Z') { move(18,22); mess((short)32); mess((short)26); } move(20,33); mess((short)33); c=y_n('Y','N','N'); if(c=='Y') { flag=0; $ begin work; las_date=year*10000+month*100+day; if(cred_type==1) { $ update r_fix set status='E',last_date=$las_date,interest=$interes1, maintn_v=$maint_v where sec_num=$s_num and acc_num=$a_num; } else { $ update f_fix set status='E',last_date=$las_date,interest=$interes1, maintn_v=$maint_v where sec_num=$s_num and acc_num=$a_num; } move(20,33); if(sqlca.sqlerrd[2]!=1) { addstr("写"); mess((short)14); printw("(%d), ",sqlca.sqlerrd[2]); flag=1; } if(flag==0) { c=cu_type[0]; cu_type[0]=toupper(c); s_type[0]=cred_type; for(i=0;i<5;i++) { if(cred_type==1) { $ insert into r_blot values (0,$ope_num,$s_num,$a_num,$nam,$s_type, $cu_type,$ter,$cr_num,"P",$amoun,0,$interes1); } else { $ insert into f_blot values (0,$ope_num,$s_num,$a_num,$nam,$s_type, $cu_type,$ter,$cr_num,"P",$amoun,0,$interes1); } if(sqlca.sqlcode!=-271) break; printw("*"); refresh(); delay(5l); } if(sqlca.sqlcode==-271) { mess((short)73); flag=1; } else if(sqlca.sqlcode!=0) { addstr("写"); mess((short)16); printw("(%d), ",sqlca.sqlcode); flag=1; } } if(flag==0 && cred_type==1 && maint_v>=0.005) { for(i=0;i<5;i++) { $ insert into r_blot values (0,$ope_num,$s_num,$a_num,$nam,$s_type, $cu_type,$ter,$cr_num,"M",$maint_v,0,0); if(sqlca.sqlcode!=-271) break; printw("*"); refresh(); delay(5l); } if(sqlca.sqlcode==-271) { mess((short)73); flag=1; } else if(sqlca.sqlcode!=0) { addstr("写"); mess((short)16); printw("(%d), ",sqlca.sqlcode); flag=1; } } if(flag==0) { if(cred_type==1) { $ open blot1; $ fetch last blot1 into $b_num; $ close blot1; } else { $ open blot2; $ fetch last blot2 into $b_num; $ close blot2; } cu_type[0]=c; for(i=0;i<7;i++) if(op.name[i]!='\0') st[i]=op.name[i]^0xff; else st[i]='\0'; ti=num_time(); move(20,20); addspace(50); move(20,20); mess((short)43); mess((short)4); getch(); printf("%c%c%c%c%c%c%c%c%c%c%c%c%c\n\n\n\n\n\n\n\n\n\n\n\n", 27,'[','5','i',28,'q',27,']',27,'%','9',1,20); addspacef(10); printf("部份提前支取日期: %4d年%2d月%2d日",year,month,day);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -