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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0010845
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 07. Sales managementmajoralways2009-10-02 18:122009-12-04 09:14
ReporternetworkbView Statuspublic 
Assigned Torafaroda 
PriorityimmediateResolutionfixedFixed in Version2.50MP10
StatusclosedFix in branchFixed in SCM revision0e8f7295dc15
ProjectionnoneETAnoneTarget Version2.35MP16
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product Version2.35MP14SCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0010845: Generate Invoices process with reactivated orders

DescriptionYou have an order with a line with qtyordered=5. Then you create a shipment and then an invoice by running Generate Invoices process. It creates an invoice with line quantity=5. (So now qtyinvoiced in c_orderline is 5).
The you void the shipment, reactivate the order and modify line quantity to 4. Complete the order and create the new shipment (with quantity=4). When running generate invoices it creates an invoice with quantity=4.
Then if you go to c_orderline qtyinvoiced=9 and qtyordered=4.

Steps To Reproduce1. Sales Management || Transactions || Sales Order: create a sales order with at least one line with any qtyordered, and complete it.
2. Sales Management || Transactions || Goods Shipment: create a shipment for the order.
3. Run generate invoices and check that it creates an invoice for the qtyordered.
4. Sales Management || Transactions || Goods Shipment: void the shipment.
5. Sales Management || Transactions || Sales Order: reactivate the order and modify line qtyordered.
6. Sales Management || Transactions || Goods Shipment: create a shipment for the order.
7. Run generate invoices and check that it creates an invoice for the new qtyordered.
8. Sales Management || Transactions || Sales Order || Line: check that qtyinvoices is bigger that qtyordered.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
depends on backport 00108562.35MP16 closedrafaroda Generate Invoices process with reactivated orders 
depends on backport 00108572.35MP16 closedrafaroda Generate Invoices process with reactivated orders 
causes defect 0026626 scheduledcollazoandy4 Improve validation when Voiding a shipment whose order has invoiced amount and Invoice Terms are 'D', 'O', 'S' 

-  Notes
(0020691)
rafaroda (developer)
2009-10-05 08:54

With this flow, starting with quantity 10, after reactivating and setting the order line to 12, it finishes as:
* Order Quantity = 12
* Delivered Quantity = 12
* Reserved Quantity = 0
* Invoiced Quantity = 22 (previous to reactivating is was 10)

Following the flow with Invoice Terms = Immediate, skipping the shipment steps and setting the order line to 12, it finishes as:
* Order Quantity = 12
* Delivered Quantity = 0
* Reserved Quantity = 12
* Invoiced Quantity = 12 (which is correct)
(0021586)
hgbot (developer)
2009-11-05 10:20

Repository: erp/devel/pi
Changeset: d65b8c735066b7d5235e17120d9079f45df11e03
Author: Gorka Ion Damián <gorkaion.damian <at> openbravo.com>
Date: Thu Nov 05 10:18:37 2009 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/d65b8c735066b7d5235e17120d9079f45df11e03 [^]

Fixed issue 10845.Added new restrictions to sales documents.
-Not possible to modify a draft sales order line with delivered or invoiced
qty.
-Not possible to void a shipment with invoiced qty for a sales order with
invoice rule after delivery.
-Not possible to complete an sales invoice if new invoiced qty will be higher
than ordered qty.
-Not possible to have a sales order line with invoiced qty higher than ordered
qty.

---
M src-db/database/model/functions/C_INVOICE_POST.xml
M src-db/database/model/functions/M_INOUT_POST.xml
M src-db/database/model/triggers/C_ORDLINE_CHK_RESTRICTIONS_TRG.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
---
(0021903)
sureshbabu (reporter)
2009-11-17 09:48

Tested working fine
(0022161)
rafaroda (developer)
2009-11-25 10:30

We have find out that the solution is not working properly with negative quantities.
For example, in this scenario:
 * An order with qtyordered= -2
 * You have the shipment with qty= -2
 * You have the invoice with qtyinvoiced= -2
If you try to Reactivate the invoice is not possible because trigger C_ORDLINE_CHK_RESTRICTIONS_TRG.xml finds that qtyinvoiced > qtyordered (0 > -2)

