Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0041856Openbravo ERP07. Sales managementpublic2019-09-19 17:492019-12-12 23:01
salvador_campanella 
markmm82 
normalminoralways
newopen 
5
pi 
 
Sandrahuguet
Core
No
0041856: Goods Shipment IsCompletelyInvoiced flag is not properly updated when a Sales invoice is created using a sales order
Goods Shipment IsCompletelyInvoiced flag is not properly updated when a Sales invoice is created using a sales order associated with the Goods Shipment
Reproduce in retail_mp_3.0RR18Q4.3 or Pi

Note: in Pi version, the Create lines from "order" and "Shipment" buttons of Create invoice windows are merge in just one button "Create lines From"


- Go to sales order Window
- Create a new sales order [SO] Header
Organization: Category Tree Store, BP: Carl Studson

- Add new line
Product: Alpine poles, Quantity:10

- Book the SO doing click on the book button

- Go to create Good Shipment Windows
- Create a new Good shipment Header
Organization: Category Tree Store, BP: Carl Studson

- Do click on the "Create lines from" button
In the pop-up window select the SO created before
Select the "warehouse position"
Select the lines and do click on the "OK" button

- Go to Sales invoice window
- Create a new sales invoice Header
Organization: Category Tree Store, BP: Carl Studson

- Do click on the "Create lines from Order" button
in the pop-up window select the order created before and do click on the "Done" button

- Complete the invoice doing click on the "complete" button and later in the pop-up on the "OK" button


- Go to Goods Shipment window
- Select the records created before
- Complete the Goods Shipment doing click on the "Complete" button

You could check in the more information area that the isCompletelyinvoice flag is not mark

Because of this if you go to the Invoice window and
- Create a new invoice header
- Do click on the "Create line from Order"
Result: the previous order not appear - This is ok

But if you do click on the "Create lines from Shipment" the good Shipment related to the order mark as complete before appears in the list.
No tags attached.
Issue History
2019-09-19 17:49salvador_campanellaNew Issue
2019-09-19 17:49salvador_campanellaAssigned To => platform
2019-09-19 17:49salvador_campanellaModules => Core
2019-09-19 17:49salvador_campanellaResolution time => 1570658400
2019-09-19 17:49salvador_campanellaTriggers an Emergency Pack => No
2019-09-19 17:50salvador_campanellaversion3.0PR18Q4.3 => pi
2019-09-20 07:59alostaleAssigned Toplatform => Triage Finance
2019-09-20 10:01SandrahuguetAssigned ToTriage Finance => markmm82
2019-09-23 00:18markmm82Statusnew => scheduled
2019-09-23 11:41salvador_campanellaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=19395#r19395
2019-09-23 15:42SandrahuguetSeveritymajor => minor
2019-09-23 15:42SandrahuguetStatusscheduled => acknowledged
2019-09-23 15:42SandrahuguetCategoryA. Platform => 07. Sales management
2019-09-23 15:42SandrahuguetTypedefect => design defect
2019-09-23 15:52SandrahuguetNote Added: 0114730
2019-09-23 15:54SandrahuguetAssigned Tomarkmm82 => Triage Finance
2019-09-25 01:40markmm82Assigned ToTriage Finance => markmm82
2019-09-25 01:40markmm82Statusacknowledged => scheduled
2019-09-25 03:24markmm82Note Added: 0114767
2019-09-25 03:27markmm82Note Edited: 0114767bug_revision_view_page.php?bugnote_id=0114767#r19402
2019-09-25 03:32markmm82Note Added: 0114768
2019-09-25 03:38markmm82Note Added: 0114769
2019-09-25 03:42markmm82Note Added: 0114770
2019-11-06 08:43hgbotCheckin
2019-11-06 08:43hgbotNote Added: 0115423
2019-11-06 08:43hgbotStatusscheduled => resolved
2019-11-06 08:43hgbotResolutionopen => fixed
2019-11-06 08:43hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/e1a5736fea651f50bbeb399db6abbf12ec7db0db [^]
2019-11-06 08:43SandrahuguetReview Assigned To => Sandrahuguet
2019-11-06 08:43SandrahuguetNote Added: 0115424
2019-11-06 08:43SandrahuguetStatusresolved => closed
2019-11-06 08:43SandrahuguetFixed in Version => 3.0PR20Q1
2019-11-07 09:12hgbotCheckin
2019-11-07 09:12hgbotNote Added: 0115447
2019-11-07 09:12SandrahuguetStatusclosed => new
2019-11-07 09:12SandrahuguetResolutionfixed => open
2019-11-07 09:12SandrahuguetFixed in Version3.0PR20Q1 =>
2019-11-07 10:40SandrahuguetResolution time1570658400 =>
2019-11-07 10:53aferrazNote Added: 0115450
2019-12-12 23:01hudsonbotCheckin
2019-12-12 23:01hudsonbotNote Added: 0116273
2019-12-12 23:01hudsonbotCheckin
2019-12-12 23:01hudsonbotNote Added: 0116274

Notes
(0114730)
Sandrahuguet   
2019-09-23 15:52   
Set as design defect:
It is a corner case that we do not recommend.
The common way of working is start a document and complete it, and not leave documents in draft status.
Fix it is complicated and risky, and could break right scenarios that currently works fine.
(0114767)
markmm82   
2019-09-25 03:24   
(edited on: 2019-09-25 03:27)
Test Plan 1:
As F&B Group Admin:
1 Create a Sales Order, mark the Invoice Terms as Immediate.
2 Add any line with product with stock and complete it.

