Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031061Openbravo ERP04. Warehouse managementpublic2015-10-06 12:172015-11-23 21:17
VictorVillar 
aferraz 
urgentmajoralways
closedfixed 
5
 
3.0PR16Q1 
dmiguelez
Core
No
0031061: Not possible to reactivate a purchase invoice because there is a relation with a landed cost
Not possible to reactivate a purchase invoice because there is a relation with a landed cost
As Group admin role,
  Go to Landed Cost Type window:
       Org: *
       Landed Cost Distribution Algorithm: by amount
       Product: Descuento 10%
  Go to Purchase order window
      create a new one for Cerveza Ale
  Create the Goods Receipt related.
  Create the Purchase invoice related.
      Add the Discount: Descuento 10%
 Process it.

Go to Landed Cost window,
   create a new one for EspaƱa and the Landed Cost Type:created before
   Cost tab: add a cost value = 10
   Receipt tab: select the goods receipt created before.
Process it.

Go to the purchase invoice line Descuento 10% of the purchase invoice created before. Click on Match LC Cost button and select the Landed Cost created before. Enter a Matched Amount. Click on Done button.

Try to reactivate the Purchase Invoice. You can not do that because there are related items. This is wrong because the Process Matching has not been launched yet, you should be able to reactivate the invoice
No tags attached.
Issue History
2015-10-06 12:17VictorVillarNew Issue
2015-10-06 12:17VictorVillarAssigned To => Triage Finance
2015-10-06 12:17VictorVillarModules => Core
2015-10-06 12:17VictorVillarResolution time => 1447196400
2015-10-06 12:17VictorVillarTriggers an Emergency Pack => No
2015-10-06 12:17VictorVillarIssue Monitored: networkb
2015-11-05 12:49aferrazAssigned ToTriage Finance => aferraz
2015-11-05 12:50aferrazStatusnew => scheduled
2015-11-09 11:18aferrazNote Added: 0081615
2015-11-09 11:20aferrazNote Edited: 0081615bug_revision_view_page.php?bugnote_id=0081615#r10107
2015-11-10 13:16psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=10122#r10122
2015-11-10 14:07psanjuanNote Edited: 0081615bug_revision_view_page.php?bugnote_id=0081615#r10126
2015-11-10 14:10psanjuanNote Edited: 0081615bug_revision_view_page.php?bugnote_id=0081615#r10127
2015-11-10 14:17psanjuanNote Edited: 0081615bug_revision_view_page.php?bugnote_id=0081615#r10128
2015-11-10 14:43psanjuanNote Edited: 0081615bug_revision_view_page.php?bugnote_id=0081615#r10129
2015-11-10 14:46psanjuanNote Edited: 0081615bug_revision_view_page.php?bugnote_id=0081615#r10130
2015-11-10 14:47psanjuanNote Edited: 0081615bug_revision_view_page.php?bugnote_id=0081615#r10131
2015-11-10 14:49psanjuanNote Edited: 0081615bug_revision_view_page.php?bugnote_id=0081615#r10132
2015-11-10 14:53psanjuanNote Edited: 0081615bug_revision_view_page.php?bugnote_id=0081615#r10133
2015-11-11 13:57psanjuanNote Edited: 0081615bug_revision_view_page.php?bugnote_id=0081615#r10152
2015-11-11 14:01psanjuanNote Edited: 0081615bug_revision_view_page.php?bugnote_id=0081615#r10153
2015-11-11 14:03psanjuanNote Edited: 0081615bug_revision_view_page.php?bugnote_id=0081615#r10154
2015-11-11 14:04psanjuanNote Edited: 0081615bug_revision_view_page.php?bugnote_id=0081615#r10155
2015-11-11 14:24psanjuanNote Edited: 0081615bug_revision_view_page.php?bugnote_id=0081615#r10156
2015-11-11 14:24psanjuanNote Edited: 0081615bug_revision_view_page.php?bugnote_id=0081615#r10157
2015-11-11 14:25psanjuanNote Edited: 0081615bug_revision_view_page.php?bugnote_id=0081615#r10158
2015-11-11 14:26psanjuanNote Edited: 0081615bug_revision_view_page.php?bugnote_id=0081615#r10159
2015-11-11 14:30psanjuanNote Edited: 0081615bug_revision_view_page.php?bugnote_id=0081615#r10160
2015-11-11 14:36psanjuanNote Edited: 0081615bug_revision_view_page.php?bugnote_id=0081615#r10161
2015-11-11 14:43psanjuanNote Edited: 0081615bug_revision_view_page.php?bugnote_id=0081615#r10162
2015-11-17 10:25hgbotCheckin
2015-11-17 10:25hgbotNote Added: 0081915
2015-11-17 10:25hgbotStatusscheduled => resolved
2015-11-17 10:25hgbotResolutionopen => fixed
2015-11-17 10:25hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/965d59c74291f20e61a21ee62ca986f3963dd431 [^]
2015-11-17 10:26dmiguelezReview Assigned To => dmiguelez
2015-11-17 10:26dmiguelezNote Added: 0081916
2015-11-17 10:26dmiguelezStatusresolved => closed
2015-11-23 21:17hudsonbotCheckin
2015-11-23 21:17hudsonbotNote Added: 0082247

