update 编辑参会人的金额和税率
This commit is contained in:
@@ -4,6 +4,8 @@ import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 设置静态参数初始化
|
||||
*/
|
||||
@@ -22,12 +24,19 @@ public class StaticConfig {
|
||||
|
||||
@Value(value = "${spring.mail.host}")
|
||||
private String host;
|
||||
|
||||
public static String TAX_RATE;
|
||||
/**
|
||||
* 税率
|
||||
*/
|
||||
public static BigDecimal TAX_RATE;
|
||||
/**
|
||||
* 税率计算
|
||||
*/
|
||||
public static BigDecimal TAX_RATE_CALCULATE;
|
||||
|
||||
@Value("${tax_rate}")
|
||||
public void setTaxRate(String taxRate) {
|
||||
StaticConfig.TAX_RATE = taxRate;
|
||||
StaticConfig.TAX_RATE = new BigDecimal(taxRate);
|
||||
StaticConfig.TAX_RATE_CALCULATE = new BigDecimal(taxRate).add(BigDecimal.ONE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -803,7 +803,7 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
|
||||
BigDecimal noTaxAmount = payMailBillProject.getNoTaxAmount();
|
||||
BigDecimal tax = payMailBillProject.getTax();
|
||||
if (noTaxAmount == null || tax == null){
|
||||
noTaxAmount = invoiceAmount.divide(new BigDecimal(StaticConfig.TAX_RATE), 2, RoundingMode.HALF_UP);
|
||||
noTaxAmount = invoiceAmount.divide(StaticConfig.TAX_RATE_CALCULATE, 2, RoundingMode.HALF_UP);
|
||||
tax = invoiceAmount.subtract(noTaxAmount);
|
||||
}
|
||||
payPaymentRecordService.isTax(noTaxAmount,tax,invoiceAmount);
|
||||
@@ -1140,7 +1140,7 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
|
||||
BigDecimal noTaxAmount = bm.getNoTaxAmount();
|
||||
BigDecimal tax = bm.getTax();
|
||||
if (noTaxAmount == null || tax == null){
|
||||
noTaxAmount = thisInvoiceAmount.divide(new BigDecimal(StaticConfig.TAX_RATE), 2, RoundingMode.HALF_UP);
|
||||
noTaxAmount = thisInvoiceAmount.divide(StaticConfig.TAX_RATE_CALCULATE, 2, RoundingMode.HALF_UP);
|
||||
tax = thisInvoiceAmount.subtract(noTaxAmount);
|
||||
bm.setNoTaxAmount(noTaxAmount);
|
||||
bm.setTax(tax);
|
||||
|
||||
+24
-1
@@ -30,6 +30,7 @@ import com.jero.company.entity.PayCompanyManagement;
|
||||
import com.jero.company.entity.PayContactsManagement;
|
||||
import com.jero.company.service.IPayCompanyManagementService;
|
||||
import com.jero.company.service.IPayContactsManagementService;
|
||||
import com.jero.config.StaticConfig;
|
||||
import com.jero.contract.common.PayIncomeContractCommon;
|
||||
import com.jero.contract.entity.PayIncomeContract;
|
||||
import com.jero.contract.entity.PayIncomeContractAssociated;
|
||||
@@ -77,6 +78,7 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -972,7 +974,10 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
|
||||
if (ObjectUtil.isNull(payMeetingSituation)) {
|
||||
throw new JeroBootException("参会人错误!");
|
||||
}
|
||||
payMeetingSituationVO.setAmountReceivable(payMeetingSituation.getAmountReceivable());
|
||||
BigDecimal amountReceivable = payMeetingSituationVO.getAmountReceivable();
|
||||
if (amountReceivable == null){
|
||||
payMeetingSituationVO.setAmountReceivable(BigDecimal.ZERO);
|
||||
}
|
||||
BeanUtils.copyProperties(payMeetingSituationVO, payMeetingSituation);
|
||||
//处理校验参会人信息
|
||||
PayMeetingSituation payMeetingSituation1;
|
||||
@@ -1234,6 +1239,21 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
|
||||
payMeetingSituation1.setCheckInHotel(payMeetingSituation.getCheckInHotel());
|
||||
payMeetingSituation1.setArrivalTime(payMeetingSituation.getArrivalTime());
|
||||
payMeetingSituation1.setDepartureTime(payMeetingSituation.getDepartureTime());
|
||||
//处理默认税率
|
||||
BigDecimal amountReceivable = payMeetingSituation1.getAmountReceivable();
|
||||
BigDecimal taxRate = payMeetingSituation.getTaxRate();
|
||||
if (taxRate == null){
|
||||
payMeetingSituation1.setTaxRate(StaticConfig.TAX_RATE);
|
||||
BigDecimal noTaxAmount = amountReceivable.divide(StaticConfig.TAX_RATE_CALCULATE, 2, RoundingMode.HALF_UP);
|
||||
BigDecimal tax = amountReceivable.subtract(noTaxAmount);
|
||||
payMeetingSituation1.setNoTaxAmount(noTaxAmount);
|
||||
payMeetingSituation1.setTax(tax);
|
||||
}else {
|
||||
payMeetingSituation1.setTaxRate(taxRate);
|
||||
payMeetingSituation1.setNoTaxAmount(payMeetingSituation.getNoTaxAmount());
|
||||
payMeetingSituation1.setTax(payMeetingSituation.getTax());
|
||||
}
|
||||
payMeetingSituation1.setAmountReceivable(payMeetingSituation.getAmountReceivable());
|
||||
//其他会议的嘉宾和内部企业
|
||||
} else {
|
||||
CommonGuestVO commonGuestVO = new CommonGuestVO();
|
||||
@@ -1297,6 +1317,9 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
|
||||
payMeetingSituation1.setPaidNoTaxAmount(BigDecimal.ZERO);
|
||||
|
||||
payMeetingSituation1.setPayMode(0);
|
||||
payMeetingSituation1.setTaxRate(BigDecimal.ZERO);
|
||||
payMeetingSituation1.setTax(BigDecimal.ZERO);
|
||||
payMeetingSituation1.setNoTaxAmount(BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ public class PayConfirmPaymentRecordService extends ServiceImpl<PayConfirmPaymen
|
||||
BigDecimal tax = payConfirmPaymentRecord.getTax();
|
||||
BigDecimal amountReceived = payConfirmPaymentRecord.getAmountReceived();
|
||||
if (noTaxAmount == null || tax == null){
|
||||
noTaxAmount = amountReceived.divide(new BigDecimal(StaticConfig.TAX_RATE), 2, RoundingMode.HALF_UP);
|
||||
noTaxAmount = amountReceived.divide(StaticConfig.TAX_RATE_CALCULATE, 2, RoundingMode.HALF_UP);
|
||||
tax = amountReceived.subtract(noTaxAmount);
|
||||
payConfirmPaymentRecord.setNoTaxAmount(noTaxAmount);
|
||||
payConfirmPaymentRecord.setTax(tax);
|
||||
|
||||
+2
-2
@@ -565,7 +565,7 @@ public class PayPaymentCheckServiceImpl extends ServiceImpl<PayPaymentCheckMappe
|
||||
noTaxAmount = amountReceived;
|
||||
tax = BigDecimal.ZERO;
|
||||
}else {
|
||||
noTaxAmount = amountReceived.divide(new BigDecimal(StaticConfig.TAX_RATE), 2, RoundingMode.HALF_UP);
|
||||
noTaxAmount = amountReceived.divide(StaticConfig.TAX_RATE_CALCULATE, 2, RoundingMode.HALF_UP);
|
||||
tax = amountReceived.subtract(noTaxAmount);
|
||||
}
|
||||
payPaymentRecord.setTax(tax);
|
||||
@@ -642,7 +642,7 @@ public class PayPaymentCheckServiceImpl extends ServiceImpl<PayPaymentCheckMappe
|
||||
noTaxAmount = amountReceived;
|
||||
tax = BigDecimal.ZERO;
|
||||
}else {
|
||||
noTaxAmount = amountReceived.divide(new BigDecimal(StaticConfig.TAX_RATE), 2, RoundingMode.HALF_UP);
|
||||
noTaxAmount = amountReceived.divide(StaticConfig.TAX_RATE_CALCULATE, 2, RoundingMode.HALF_UP);
|
||||
tax = amountReceived.subtract(noTaxAmount);
|
||||
}
|
||||
payPaymentRecord.setTax(tax);
|
||||
|
||||
+4
-4
@@ -213,7 +213,7 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
|
||||
BigDecimal tax1 = payPaymentRecord.getTax();
|
||||
if (noTaxAmount1 == null || tax1 == null){
|
||||
BigDecimal amountReceived = payPaymentRecord.getAmountReceived();
|
||||
BigDecimal noTaxAmount = amountReceived.divide(new BigDecimal(StaticConfig.TAX_RATE), 2, RoundingMode.HALF_UP);
|
||||
BigDecimal noTaxAmount = amountReceived.divide(StaticConfig.TAX_RATE_CALCULATE, 2, RoundingMode.HALF_UP);
|
||||
BigDecimal tax = amountReceived.subtract(noTaxAmount);
|
||||
payPaymentRecord.setNoTaxAmount(noTaxAmount);
|
||||
payPaymentRecord.setTax(tax);
|
||||
@@ -367,7 +367,7 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
|
||||
BigDecimal noTaxAmount;
|
||||
List<PayContactsManagementTemporary> listId = new ArrayList<>();
|
||||
|
||||
BigDecimal divide = payPaymentRecord.getAmountReceived().divide(new BigDecimal(StaticConfig.TAX_RATE), 2, RoundingMode.HALF_UP);
|
||||
BigDecimal divide = payPaymentRecord.getAmountReceived().divide(StaticConfig.TAX_RATE_CALCULATE, 2, RoundingMode.HALF_UP);
|
||||
//累加主列表实收金额
|
||||
//来款条件校验
|
||||
amountReceivedVerification( payPaymentRecord, flag);
|
||||
@@ -642,7 +642,7 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
|
||||
noTaxAmount = amountReceived;
|
||||
tax = BigDecimal.ZERO;
|
||||
}else {
|
||||
noTaxAmount = amountReceived.divide(new BigDecimal(StaticConfig.TAX_RATE), 2, RoundingMode.HALF_UP);
|
||||
noTaxAmount = amountReceived.divide(StaticConfig.TAX_RATE_CALCULATE, 2, RoundingMode.HALF_UP);
|
||||
tax = amountReceived.subtract(noTaxAmount);
|
||||
}
|
||||
//保存税额
|
||||
@@ -696,7 +696,7 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl<PayPaymentRecordMap
|
||||
noTaxAmount = amountReceived;
|
||||
tax = BigDecimal.ZERO;
|
||||
}else {
|
||||
noTaxAmount = amountReceived.divide(new BigDecimal(StaticConfig.TAX_RATE), 2, RoundingMode.HALF_UP);
|
||||
noTaxAmount = amountReceived.divide(StaticConfig.TAX_RATE_CALCULATE, 2, RoundingMode.HALF_UP);
|
||||
tax = amountReceived.subtract(noTaxAmount);
|
||||
}
|
||||
//保存税额
|
||||
|
||||
@@ -339,4 +339,4 @@ singleSignON:
|
||||
client_secret: 3a381f2432d648879ebd10ba7b54a8ae
|
||||
client_url: https://iam.catarc.ac.cn
|
||||
|
||||
tax_rate: 1.06
|
||||
tax_rate: 0.06
|
||||
Reference in New Issue
Block a user