Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0047552
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 07. Sales managementmajorhave not tried2021-08-14 02:092021-08-30 11:44
ReporterlbressanView Statuspublic 
Assigned Tovmromanos 
PrioritynormalResolutionfixedFixed in VersionPR21Q4
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0047552: Error while issue sales order with positive tolerance

DescriptionWhen we activate the tolerance in the products and in the Advance Warehouse, when the tolerance is higher than the ordered quantity of the Sales Order, the difference is NOT being invoiced:
Example: Sales Order, with a line of a product of quantity 10, issues the sales order for 11, generates a sales invoice of 10, when it should generate a sales invoice with a line with 11
Steps To Reproduce1) Access Sales Order and Create a header for any Business Partner and a warehouse that has positive tolerance enabled.
2) Create a line with any product that has Stock, and put operational quantity in 10. Then Book the Sales Order
3) Positioned in the header of the Sales Order, Press the Pick button, and in the task in question, change the Confirmed Quantity to 12, then confirm the Picking
4) Press the Issue button, without changing anything.
5) Access Sales Invoice and you will see that the amount invoiced will be 10, when it should be 12.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0131361)
vmromanos (manager)
2021-08-25 14:38

Originally reported for the WMS, but actually it's a bug in Core
(0131362)
vmromanos (manager)
2021-08-25 14:44

Steps to reproduce in Core:

Login as F&B admin
Go to Product window and search for Vino Tinto 0,75L product.
Set Is Quantity Variable flag to Yes
Create a Sales Order:
 - F&B España - Región Norte
 - Hoteles Buenas Noches, S.A.
 - After Delivery
Enter 10 units of Vino Tinto 0,75L
Book it.
Go to Goods Shipment and create a new record:
 - F&B España - Región Norte
 - Hoteles Buenas Noches, S.A.
Press Create Lines From:
 - Rn-0-0-0
 - Order: the one just created
 - Select the line for 10 units
Go to Lines tab and change the qty to 11 units
Complete the goods shipment:
 - Set "Invoice if possible"
Browse to the new invoice created (doc. no shown in the success message)
Go the invoice lines.
The invoice quantity is 10 but it should be 11 units
(0131364)
vmromanos (manager)
2021-08-25 14:49
edited on: 2021-08-25 14:49

Test plan I (Immediate/After Delivery):

Login as F&B admin
Go to Product window and search for Vino Tinto 0,75L product.
Set Is Quantity Variable flag to Yes
Create a Sales Order:
 - F&B España - Región Norte
 - Hoteles Buenas Noches, S.A.
 - Immediate
Enter 10 units of Vino Tinto 0,75L
Book it.
Go to Goods Shipment and create a new record:
 - F&B España - Región Norte
 - Hoteles Buenas Noches, S.A.
Press Create Lines From:
 - Rn-0-0-0
 - Order: the one just created
 - Select the line for 10 units
Go to Lines tab and change the qty to 11 units
Complete the goods shipment:
 - Set "Invoice if possible"
Browse to the new invoice created (doc. no shown in the success message)
Go the invoice lines.
The invoice quantity is 11 [before the fix was 10 units]


Test plan II (After Delivery):

Repeat test plan I, but setting sales order invoice terms to "After Delivery".
The results should be the same.


Test plan III (After Order Delivered):

Repeat test plan I, but setting sales order invoice terms to "After Order Delivery".
The results should be the same [before the fix the invoice was not generated]

(0131376)
hgbot (developer)
2021-08-26 14:20

Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/425 [^]
(0131431)
hgbot (developer)
2021-08-30 11:44

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 895d7dd23cc76d5715174632da9dcab84b7bbc59
Author: Víctor Martínez Romanos <victor.martinez@openbravo.com>
Date: 2021-08-26T14:24:38+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/895d7dd23cc76d5715174632da9dcab84b7bbc59 [^]

Related to ISSUE-47552: Centralize refresh in tests

Instead of manually refreshing the sales order everytime the goods shipment
is processed, we do it inside the test's method that process the shipment.

---
M src-test/src/org/openbravo/test/materialMgmt/invoiceFromShipment/InvoiceFromShipmentTest.java
M src-test/src/org/openbravo/test/materialMgmt/invoiceFromShipment/TestUtils.java
---
(0131432)
hgbot (developer)
2021-08-30 11:44

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 2673733ff74c5a47b4d34f25c8fc95de4efdfd3e
Author: Víctor Martínez Romanos <victor.martinez@openbravo.com>
Date: 2021-08-26T14:35:17+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/2673733ff74c5a47b4d34f25c8fc95de4efdfd3e [^]

