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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0032713
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Z. Othersmajoralways2016-04-19 13:312016-06-17 19:37
ReporterngarciaView Statuspublic 
Assigned Tomarkmm82 
PriorityimmediateResolutionfixedFixed in Version3.0PR16Q3
StatusclosedFix in branchFixed in SCM revisionaaf4e4439bf8
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toaferraz
Web browser
ModulesAdvanced Payables and Receivables Mngmt
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0032713: Cannot Add Payment with Invoice's Organization if there exists a voided payment with different org associated with the invoice

DescriptionCannot Add Payment with Invoice's Organization if there exists a voided payment with different org associated with the invoice. The new payment plan details (FIN_PAYMENT_SCHEDULEDETAIL) are created for the payment's organization which is different from the invoice's organization
Steps To ReproduceAs group admin role:
   Create a Payment Method with
      Execution Type: Automatic
      Execution Process: Simple Execution Process
      Deferred: Y
   Add it to the financial account
   Create a Sales Invoice for F&B España Region Norte
   Select the previously created payment method
   Create a Payment In for F&B España S.A.
   Select the previously created payment method
   Add the invoice and process it
   Do not execute it
   Void the Payment
   Go to Sales Invoice window and check you cannot add a payment to it
Proposed SolutionChange the organization in the processPayment function of FIN_PaymentProcess class:


final FIN_PaymentScheduleDetail mergedScheduleDetail = dao
                        .getNewPaymentScheduleDetail(payment.getOrganization(), outStandingAmt);
TagsNo tags attached.
Attached Files? file icon 32713.sql [^] (697 bytes) 2016-05-02 17:20

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0086084)
psanjuan (manager)
2016-04-29 14:23

issue verified.
(0086085)
psanjuan (manager)
2016-04-29 14:42
edited on: 2016-04-29 15:10

Test Plan

Create a Payment Method with below setup:
* Execution Type: Automatic
* Execution Process: Simple Execution Process
* Deferred: Y

Add it to the financial account (Cuenta de Banco).

Create a Sales Invoice for F&B España Region Norte for BP Alimentos y Supermercados. Select the previously created payment method. Complete the invoice.

Create a Payment In for F&B España S.A. Select the previously created payment method. Add the invoice previously created and process it.

Do not execute the payment but void it.

Go to Sales Invoice window and check that you can add a payment to it, that is to pay that invoice by using the same organization (F&B España Region Norte).

Repeat same test as above for purchase invoice, and sales/purchase order.

(0086095)
markmm82 (developer)
2016-04-30 03:10
edited on: 2016-04-30 03:41

Test plan to fix the wrong data generated by the issue.
   1-Run the Steps to reproduce steps without apply the patch.
   2-Check you cannot add a payment to the created invoice after reproduce the steps.
   3-Run the following script:
    --Updates all fin_payment_scheduledetail's ad_org_id fields to the invoice's ad_org_id
    --if the fin_payment_scheduledetail is related to an invoice.

    update fin_payment_scheduledetail as psd
    set ad_org_id = (select distinct i.ad_org_id
        from fin_payment_schedule ps
           join c_invoice as i on ps.c_invoice_id = i.c_invoice_id
        where
        psd.fin_payment_schedule_invoice = ps.fin_payment_schedule_id
        and psd.ad_org_id <> i.ad_org_id
        and psd.isactive = 'Y'
        and psd.iscanceled = 'N'
    )
    where exists(select i.ad_org_id
        from fin_payment_schedule ps
           join c_invoice as i on ps.c_invoice_id = i.c_invoice_id
        where ps.fin_payment_schedule_id = psd.fin_payment_schedule_invoice
           and psd.ad_org_id <> i.ad_org_id
           and psd.isactive = 'Y'
           and psd.iscanceled = 'N'
    );

    --Updates all fin_payment_scheduledetail's ad_org_id fields to the order's ad_org_id
    --if the fin_payment_scheduledetail is related to an order.

    update fin_payment_scheduledetail as psd
    set ad_org_id = (select distinct o.ad_org_id
        from fin_payment_schedule ps
           join c_order as o on ps.c_order_id = o.c_order_id
        where
        psd.fin_payment_schedule_order = ps.fin_payment_schedule_id
        and psd.ad_org_id <> o.ad_org_id
        and psd.isactive = 'Y'
        and psd.iscanceled = 'N'
    )
    where exists(select o.ad_org_id
        from fin_payment_schedule ps
           join c_order as o on ps.c_order_id = o.c_order_id
        where
        psd.fin_payment_schedule_order = ps.fin_payment_schedule_id
        and psd.ad_org_id <> o.ad_org_id
        and psd.isactive = 'Y'
        and psd.iscanceled = 'N'
    );
    
    4-Go to Sales Invoice window, select the previously created and check you can add a payment to it.
    
    The above script updates all the fin_payment_scheduledetail ' organizations with the invoice's organizations (if is related to an invoice) or with the order's organizations (if is related to an order).