3 Create a Goods Shipment.
4 Executes the Create Lines From process
5 Select the lines from previoulsy created Order.
6 DO NOT COMPLETE the shipment.

7 Create a Sales Invoice.
8 Execute the Create Lines From Order process.
9 Select the lines from previoulsy created Order. (Same than included into the
   Shipment)
10 Complete the Invoice.

11 Go back to the Shipment.
12 Try to complete it.
13 Notice there is an error message:
14 Error:
15 There is one or more shipment lines linked to order lines already
      invoiced. Please remove these lines and create again from the related
      invoice.

16 Remove the Shipment Lines related to the Order.
17 Execute the Create Lines From process
18 Select this time the Invoice
19 Mark the Invoice Lines related to the order and the warehouse.
20 OK

21 Try to complete the Shipment.
22 Notice the document is processed successfully.
23 Notice the flag Completely Invoiced is marked.

(0114768)
markmm82   
2019-09-25 03:32   
Test Plan 2: After remove lines, create from the order again
Repeat steps of test plan 1 from 1 to 16

17 Execute the Create Lines From process
18 Select the Order again
19 Mark the invoiced order Lines and the warehouse.
20 OK

21 Try to complete the Shipment.
22 Notice the document is processed successfully.
23 Notice the flag Completely Invoiced is marked.
(0114769)
markmm82   
2019-09-25 03:38   
Test Plan 3: Shipment is completed before invoice the order.
As F&B Group Admin:
1 Create a Sales Order, mark the Invoice Terms as Immediate.
2 Add any line with product with stock and complete it.

3 Create a Goods Shipment.
4 Executes the Create Lines From process
5 Select the lines from previoulsy created Order.
6 COMPLETE the shipment.
  Notice the Completely Invoiced flag is not marked.

7 Create a Sales Invoice.
8 Execute the Create Lines From Order process.
9 Select the lines from previoulsy created Order. (Same than included into the
   Shipment)
10 Complete the Invoice.

11 Go back to the Shipment.
12 Refresh it
23 Notice the flag Completely Invoiced was updated and it is marked now.
(0114770)
markmm82   
2019-09-25 03:42   
Test Plan 4: Shipment is completed and invoiced (invoice lines are created from shipment not from the order).
As F&B Group Admin:
1 Create a Sales Order, mark the Invoice Terms as Immediate.
2 Add any line with product with stock and complete it.

3 Create a Goods Shipment.
4 Executes the Create Lines From process
5 Select the lines from previoulsy created Order.
6 COMPLETE the shipment.
  Notice the Completely Invoiced flag is not marked.

7 Create a Sales Invoice.
8 Execute the Create Lines From Shipment process.
9 Select the lines from previoulsy created Shipment.
10 Complete the Invoice.

11 Go back to the Shipment.
12 Refresh it
23 Notice the flag Completely Invoiced was updated and it is marked now.
(0115423)
hgbot   
2019-11-06 08:43   
Repository: erp/devel/pi
Changeset: e1a5736fea651f50bbeb399db6abbf12ec7db0db
Author: Mark Molina <mark.molina <at> doceleguas.com>
Date: Tue Sep 24 22:07:23 2019 -0300
URL: http://code.openbravo.com/erp/devel/pi/rev/e1a5736fea651f50bbeb399db6abbf12ec7db0db [^]

Fixes issue 41856: It is not possible to complete a Shipment if any of it lines
is linked to order lines, wich are included in an invoice that was already
completed and the invice lines are not related to any shipment line.

To avoid that Shipment in Draft status can be completed if its lines are linked to
already invoiced order lines a new validation was included at completion time.
If this validation is fullfilled then an error message is shown and the process
is interrupted.

---
M src-db/database/model/functions/M_INOUT_POST.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
---
(0115424)
Sandrahuguet   
2019-11-06 08:43   
code review + testing ok
(0115447)
hgbot   
2019-11-07 09:12   
Repository: erp/devel/pi
Changeset: 085c0d82531fc83a341dc7a99d66d714f3eef9fe
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Thu Nov 07 09:12:27 2019 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/085c0d82531fc83a341dc7a99d66d714f3eef9fe [^]

related to issue 41856 backed out changeset e1a5736fea65

---
M src-db/database/model/functions/M_INOUT_POST.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
---
(0115450)
aferraz   
2019-11-07 10:53   
Backed out as fix was not correct in following scenario:
- Create an order from Web POS using a delivery mode different than Pick & Carry
- Invoice the order directly or doing the cashup
- Deliver the order from Web POS using Issue Sales Order window -> OrderLinesAlreadyInvoiced error message was shown and it should not:

https://ci.openbravo.com/job/try-ret-test-pgsql-suite4/14923/ [^]
https://ci.openbravo.com/job/try-ret-test-oracle-suite4/14912/ [^]
(0116273)
hudsonbot   
2019-12-12 23:01   
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/954d2b7a66fb [^]
Maturity status: Test
(0116274)
hudsonbot   
2019-12-12 23:01   
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/954d2b7a66fb [^]
Maturity status: Test