Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0032713 | Openbravo ERP | Z. Others | public | 2016-04-19 13:31 | 2016-06-17 19:37 |
|
Reporter | ngarcia | |
Assigned To | markmm82 | |
Priority | immediate | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | 3.0PR16Q3 | |
Merge Request Status | |
Review Assigned To | aferraz |
OBNetwork customer | OBPS |
Web browser | |
Modules | Advanced Payables and Receivables Mngmt |
Support ticket | 41573 |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0032713: Cannot Add Payment with Invoice's Organization if there exists a voided payment with different org associated with the invoice |
Description | Cannot 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 Reproduce | 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 cannot add a payment to it |
Proposed Solution | Change the organization in the processPayment function of FIN_PaymentProcess class:
final FIN_PaymentScheduleDetail mergedScheduleDetail = dao
.getNewPaymentScheduleDetail(payment.getOrganization(), outStandingAmt); |
Additional Information | |
Tags | No tags attached. |
Relationships | |
Attached Files | 32713.sql (697) 2016-05-02 17:20 https://issues.openbravo.com/file_download.php?file_id=9350&type=bug |
|
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 | OBNetwork customer | => Yes |
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:32 | ngarcia | Support ticket | => 41573 |
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 | bug_revision_view_page.php?bugnote_id=0086085#r11918 |
2016-04-29 14:51 | psanjuan | Note Added: 0086086 | |
2016-04-29 14:59 | psanjuan | Note Edited: 0086086 | bug_revision_view_page.php?bugnote_id=0086086#r11920 |
2016-04-29 15:09 | psanjuan | Note Deleted: 0086086 | |
2016-04-29 15:10 | psanjuan | Note Edited: 0086085 | bug_revision_view_page.php?bugnote_id=0086085#r11921 |
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 | bug_revision_view_page.php?bugnote_id=0086095#r11923 |
2016-05-02 10:31 | psanjuan | Note Edited: 0086096 | bug_revision_view_page.php?bugnote_id=0086096#r11931 |
2016-05-02 11:01 | psanjuan | Note Edited: 0086096 | bug_revision_view_page.php?bugnote_id=0086096#r11932 |
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 | |
Notes |
|
|
|
|
(0086085)
|
psanjuan
|
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
|
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
|
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
|
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
---
|
|
|
|
|
|
|
Attached query to fix wrong data. |
|
|
|
|