Also it is necessary to show order documentno in the error, because when GenerateInvoices process fails the error raised says invoice documentno but as the invoice is not finally created you don't know which order gives you the error.
(0022187)
hgbot (developer)
2009-11-26 15:45

Repository: erp/devel/pi
Changeset: 0e8f7295dc154ad5f1437f374572f2dae7a2969a
Author: Rafa Roda Palacios <rafael.roda <at> openbravo.com>
Date: Wed Nov 25 11:34:53 2009 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/0e8f7295dc154ad5f1437f374572f2dae7a2969a [^]

Fixes issue 10845 Now caring negative orders cycle.

---
M src-db/database/model/functions/C_INVOICE_POST.xml
M src-db/database/model/functions/M_INOUT_POST.xml
M src-db/database/model/triggers/C_ORDLINE_CHK_RESTRICTIONS_TRG.xml
---
(0022188)
rafaroda (developer)
2009-11-26 15:46

SALES ORDER WITH POSITIVE QUANTITIES

1) Create a Sales Order Sales Management || Transactions || Sales Order
* Transaction Document = Warehouse Order
* Invoice Terms = After Delivery
2) Navigate to Lines tab and create a new record:
* Product = Hammer
* Ordered Quantity = 2
3) Navigate back to Header and Complete the Sales Order: a new Shipment is automatically created.
4) Navigate to Generate Invoices process Sales Management || Transactions || Generate Invoices
5) Select the former Sales Order and click on OK: a new Sales Invoice is created automatically.
6) Navigate to the Sales Order line and check that:
* Order Quantity = 2
* Delivered Quantity = 2
* Invoiced Quantity = 2
7) Navigate to the Goods Shipment created, click on Close button and select Void: Shipment No. : xxxx line : 10. It is not possible to void a shipment of an order that has an invoice rule after delivery having invoiced lines. CORRECT
8) Navigate to the Sales Invoice created, click on Reactivate button and select Reactivate: Sales Invoice is reactivated. CORRECT
9) Navigate back to the Goods Shipment created, click on Close button and select Void: Goods Shipment is reversed. CORRECT
10) Navigate back to the Sales Order, click on Close button and select Reactivate: Sales Order is reactivated. CORRECT
11) Navigate to Lines and change Ordered Quantity to 3 (Delivered Quantity = 0 and Invoiced Quantity = 0).
12) Navigate back to Header and Complete the Sales Order: a new Shipment is automatically created.
13) Navigate to the previous Sales Invoice and re-Complete it.
14) Navigate to Generate Invoices process Sales Management || Transactions || Generate Invoices
15) Select the former Sales Order and click on OK: It is not possible to complete the invoice xxxx line 10. Order No. xxxx: Invoiced Quantity cannot be higher than Ordered Quantity. CORRECT
16) Navigate to the previous Sales Invoice and reactivate it.
17) Navigate to Generate Invoices process Sales Management || Transactions || Generate Invoices
18) Select the former Sales Order and click on OK: a new Sales Invoice is created automatically.
20) Navigate to the Sales Order line and check that:
* Order Quantity = 3
* Delivered Quantity = 3
* Invoiced Quantity = 3

SALES ORDER WITH NEGATIVE QUANTITIES

