Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0020274
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 09. Financial managementtrivialalways2012-04-16 13:382012-04-21 14:24
ReporterdmiguelezView Statuspublic 
Assigned Todmiguelez 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branchpiFixed in SCM revision39b4cef629e4
ProjectionnoneETAnoneTarget Version
OSLinux 32 bitDatabasePostgreSQLJava version1.6.0_18
OS VersionCommunity ApplianceDatabase version8.3.9Ant version1.7.1
Product VersionpiSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0020274: Code Review: When looking for credit of a Business Partner it does not take all the possible Payment Status into account.

DescriptionCode Review:

In AdvPaymentMngtDao.java
When searching for the credit of a Business Partner it does not take all the possibles status of the Payments into account.
Steps To Reproducepublic List<FIN_Payment> getCustomerPaymentsWithCredit(Organization org, BusinessPartner bp,
      boolean isReceipt) {

    List<String> paidStatus = FIN_Utility.getListPaymentConfirmed();
    try {
      OBContext.setAdminMode(true);
      OBCriteria<FIN_Payment> obcPayment = OBDal.getInstance().createCriteria(FIN_Payment.class);
      obcPayment.add(Restrictions.eq(FIN_Payment.PROPERTY_BUSINESSPARTNER, bp));
      obcPayment.add(Restrictions.eq(FIN_Payment.PROPERTY_RECEIPT, isReceipt));
      obcPayment.add(Restrictions.ne(FIN_Payment.PROPERTY_GENERATEDCREDIT, BigDecimal.ZERO));
      obcPayment.add(Restrictions.ne(FIN_Payment.PROPERTY_STATUS, "RPAP"));
      obcPayment.add(Restrictions.ne(FIN_Payment.PROPERTY_STATUS, "RPVOID"));
      obcPayment.add(Restrictions.neProperty(FIN_Payment.PROPERTY_GENERATEDCREDIT,
          FIN_Payment.PROPERTY_USEDCREDIT));
      final Organization legalEntity = FIN_Utility.getLegalEntityOrg(org);
      Set<String> orgIds = OBContext.getOBContext().getOrganizationStructureProvider()
          .getChildTree(legalEntity.getId(), true);
      obcPayment.add(Restrictions.in("organization.id", orgIds));
      obcPayment.addOrderBy(FIN_Payment.PROPERTY_PAYMENTDATE, true);
      obcPayment.addOrderBy(FIN_Payment.PROPERTY_DOCUMENTNO, true);
      return obcPayment.list();
    } finally {
      OBContext.restorePreviousMode();
    }
  }


When filtering by status it does not take into account the possible status modules can introduce in the system.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
depends on feature request 0020273 closeddmiguelez It would be usefull to have a method that returns a list of payment confirmed/not confirme status 

-  Notes
(0047729)
hgbot (developer)
2012-04-19 09:59

Repository: erp/devel/pi
Changeset: 39b4cef629e4ea200e17465dd992e878177490b6
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Mon Apr 16 16:26:50 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/39b4cef629e4ea200e17465dd992e878177490b6 [^]

Fixes issue 0020274: Now a list of all possible Payment Status
is retrieved instead.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/AdvPaymentMngtDao.java
---
(0047742)
mirurita (developer)
2012-04-19 12:12

code review + testing OK
(0047837)
hudsonbot (developer)
2012-04-21 14:24

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/2eb57286c1fc [^]

Maturity status: Test

- Issue History
Date Modified Username Field Change
2012-04-16 13:38 dmiguelez New Issue
2012-04-16 13:38 dmiguelez Assigned To => vmromanos
2012-04-16 13:38 dmiguelez Modules => Core
2012-04-16 13:42 dmiguelez Assigned To vmromanos => dmiguelez
2012-04-16 13:42 dmiguelez Status new => scheduled
2012-04-16 13:42 dmiguelez fix_in_branch => pi
2012-04-16 15:43 dmiguelez Relationship added depends on 0020273
2012-04-19 09:59 hgbot Checkin
2012-04-19 09:59 hgbot Note Added: 0047729
2012-04-19 09:59 hgbot Status scheduled => resolved
2012-04-19 09:59 hgbot Resolution open => fixed
2012-04-19 09:59 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/39b4cef629e4ea200e17465dd992e878177490b6 [^]
2012-04-19 12:12 mirurita Note Added: 0047742
2012-04-19 12:12 mirurita Status resolved => closed
2012-04-21 14:24 hudsonbot Checkin
2012-04-21 14:24 hudsonbot Note Added: 0047837


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker