[
http://mifosforge.jira.com/browse/MIFOS-3215?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sam Birney updated MIFOS-3215:
------------------------------
Comment: was deleted
(was: I finished implementing and testing this. Still waiting to hear back on
if it is a reasonable approach.
@Override
public List<AccountPaymentParametersDto> lookupPayments(AccountReferenceDto
accountRef)
throws PersistenceException {
final int accountId = accountRef.getAccountId();
final AccountBO account = getAccountPersistence().getAccount(accountId);
List<AccountPaymentParametersDto> paymentDtos = new
ArrayList<AccountPaymentParametersDto>();
for (AccountPaymentEntity paymentEntity : account.getAccountPayments())
{
paymentDtos.add(makePaymentDto(paymentEntity));
}
return paymentDtos;
}
public AccountPaymentParametersDto makePaymentDto(AccountPaymentEntity
paymentEntity) {
AccountPaymentParametersDto paymentDto = new
AccountPaymentParametersDto(
paymentEntity.getCreatedByUser() == null ?
new
UserReferenceDto(paymentEntity.getAccountTrxns().iterator().next().
getPersonnel().getPersonnelId()) :
new
UserReferenceDto(paymentEntity.getCreatedByUser().getPersonnelId()),
new AccountReferenceDto(paymentEntity.getAccount().getAccountId()),
paymentEntity.getAmount().getAmount(),
LocalDate.fromDateFields(paymentEntity.getPaymentDate()),
new PaymentTypeDto(paymentEntity.getPaymentType().getId(),
paymentEntity.getPaymentType().toString()),
paymentEntity.getComment() == null ?
paymentEntity.toString() :
paymentEntity.getComment(),
paymentEntity.getReceiptDate() == null ? null :
LocalDate.fromDateFields(paymentEntity.getReceiptDate()),
paymentEntity.getReceiptNumber());
return paymentDto;
}
)
> Review API addition to allow plugins to detect duplicate payment info
> ---------------------------------------------------------------------
>
> Key: MIFOS-3215
> URL: http://mifosforge.jira.com/browse/MIFOS-3215
> Project: mifos
> Issue Type: Improvement
> Reporter: Sam Birney
> Assignee: Van Mittal-Henkle
> Priority: Major
> Attachments: StandardAccountService.java
>
>
> (I emailed this to the developers list a few days ago. I hope someone will
> please respond soon, we would really like to start preventing duplicate
> payments from being imported.)
> the AccountService API currently provides a useful way for client code to
> apply payments to accounts, which is used by the bank import (and MPesa
> import) plugins.
> I propose enhancing it with a way to provide information about existing
> payments as well. With the ability to retrieve information about existing
> payments, clients could make choices about whether to warn users that
> payments may have already been applied for the same account on the same
> payment date, with the same receipt number, e.g.
> This would be a big help at a certain MFI which is currently using the bank
> import plugin extensively, and often finding that users are mistakenly
> uploading the same spreadsheet of payment data multiple times, leading to
> lots of bad data which is not always detected immediately and significantly
> time-consuming to correct when it is detected.
> The new interface method prototype could look like the following, and its
> implementation could look like that in the attached file. Before I go
> further with extending the plugin with logic to detect duplicate records,
> does this seem reasonable? Would it be OK to add this to the AccountService?
> /**
> * Lookup all payments associated with a given account.
> *
> * <at> param accountRef is a reference to the account for which payment
> information is requested.
> */
> public List<AccountPaymentParametersDto>
> lookupPayments(AccountReferenceDto accountRef) throws Exception;
> thanks,
> Sam
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://mifosforge.jira.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Mifos-issues mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mifos-issues