Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029685Openbravo ERP08. Project and service managementpublic2015-04-23 18:272016-12-16 18:37
ngarcia 
AtulOpenbravo 
highminoralways
closedfixed 
5
 
3.0PR17Q1 
aferraz
Core
No
0029685: Create AP Expense Invoices process creates wrong line numbers
Create AP Expense Invoices process creates wrong line numbers: 10, 20, 40 80...
As group admin role:
   Set an Employee also as Vendor and configure defaults values for Payment Terms, Financial Account, Price List...
   Create 4 products with Product Type = Expense Type
   Add price to them in the price list defined for the Business Partner
   Create a Expense Sheet for that Business Partner
   Add the four products in lines
   Process it
   Launch the Create AP Expense Invoices process
   Check the created Purchase Invoice's line numbers are 10, 20, 40 and 80 instead of 10, 20, 30 and 40
Attached a possible fix
No tags attached.
diff 29685.diff (736) 2015-04-23 18:38
https://issues.openbravo.com/file_download.php?file_id=8020&type=bug
Issue History
2015-04-23 18:27ngarciaNew Issue
2015-04-23 18:27ngarciaAssigned To => Triage Finance
2015-04-23 18:27ngarciaModules => Core
2015-04-23 18:27ngarciaTriggers an Emergency Pack => No
2015-04-23 18:38ngarciaFile Added: 29685.diff
2015-04-23 18:38ngarciaProposed Solution updated
2015-04-23 18:46ngarciaIssue Monitored: networkb
2015-07-31 10:12AtulOpenbravoAssigned ToTriage Finance => AtulOpenbravo
2015-07-31 10:13AtulOpenbravoStatusnew => scheduled
2015-07-31 10:14AtulOpenbravoNote Added: 0079138
2016-03-04 11:54psanjuanNote Added: 0084723
2016-03-04 11:54psanjuanNote Added: 0084724
2016-03-07 17:06psanjuanNote Added: 0084785
2016-10-17 12:58hgbotCheckin
2016-10-17 12:58hgbotNote Added: 0090634
2016-10-17 12:58hgbotStatusscheduled => resolved
2016-10-17 12:58hgbotResolutionopen => fixed
2016-10-17 12:58hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/227ef1f5090155944f9c89a3f5158e43f8c030b1 [^]
2016-10-17 12:59aferrazReview Assigned To => aferraz
2016-10-17 12:59aferrazNote Added: 0090636
2016-10-17 12:59aferrazStatusresolved => closed
2016-10-17 12:59aferrazFixed in Version => 3.0PR17Q1
2016-12-16 18:37hudsonbotCheckin
2016-12-16 18:37hudsonbotNote Added: 0092522

Notes
(0079138)
AtulOpenbravo   
2015-07-31 10:14   
Test Plan
- Login as group admin role.
- Set an Employee also as Vendor and configure defaults values for Payment Terms, Financial Account, Price List, etc
- Create 4 products with Product Type = Expense Type.
- Add price to them in the price list defined for the Business Partner.
- Create a Expense Sheet for that Business Partner.
   Add the four products in lines.
   Process it.
-Launch the Create AP Expense Invoices process.
- Check the created Purchase Invoice's line numbers are 10, 20, 30 and 40.
(0084723)
psanjuan   
2016-03-04 11:54   
Repro - steps required to reproduce this issue:

- Set BP "Javier Martín" (Employee) as Vendor by setting up a Purchase Price List, a payment method, payment terms and a financial account.
- Create 4 products named "Expense 1", "Expense 2", "Expense 3" and "Expense 4". All of them set up as Product Type = Expense type. In lines tab select a purchase price list (i.e. Tarifa Bebidas Alegres) and enter a unit/list price for all of them.
- Go to Expense sheet and create a new one for Javier Martin, dated on 04-03-2016.
- Go to lines tab and enter below info:
line 1 = Product "Expense 1" Qty = 1
line 2 = Product "Expense 2" Qty = 2
line 3 = Product "Expense 3" Qty = 3
line 4 = Product "Expense 4" Qty = 4
- Process Expenses
- Launch the "Create AP Expense Invoices" process by choosing Javier Martin employee. From Date 01-03-2016 To date 05-03-2016 Dated Invoiced 04-03-2016
Press Process.
- Navigate to the purchase invoice created and check that purchase order line numbers are not correct, as it is shown as: 10,20,40,80
(0084724)
psanjuan   
2016-03-04 11:54   
Issue Verified
(0084785)
psanjuan   
2016-03-07 17:06   
Test Plan above verified.

Issue can be code reviewed and closed.
(0090634)
hgbot   
2016-10-17 12:58   
Repository: erp/devel/pi
Changeset: 227ef1f5090155944f9c89a3f5158e43f8c030b1
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Fri Jul 31 13:38:35 2015 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/227ef1f5090155944f9c89a3f5158e43f8c030b1 [^]

Fixes issue 29685: Create AP Expense Invoices process creates wrong line number

Getting line no is used similar that is used to set default value for line
column in Tables and Columns. For eg:- select coalesce(max(line), 0) + 10
Unnecessary variable int line is no more needed so removed.
While executing create AP Expense invoice process there was null pointer
exception raised from AccDefUtility class which is fixed.

---
M src/org/openbravo/erpCommon/ad_process/ExpenseAPInvoice.java
M src/org/openbravo/erpCommon/ad_process/ExpenseAPInvoice_data.xsql
M src/org/openbravo/erpCommon/utility/AccDefUtility.java
---
(0090636)
aferraz   
2016-10-17 12:59   
Code review OK
(0092522)
hudsonbot   
2016-12-16 18: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/dc8bf00badd0 [^]
Maturity status: Test