From 105b49cd6d92d25dddf5af86c4d49112bd56a27e Mon Sep 17 00:00:00 2001 From: talele08 Date: Tue, 28 Jul 2020 16:29:45 +0530 Subject: [PATCH] WOR-394 Advance Payment hot fix (#65) WOR-394 correction to advance tax amount in case of multiple updates WOR-394 Error map is thrown as Custom Exception in validate --- .../main/java/org/egov/demand/service/ReceiptServiceV2.java | 2 +- .../java/org/egov/demand/web/validator/DemandValidatorV1.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/billing-service/src/main/java/org/egov/demand/service/ReceiptServiceV2.java b/billing-service/src/main/java/org/egov/demand/service/ReceiptServiceV2.java index 305baf42..08d56f89 100644 --- a/billing-service/src/main/java/org/egov/demand/service/ReceiptServiceV2.java +++ b/billing-service/src/main/java/org/egov/demand/service/ReceiptServiceV2.java @@ -175,7 +175,7 @@ private void updateSingleDemandDetail(DemandDetail currentDetail, BillAccountDet BigDecimal newAmount = billAccDetail.getAdjustedAmount(); if(advanceTaxHead!=null && billAccDetail.getTaxHeadCode().equalsIgnoreCase(advanceTaxHead)) - currentDetail.setTaxAmount(billAccDetail.getAmount()); + currentDetail.setTaxAmount(billAccDetail.getAmount().add(oldCollectedAmount)); if (isRecieptCancellation) currentDetail.setCollectionAmount(oldCollectedAmount.subtract(newAmount)); diff --git a/billing-service/src/main/java/org/egov/demand/web/validator/DemandValidatorV1.java b/billing-service/src/main/java/org/egov/demand/web/validator/DemandValidatorV1.java index 72c11d67..aa0dd86a 100644 --- a/billing-service/src/main/java/org/egov/demand/web/validator/DemandValidatorV1.java +++ b/billing-service/src/main/java/org/egov/demand/web/validator/DemandValidatorV1.java @@ -485,6 +485,9 @@ public void validateForUpdate(DemandRequest demandRequest, DocumentContext mdmsD olddemandDetails.addAll(newDemandDetails); validateDemandDetails(olddemandDetails, errorMap); + if(!errorMap.isEmpty()) + throw new CustomException(errorMap); + /* * validate demand for Create is called to validate the new demand details which is part of update *