1) Create a Sales Order Sales Management || Transactions || Sales Order
* Transaction Document = Warehouse Order
* Invoice Terms = After Delivery
2) Navigate to Lines tab and create a new record:
* Product = Hammer
* Ordered Quantity = -2
3) Navigate back to Header and Complete the Sales Order: a new Shipment is automatically created.
4) Navigate to Generate Invoices process Sales Management || Transactions || Generate Invoices
5) Select the former Sales Order and click on OK: a new Sales Invoice is created automatically.
6) Navigate to the Sales Order line and check that:
* Order Quantity = -2
* Delivered Quantity = -2
* Invoiced Quantity = -2
7) Navigate to the Goods Shipment created, click on Close button and select Void: Shipment No. : xxxx line : 10. It is not possible to void a shipment of an order that has an invoice rule after delivery having invoiced lines. CORRECT
8) Navigate to the Sales Invoice created, click on Reactivate button and select Reactivate: Sales Invoice is reactivated. CORRECT
9) Navigate back to the Goods Shipment created, click on Close button and select Void: Goods Shipment is reversed. CORRECT
10) Navigate back to the Sales Order, click on Close button and select Reactivate: Sales Order is reactivated. CORRECT
11) Navigate to Lines and change Ordered Quantity to -3 (Delivered Quantity = 0 and Invoiced Quantity = 0).
12) Navigate back to Header and Complete the Sales Order: a new Shipment is automatically created.
13) Navigate to the previous Sales Invoice and re-Complete it.
14) Navigate to Generate Invoices process Sales Management || Transactions || Generate Invoices
15) Select the former Sales Order and click on OK: It is not possible to complete the invoice xxxx line 10. Order No. xxxx: Invoiced Quantity cannot be higher than Ordered Quantity. CORRECT
16) Navigate to the previous Sales Invoice and reactivate it.
17) Navigate to Generate Invoices process Sales Management || Transactions || Generate Invoices
18) Select the former Sales Order and click on OK: a new Sales Invoice is created automatically.
20) Navigate to the Sales Order line and check that:
* Order Quantity = -3
* Delivered Quantity = -3
* Invoiced Quantity = -3
(0022273)
sureshbabu (reporter)
2009-12-01 07:48

Tested as per the steps given by Rafa(working fine)
(0022419)
hudsonbot (developer)
2009-12-04 09:14

---
A changeset related to this issue has passed a series of tests and has been promoted to main:

Changeset: http://code.openbravo.com/erp/devel/main/rev/f6bc559b1872 [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
---

- Issue History
Date Modified Username Field Change
2009-10-02 18:12 networkb New Issue
2009-10-02 18:12 networkb Assigned To => rafaroda
2009-10-05 08:54 rafaroda Note Added: 0020691
2009-10-05 08:54 rafaroda Priority immediate => urgent
2009-10-05 08:54 rafaroda Status new => scheduled
2009-10-05 08:54 rafaroda fix_in_branch => pi
2009-10-19 11:39 rafaroda Assigned To rafaroda => gorkaion
2009-11-05 10:20 hgbot Checkin
2009-11-05 10:20 hgbot Note Added: 0021586
2009-11-05 10:20 hgbot Status scheduled => resolved
2009-11-05 10:20 hgbot Resolution open => fixed
2009-11-05 10:20 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d65b8c735066b7d5235e17120d9079f45df11e03 [^]
2009-11-17 09:48 sureshbabu Note Added: 0021903
2009-11-17 09:48 sureshbabu Status resolved => closed
2009-11-17 09:48 sureshbabu Fixed in Version => 2.50MP9
2009-11-18 00:00 anonymous sf_bug_id 0 => 2899456
2009-11-25 10:30 rafaroda Assigned To gorkaion => rafaroda
2009-11-25 10:30 rafaroda Note Added: 0022161
2009-11-25 10:30 rafaroda Status closed => new
2009-11-25 10:30 rafaroda Resolution fixed => open
2009-11-25 10:30 rafaroda Fixed in Version 2.50MP9 =>
2009-11-25 10:31 rafaroda Priority urgent => immediate
2009-11-25 10:31 rafaroda Status new => scheduled
2009-11-25 10:31 rafaroda Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/d65b8c735066b7d5235e17120d9079f45df11e03 [^] =>
2009-11-25 10:31 rafaroda fix_in_branch pi =>
2009-11-26 15:45 hgbot Checkin
2009-11-26 15:45 hgbot Note Added: 0022187
2009-11-26 15:45 hgbot Status scheduled => resolved
2009-11-26 15:45 hgbot Resolution open => fixed
2009-11-26 15:45 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/0e8f7295dc154ad5f1437f374572f2dae7a2969a [^]
2009-11-26 15:46 rafaroda Note Added: 0022188
2009-12-01 07:48 sureshbabu Note Added: 0022273
2009-12-01 07:48 sureshbabu Status resolved => closed
2009-12-01 07:48 sureshbabu Fixed in Version => 2.50MP10
2009-12-04 09:14 hudsonbot Checkin
2009-12-04 09:14 hudsonbot Note Added: 0022419
2014-09-26 14:15 vmromanos Relationship added causes 0026626


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker