int func_before_oper() { can_oper=1 num HJ; int n,n2; string eba_id; { HJ=grid_get_col_sum("MG_Item","inp_amount");//本单金额合计 //warn('值为,'+HJ) eba_id=gui_get_val('ComboBox_Ext_Eba_Id'); // warn('值为,'+eba_id) if(eba_id>0) { //db_select_area(0); db_run("select should_in from eba where eba_id= '"+eba_id+"' " );//应收款 if(db_row_count()>0) n2= to_int(db_res(0)) // warn('值为,'+n2) { //db_select_area(1); db_run("select pre_in from eba where eba_id= '"+eba_id+"' " );//预收款 if(db_row_count()>0) n= to_int(db_res(0)) // warn('值为,'+n) { float a,b a=n2/100+HJ warn('值为,'+a) b=n/100/a*100-80 warn('值为,'+b) if(b<0) warn( '亲!你的客户欠款超出了欠款限额,请收款哦') can_oper=0 }; return 1; }; }; }; }; int func_before_oper() { can_oper=1 num HJ; int n,n2; string eba_id; { HJ=grid_get_col_sum("MG_Item","inp_amount");//本单金额合计 //warn('值为,'+HJ) eba_id=gui_get_val('ComboBox_Ext_Eba_Id'); // warn('值为,'+eba_id) if(eba_id>0) { //db_select_area(0); db_run("select should_in from eba where eba_id= '"+eba_id+"' " );//应收款 if(db_row_count()>0) n2= to_int(db_res(0)) // warn('值为,'+n2) { //db_select_area(1); db_run("select pre_in from eba where eba_id= '"+eba_id+"' " );//预收款 if(db_row_count()>0) n= to_int(db_res(0)) // warn('值为,'+n) { float a,b a=n2/100+HJ warn('值为,'+a) b=n/100/a*100-80 warn('值为,'+b) if(b<0) warn( '亲!你的客户欠款超出了欠款限额,请收款哦') can_oper=0 }; return 1; }; }; }; }; 写了一个脚本,放在销售发货里面的,当预收款的金额 小于 销售发货的金额+应收款的金额80%时禁止审核,不知道为什么,有时好用有时不能用,老师帮我改进一下吧 |