📄 fix_open1.ec
字号:
if(c==10) cr_num=x; move(10,20); addspace(10); move(10,48); prt_inum(cr_num,7); if(c==10||c==13||c==25) n=8; else if(c==24) n=6; else if(c==5) n=9; else if(c==4) n=10; break; case 8: move(11,30); c=readch(); if(c=='Y') cu_type[0]=tolower(cu_type[0]); else if(c=='N') cu_type[0]=toupper(cu_type[0]); move(11,48); if(islower(cu_type[0])) addstr("自动转存 "); else addstr("不自动转存"); if(c=='Y'||c=='N'||c==10||c==25||c==5) n=9; else if(c==24) n=7; else if(c==4) n=10; break; case 9: move(20,20); mess((short)5); c=y_n('Y','N','C'); move(20,20); addspace(42); if(c=='C') n=1; else if(c=='Y') { flag=0; ope_num[0]=op_num; ope_num[1]='\0'; if(toupper(cu_type[0])=='R') cred_type=1; else cred_type=11; s_type[0]=cred_type; cred_num=cr_num; move(20,20); $ begin work; { move(20,20); ope_date=int_date=las_date=year*10000+month*100+day; statu[0]='A'; k=(ter[0]>64)?(ter[0]-64):(ter[0]-48)*12; ter[0]=k; k+=((toupper(cu_type[0])-64)*10000+cred_type*100); interes=get_rate(k,int_date); maint_v=0.0; if(cred_type==1) { $ insert into r_fix values ($s_num,$a_num,$nam,$pas,$cu_type,$ter,$amoun, $addres,$cr_num,$ope_date,$int_date,$statu, $las_date,$interes,$maint_v); } else { $ insert into f_fix values ($s_num,$a_num,$nam,$pas,$cu_type,$ter,$amoun, $addres,$cr_num,$ope_date,$int_date,$statu, $las_date,$interes,$maint_v); } if(sqlca.sqlcode!=0) { addstr("写"); mess((short)14); printw("(%d), ",sqlca.sqlcode); } else { c=cu_type[0]; cu_type[0]=toupper(c); for(n=0;n<5;n++) { if(cred_type==1) { $ insert into r_blot values (0,$ope_num,$s_num,$a_num,$nam,$s_type, $cu_type,$ter,$cr_num,"O",$amoun, $amoun,0); } else { $ insert into f_blot values (0,$ope_num,$s_num,$a_num,$nam,$s_type, $cu_type,$ter,$cr_num,"O",$amoun, $amoun,0); } if(sqlca.sqlcode!=-271) break; printw("*"); refresh(); delay(5l); } if(sqlca.sqlcode==-271) mess((short)73); else if(sqlca.sqlcode!=0) { addstr("写"); mess((short)16); printw("(%d), ",sqlca.sqlcode); } else { 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; $ insert into open_acc values ($s_num,$s_type,$cu_type,$ter,$a_num,$nam, $addres,$amoun,$ope_num); if(sqlca.sqlcode!=0) { addstr("写"); mess((short)17); printw("(%d), ",sqlca.sqlcode); } else { move(20,20); addspace(40); move(20,20); mess((short)13); flag=1; } } } } if(flag==1) { $ commit work; } else { $ rollback work; } n=10; } else n=10; } if(n==10) break; } move(20,46); mess((short)15); c=y_n('Y','N','N'); if(c=='N') break; cr_num++; move(2,0); clrtobot(); block(1,0,22,80); n=1; }$ close database;#include </u/ebcsav/include/end>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); mess((short)3); getch(); return; } $ open read3; if(sqlca.sqlcode !=0) { printw("** %d 错误 1: 打开利率表出错 **",sqlca.sqlcode); getch(); return; }$fetch first read3;dat2=0;do{ if(dat1<=dat&&dat1>=dat2) { dat2=dat1; ll2=rat; } $fetch next read3; }while(sqlca.sqlcode!=SQLNOTFOUND);$close read3;return(ll2);}#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/prtf_upper>#include </u/ebcsav/include/num_time>#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/delay>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -