分享_在采购单中查需求计划数及已经收货数的脚本_产供销
作者 |
|
中山-缘人 [个人空间] QQ名 覃健
注册  2012-02-24 发贴数 227 精华数 0 原创贴 0 来自 中山 状态 正常
级别 会员 |
|
|
初次写这样的脚本,请老师们多多指教 int init_row() { string vc_id,vc_no,sql,rs_id,pr_id; vc_no=grid_get_v('MG_Item','ref_voucher_no',change_row_id); vc_id=grid_get_v('MG_Item','ref_voucher_id',change_row_id); rs_id=grid_get_v('MG_Item','res_id',change_row_id); pr_id = gui_get_val('ComboBox_Ext_Project_Id') sql="select sum(inp_num) from ebs_vr_item where voucher_id =(" sql=sql+"select voucher_id from ebs_v where voucher_no =(" sql=sql+"select ass_no from ebs_vr where voucher_id = '"+vc_id+"' )) and res_id = '"+rs_id+"'" db_run(sql); if(db_row_count()>0); grid_set_v('MG_Item','vr_item_ext_5',change_row_id,db_res(0)); sql="select sum(inp_num) from ebs_vr_item where voucher_id in ("; sql=sql+"select voucher_id from ebs_v where (state='B' or state='c')"; sql=sql+"and voucher_type = 'AB' and (voucher_id in ("; sql=sql+"select voucher_id from ebs_vr where project_id = '"+pr_id+"'))) and res_id = '"+rs_id+"'"; db_run(sql); if(db_row_count()>0); grid_set_v('MG_Item','vr_item_ext_2',change_row_id,db_res(0)); return 1; }; |
|
|
于 2016-06-02 19:16 被 中山-缘人 修改
|
|
wbjjzhu [个人空间]
注册  2012-08-22 发贴数 102 精华数 0 原创贴 1 来自 状态 正常
级别 会员 |
|
|
|