📄 proc1.0524
字号:
$select ye into $ye from sfjzhb where sfdwzh=$sfjmx_msg.sfdwzh; if(sqlca.sqlcode!=0){ memcpy(msg->rc,PATR_ERR,2); $close sfj_cur; $rollback work; return(0); } memcpy(&sfjls_msg,&sfjmx_msg,sizeof(sfjmx_file)); ye=ye+atof(sfjmx_msg.sfje); sprintf(sfjls_msg.ye,"%13.2f",ye); $insert into lssfjmx values($sfjls_msg); if(sqlca.sqlcode!=0){ memcpy(msg->rc,PATR_ERR,2); $close sfj_cur; $rollback work; return(0); } while(1){ $fetch sfj_cur into $sfjmx_msg; if(sqlca.sqlcode==100) break; if(sqlca.sqlcode!=0){ memcpy(msg->rc,PATR_ERR,2); $close sfj_cur; $rollback work; return(0); } if(strcmp(sfjmx_msg.sfdwzh,zh,9)==0){ memcpy(&sfjls_msg,&sfjmx_msg,sizeof(sfjmx_file)); ye=ye+atof(sfjmx_msg.sfje); sprintf(sfjls_msg.ye,"%13.2f",ye); $insert into lssfjmx values($sfjls_msg); if(sqlca.sqlcode!=0){ $rollback work; memcpy(msg->rc,PATR_ERR,2); $close sfj_cur; return(0); } } } $update sfjzhb set ye=$ye where sfdwzh=$zh; $close sfj_cur; $delete from sfjmxb where sfdwzh=$zh; if(sqlca.sqlcode!=0){ memcpy(msg->rc,PATR_ERR,2); $close sfj_cur; $rollback work; return(0); } $select count(*) into $yn from sfjmxb; if(sqlca.sqlcode!=0){ memcpy(msg->rc,PATR_ERR,2); $close sfj_cur; $rollback work; return(0); }}memcpy(msg->rc,PATR_OK,2);$commit work;return(1);}*/proc90(msg)DL_MSG *msg;{FILE *fp;int i;$char ksrq[11];$char jsrq[11];$char dwfzh[9];char str[6];$char mc[11],qcjy[14];memset(ksrq,'\0',11);memset(jsrq,'\0',11);memset(dwfzh,'\0',9);memcpy(ksrq,msg->point+5,5);memcpy(ksrq+5,"/",1);memcpy(ksrq+6,msg->point,4);memcpy(jsrq,msg->passwd2+5,5);memcpy(jsrq+5,"/",1);memcpy(jsrq+6,msg->passwd2,4);memcpy(dwfzh,msg->passwd1,8);sprintf(sndname,"/usr/hcdl/dlmg/server/report/yswdwmx.prt");fp=fopen(sndname,"w");if(fp==NULL){ memcpy(msg->rc,PATR_ERR,2); return(0); }$select sfdwmc,qcjy into $mc,$qcjy from sfjzhb where sfdwzh=$dwfzh; if(sqlca.sqlcode!=0){ memcpy(msg->rc,PATR_CXERR,2); return(0); }$declare mx_cur cursor for select * from sfjmxlsb where sfdwzh=$dwfzh and jkrq>=$ksrq and jkrq<=$jsrq;$open mx_cur;if(sqlca.sqlcode!=0){ memcpy(msg->rc,PATR_CXERR,2); return(0); }fprintf(fp,"\n\n");fprintf(fp," 单位预算外资金收支明细表\n");fprintf(fp," =========================\n");fprintf(fp,"账号:%s 户名:%s 期初结转:%s\n",dwfzh,mc,qcjy);fprintf(fp,"┌────┬─────┬─────┬────┬─────┬────────┬────────┬────────┐\n");fprintf(fp,"│ 序号 │ 日 期 │ 凭证号 │ 摘要 │ 项目号 │ 借方发生额 │ 贷方发生额 │ 余 额 │\n");fprintf(fp,"├────┼─────┼─────┼────┼─────┼────────┼────────┼────────┤\n");i=0;while(1){ $fetch mx_cur into $sfjls_msg; if(sqlca.sqlcode==100){ memcpy(msg->rc,PATR_OK,2); $close mx_cur;fprintf(fp,"└────┸─────┸─────┸────┸─────┸────────┸────────┸────────┚\n"); fprintf(fp,"\f"); fclose(fp); return(3); } if(sqlca.sqlcode!=0){ memcpy(msg->rc,PATR_ERR,2); $close mx_cur; return(0); }fprintf(fp,"│%6d │%10s",i,sfjls_msg.jkrq);if(strcmp(sfjls_msg.zy,"0")==0)strcpy(str,"现金");else strcpy(str,"转帐");fprintf(fp,"│%7s │%6s │%7s │",sfjls_msg.pzh,str,sfjls_msg.sfxm);if(strcmp(sfjls_msg.zy,"0")==0)fprintf(fp,"%16s│%16s│%16s│\n"," ",sfjls_msg.sfje,sfjls_msg.sfje);else fprintf(fp,"%16s│%16s│%16s│\n",sfjls_msg.sfje," ",sfjls_msg.sfje); i++; if(i%50==0){fprintf(fp,"└────┸─────┸─────┸────┸─────┸────────┸────────┸────────┚\n");fprintf(fp,"\f");fprintf(fp,"\n\n");fprintf(fp," 单位预算外资金收支明细表\n");fprintf(fp," =========================\n");fprintf(fp,"账号:%s 户名:%s 期初结转:%s\n",dwfzh,mc,qcjy);fprintf(fp,"┌────┬─────┬─────┬────┬─────┬────────┬────────┬────────┐\n");fprintf(fp,"│ 序号 │ 日 期 │ 凭证号 │ 摘要 │ 项目号 │ 借方发生额 │ 贷方发生额 │ 余 额 │\n");fprintf(fp,"├────┼─────┼─────┼────┼─────┼────────┼────────┼────────┤\n");}}}proc93(msg)DL_MSG *msg;{$ char jzrq[11];memset(jzrq,'\0',11);memcpy(jzrq,msg->point+5,5);memcpy(jzrq+5,"/",1);memcpy(jzrq+6,msg->point,4);$begin work;$lock table lslsb in exclusive mode;$ delete from lslsb where jkrq<=$jzrq; if(sqlca.sqlcode!=0) { $ rollback work; memcpy(msg->rc,PATR_ERR,2); return(1); }$commit work;memcpy(msg->rc,PATR_OK,2);return(1);}proc99(msg)DL_MSG *msg;{$ char jzrq[11];long date;short mdy[3];char mon[3];FILE *fp;memset(jzrq,'\0',11);memcpy(jzrq,msg->point+5,5);memcpy(mon,msg->point+5,2);mon[2]='\0';memcpy(jzrq+5,"/",1);memcpy(jzrq+6,msg->point,4);if((atoi(mon)==0)||(atoi(mon)>12)) { memcpy(msg->rc,PATR_ERR,2); return(1); }rtoday(&date);rjulmdy(date,mdy);if(atoi(mon)==mdy[0]) { memcpy(msg->rc,PATR_ERR,2); return(1); }$begin work;$lock table jjfkb in exclusive mode;$ delete from jjfkb where jkrq<=$jzrq;if(sqlca.sqlcode!=0) { $ rollback work; memcpy(msg->rc,PATR_ERR,2); return(1); }$commit work;memcpy(msg->rc,PATR_OK,2);return(1);}proc96(msg)DL_MSG *msg;{$ char rq[7],preym[7];$ double bysr,byzc,bysrlj,byzclj;char year[5],month[3];memset(rq,'\0',7);memset(preym,'\0',7);memset(year,'\0',5);memset(month,'\0',3);memcpy(rq,msg->point,6);memcpy(year,msg->point,4);memcpy(month,msg->point+4,2);if(atoi(month)==1)sprintf(preym,"%4d%2d",atoi(year)-1,12);else sprintf(preym,"%4d%2d",atoi(year),atoi(month));$declare sfjzh_cur cursor for select * from sfjzhb;$open sfjzh_cur;if(sqlca.sqlcode!=0){memcpy(msg->rc,PATR_ERR,2);return(1);}while(1){$fetch sfjzh_cur into $sfjzh_msg; if(sqlca.sqlcode==100)break;if(sqlca.sqlcode!=0){ $close sfjzh_cur; memcpy(msg->rc,PATR_ERR,2); return(1); }if(memcmp(sfjzh_msg.sfdwzh+2,"000000",6)==0)continue;bysr=0;byzc=0;$declare lssfj_cur cursor for select * from lssfjmx;$open lssfj_cur;if(sqlca.sqlcode!=0){ $close sfjzh_cur; memcpy(msg->rc,PATR_ERR,2); return(1); }while(1){ $fetch lssfj_cur into $sfjls_msg; if(sqlca.sqlcode==100)break; if(sqlca.sqlcode!=0){ $close lssfj_cur; $close sfjzh_cur; memcpy(msg->rc,PATR_ERR,2); return(1); } if((memcmp(sfjls_msg.sfdwzh,sfjzh_msg.sfdwzh,8)==0)&&(memcmp(sfjls_msg.jkrq,rq+4,2)==0)&&(memcmp(sfjls_msg.jkrq+6,rq,4))==0){ if(memcmp(sfjls_msg.sffx,"0",1)==0) bysr+=atof(sfjls_msg.sfje); else byzc+=atof(sfjls_msg.sfje); }}$close lssfj_cur;$free lssfj_cur;memcpy(sfjyd_msg.sfdwzh,sfjzh_msg.sfdwzh,8);memcpy(sfjyd_msg.ym,rq,8);sprintf(sfjyd_msg.bysr,"%13.2f",bysr);sprintf(sfjyd_msg.byzc,"%13.2f",byzc);$select bysrlj,byzclj into $bysrlj,$byzclj from sfjydb where ym=$preym and sfdwzh=$sfjzh_msg.sfdwzh;if(sqlca.sqlcode==100){ bysrlj=0;byzclj=0; }if((sqlca.sqlcode!=0)&&(sqlca.sqlcode!=100)){ $close sfjzh_cur; memcpy(msg->rc,PATR_ERR,2); return(1); }bysrlj+=bysr;byzclj+=byzc;sprintf(sfjyd_msg.bysrlj,"%13.2f",bysrlj);sprintf(sfjyd_msg.byzclj,"%13.2f",-byzclj);sprintf(sfjyd_msg.qmjy,"%13.2f",atof(sfjzh_msg.qcjy)+bysrlj+byzclj);$insert into sfjydb values($sfjyd_msg);if(sqlca.sqlcode!=0){ $close sfjzh_cur; memcpy(msg->rc,PATR_ERR,2); return(1); }}$close sfjzh_cur;$open sfjzh_cur;if(sqlca.sqlcode!=0){memcpy(msg->rc,PATR_ERR,2);return(1);}while(1){$fetch sfjzh_cur into $sfjzh_msg;if(sqlca.sqlcode==100)break;if(sqlca.sqlcode!=0){ $close sfjzh_cur; memcpy(msg->rc,PATR_ERR,2); return(1); }if(memcmp(sfjzh_msg.sfdwzh+2,"000000",6)!=0)continue;bysr=0;byzc=0;$declare sfjyd_cur cursor for select * from sfjydb where ym=$rq;$open sfjyd_cur;if(sqlca.sqlcode!=0){ $close sfjzh_cur; memcpy(msg->rc,PATR_ERR,2); return(1); }while(1){ $fetch sfjyd_cur into $sfjyd_msg; if(sqlca.sqlcode==100)break; if(sqlca.sqlcode!=0){ $close sfjzh_cur; $close sfjyd_cur; memcpy(msg->rc,PATR_ERR,2); return(1); } if((memcmp(sfjyd_msg.sfdwzh,sfjzh_msg.sfdwzh,2)==0)&&(memcmp(sfjyd_msg.ym,rq,6)==0)){ bysr+=atof(sfjyd_msg.bysr); byzc+=atof(sfjyd_msg.byzc);}}$close sfjyd_cur;$free sfjyd_cur;memcpy(sfjyd_msg.sfdwzh,sfjzh_msg.sfdwzh,8);memcpy(sfjyd_msg.ym,rq,8);sprintf(sfjyd_msg.bysr,"%13.2f",bysr);sprintf(sfjyd_msg.byzc,"%13.2f",byzc);$select bysrlj,byzclj into $bysrlj,$byzclj from sfjydb where ym=$preym and sfdwzh=$sfjzh_msg.sfdwzh;if(sqlca.sqlcode==100){ bysrlj=0; byzclj=0; }if((sqlca.sqlcode!=0)&&(sqlca.sqlcode!=100)){ $close sfjzh_cur; memcpy(msg->rc,PATR_ERR,2); return(1); }bysrlj+=bysr;byzclj+=byzc;sprintf(sfjyd_msg.bysrlj,"%13.2f",bysrlj);sprintf(sfjyd_msg.byzclj,"%13.2f",-byzclj);sprintf(sfjyd_msg.qmjy,"%13.2f",atof(sfjzh_msg.qcjy)+bysrlj+byzclj);$insert into sfjydb values($sfjyd_msg);if(sqlca.sqlcode!=0){ $close sfjzh_cur; memcpy(msg->rc,PATR_ERR,2); return(1); }}$close sfjzh_cur;memcpy(msg->rc,PATR_OK,2);return(1);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -