Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
WOR-394 Advance Payment hot fix (#65)
Browse files Browse the repository at this point in the history
WOR-394 correction to advance tax amount in case of multiple updates

WOR-394 Error map is thrown as Custom Exception in validate
  • Loading branch information
talele08 authored Jul 28, 2020
1 parent afb3913 commit 105b49c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit 105b49c

Please sign in to comment.