📄 large_canc.ec
字号:
/* large_canc */#include </u/ebcsav/include/sav.h>$include sqlca;$include sqlda;void addspace();void addspacef();void mess();char y_n();char readdv();char fv_date();void prt_inum();void prt_dnum();void prtf_dnum();void prtf_inum();void delay();short num_time();#include </u/ebcsav/include/begin>short cred_type,ti,i,j,flag;char st[7];char ss[11];double x;long k;unsigned char c;$ 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,b_num;$ double amoun,interes,maint_v;FILE *pf;move(0,29);$ database saving;printw("大 额 储 蓄 销 户");s_num[1]='\0';ope_num[0]=op_num;ope_num[1]='\0';s_type[1]='\0';$ declare blot scroll cursor for select blot_num from r_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); if((op.num&0x80)!=0) s_num[0]=op.num&0x7f; else { move(3,6); addstr("营业所编号( 按 0 返回): "); readdv(&x,2); s_num[0]=x; if(s_num[0]==0) break; } move(3,6); addstr("营业所编号: "); prt_inum((long)s_num[0],2); cred_type=6; move(5,6); addstr("币种: 人民币"); move(7,6); addstr("帐号( 按 0 返回 ): "); readdv(&x,9); a_num=x; if(a_num==0) break; move(7,6); addstr("帐号: "); prt_inum(a_num,9); $ 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 l_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(k>year*10000+month*100+day) { move(20,25); addstr("该帐户未到期限, 不能提前支取, "); mess((short)3); getch(); continue; } interes=amoun*interes*ter[0]*0.001; k=interes; x=interes-k; interes=((long)(x*100.0+0.5))/100.0+k; move(2,0); clrtobot(); block(1,0,22,80); move(3,10); addstr("帐 号: "); move(3,48); prt_inum((short)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("美元"); } 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(14,10); addstr("利 息: "); move(14,48); prt_dnum(interes,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; $ update l_fix set status='E',last_date=$las_date,interest=$interes 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]); } else { s_type[0]=cred_type; 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,"E",$amoun,0,$interes); if(sqlca.sqlcode!=-271) break; printw("*"); refresh(); delay(5l); } if(sqlca.sqlcode==-271) mess((short)73); else if(sqlca.sqlcode!=0) { addstr("写"); mess(16); printw("(%d), ",sqlca.sqlcode); } else { $ open blot; $ fetch last blot into $b_num; $ close blot; 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(30); printf("销户日期: %4d年%2d月%2d日\n",year,month,day); printf("%c%c%c%c%c",12,27,'[','4','i'); move(20,20); addspace(50); move(20,20); mess((short)44); mess((short)4); getch(); printf("%c%c%c%c\n\n",27,'[','5','i'); addspacef(10); printf("%-10s",ss); addspacef(10); printf("%4d年%2d月%2d日 %2d时%2d分",year%100,month,day, ti/100,ti%100); addspacef(11); printf("%-10s",ss); addspacef(10); printf("%4d年%2d月%2d日 %2d时%2d分\n",year%100,month,day, ti/100,ti%100); addspacef(16); printf("%-8s",nam); addspacef(10); prtf_inum((long)s_num[0],2); putchar('-'); prtf_inum(a_num,9); addspacef(10); printf("%-6s",st); addspacef(8); printf("%-8s",nam); addspacef(10); prtf_inum((long)s_num[0],2); putchar('-'); prtf_inum(a_num,9); addspacef(10); printf("%-6s\n",st); addspacef(16); switch(toupper(cu_type[0])) { case 'C': printf("加拿大元"); break; case 'F': printf("法国法郎"); break; case 'H': printf("港元 "); break; case 'J': printf("日元 "); break; case 'M': printf("德国马克"); break; case 'P': printf("英镑 "); break; case 'R': printf("人民币 "); break; case 'U': printf("美元 "); } addspacef(8); printf("大额销户"); addspacef(8); if(ter[0]<12) printf("%1d月",ter[0]); else printf("%1d年",ter[0]/12); addspacef(8); printf("%3d",b_num); addspacef(8); switch(toupper(cu_type[0])) { case 'C': printf("加拿大元"); break; case 'F': printf("法国法郎"); break; case 'H': printf("港元 "); break; case 'J': printf("日元 "); break; case 'M': printf("德国马克"); break; case 'P': printf("英镑 "); break; case 'R': printf("人民币 "); break; case 'U': printf("美元 "); } addspacef(8); printf("大额销户"); addspacef(8); if(ter[0]<12) printf("%1d月",ter[0]); else printf("%1d年",ter[0]/12); addspacef(8); printf("%3d\n\n",b_num); addspacef(13); prtf_dnum(amoun,13); addspacef(7); prtf_dnum(interes,13); addspacef(21); prtf_dnum(amoun,13); addspacef(7); prtf_dnum(interes,13); printf("\n\n\n\n\n\n\n\n"); addspacef(30); prtf_dnum(amoun+interes,16); addspacef(38); prtf_dnum(amoun+interes,16); printf("\n"); printf("%c%c%c%c%c",12,27,'[','4','i'); move(20,20); addspace(40); move(20,20); mess((short)23); flag=1; } } if(flag==1) { $ commit work; } else { $ rollback work; } mess((short)3); getch(); } }$ close database;#include </u/ebcsav/include/end>#include </u/ebcsav/include/mess>#include </u/ebcsav/include/addspace>#include </u/ebcsav/include/addspacef>#include </u/ebcsav/include/y_n>#include </u/ebcsav/include/prt_inum>#include </u/ebcsav/include/prt_dnum>#include </u/ebcsav/include/prtf_inum>#include </u/ebcsav/include/prtf_dnum>#include </u/ebcsav/include/num_time>#include </u/ebcsav/include/readdv>#include </u/ebcsav/include/fv_date>#include </u/ebcsav/include/delay>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -