在制作会计凭证时,可能会由于删除之前凭证等原因导致凭证断号,尽管可以利用系统的“断号检查”功能来修正,但是不如在制作凭证时直接检查修正。下面的脚本放在“会计凭证”、“结转凭证”和“调汇凭证”。 int func_before_save() { string a,b,sql; int i,n,x,y; a=str_get_sub(gui_get_val("DateTimePicker_Voucher_Date"),0,6); b=a+'%'; sql="select mark_no from ebs_v as a,evm_v as b where a.voucher_id=b.voucher_id "; sql=sql+"and a.voucher_type like 'V_' and a.voucher_date like '"+b+"' order by mark_no"; db_run(sql); n=db_row_count(); x=1; for(i=0;i<n;i++) { db_go_row(i); y=db_res(0); if(x!=y){ if(confirm("凭证号存在断号,是否自动补全?")==1){ gui_set_val("Edit_Mark_No",x); } break; } x++; } return 1; }; |