Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028073Openbravo ERP03. Procurement managementpublic2014-11-04 10:402017-05-29 17:43
psanjuan 
markmm82 
highmajoralways
closedfixed 
20Ubuntu 8.04.1
 
3.0PR17Q3 
aferraz
Core
No
0028073: Purchase Invoice do not properly created by using "Create Lines From" button if a goods receipt has been voided.
Purchase Invoice do not properly created by using "Create Lines From" button if a goods receipt has been voided.
Go to Product window. Create a new product named "New Product". Select F&B España org while creating the product. Go to Price tab and select "Tarifa Bebidas Alegres". Enter a unit/list price of 10.00

Go to Purchase order and create a new order for F&B España. Select "New product" and "Bebidas Alegres" business partner. Enter a quantity of 500 units. Book the order.

Go to Goods Receipt window and create a new receipt for "F&B España" and "Bebidas Alegres" business partner. Use "Create Lines From" process button and select the order. Receipt all quantity, that is 500 Units. Enter a Storage Bin. Complete the receipt

Void the Receipt by using the process button "Close" and then Void.

Enter a new receipt for "F&B España" and "Bebidas Alegres" business partner. Use "Create Lines From" process button and select the order. Receipt 150 units. Enter a Storage Bin. Complete the receipt.

Go to purchase invoice window and create a new one for "F&B España" and "Bebidas Alegres" business partner. Click on "Create Lines From".
Realize that 3 lines are created in "lines" tab and only one should be created, the one related to the 150 units actually receipt. See image attached.


No tags attached.
png issue_28073.png (126,773) 2014-11-04 10:49
https://issues.openbravo.com/file_download.php?file_id=7472&type=bug
png
Issue History
2014-11-04 10:40psanjuanNew Issue
2014-11-04 10:40psanjuanAssigned To => dmiguelez
2014-11-04 10:40psanjuanModules => Core
2014-11-04 10:40psanjuanTriggers an Emergency Pack => No
2014-11-04 10:49psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6940#r6940
2014-11-04 10:49psanjuanFile Added: issue_28073.png
2014-11-12 10:51psanjuanNote Added: 0071592
2016-01-27 02:21rqueraltaNote Added: 0083629
2017-03-27 18:42ngarciaResolution time => 1492380000
2017-03-27 18:42ngarciaIssue Monitored: ngarcia
2017-03-27 18:42ngarciaAssigned Todmiguelez => Triage Finance
2017-03-27 18:47ngarciaNote Added: 0095594
2017-03-27 21:00PracticsIssue Monitored: Practics
2017-03-29 15:22aferrazAssigned ToTriage Finance => markmm82
2017-03-29 21:59markmm82Statusnew => scheduled
2017-03-30 18:29markmm82Note Added: 0095734
2017-03-30 18:31markmm82Note Added: 0095735
2017-03-30 20:00markmm82Note Edited: 0095735bug_revision_view_page.php?bugnote_id=0095735#r14929
2017-04-03 13:12hgbotCheckin
2017-04-03 13:12hgbotNote Added: 0095799
2017-04-03 13:12hgbotStatusscheduled => resolved
2017-04-03 13:12hgbotResolutionopen => fixed
2017-04-03 13:12hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/2933c75ab71382bc872e4178614fda319bbb4f70 [^]
2017-04-03 13:14aferrazReview Assigned To => aferraz
2017-04-03 13:14aferrazNote Added: 0095800
2017-04-03 13:14aferrazStatusresolved => closed
2017-04-03 13:14aferrazFixed in Version => 3.0PR17Q3
2017-05-29 17:43hudsonbotCheckin
2017-05-29 17:43hudsonbotNote Added: 0096860

Notes
(0071592)
psanjuan   
2014-11-12 10:51   
Triage required.
(0083629)
rqueralta   
2016-01-27 02:21   
Test Plan

As F&B Internationa Group Admin

Go to Product window.
  Create a new product named "New Product".
  Select F&B España organization while creating the product.
  Go to Price tab and select "Tarifa Bebidas Alegres".
  Enter a unit/list price of 10.00.

Go to Purchase order window
  Create a new order for F&B España.
  Select "New product" and "Bebidas Alegres" business partner.
  Enter a quantity of 500 units.
  Book the order.

Go to Goods Receipt window
  Create a new receipt for "F&B España" and "Bebidas Alegres" business partner.
  Use "Create Lines From" process button and select the order.
  Receipt all quantity, that is 500 Units.
  Enter a Storage Bin.
  Complete the receipt.
  Void the Receipt by using the process button "Close" and then Void.
  
  Enter a new receipt for "F&B España" and "Bebidas Alegres" business partner.
  Use "Create Lines From" process button and select the order.
  Receipt 150 units.
  Enter a Storage Bin.
  Complete the receipt.

Go to Purchase Invoice window
  Create a new one for "F&B España" and "Bebidas Alegres" business partner.
  Click on "Create Lines From".
  