Notes
(0081615)
aferraz   
2015-11-09 11:18   
(edited on: 2015-11-11 14:43)
(*) Test plan 1 - Account Landed Cost type.

As QA Admin:

Go to G/L window and create a new one for Spain Org with below setup:

Name = Fees
Enable in Financial Invoices = Yes
Tax Category = Exempt

In the accounting tab, select any ledger account.

Go to Landed Cost Type window. Create a new landed cost type for Spain org with below setup:

Name = Fees
Landed Cost Distribution Algorithm: by amount
Account: select Fees G/L Item
  
Go to Purchase order window and create a new one for Spain, Vendor A BP. Add a purchase order line for Raw Material product, 15 units.Book the order.
  
Create the Goods Receipt related by using the option "Create Lines From" to select the order above, add a storage bin and an attribute set value. Complete it.
 
Run Costing Background process for QA Client. Verify it ends successfully so the cost of Raw Material product is calculated.

Create the Purchase invoice related by using the option "Create Lines From", select the receipt created above.
Add a new line set as financial invoice. Select the Account: Fees. Add a net unit price of 15.00 so total line net amount is 15.00. Complete the Invoice, do not use credit if any.

Go to Landed Cost window, and create a new one for Spain org.
Select the Landed Cost Type "Fees" in the cost tab, add a cost value = 150
In the Receipt tab: select the goods receipt created before.

Process landed cost.

Go back to the purchase invoice. Select invoice line "Fees".

Click on Match LC Cost button and select the Landed Cost created before. Enter a Matched Amount of 50
Click on Done button.

Go to landed cost window and check that a matched amount of 50 is shown in the landed cost document, Matched Amount tab.

Try to reactivate the Purchase Invoice. It is possible to reactivate the purchase invoice to change net price for instance of Raw Material product.

Go to landed cost window and check that the matched amount of 50 remains there.

Complete the invoice one again.

Click on "Match LC Cost" button and remove the selection. Press Done.

Go to landed cost window and check that the matched amount of 50 is not there.

Go back to the invoice and click on "Match LC Cost" button and select Fees landed cost line. Enter a Matched Amount of 15, select "Process Matching". Press Done.

Try to Reactivate the invoice. It is possible to reactivate the invoice in case any data of the invoice needs to be changed but landed cost data; otherwise process matching would need to be cancelled from Landed Cost window.


(*) Test plan 2 - Product Landed Cost type.

Go to product window and create a new product named "Transportation Cost" with below setup:
Product Category = Services
Product Type = Service
Price List Version = Purchase
Unit/list Price = 105

Go to landed cost type window and create a new one with below setup:
Name = Transportation cost
Landed cost distribution algorithm = Amount
Product = Transportation Cost.

Go to Purchase order window and create a new one for Spain, Vendor A BP. Add a purchase order line for Raw Material product, 15 units. Book the order.
  
Create the Goods Receipt related by using the option "Create Lines From" to select the order above, add a storage bin and an attribute set value. Complete it.
 
Run Costing Background process for QA Client. Verify it ends successfully so the cost of Raw Material product is calculated.