Related to ISSUE-47552: Added new tests to cover the reported issue

* Sales order fully/partially invoiced before the shipment
* Shipping more quantity than the originally ordered with different invoice terms

Also includes fixes in the javadoc of one method that wasn't accurate

---
M src-test/src/org/openbravo/test/materialMgmt/invoiceFromShipment/InvoiceFromShipmentTest.java
---
(0131433)
hgbot (developer)
2021-08-30 11:44

Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/425 [^]
(0131434)
hgbot (developer)
2021-08-30 11:44

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 89871c14fe9491f1d87e27ec2d1bbb28711736f0
Author: Víctor Martínez Romanos <victor.martinez@openbravo.com>
Date: 2021-08-26T14:35:17+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/89871c14fe9491f1d87e27ec2d1bbb28711736f0 [^]

Fixed ISSUE-47552: Invoice generator from goods shipment with positive tolerance

The fix makes sure we invoice any quantity shipped that wasn't been invoiced yet.

The code has been fixed in two concrete places, both associated with the scenario of
a goods shipment linked to a sales order:

1. When the invoice terms is After Order delivery: in this case que make sure we invoice
even in the case the order's delivery status is greater than 100 (that might happen with
quantity variable products or tolerances in WMS).

2. When the invoice terms allows to invoice before the shipment: in this case the formula
to calculate the qty to invoice has changed. Before it was:
  min(qtyOrdered - qtyInvoiced, qtyInThisShipment).
which was trying to support the corner case where the sales order was previously invoiced
before the shipment.

After the fix the formula is:
  qtyTotallyShipped - qtyPreviouslyInvoiced
and supports the corner case where the sales order has been previously invoiced but in a
different way. Instead of looking at the qty being shipped right now, it considers all the
shipped qty (including this shipment). This allows to easily know the qty actually pending
to invoice.

---
M src/org/openbravo/materialmgmt/InvoiceGeneratorFromGoodsShipment.java
---
(0131435)
hgbot (developer)
2021-08-30 11:44

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 79b67ae2252a9465840c18209f18c9a9b5df440c
Author: Víctor Martínez Romanos <victor.martinez@openbravo.com>
Date: 2021-08-30T11:30:18+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/79b67ae2252a9465840c18209f18c9a9b5df440c [^]

Related to ISSUE-47552: Force to refresh sales order line before calculations

When the shipment has been generated programatically just before calling the
InvoiceGeneratorFromGoodsShipment, it might happen that the order line object
is not updated, and therefore the delivery quantity is not updated.
We force an hibernate object refresh to make sure we always work with the updated qtys.

---
M src/org/openbravo/materialmgmt/InvoiceGeneratorFromGoodsShipment.java
---

- Issue History
Date Modified Username Field Change
2021-08-14 02:09 lbressan New Issue
2021-08-14 02:09 lbressan Assigned To => Triage Finance
2021-08-14 02:09 lbressan Resolution time => 1630620000
2021-08-23 11:08 dmiguelez Assigned To Triage Finance => vmromanos
2021-08-25 14:37 vmromanos Project Modules => Openbravo ERP
2021-08-25 14:38 vmromanos Modules => Core
2021-08-25 14:38 vmromanos Triggers an Emergency Pack => No
2021-08-25 14:38 vmromanos Note Added: 0131361
2021-08-25 14:38 vmromanos Category Advance Warehouse Operations => 07. Sales management
2021-08-25 14:44 vmromanos Status new => scheduled
2021-08-25 14:44 vmromanos Note Added: 0131362
2021-08-25 14:49 vmromanos Note Added: 0131364
2021-08-25 14:49 vmromanos Note Edited: 0131364 View Revisions
2021-08-26 14:20 hgbot Note Added: 0131376
2021-08-30 11:44 hgbot Note Added: 0131431
2021-08-30 11:44 hgbot Note Added: 0131432
2021-08-30 11:44 hgbot Resolution open => fixed
2021-08-30 11:44 hgbot Status scheduled => closed
2021-08-30 11:44 hgbot Note Added: 0131433
2021-08-30 11:44 hgbot Fixed in Version => PR21Q4
2021-08-30 11:44 hgbot Note Added: 0131434
2021-08-30 11:44 hgbot Note Added: 0131435


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker