|
@@ -1213,6 +1213,8 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
|
|
/**入库和出库处理单据子表信息*/
|
|
/**入库和出库处理单据子表信息*/
|
|
depotItemService.saveDetials(rows,headId, "add",request);
|
|
depotItemService.saveDetials(rows,headId, "add",request);
|
|
}
|
|
}
|
|
|
|
+ //修改订单总额
|
|
|
|
+ updateTotalPriceById(list.get(0));
|
|
logService.insertLog("单据",
|
|
logService.insertLog("单据",
|
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(depotHead.getNumber()).toString(),
|
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(depotHead.getNumber()).toString(),
|
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
|
@@ -1329,10 +1331,12 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
|
|
}
|
|
}
|
|
/**入库和出库处理单据子表信息*/
|
|
/**入库和出库处理单据子表信息*/
|
|
depotItemService.saveDetials(rows,depotHead.getId(), "update",request);
|
|
depotItemService.saveDetials(rows,depotHead.getId(), "update",request);
|
|
- //处理实际入库数量价格总额
|
|
|
|
|
|
+ //修改订单总额
|
|
// if (depotHead.getSubType().equals("采购") || depotHead.getSubType().equals("销售")){
|
|
// if (depotHead.getSubType().equals("采购") || depotHead.getSubType().equals("销售")){
|
|
// updateTotalPriceById(depotHead);
|
|
// updateTotalPriceById(depotHead);
|
|
// }
|
|
// }
|
|
|
|
+
|
|
|
|
+ updateTotalPriceById(depotHead);
|
|
logService.insertLog("单据",
|
|
logService.insertLog("单据",
|
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(depotHead.getNumber()).toString(),
|
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(depotHead.getNumber()).toString(),
|
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
|
@@ -2046,6 +2050,7 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
|
|
depotItem.setWarehousingUser(user.getId());
|
|
depotItem.setWarehousingUser(user.getId());
|
|
//基本单位数量*单价
|
|
//基本单位数量*单价
|
|
depotItem.setAllPrice(depotItem.getBasicNumber().multiply(depotItem.getUnitPrice()));
|
|
depotItem.setAllPrice(depotItem.getBasicNumber().multiply(depotItem.getUnitPrice()));
|
|
|
|
+ depotItem.setTaxMoney(depotItem.getBasicNumber().multiply(depotItem.getTaxRate()));
|
|
//单价总额 + 税额
|
|
//单价总额 + 税额
|
|
depotItem.setTaxLastMoney(depotItem.getAllPrice().add(depotItem.getTaxMoney()));
|
|
depotItem.setTaxLastMoney(depotItem.getAllPrice().add(depotItem.getTaxMoney()));
|
|
//添加单据子表
|
|
//添加单据子表
|
|
@@ -2077,18 +2082,22 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
|
|
*/
|
|
*/
|
|
private void updateTotalPriceById(DepotHead depotHead) throws Exception {
|
|
private void updateTotalPriceById(DepotHead depotHead) throws Exception {
|
|
BigDecimal sum = BigDecimal.ZERO;
|
|
BigDecimal sum = BigDecimal.ZERO;
|
|
- if (depotHead.getSubType().equals("采购") || depotHead.getSubType().equals("销售") ){
|
|
|
|
//获取单据子表
|
|
//获取单据子表
|
|
List<DepotItem> list = depotItemService.getListByHeaderId(depotHead.getId());
|
|
List<DepotItem> list = depotItemService.getListByHeaderId(depotHead.getId());
|
|
for (DepotItem depotItem : list) {
|
|
for (DepotItem depotItem : list) {
|
|
- sum = sum.add(depotItem.getTaxLastMoney());
|
|
|
|
|
|
+ if (depotItem.getTaxLastMoney() != null){
|
|
|
|
+ sum = sum.add(depotItem.getTaxLastMoney());
|
|
|
|
+ }else {
|
|
|
|
+ sum = sum.add(depotItem.getAllPrice());
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
BigDecimal totalPrice = sum;
|
|
BigDecimal totalPrice = sum;
|
|
if (depotHead.getTotalPrice().compareTo(BigDecimal.ZERO) < 0){
|
|
if (depotHead.getTotalPrice().compareTo(BigDecimal.ZERO) < 0){
|
|
totalPrice = totalPrice.negate();
|
|
totalPrice = totalPrice.negate();
|
|
}
|
|
}
|
|
this.update(new UpdateWrapper<DepotHead>().set("total_price",totalPrice).set("change_amount",totalPrice).set("discount_last_money",sum).eq("id",depotHead.getId()));
|
|
this.update(new UpdateWrapper<DepotHead>().set("total_price",totalPrice).set("change_amount",totalPrice).set("discount_last_money",sum).eq("id",depotHead.getId()));
|
|
- }
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|