Create the Purchase invoice related by using the option "Create Lines From", select the receipt created above.
Add a new line set as financial invoice. Select the Product: Transportation Cost. Add a net unit price of 15.00 so total line net amount is 15.00. Complete the Invoice, do not use credit if any.

Go to Landed Cost window, and create a new one for Spain org.
Select the Landed Cost Type "Transportation Cost" in the cost tab, add a cost value = 25
In the Receipt tab: select the goods receipt created before.

Process landed cost.

Go back to the purchase invoice. Select invoice line "Transportation Cost".

Click on Match LC Cost button and select the Landed Cost created before. Enter a Matched Amount of 5.00.
Click on Done button.

Go to landed cost window and check that a matched amount of 5.00 is shown in the landed cost document, Matched Amount tab.

Try to reactivate the Purchase Invoice. It is possible to reactivate the purchase invoice to change net price for instance of Raw Material product.

Go to landed cost window and check that the matched amount of 5.00 remains there.

Complete the invoice one again.

Click on "Match LC Cost" button and remove the selection. Press Done.

Go to landed cost window and check that the matched amount of 5.00 is not there.

Go back to the invoice and click on "Match LC Cost" button and select "Transportation Cost" landed cost line. Enter a Matched Amount of 15, select "Process Matching". Press Done.

Try to Reactivate the invoice. It is possible to reactivate the invoice in case any data of the invoice needs to be changed but landed cost data; otherwise process matching would need to be cancelled from Landed Cost window.

(*) Test plan 3 - Product Landed Cost type (Discount).

As QA Admin:

Go to Landed Cost Type window. Create a new landed cost type for Spain org with below setup:

Name = Discount
Landed Cost Distribution Algorithm: by amount
product: discount 10%
  
Go to Purchase order window and create a new one for Spain, Vendor A BP. Add a purchase order line for Raw Material product, 15 units.Book the order.
  
Create the Goods Receipt related by using the option "Create Lines From" to select the order above, add a storage bin and an attribute set value. Complete it.
 
Run Costing Background process for QA Client. Verify it ends successfully so the cost of Raw Material product is calculated.

Create the Purchase invoice related by using the option "Create Lines From", select the receipt created above.
go to basic discounts tab and add the discount.
Complete the Invoice, do not use credit if any.
Check that a new invoice line for the discount has been used for an amount of -3.00

Go to Landed Cost window, and create a new one for Spain org.
Select the Landed Cost Type "Discount" in the cost tab, add a cost value = -5
In the Receipt tab: select the goods receipt created before.

Process landed cost.

Go back to the purchase invoice. Select invoice line "Discount".

Click on Match LC Cost button and select the Landed Cost created before. Enter a Matched Amount of -5
Click on Done button.

Go to landed cost window and check that a matched amount of -5 is shown in the landed cost document, Matched Amount tab.

Try to reactivate the Purchase Invoice. It is not possible to reactivate the purchase invoice because this process removes the discount line and that one has a matched landed cost amount (not processed) related.

Go to Discount line and click on Match LC cost button, remove the selection. Press Done.

Go to landed cost window and check that a matched amount of -5 is not shown in the landed cost document, Matched Amount tab.

Go back to the purchase invoice and try to reactivate it.
Check that it can be reactivated and discount line is removed.

(0081915)
hgbot   
2015-11-17 10:25   
Repository: erp/devel/pi
Changeset: 965d59c74291f20e61a21ee62ca986f3963dd431
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Mon Nov 09 11:11:18 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/965d59c74291f20e61a21ee62ca986f3963dd431 [^]

Fixes issue 31061: Can not reactivate a invoice if it's related to a LandedCost

It is not possible to reactivate a purchase invoice if any line has a related landed cost matched.
Now, it will be possible to manually remove this landed cost matched, if matching is not processed, by unselecting it in Match LC Costs pick and edit, and then reactivate purchase invoice.

---
M src/org/openbravo/costing/LCCostMatchFromInvoiceHandler.java
---
(0081916)
dmiguelez   
2015-11-17 10:26   
Code Review + Testing Ok
(0082247)
hudsonbot   
2015-11-23 21:17   
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/7b56bebaaa88 [^]
Maturity status: Test