Skip to content

Commit

Permalink
[PHOENIX-6857]- Checking Demand Bill status while generating Notices.
Browse files Browse the repository at this point in the history
  • Loading branch information
kamleshpratap143 committed Jun 2, 2017
1 parent ef58f1e commit bb5891b
Showing 1 changed file with 39 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,10 @@ else if (NOTICE_TYPE_DISTRESS.equals(noticeType))
validateDistressNotice(errors, basicProperty);
else if (NOTICE_TYPE_INVENTORY.equals(noticeType))
validateInventoryNotice(errors, basicProperty);
else if (VALUATION_CERTIFICATE.equals(noticeType) || NOTICE_TYPE_OC.equals(noticeType))
else if (VALUATION_CERTIFICATE.equals(noticeType))
validateCertificate(errors, basicProperty);
else if (NOTICE_TYPE_OC.equals(noticeType))
validateOwnerCertificate(errors, basicProperty);
else
validateOccupierNotice(errors, basicProperty);
return errors;
Expand Down Expand Up @@ -285,12 +287,12 @@ public ReportOutput generateNotice(final String noticeType, final BasicProperty
reportInput = generateEsdNotice(basicProperty, reportParams, city, noticeNo, formatter);
else if (NOTICE_TYPE_INVENTORY.equals(noticeType))
reportInput = generateInventoryNotice(basicProperty, reportParams, city, formatter);
else if (VALUATION_CERTIFICATE.equals(noticeType))
reportInput = generateValuationCertificate(basicProperty, reportParams, city, noticeNo);
else if (NOTICE_TYPE_OC.equals(noticeType))
reportInput = generateOwnershipCertificate(basicProperty, reportParams, city, noticeNo);
else if (NOTICE_TYPE_OCCUPIER.equals(noticeType))
reportOutput = prepareOccupierNotice(basicProperty, reportParams, city, noticeNo);
else if (VALUATION_CERTIFICATE.equals(noticeType))
reportInput = generateValuationCertificate(basicProperty, reportParams, city, noticeNo);
else if (NOTICE_TYPE_OC.equals(noticeType))
reportInput = generateOwnershipCertificate(basicProperty, reportParams, city, noticeNo);
else if (NOTICE_TYPE_OCCUPIER.equals(noticeType))
reportOutput = prepareOccupierNotice(basicProperty, reportParams, city, noticeNo);
else
reportInput = generateDistressNotice(basicProperty, reportParams, city, noticeNo);

Expand Down Expand Up @@ -420,30 +422,36 @@ private void validateCertificate(final List<String> errors, final BasicProperty
errors.add("assessment.has.pt.due");
}

private List<String> validateDemandBill(final BasicProperty basicProperty, final List<String> errors) {
final BigDecimal totalDue = getTotalPropertyTaxDue(basicProperty);
if (totalDue.compareTo(BigDecimal.ZERO) == 0)
errors.add("common.no.property.due");
else {
final boolean billExists = getDemandBillByAssessmentNo(basicProperty);
if (!billExists)
errors.add("common.demandbill.not.exists");
}
return errors;
}

private List<String> validateOccupierNotice(final List<String> errors, final BasicProperty basicProperty) {
Boolean hasTenant = Boolean.FALSE;
for (final Floor floor : basicProperty.getProperty().getPropertyDetail().getFloorDetails())
if (OCC_TENANT.equalsIgnoreCase(floor.getPropertyOccupation().getOccupancyCode()))
hasTenant = Boolean.TRUE;
if (!hasTenant)
errors.add("error.tenant.not.exist");
final boolean billExists = getDemandBillByAssessmentNo(basicProperty);
if (!billExists)
errors.add("common.demandbill.not.exists");
return errors;
}
private void validateOwnerCertificate(final List<String> errors, final BasicProperty basicProperty) {
validateCertificate(errors, basicProperty);
validateDemandBillExistance(errors, basicProperty);
}

private List<String> validateDemandBill(final BasicProperty basicProperty, final List<String> errors) {
final BigDecimal totalDue = getTotalPropertyTaxDue(basicProperty);
if (totalDue.compareTo(BigDecimal.ZERO) == 0)
errors.add("common.no.property.due");
validateDemandBillExistance(errors, basicProperty);
return errors;
}

private List<String> validateOccupierNotice(final List<String> errors, final BasicProperty basicProperty) {
Boolean hasTenant = Boolean.FALSE;
for (final Floor floor : basicProperty.getProperty().getPropertyDetail().getFloorDetails())
if (OCC_TENANT.equalsIgnoreCase(floor.getPropertyOccupation().getOccupancyCode()))
hasTenant = Boolean.TRUE;
if (!hasTenant)
errors.add("error.tenant.not.exist");
validateDemandBillExistance(errors, basicProperty);
return errors;
}

private List<String> validateDemandBillExistance(final List<String> errors, final BasicProperty basicProperty) {
final boolean billExists = getDemandBillByAssessmentNo(basicProperty);
if (!billExists)
errors.add("common.demandbill.not.exists");
return errors;
}

private ReportRequest generateDistressNotice(final BasicProperty basicProperty, final Map<String, Object> reportParams,
final City city, final String noticeNo) {
Expand Down

0 comments on commit bb5891b

Please sign in to comment.