(0086096)
markmm82 (developer)
2016-04-30 03:39
edited on: 2016-05-02 11:01

Test plan 1:

As group admin role:
   Create a Payment Method with
      Execution Type: Automatic
      Execution Process: Simple Execution Process
      Deferred: Y
   Add it to the financial account
   Create a Sales Invoice for F&B España Region Norte
   Select the previously created payment method
   Create a Payment In for F&B España S.A.
   Select the previously created payment method
   Add the invoice and process it
   Do not execute it
   Void the Payment
   Go to Sales Invoice window and check you can add a payment to it.

Repeat same test as above for purchase invoice.

Repeat same test as above by paying the invoice created for F&B España - Region Norte, also from Payment in/out window.

Test plan 2:

As group admin role:
   Create a Payment Method (if not created in Test Plan 1) with
      Execution Type: Automatic
      Execution Process: Simple Execution Process
      Deferred: Y
   Add it to the financial account
   Create a Sales Order for F&B España Region Norte
   Select the previously created payment method
   Create a Payment In for F&B España S.A.
   Select the previously created payment method
   Add the order and process it
   Do not execute it
   Void the Payment
   Go to Sales Order window and check you can add a payment to it.

Repeat same test as above for purchase order.

Repeat same test as above by paying the order created for F&B España - Region Norte, also from Payment in/out window.

(0086125)
hgbot (developer)
2016-05-02 17:18

Repository: erp/devel/pi
Changeset: aaf4e4439bf83ed97bca10c10f85a6ea4f02c789
Author: Mark <m.molina <at> nectus.com>
Date: Fri Apr 29 12:36:06 2016 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/aaf4e4439bf83ed97bca10c10f85a6ea4f02c789 [^]

Fixes issue 32713: Allow add payment with invoice org when exist a void payment
The new payment plan details are created for the invoice's organization instead of the payment's organization.
Similar for Payments created from orders: the new payment plan details are created for the order's organization instead of the payment's organization.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
---
(0086126)
aferraz (manager)
2016-05-02 17:19

Code review + Testing OK
(0086127)
aferraz (manager)
2016-05-02 17:20

Attached query to fix wrong data.
(0087508)
hudsonbot (developer)
2016-06-17 19:37

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/0dc7be081b1c [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2016-04-19 13:31 ngarcia New Issue
2016-04-19 13:31 ngarcia Assigned To => Triage Finance
2016-04-19 13:31 ngarcia Modules => Core
2016-04-19 13:31 ngarcia Resolution time => 1463954400
2016-04-19 13:31 ngarcia Triggers an Emergency Pack => No
2016-04-19 13:31 ngarcia Issue Monitored: networkb
2016-04-19 13:38 ngarcia Modules Core => Advanced Payables and Receivables Mngmt
2016-04-21 10:23 aferraz Assigned To Triage Finance => markmm82
2016-04-27 10:15 ngarcia Priority urgent => immediate
2016-04-27 14:40 markmm82 Status new => scheduled
2016-04-29 14:23 psanjuan Note Added: 0086084
2016-04-29 14:42 psanjuan Note Added: 0086085
2016-04-29 14:48 psanjuan Note Edited: 0086085 View Revisions
2016-04-29 14:51 psanjuan Note Added: 0086086
2016-04-29 14:59 psanjuan Note Edited: 0086086 View Revisions
2016-04-29 15:09 psanjuan Note Deleted: 0086086
2016-04-29 15:10 psanjuan Note Edited: 0086085 View Revisions
2016-04-30 03:10 markmm82 Note Added: 0086095
2016-04-30 03:39 markmm82 Note Added: 0086096
2016-04-30 03:41 markmm82 Note Edited: 0086095 View Revisions
2016-05-02 10:31 psanjuan Note Edited: 0086096 View Revisions
2016-05-02 11:01 psanjuan Note Edited: 0086096 View Revisions
2016-05-02 17:18 hgbot Checkin
2016-05-02 17:18 hgbot Note Added: 0086125
2016-05-02 17:18 hgbot Status scheduled => resolved
2016-05-02 17:18 hgbot Resolution open => fixed
2016-05-02 17:18 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/aaf4e4439bf83ed97bca10c10f85a6ea4f02c789 [^]
2016-05-02 17:19 aferraz Review Assigned To => aferraz
2016-05-02 17:19 aferraz Note Added: 0086126
2016-05-02 17:19 aferraz Status resolved => closed
2016-05-02 17:19 aferraz Fixed in Version => 3.0PR16Q3
2016-05-02 17:20 aferraz File Added: 32713.sql
2016-05-02 17:20 aferraz Note Added: 0086127
2016-06-17 19:37 hudsonbot Checkin
2016-06-17 19:37 hudsonbot Note Added: 0087508


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker