推荐_客户允许欠款只能是限定金额,可以是百分比吗_产供销
作者 |
|
cjsjtzlhh [个人空间]
  注册  2010-05-10 发贴数 231 精华数 0 原创贴 0 来自 状态 正常
级别 会员 |
|
|
客户允许欠款只能是限定金额,可以是百分比吗,比如,定金交了20000元,第一次发货10000元,本次销售发货单要开16000元,定金少于总货款的80%,那么本次不允许发货,销售发货单不允许审核 |
|
|
|
|
cjsjtzlhh [个人空间]
  注册  2010-05-10 发贴数 231 精华数 0 原创贴 0 来自 状态 正常
级别 会员 |
|
|
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%时禁止审核,不知道为什么,有时好用有时不能用,老师帮我改进一下吧 |
|
|
|
|
cjsjtzlhh [个人空间]
  注册  2010-05-10 发贴数 231 精华数 0 原创贴 0 来自 状态 正常
级别 会员 |
|
|
改了一下,好像可以用了,老师看看有错误吗? 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,c; c=80 a=n2/100+HJ warn('值为,'+a) b=n/100/a*100 // warn('值为,'+b) if(b<c) { warn( '亲!你的客户欠款超出了欠款限额,请收款哦') can_oper=0 }; }; }; }; }; return 1; }; |
|
|
|
|
afoo [个人空间] QQ名 常德-ZEN
  注册  2010-04-08 发贴数 207 精华贴 6 原创贴 6 来自 常德-ZEN 状态 正常
级别 会员 |
|
|
|
|

官方认证第三方服务团队 蒋逸凡(常德-ZEN) QQ:50636277 微信FrankBZE
服务介绍: http://www.onlyit.cn/user_show_topic?user_id=13498&topic_id=79894&topic_page_id=1
|
|
|
|