protected void updateReceiptStatusWhenCancelled(final String receiptNumber){
  final List<EgdmCollectedReceipt> egdmCollectedReceipts=demandGenericDAO.getAllEgdmCollectedReceipts(receiptNumber);
  if (egdmCollectedReceipts != null && !egdmCollectedReceipts.isEmpty())   for (  final EgdmCollectedReceipt egDmCollectedReceipt : egdmCollectedReceipts) {
    egDmCollectedReceipt.setStatus(DemandConstants.CANCELLED_RECEIPT);
    egDmCollectedReceipt.setUpdatedTime(new Date());
    egdmCollectedReceiptDAO.update(egDmCollectedReceipt);
  }
}

protected void updateReceiptStatusWhenCancelled ( final String receiptNumber ) { final List < EgdmCollectedReceipt > egdmCollectedReceipts = demandGenericDAO . getAllEgdmCollectedReceipts ( receiptNumber ) ; if ( egdmCollectedReceipts != null && ! egdmCollectedReceipts . isEmpty ( ) ) for ( final EgdmCollectedReceipt egDmCollectedReceipt : egdmCollectedReceipts ) { egDmCollectedReceipt . setStatus ( DemandConstants . CANCELLED_RECEIPT ) ; egDmCollectedReceipt . setUpdatedTime ( new Date ( ) ) ; egdmCollectedReceiptDAO . update ( egDmCollectedReceipt ) ; } }
when receipt is cancelled the status of the receipt in egdmcollectedreceipts is updated as cancelled .
