This commit is contained in:
linfso 2025-05-19 18:04:53 +08:00
commit 75ea8c1cce

View File

@ -36,7 +36,6 @@ package com.xdadan.erp.emis.service;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.text.WordUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -261,9 +260,7 @@ public class EmisBaseService {
String newSettleType=getWaybillSettleType(newBill);
// 结算方式相同,判断增加的额度是否在范围内
if (oldSettleType.equals(newSettleType) &&
(oldBill.getPayee().equals(newBill.getPayee()) ||
oldBill.getCustNo().equals(newBill.getCustNo()))) {
if (oldSettleType.equals(newSettleType) && checkOperator(oldBill, newBill, newSettleType)) {
BigDecimal changeMoney=newBill.getFreight().subtract(oldBill.getFreight());
if(changeMoney.compareTo(BigDecimal.ZERO)>0){
if("2".equals(newSettleType)){
@ -349,6 +346,13 @@ public class EmisBaseService {
}
}
private boolean checkOperator(EmisWaybill oldBill, EmisWaybill newBill, String newSettleType) {
if ("2".equals(newSettleType)) {
return oldBill.getCustNo().equals(newBill.getCustNo());
}
return oldBill.getPayee().equals(newBill.getPayee());
}
/**
* 计算并返回销售临时额度总额
* tempCreditMoney = creditMoney + tempCreditMoneyAdjust