1,不在发货、采购单做收付款。2,不做整单折扣。 3,收、付款单中 预收/付充销 编辑框不填,通过制 应收核销/应付核销 单来核销 以采购对账明细报表为例 rep.pay.007 当前报表脚本定义 合计金额列就是结算金额。可报存为xls,转发给供应商对账,求和公式校验也是一致的。 int load_over() { int i,n; n=grid_row_num("MG"); for(i=1;i<n;i++) { string vrtype,vrtypeid,vramount;//赋值非采购单据到合计金额 vrtype =grid_get_v("MG","voucher_type",i); vrtypeid =grid_get_v("MG","voucher_id",i); if(vrtype=="付款单") { db_run("select amount from ebm_mio where voucher_id= "+vrtypeid+""); vramount=str_std_num(to_int(db_res(0))/100,2); grid_set_v("MG","res_total_amount",i,-vramount-grid_get_v("MG","pre_pay",i)); } if(vrtype=="预付款单") { db_run("select amount from ebm_mio where voucher_id= "+vrtypeid+""); vramount=str_std_num(to_int(db_res(0))/100,2); grid_set_v("MG","res_total_amount",i,-vramount); } if(vrtype=="应付款单") { db_run("select amount from ebm_mio where voucher_id= "+vrtypeid+""); vramount=str_std_num(to_int(db_res(0))/100,2); grid_set_v("MG","res_total_amount",i,vramount); } if(vrtype=="应付核销") { db_run("select pre_out,amount from ebm_mio where voucher_id= "+vrtypeid+""); vramount=str_std_num((to_int(db_res(0))+to_int(db_res(1)))/100,2); grid_set_v("MG","res_total_amount",i,-vramount); } } grid_set_v("MG","res_total_amount",1,grid_get_v("MG","end_should_pay",1)-grid_get_v("MG","end_pre_pay",1)); grid_set_v("MG_Sum","res_total_amount",0,grid_get_col_sum("MG","res_total_amount")); grid_cal_sum("MG"); return 1; }; |