Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0013364Openbravo ERP07. Sales managementpublic2010-05-18 12:312010-06-16 00:00
networkb 
harikrishnan 
urgentmajoralways
closedfixed 
5
2.50MP14 
2.50MP19 
Core
No
0013364: The genereate invoices process does not work when there are many orders so when many invoices are going to be created
The genereate invoices process does not work when there are many orders so when many invoices are going to be created
-Create 300 sales orders with invoice rule = immediate and with lines in organization A
-Complete the orders
-Go to Sales management > transactions > Generate invoices
-Select the organization A and click OK

-You get an error

The problem is because the variable v_Message on the c_invoice_create function is filled with the documentno of all the invoices created.
If many invoices are created, the variable can save all the documentno because the variable has lengh 2000, so you get an error.
-Show only the number of invoices created and not the documentno of all these invoices
No tags attached.
has duplicate design defect 0013505 scheduled dmiguelez No of invoices created appear but the created invoice document numbers are not appearing 
? create300orders.sql (1,358) 2010-05-27 12:50
https://issues.openbravo.com/file_download.php?file_id=2612&type=bug
Issue History
2010-05-18 12:31networkbNew Issue
2010-05-18 12:31networkbAssigned To => adrianromero
2010-05-18 12:35networkbSeverityminor => major
2010-05-18 13:06psarobeNote Added: 0027415
2010-05-18 13:06psarobeStatusnew => feedback
2010-05-18 13:15networkbStatusfeedback => new
2010-05-18 13:15networkbSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=380#r380
2010-05-18 13:32networkbProposed Solution updated
2010-05-18 13:49adrianromeroNote Added: 0027423
2010-05-18 13:50adrianromeroStatusnew => scheduled
2010-05-18 13:50adrianromerofix_in_branch => pi
2010-05-27 12:50networkbNote Added: 0027775
2010-05-27 12:50networkbFile Added: create300orders.sql
2010-06-02 17:56adrianromeroRelationship addedhas duplicate 0013505
2010-06-09 14:14harikrishnanAssigned Toadrianromero => harikrishnan
2010-06-09 14:15hgbotCheckin
2010-06-09 14:15hgbotNote Added: 0028210
2010-06-09 14:15hgbotStatusscheduled => resolved
2010-06-09 14:15hgbotResolutionopen => fixed
2010-06-09 14:15hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/7be8c400ed75de1aecd4d14d05bdbde26ac0c416 [^]
2010-06-09 14:16harikrishnanNote Added: 0028211
2010-06-10 12:59hudsonbotCheckin
2010-06-10 12:59hudsonbotNote Added: 0028263
2010-06-15 14:18arunkumarNote Added: 0028445
2010-06-15 14:18arunkumarStatusresolved => closed
2010-06-16 00:00anonymoussf_bug_id0 => 3016763

Notes
(0027415)
psarobe   
2010-05-18 13:06   
Hi,

Are you sure about the steps? Are you sure about the length of the variable?
(0027423)
adrianromero   
2010-05-18 13:49   
My proposal is to show the number of invoices created as suggested but also continue to show all document numbers created that fit in 2000 characters. I think that in the general case, when an small number of invoices is created, is good not to change the current behavior and show the document number of invoices created.
(0027775)
networkb   
2010-05-27 12:50   
An attach to create 300 orders with 5 lines each one has been added in order to anayze the problem
(0028210)
hgbot   
2010-06-09 14:15   
Repository: erp/devel/pi
Changeset: 7be8c400ed75de1aecd4d14d05bdbde26ac0c416
Author: Harikrishnan Raja <harikrishnan.raja <at> openbravo.com>
Date: Wed Jun 09 17:44:00 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/7be8c400ed75de1aecd4d14d05bdbde26ac0c416 [^]

Fixes issue 13364:The generate invoices process does not work when there are many orders so when many invoices are going to be created

---
M src-db/database/model/functions/C_INVOICE_CREATE.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
---
(0028211)
harikrishnan   
2010-06-09 14:16   
Steps to Test:

Prerequisite:
*Create 300 invoice using the attached sql file.

*Go to Generate Invoices under the sales management and execute for process.
*Now for 300 invoices its shows the success message for 10 invoice document no only.

Root Cause:
*The document no of all the 300 invoices then this exceeds 2000 length which is the size of v_message variable.

Impact:

*The condition is checked properly adding the message.Hence their is no impact in other areas.
(0028263)
hudsonbot   
2010-06-10 12:59   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/7be8c400ed75 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/90bc12ff4afd [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17576.obx [^]
(0028445)
arunkumar   
2010-06-15 14:18   
Tested working fine