Compare commits

...

2 Commits

1 changed files with 5 additions and 5 deletions

View File

@ -638,9 +638,9 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98819, "薪资核算结果还未归档,可直接核算")); throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98819, "薪资核算结果还未归档,可直接核算"));
} }
// 税款所在年的日期范围第一天最后一天 // 税款所在年的日期范围第一天最后一天
LocalDateRange yearRange = SalaryDateUtil.localDate2YearRange(salaryAcctRecordPO.getSalaryMonth()); LocalDateRange yearRange = SalaryDateUtil.localDate2YearRange(salaryAcctRecordPO.getTaxCycle());
if (Objects.isNull(yearRange)) { if (Objects.isNull(yearRange)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "薪资所属月为空")); throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "税款所属期为空"));
} }
// 查询税款所在年的该个税扣缴义务人所有薪资核算记录 // 查询税款所在年的该个税扣缴义务人所有薪资核算记录
// 获取账套所属个税扣缴义务人的核算记录 // 获取账套所属个税扣缴义务人的核算记录
@ -657,13 +657,13 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
if (!taxDeclarationFunctionEnum.getValue().equals(TaxDeclarationFunctionEnum.CLOSURE.getValue())) { if (!taxDeclarationFunctionEnum.getValue().equals(TaxDeclarationFunctionEnum.CLOSURE.getValue())) {
// 如果已经存在之后月份的薪资核算记录了就不允许重新核算本月了 // 如果已经存在之后月份的薪资核算记录了就不允许重新核算本月了
SalaryAcctRecordPO afterSalaryAcctRecordPO = selfSalaryAcctRecordPOS.stream() SalaryAcctRecordPO afterSalaryAcctRecordPO = selfSalaryAcctRecordPOS.stream()
.filter(po -> po.getSalaryMonth().compareTo(salaryAcctRecordPO.getSalaryMonth()) > 0) .filter(po -> po.getTaxCycle().compareTo(salaryAcctRecordPO.getTaxCycle()) > 0)
.findAny() .findAny()
.orElse(null); .orElse(null);
if (Objects.nonNull(afterSalaryAcctRecordPO)) { if (Objects.nonNull(afterSalaryAcctRecordPO)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(105826, "已经存在{0}的薪资核算记录了,不能重新核算{1}的薪资了") throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(105826, "已经存在{0}的薪资核算记录了,不能重新核算{1}的薪资了")
.replace("{0}", SalaryDateUtil.localDate2YearMonth(afterSalaryAcctRecordPO.getSalaryMonth()).toString()) .replace("{0}", SalaryDateUtil.localDate2YearMonth(afterSalaryAcctRecordPO.getTaxCycle()).toString())
.replace("{1}", SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()).toString())); .replace("{1}", SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getTaxCycle()).toString()));
} }
} }