Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037834Openbravo ERP02. Master data managementpublic2018-02-05 15:532018-03-09 15:18
JONHM 
AtulOpenbravo 
highmajoralways
scheduledopen 
5
 
 
Core
No
0037834: Performance issue in Create Invoices From Orders window
Create Invoices From Orders process takes too long to load (2719689.500 ms) in environments with high amount of data
- Open window "Create Invoices From Orders"

It takes 2719689.500 ms to load
No tags attached.
? create_invoices.sql (23,533) 2018-02-05 16:24
https://issues.openbravo.com/file_download.php?file_id=11527&type=bug
? create_invoices_test_plan (20,107) 2018-02-05 16:24
https://issues.openbravo.com/file_download.php?file_id=11528&type=bug
Issue History
2018-02-05 15:53JONHMNew Issue
2018-02-05 15:53JONHMAssigned To => Triage Finance
2018-02-05 15:53JONHMFile Added: generate_invoices.sql
2018-02-05 15:53JONHMModules => Core
2018-02-05 15:53JONHMResolution time => 1519599600
2018-02-05 15:53JONHMTriggers an Emergency Pack => No
2018-02-05 15:53JONHMFile Added: generate_invoices_test_plan
2018-02-05 15:56JONHMSummaryCreate Invoices From Orders process takes too long to load => Performance issue in Create Invoices From Orders window
2018-02-05 16:12jfrancesIssue Monitored: jfrances
2018-02-05 16:24JONHMFile Deleted: generate_invoices.sql
2018-02-05 16:24JONHMFile Deleted: generate_invoices_test_plan
2018-02-05 16:24JONHMFile Added: create_invoices.sql
2018-02-05 16:24JONHMFile Added: create_invoices_test_plan
2018-02-06 11:20dmiguelezAssigned ToTriage Finance => collazoandy4
2018-02-12 20:37collazoandy4Statusnew => scheduled
2018-02-15 17:52collazoandy4Note Added: 0102449
2018-02-15 17:53collazoandy4Note Added: 0102450
2018-02-16 17:19collazoandy4Note Edited: 0102450bug_revision_view_page.php?bugnote_id=0102450#r16729
2018-02-21 06:17AtulOpenbravoAssigned Tocollazoandy4 => AtulOpenbravo
2018-03-09 15:18vmromanosResolution time1519599600 =>
2018-03-09 15:18vmromanosNote Added: 0103140
2018-03-09 15:18vmromanosTypedefect => design defect

Notes
(0102449)
collazoandy4   
2018-02-15 17:52   
Test Plan
  Go to Sales Order and create three new records:
    1. Business Partner: Alimentos y Supermercados, S.A, Invoice Terms: Immediate, Product: Agua sin Gas 1L, Ordered Quantity: 5
    2. Business Partner: Hoteles Buenas Noches, S.A., Invoice Terms: After Delivery, Product: Zumo de Pera 0,5L, Ordered Quantity: 6
    3. Business Partner: Restaurantes Luna Llena, S.A., Invoice Terms: After Order Delivered, Product: Zumo de PiƱa 0,5L, Ordered Quantity: 7
  Go to Goods Shipment window and create a new record:
    Business Partner: Hoteles Buenas Noches, S.A.
    Create Lines From the previous order created
    Edit the line created Movement Quantity: 3
    Complete the shipment
    Create another record in Header tab:
      Business Partner: Restaurantes Luna Llena, S.A.
      Create Lines From the previous order created
      Complete the shipment
  Open Create Invoices from Orders window and check 3 records are shown (one for each busines partner)
    Set From Date: Tomorrow and check no record is shown
    Set From Date: Yesterday and To Date: Today and check three records is shown
    Check Lines Include Taxes: Y and check Total Gross = Total Lines
(0102450)
collazoandy4   
2018-02-15 17:53   
(edited on: 2018-02-16 17:19)
With the changes made the execution query cost was reduce from 17724248.29 to 944005.29

(0103140)
vmromanos   
2018-03-09 15:18   
Moved to design defect:

Here we have several problems that affects the performance:
1. In customer environment we have 6M candidate order lines to be invoiced, which results in 191K records to be shown in the window. This crashes the browser when rendering the records because it clearly exceeds the purpose of this manual window. Another process should be used instead to manage such a big number of records.

2. The process is based on the C_Invoice_Candidate_V view and, on top of it, it runs a query that joins with other tables and implements some logic. Problem of this approach is that indexes are not as powerful as having everything in just one query. This situation, and the extremely high number of order lines pending to be invoiced, creates a bottleneck when executing the query.

The way to fix it would be to write a separate query without using the view. However this is not a good idea because right now everything related to pending invoicing is centralized in C_Invoice_Candidate_V view.