📄 pt_sched.ec
字号:
/* pt_schedule */#include </u/ebcsav/include/sav.h>$include sqlca;$include sqlda;short menu();short menusel();void addspace();void addspacef();void mess();char y_n();char readdv();void prt_inum();void prt_dnum();void prtf_inum();void prtf_dnum();#include </u/ebcsav/include/begin>short i,num_c2,num_c3,num_c4,pa,l,f,l1;double x;char c;char s[7],st[21];FILE *pf;$ char s_num[2],nam[9],cu_type[2],statu[2];$ long a_num,pre_date,b_num,b_date,e_date;$ double amoun,balanc,interes;static char *title2[6]={"0.返 回 ","2.活 期 ","3.零存整取 ", "4.存本取息 ","5.定活两便 ","7.通知存款 "};static char *remind2[6]={" 返回主选择单 "," 打印活期储蓄储户明细 ", " 打印零存整取储户明细 "," 打印存本取息储户明细 ", " 打印定活两便储户明细 "," 打印通知存款储户明细 "};static short menu_row2[6]={5,5,5,5,5,5},menu_col2[6]={9,18,27,38,49,60};static char *title3[3]={"0.返 回 ","1.人民币 ","2.外币 "};static char *remind3[3]={" 返回主选择单 "," 打印人民币储户明细 ", " 打印外币储户明细 "};static short menu_row3[3]={7,7,7},menu_col3[3]={9,18,27};static char *title4[4]={"0.返 回 ","1.自动搜索 ","2.指定帐号 ", "3.指定帐号与时间 "};static char *remind4[4]={" 返回主选择单 ", " 自动搜索打印已满页并且未曾打印过的帐户明细信息 ", " 指定帐号打印其已满页并且未曾打印过的帐户明细信息 ", " 指定帐号打印其指定时间段的帐户明细信息 "};static short menu_row4[4]={9,9,9,9},menu_col4[4]={9,18,29,40};pf=fopen("/u/ebcsav/data/sav_sect.dat","r");fseek(pf,((op.num&0x7f)-1)*34+24,0);fread(st,10,1,pf);fclose(pf);st[10]='\0';for(i=0;i<7;i++) if(op.name[i]!='\0')s[i]=op.name[i]^0xff; else s[i]='\0';move(0,24);$ database saving;printw("打 印 帐 户 明 细 信 息");num_c2=num_c3=num_c4=0;while(1) { move(2,0); clrtobot(); block(1,0,22,80); if((op.type&1)==0) { num_c2=1; num_c3=2; } else { block(4,7,3,66); num_c2=menu(title2,remind2,menu_row2,menu_col2,5,num_c2); num_c2=menusel(title2,remind2,menu_row2,menu_col2,5,num_c2,0); if(num_c2==0) break; if(num_c2==1) { if((op.type&2)==0) num_c3=1; else { block(6,7,3,32); num_c3=menu(title3,remind3,menu_row3,menu_col3,2,num_c3); num_c3=menusel(title3,remind3,menu_row3,menu_col3,2,num_c3,0); if(num_c3==0) continue; } } else num_c3=1; } block(8,7,3,52); num_c4=menu(title4,remind4,menu_row4,menu_col4,3,num_c4); num_c4=menusel(title4,remind4,menu_row4,menu_col4,3,num_c4,0); if(num_c4==0) break; s_num[1]='\0'; move(12,6); addstr("营业所编号: "); if((op.num&0x80)!=0) { s_num[0]=op.num&0x7f; prt_inum((long)s_num[0],2); } else { readdv(&x,2); s_num[0]=x; } move(14,6); if(num_c4==1) addstr("起始帐号(按 0 返回): "); else addstr("帐号(按 0 返回): "); readdv(&x,9); a_num=x; if(a_num==0) break; switch(num_c4) { case 1: case 2: move(20,20); addspace(50); if(num_c4==1) { switch(num_c2) { case 1: if(num_c3==1) { $ declare read_21 scroll cursor for select acc_num,status into $a_num,$statu from r_demand where sec_num=$s_num and acc_num>=$a_num; $ open read_21; } else { $ declare read_22 scroll cursor for select acc_num,status into $a_num,$statu from f_demand where sec_num=$s_num and acc_num>=$a_num; $ open read_22; } break; case 2: $ declare read_31 scroll cursor for select acc_num,status into $a_num,$statu from r_dated where sec_num=$s_num and acc_num>=$a_num; $ open read_31; break; case 5: $ declare read_71 scroll cursor for select acc_num,status into $a_num,$statu from r_call where sec_num=$s_num and acc_num>=$a_num; $ open read_71; } if(sqlca.sqlcode!=0) { move(20,26); addstr("打开"); mess((short)14); printw("(%d), ",sqlca.sqlcode); mess((short)3); getch(); break; } } while(1) { if(num_c4==1) { switch(num_c2) { case 1: if(num_c3==1) { $ fetch read_21; } else { $ fetch read_22; } break; case 2: $ fetch read_31; break; case 5: $ fetch read_71; } if(sqlca.sqlcode!=0) { move(20,26); addstr("没有其他需要打印的帐户明细表, "); mess((short)3); getch(); break; } } else { switch(num_c2) { case 1: if(num_c3==1) { $ select status into $statu from r_demand where sec_num=$s_num and acc_num=$a_num; } else { $ select status into $statu from f_demand where sec_num=$s_num and acc_num=$a_num; } break; case 2: $ select status into $statu from r_dated where sec_num=$s_num and acc_num=$a_num; break; case 5: $ select status into $statu from r_call where sec_num=$s_num and acc_num=$a_num; } if(sqlca.sqlcode!=0) { move(20,26); mess((short)29); printw("(%d), ",sqlca.sqlcode); mess((short)3); getch(); break; } } f=(statu[0]=='E')?1:0; switch(num_c2) { case 1: if(num_c3==1) { $ declare read_221 scroll cursor for select * into $s_num,$a_num,$pre_date,$b_num,$nam, $cu_type,$amoun,$balanc,$interes,$statu from r_dem_sch where sec_num=$s_num and acc_num=$a_num; $ open read_221; } else { $ declare read_222 scroll cursor for select * into $s_num,$a_num,$pre_date,$b_num,$nam, $cu_type,$amoun,$balanc,$interes,$statu from f_dem_sch where sec_num=$s_num and acc_num=$a_num; $ open read_222; } break; case 2: $ declare read_231 scroll cursor for select * into $s_num,$a_num,$pre_date,$b_num,$nam, $cu_type,$amoun,$balanc,$interes,$statu from r_dated_sch where sec_num=$s_num and acc_num=$a_num; $ open read_231; break; case 5: $ declare read_271 scroll cursor for select * into $s_num,$a_num,$pre_date,$b_num,$nam, $cu_type,$amoun,$balanc,$interes,$statu from r_cal_sch where sec_num=$s_num and acc_num=$a_num; $ open read_271; } if(sqlca.sqlcode!=0) { move(20,26); addstr("打开"); mess((short)18); printw("(%d), ",sqlca.sqlcode); mess((short)3); getch(); if(num_c4==1) continue; else break; } l1=0; while(1) { switch(num_c2) { case 1: if(num_c3==1) { $ fetch read_221; } else { $ fetch read_222; } break; case 2: $ fetch read_231; break; case 5: $ fetch read_271; } if(sqlca.sqlcode!=0) break; if((statu[0]&8)!=0) l1++; } switch(num_c2) { case 1: if(num_c3==1) { $ close read_221; } else { $ close read_222; } break; case 2: $ close read_231; break; case 5: $ close read_271; } if(l1==0 ||(l1<40 && f==0)) { if(num_c4==1) continue; else { move(20,26); addstr("该帐户明细未满页, "); mess((short)3); getch(); break; } } switch(num_c2) { case 1: if(num_c3==1) { $ open read_221; } else { $ open read_222; } break; case 2: $ open read_231; break; case 5: $ open read_271; } if(sqlca.sqlcode!=0) { move(20,26); addstr("打开"); mess((short)18); printw("(%d), ",sqlca.sqlcode); mess((short)3); getch(); break; } move(20,20); mess((short)60); mess((short)4); getch(); printf("%c%c%c%c%c%c%c%c%c\n\n\n\n",27,'[','5','i', 27,'%','9',1,20); pa=1; l=0; while(1) { switch(num_c2) { case 1: if(num_c3==1) { $ fetch read_221; } else { $ fetch read_222; } break; case 2: $ fetch read_231; break; case 5: $ fetch read_271; } if(sqlca.sqlcode!=0) break; if((statu[0]&8)==0) continue; statu[0]&=0xf7; switch(num_c2) { case 1: if(num_c3==1) { $ update r_dem_sch set status=$statu where sec_num=$s_num and acc_num=$a_num and pres_date=$pre_date and blot_num=$b_num; } else { $ update f_dem_sch set status=$statu where sec_num=$s_num and acc_num=$a_num and pres_date=$pre_date and blot_num=$b_num; } break; case 2: $ update r_dated_sch set status=$statu where sec_num=$s_num and acc_num=$a_num and pres_date=$pre_date and blot_num=$b_num; break; case 5: $ update r_cal_sch set status=$statu where sec_num=$s_num and acc_num=$a_num and pres_date=$pre_date and blot_num=$b_num; } if(sqlca.sqlerrd[2]!=1) break; if(l==0) { if(pa>1) printf("%c",12); addspacef(44); printf("%c%c%c%c帐 户 明 细 表%c%c%c%c\n", 28,'p',27,'[',28,'q',27,']'); addspacef(40);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -