Quellcode durchsuchen

反馈 2023040227
销售订单转出货单后 ,帮忙把销售订单的未含运费单价(sd_yfdj_user)带到出货单,出货单维护界面 按钮转销售退货单。sd_yfdj_user的价格赋值到销售销售退货单的pd_sendprice,并且计算出退货金额。

shenliang vor 1 Jahr
Ursprung
Commit
a3a09ad968
1 geänderte Dateien mit 6 neuen und 1 gelöschten Zeilen
  1. 6 1
      src/com/uas/erp/dao/common/impl/ProdInOutDaoImpl.java

+ 6 - 1
src/com/uas/erp/dao/common/impl/ProdInOutDaoImpl.java

@@ -2047,7 +2047,7 @@ public class ProdInOutDaoImpl extends BaseDao implements ProdInOutDao {
 	@Override
 	public void toAppointedProdSaleReturn(int pi_id, int pd_id, double qty, int detno) {
 		Object[] pi = getFieldsDataByCondition("ProdInOut", new String[] { "pi_id", "pi_class", "pi_inoutno" }, "pi_id=" + pi_id);
-		Object[] source = getFieldsDataByCondition("ProdIODetail", new String[] { "pd_inoutno", "pd_pdno", "pd_batchcode" }, "pd_id="
+		Object[] source = getFieldsDataByCondition("ProdIODetail", new String[] { "pd_inoutno", "pd_pdno", "pd_batchcode","pd_yfdj_user"}, "pd_id="
 				+ pd_id);
 		Map<String, Object> diffence = new HashMap<String, Object>();
 		String num = sGetMaxNumber("BatchNum", 1);
@@ -2079,6 +2079,11 @@ public class ProdInOutDaoImpl extends BaseDao implements ProdInOutDao {
 		diffence.put("pd_turnesqty", 0);
 		diffence.put("pd_esqty", 0);
 		diffence.put("pd_model", "'" + source[2] + "'"); // 出货批号
+		diffence.put("pd_sendprice",  source[3] );  //赋值退货单价为出货单不含运费售价
+		double pd_ordertotal=Double.parseDouble(source[3].toString()) * qty; //退货金额
+		BigDecimal pd_ordertotal2 = new BigDecimal(pd_ordertotal);  //保留2位小数
+		double pd_ordertotal3 = pd_ordertotal2.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
+		diffence.put("pd_ordertotal",pd_ordertotal3 );
 		copyRecord("ProdIODetail", "ProdIODetail", "pd_id=" + pd_id, diffence);
 	}