Check that only one line was created in Lines tab related to the 150 units actually receipt.
This issue can't be reproduced
(0095594)
ngarcia   
2017-03-27 18:47   
If order is selected in Create Lines From process, the whole ordered quantity should be invoiced. In case there does not exist a new goods receipt and only the voided one an invoice with an amount of 0 is wrongly created.

Steps to reproduce:
- Create a Purchase Order, add a product to it and book it
- Create a Goods Receipt from it, complete it and void it
- Create a Purchase Invoice header, select the previously created order and check two lines are shown. The purchase invoice total gross amount is 0
(0095734)
markmm82   
2017-03-30 18:29   
Issue verified with test plan described in the note:
https://issues.openbravo.com/view.php?id=28073#c95594 [^]
(0095735)
markmm82   
2017-03-30 18:31   
(edited on: 2017-03-30 20:00)
Test plan 1:

1. Create a Purchase Order, add a product to it and book it
2. Create a Goods Receipt from it, complete it and void it
3. Create a Purchase Invoice header, select the previously created order and check just one line is shown.
Notice that the whole ordered quantity has been invoiced, as consequence the purchase invoice total gross amount match the total amount of the selected order.


Test Plan 2:
As F&B International Group Admin
1. Go to Product window.
  Create a new product named "New Product".
  Select F&B España organization while creating the product.
  Go to Price tab and select "Tarifa Bebidas Alegres".
  Enter a unit/list price of 10.00.

2. Go to Purchase order window
  Create a new order for F&B España.
  Select "New product" and "Bebidas Alegres" business partner.
  Enter a quantity of 500 units.
  Select "Compras exentas" tax
  Book the order.
  Notice Total Gross Amount is 5000.

3. Go to Goods Receipt window
  Create a new receipt for "F&B España" and "Bebidas Alegres" business partner.
  Use "Create Lines From" process button and select the order.
  Receipt all quantity, that is 500 Units.
  Enter a Storage Bin.
  Complete the receipt.
  Void the Receipt by using the process button "Close" and then Void.
  
4. Go to Purchase Invoice window
  Create a new one for "F&B España" and "Bebidas Alegres" business partner.
  Click on "Create Lines From".
  Select the previously created order. Press OK.
  Check that only one line was created in Lines tab related to the 500 units actually receipt and Total Gross amount is the same than the order: 5000.

5. You can complete the invoice successfully.


Test Plan 3: One shipment voided and another one partially shipped.
1. Go to Product window.
  Create a new product named "New Product".
  Select F&B España organization while creating the product.
  Go to Price tab and select "Tarifa Bebidas Alegres".
  Enter a unit/list price of 10.00.

2. Go to Purchase order window
  Create a new order for F&B España.
  Select "New product" and "Bebidas Alegres" business partner.
  Enter a quantity of 500 units.
  Select "Compras exentas" tax
  Book the order.
  Notice Total Gross Amount is 5000.

3. Go to Goods Receipt window
  Create a new receipt for "F&B España" and "Bebidas Alegres" business partner.
  Use "Create Lines From" process button and select the order.
  Receipt all quantity, that is 500 Units.
  Enter a Storage Bin.
  Complete the receipt.
  Void the Receipt by using the process button "Close" and then Void.
  
4. Enter a new receipt for "F&B España" and "Bebidas Alegres" business partner.
  Use "Create Lines From" process button and select the order.
  Receipt 150 units.
  Enter a Storage Bin.
  Complete the receipt.

5. Go to Purchase Invoice window
  Create a new one for "F&B España" and "Bebidas Alegres" business partner.
  Click on "Create Lines From".
  Select the previously created order. Press OK.
  Check that only one line was created in Lines tab related to the receipt 150 units and Total Gross amount has been calculted according it: invoiced quantity * product price = 150 * 10 = 1500.

6. You can complete the invoice successfully.

(0095799)
hgbot   
2017-04-03 13:12   
Repository: erp/devel/pi
Changeset: 2933c75ab71382bc872e4178614fda319bbb4f70
Author: Mark <markmm82 <at> gmail.com>
Date: Thu Mar 30 12:19:44 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/2933c75ab71382bc872e4178614fda319bbb4f70 [^]

Fixes issue 28073: Wrong Purchase Invoice created by using "Create Lines From"

Purchase Invoice wasn't properly created by using "Create Lines From" process if
a goods receipt has been voided.

When the process was run selecting an order with a goods receipt voided, joins
between tables were adding lines related to the reverse goods receipt because the
goods receipt status wasn't taken into account.

To avoid it, was added to the query the condition that M_InOut.docstatus is
different than void ('VO') to not consider this lines of cancelled receipts.

---
M src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice_data.xsql
---
(0095800)
aferraz   
2017-04-03 13:14   
Code review + Testing OK
(0096860)
hudsonbot   
2017-05-29 17:43   
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/1ee70113bdc4 [^]
Maturity status: Test