管理者软件
专业源于专注
www. myOIT. cn   
软件交流 管理软件 软件手册 »

    

 4  1/1   1  
作者
内容
cjsjtzlhh  [个人空间]


注册  2010-05-10
发贴数  230
精华数  0
原创贴  0
来自  
状态  正常

级别  会员
#1»发布于2015-01-18 10:21

客户允许欠款只能是限定金额,可以是百分比吗,比如,定金交了20000元,第一次发货10000元,本次销售发货单要开16000元,定金少于总货款的80%,那么本次不允许发货,销售发货单不允许审核


        




cjsjtzlhh  [个人空间]


注册  2010-05-10
发贴数  230
精华数  0
原创贴  0
来自  
状态  正常

级别  会员
#2»发布于2015-01-18 19:42

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
发贴数  230
精华数  0
原创贴  0
来自  
状态  正常

级别  会员
#3»发布于2015-01-18 20:03

改了一下,好像可以用了,老师看看有错误吗? 
 
 
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
发贴数  204
精华贴  6
原创贴  6
来自  常德-ZEN
状态  正常

级别  会员
#4»发布于2015-01-20 23:18

马克,备用+学习!


        




官方认证第三方服务团队  蒋逸凡(常德-ZEN) QQ:50636277
服务介绍: http://www.onlyit.cn/user_home?user_id=13498

 4  1/1   1  


登录后方可发贴


[ 电话: 0571-85462761 王先生 QQ: 124520435 加入软件QQ群 - 中国杭州 - 备案号码 浙ICP备19051128号]