📄 dated_repl.ec
字号:
/* 零整换折 */#include </u/ebcsav/include/sav.h>$include sqlca;$include sqlda;void addspace();void mess();char y_n();char readdv();char readst();char readch();char fv_date();long ac_num();double get_inte();double get_rate();void prt_inum();void prt_dnum();void addspacef();void prtf_inum();void prtf_dnum();short num_time();#include </u/ebcsav/include/begin>short ti,i,n,j=0;double x,amm,lx;long k,k1;unsigned char c;char st[30],yn;$ char s_num[2],nam[9],cu_type[2],fg[2];$ long a_num,cr_num,ope_date,cr_num1,pas,b_num;$ double amoun,inte,amou,bala,i_rate;$ short cred_type;$ long cred_num,i_date,l_date,o_date;$ char ope_num[2],s_type[2],sta[2],l_num[2],te[2];move(0,25);$ database saving;printw("零 存 整 取 换 折");ope_num[0]=op_num;ope_num[1]='\0';s_num[0]=op.num&0x7f;s_num[1]='\0';l_num[0]=1;l_num[1]='\0';s_type[1]='\0';nam[0]='\0';te[1]='\0';fg[1]='\0';cu_type[0]='R';cu_type[1]='\0';amoun=0.0;amou=0.0;$ declare blot scroll cursor for select blot_num from r_blot;move(23,16);standout();mess(1);standend();move(3,10);addstr("帐 号: ");move(3,20);prt_inum(s_num[0],2);addstr("-");while(1) { $ begin work; j=0; while(1) { move(3,24); c=readdv(&x,9); if(c==10) a_num=x; move(3,24); prt_inum(a_num,9); cred_type=3; s_type[0]=cred_type; $ select name,pass,term,amount,balance,cre_num,open_date,inte_date, status,flag,last_date,interest,inte_rate into $nam,$pas,$te,$amou, $bala,$cr_num,$o_date,$i_date,$sta,$fg,$l_date,$inte,$i_rate from r_dated where sec_num=$s_num and acc_num=$a_num; if(sqlca.sqlcode!=0) { move(20,20); mess(19); j=1; break; } ope_date=year*10000+month*100+day; if(ope_date!=i_date) { k=0; k=((toupper(cu_type[0])-64)*10000+200); } if(sta[0]!='A') if(sta[0]=='a') { beep(); move(19,20); standout(); mess(26); standend(); } else if(toupper(sta[0])=='F'||toupper(sta[0])=='V') { yn=fv_date(l_date,toupper(sta[0])); if(yn!='Y') break; else { move(20,20); mess(68); j=1; break; } } else { move(20,20); mess(22); j=1; break; } move(5,10); addstr("姓 名: "); move(7,10); addstr("存 期: "); move(9,10); addstr("余 额: "); move(11,10); addstr("凭 证 号: "); move(13,10); addstr("新 凭 证: "); move(5,20); printw("%-8s",nam); move(7,20); prt_inum(te[0]/12,1); printw("年"); move(9,20); prt_dnum(bala,13); move(11,20); prt_inum(cr_num,7); move(13,20); c=readdv(&x,7); if(c==10) cr_num1=x; move(13,20); prt_inum(cr_num1,7); move(19,20); addspace(30);/*更新记录开始*/ move(20,20); mess(5); c=y_n('Y','N','C'); move(20,20); addspace(42); if(c=='N')break; else if(c=='Y') { move(20,20); for(n=0;n<7;n++) if(op.name[n]!='\0')st[n]=op.name[n]^0xff; else st[n]='\0'; ti=num_time(); cred_num=cr_num1; $ select cre_num from credential where op_num=$ope_num and cre_type=$cred_type and cre_num=$cr_num1; if(sqlca.sqlcode!=0) { mess(11); j=1; break; } cred_num+=200000000; $ update credential set cre_num=$cred_num where op_num=$ope_num and cre_type= $cred_type and cre_num=$cr_num1; if(sqlca.sqlerrd[2]!=1) { addstr("写"); mess(10); printw("(%d), ",sqlca.sqlcode); j=1; } else { $ update r_dated set cre_num=$cr_num1,line_num=$l_num where sec_num=$s_num and acc_num=$a_num; if(sqlca.sqlerrd[2]!=1) { addstr("写"); mess(14); printw("(%d), ",sqlca.sqlcode); j=1; } else { $ insert into r_blot values (0,$ope_num,$s_num,$a_num,$nam,$s_type, $cu_type,$te,$cr_num1,"S",0,$bala,$inte); if(sqlca.sqlcode!=0) { addstr("写"); mess(16); printw("(%d), ",sqlca.sqlcode); j=1; } else { $ open blot; $ fetch last blot into $b_num; $ close blot; $ insert into subs_cred values ($s_num,$s_type,$a_num,$nam,$cr_num,$cr_num1, $bala,$ope_num); if(sqlca.sqlcode!=0) { addstr("写"); mess(39); printw("(%d), ",sqlca.sqlcode); j=1; break; } mess(42); mess(4); getch(); printf("[5i%c%c%c%c%c%c%c%c%c", 27,'%','9',1,20,28,'q',27,']'); printf(" 凭证号: "); prtf_inum(cr_num1,7); printf("\n 原凭证号: "); prtf_inum(cr_num,7); printf("\n"); addspacef(30); printf("%4d %2d %2d %2d时%2d分\n\n\n", year,month,day,ti/100,ti%100); printf("ge 换 折fh\n\n\n\n\n"); addspacef(11); printf("%-8s ",nam); prtf_inum(s_num[0],2); printf("-"); prtf_inum(a_num,9); printf(" "); addspacef(14); printf(" "); prtf_dnum(bala,14); if(pas!=0)printf(" 密"); else printf(" "); printf("\n\n"); addspacef(19); printf("%d-%2d-%2d ",year,month,day); printf("%d-%2d-%2d ", o_date/10000+te[0]/12, (o_date%10000)/100,o_date%100); printf(" %d ",b_num); printf(" %-6s\f\n",st); printf("\n[4i"); move(20,20); addspace(30); move(20,20); mess(43); mess(4); getch(); printf("[5i%c%c%c%c%c\n\n",27,'%','9',1,20); addspacef(10); printf("%-8s",nam); addspacef(20); prtf_inum(s_num[0],2); printf("-"); prtf_inum(a_num,9); printf("\n\n\n\n "); prtf_dnum(amou,15); switch(te[0]) { case 12: printf("%4s","一年"); break; case 36: printf("%4s","三年"); break; case 60: printf("%4s","五年"); break; } k1=te[0]+((toupper(cu_type[0])-64)*10000+cred_type*100); i_rate=get_rate(k1,o_date); printf(" %d.%2d.%2d", o_date/10000+te[0]/12, (o_date%10000)/100,o_date%100); lx=(long)(bala*te[0])*(1+te[0])/2*i_rate/1000; lx=(long)lx+(long)((lx-(long)lx)*100+0.5000001)/100.00; prtf_dnum(lx,14); if(pas!=0)printf(" 密"); printf("\n\n\n\n\n"); printf(" 利率: "); printf("%5.3f",i_rate*12/10); printf("%% 性质: "); if(fg[0]==1) printf("%-4s","集体"); else printf("%-4s","个人"); printf("\n\n\n\n\n\n%4d.%2d.%2d ",year,month,day); printf("%2d",(int)(bala/amou)); printf(" "); prtf_dnum(bala,15); printf(" %-6s\f\n",st); printf("%c9%c%c[4i",'%',1,20); move(20,20); addspace(30); move(20,20); mess(38); } break; } break; } break; }/*更新记录结束*/ } if(j==1) { $ rollback work; } else { $ commit work; } move(20,50); mess(15); c=y_n('Y','N','N'); if(c=='N') break; move(20,10); addspace(62); move(3,24); addspace(40); }$ close database;#include </u/ebcsav/include/end>#include </u/ebcsav/include/mess>#include </u/ebcsav/include/addspace>#include </u/ebcsav/include/y_n>#include </u/ebcsav/include/prt_inum>#include </u/ebcsav/include/prt_dnum>#include </u/ebcsav/include/readch>#include </u/ebcsav/include/readdv>#include </u/ebcsav/include/readst>#include </u/ebcsav/include/ac_num>#include </u/ebcsav/include/fv_date>#include </u/ebcsav/include/num_time>#include </u/ebcsav/include/addspacef>#include </u/ebcsav/include/prtf_inum>#include </u/ebcsav/include/prtf_dnum>double get_rate(k,dat)long k,dat;{$double rat;$long k1,dat1;double ll2;int dat2;long tz[16]={15,30,60,90,120,150,180,210,240,270,300,330,360,720,1080,0};short year,month,day;long i,yy,mm,mm1,dd,t1,ts,m1,m2,m3,yer,da2;num_date(&year,&month,&day);yy=dat/10000;mm=(dat%10000)/100;dd=dat%100;t1=k/100;if(day>=dd)ts=(year-yy)*360+(month-mm)*30+day-dd;else { if(month==1){yer=year-1; mm1=12; } else{ mm1=month-1; yer=year; } m1=yer%400; m2=yer%100; m3=yer%4; if(mm1==1||mm1==3||mm1==5||mm1==7||mm1==8||mm1==10||mm1==12) da2=31; else if(mm1!=2) da2=30; else if(m1==0||m2!=0&&m3==0) da2=29; else da2=28; ts=(yer-yy)*360+(mm1-mm)*30+da2+day-dd; }if(t1==1807){ if(ts<15)k=180200; else { i=0; do{ i++; }while(ts>=tz[i]&&i<15); k=t1*100+i; } }k1=k;$ declare read3 scroll cursor for select ll,rq into $rat,$dat1 from inter_rate where syh=$k1; if(sqlca.sqlcode!=0) { move(21,20); addstr("申请"); mess((short)9); printw("(%d), ",sqlca.sqlcode);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -