Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036705Openbravo ERPZ. Otherspublic2017-08-23 12:252017-09-21 16:49
ngarcia 
markmm82 
urgentmajoralways
closedfixed 
5
 
3.0PR17Q4 
aferraz
Core
No
0036705: More than one pending payment plan detail for same invoice payment plan
More than one pending payment plan detail for same invoice payment plan

If these payment plan details are included in a remittance, you could not reactivate that remittance as the following error is raised

ERROR: update or delete on table "fin_payment_scheduledetail" violates foreign key constraint "rem_remline_finpayschdet" on table "rem_remittanceline" Detail: Key (fin_payment_scheduledetail_id)=(<>) is still referenced from table "rem_remittanceline".
Change the Format.xml to accept 3 decimals in prices

As System Admin role:
   Set Price Precision of EUR currency to 3

   Create a new sales price list, do not set it as Price Includes Tax
   Add 5 products to it with the following prices:
      101.15
      176.715
      8.33
      35.105
      0
   Create new Payment Terms
   Set Overdue Payment Days Rule to 60 in header
   Add a line to it
   Set Percentage due to 50 and Overdue Payment Days Rule to 30
   Set Next Business Day in both header and lines

   Create a Sales Order
   Set the previously created payment terms and price list
   Add the previously created 5 products (one unit of each, 2 units of the one with 101.15 price)
   Complete it
   Set its Invoice Terms as Immediate

   Create a Sales Invoice
   Set the previously created payment terms and price list
   Add the 4 lines of the sales order with a price different from 0
   Complete it and check two payment plans have been created for the invoice (255.59 each). Check through database two payment plan details of 0.01, one of 255.59 and one of 255.58 have been created. Is this correct?

   Create a new Sales Invoice
   Add the line with 0 price
   Complete it

   Reactivate the sales order
   Check through database two payment plan details exist for the same invoice payment plan. This is wrong

   Complete the sales order
   Check through database two payment plan details exist for the same invoice and order payment plans. This is wrong
   
No tags attached.
depends on defect 0036776 closed markmm82 Amounts in Invoice lines and taxes are rounded to price precision instead of standard precision in Create Lines From process 
Issue History
2017-08-23 12:25ngarciaNew Issue
2017-08-23 12:25ngarciaAssigned To => Triage Finance
2017-08-23 12:25ngarciaModules => Core
2017-08-23 12:25ngarciaResolution time => 1505253600
2017-08-23 12:25ngarciaTriggers an Emergency Pack => No
2017-08-23 12:26ngarciaIssue Monitored: networkb
2017-08-25 10:58aferrazAssigned ToTriage Finance => markmm82
2017-08-25 16:07markmm82Statusnew => acknowledged
2017-08-29 19:52markmm82Statusacknowledged => scheduled
2017-09-04 11:50ngarciaRelationship addeddepends on 0036776
2017-09-05 13:57hgbotCheckin
2017-09-05 13:57hgbotNote Added: 0098834
2017-09-05 13:57hgbotStatusscheduled => resolved
2017-09-05 13:57hgbotResolutionopen => fixed
2017-09-05 13:57hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f9e08035b10d25c70314392e4e2b42906c298021 [^]
2017-09-05 13:57hgbotCheckin
2017-09-05 13:57hgbotNote Added: 0098835
2017-09-11 09:50aferrazStatusresolved => new
2017-09-11 09:50aferrazResolutionfixed => open
2017-09-11 09:50aferrazNote Added: 0098926
2017-09-11 09:50aferrazAssigned Tomarkmm82 => ngarcia
2017-09-11 09:50aferrazStatusnew => feedback
2017-09-19 11:37aferrazAssigned Tongarcia => markmm82
2017-09-19 11:37aferrazStatusfeedback => new
2017-09-19 11:38aferrazStatusnew => scheduled
2017-09-19 11:38aferrazStatusscheduled => resolved
2017-09-19 11:38aferrazFixed in Version => 3.0PR17Q4
2017-09-19 11:38aferrazResolutionopen => fixed
2017-09-19 11:38aferrazReview Assigned To => aferraz
2017-09-19 11:38aferrazNote Added: 0099138
2017-09-19 11:38aferrazStatusresolved => closed
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099359
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099360

Notes
(0098834)
hgbot   
2017-09-05 13:57   
Repository: erp/devel/pi
Changeset: f9e08035b10d25c70314392e4e2b42906c298021
Author: Mark <markmm82 <at> gmail.com>
Date: Mon Sep 04 15:09:05 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/f9e08035b10d25c70314392e4e2b42906c298021 [^]

Fixes issue 36705: More than one pending payment plan detail for same invoice
payment plan

When the payment schedule details were generated it was comparing the invoiced
amount of related order with the sum of lineNetAmt + taxAmt of it lines, as tax
calculation can be done at document level, and this sum is done at line level it
is possible that exists differences between this sum and totals already rounded
in the invoice.

Also was considered an order completely invoiced if it dosn't has lines with ordered
quatities different than invoiced. When exists orders with lines with lineNetAmt = 0
it was taking it as completed invoiced and then the whole amount of the psd was included
in the invoice and it generates a difference between the total of document and the sum of the
lines that was created as a new payment schedule detail.

To avoid this situation, only are considered order lines with lineNetAmt different than zero
to use the whole amount of the psd or to re-calculate the correct amounts from Payment
Schedule and Payment Schedule Details related to the order and invoices.

---
M modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml
---
(0098835)
hgbot   
2017-09-05 13:57   
Repository: erp/devel/pi
Changeset: 40185fb2080e1d1879914f830261c7e53bb3a001
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Tue Sep 05 13:38:02 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/40185fb2080e1d1879914f830261c7e53bb3a001 [^]

Related to issue 36705: Code review improvements

Apply same fix in purchase flow.

---
M modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml
---
(0098926)
aferraz   
2017-09-11 09:50   
Waiting for customer environment to fix wrong data.
(0099138)
aferraz   
2017-09-19 11:38   
Code review + Testing OK
(0099359)
hudsonbot   
2017-09-21 16:49   
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/9750b78d3e5c [^]
Maturity status: Test
(0099360)
hudsonbot   
2017-09-21 16:49   
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/9750b78d3e5c [^]
Maturity status: Test