Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0014884Openbravo ERP07. Sales managementpublic2010-10-15 16:532010-12-09 16:07
networkb 
sivaraman 
lowminoralways
closedfixed 
5
2.50 
2.50MP24 
Core
No
0014884: Empty invoice line when creating invoice (Create Invoices from Orders process)
An empty line (no description, quantity and price = 0) is generated when creating invoices in the 'Create Invoices from Orders' process if the Invoice Terms is set to 'Customer Schedule after Delivery'.
This is not related to the 8070 bug.
1. Create an order for a customer that has an invoice term set to 'Customer Schedule after Delivery'
2. Post the document
3. Create the shipment
4. Generate the invoice ('Create Invoices from Orders' process)

In the created invoice, there is an empty line in the invoice (the first line).

If the invoice regroups more than one order, there is an empty line at the beginning of each invoiced order.

It is the reference to the shipment that is not created properly.
The problem is in the c_invoice_create(IN p_pinstance_id character varying, OUT p_invoice_id character varying, IN p_order_id character varying) function.
At the line 964 (v_Reference:=v_Reference || ': ' || Cur_InvoiceSchedule.Description;)
If the description of the shipment is empty (NULL), v_Reference is also set to NULL (reminder : something concat to null = null!).
There should be a test before the concatenation, checking if the description of the shipment header is not null (IF (Cur_InvoiceSchedule.Description IS NOT NULL) THEN).
Like that, it is only concatenated if the description is not null.

As a workaround, when the order is created, a description is entered on the header, it is automatically copied on the shipment (if the 'Create Shipments from Orders' process is used), so it is not null. Or one can manually enter the description on the shipment.
No tags attached.
has duplicate defect 00113102.50MP24 closed adrianromero Empty invoice line when creating invoice (Create Invoices from Orders process) 
related to backport 0015746 closed adrianromero Create invoices from orders. Invoice rule. After delivery not working properly 
related to defect 0015745 closed adrianromero Create invoices from orders. Invoice rule. After delivery not working properly 
Issue History
2010-10-15 16:53networkbNew Issue
2010-10-15 16:53networkbAssigned To => adrianromero
2010-10-15 16:53networkbIssue generated from0011310
2010-10-18 12:41adrianromeroRelationship addedhas duplicate 0011310
2010-10-18 13:05psarobePrioritynormal => low
2010-10-18 13:05psarobeSeveritymajor => minor
2010-10-19 14:10neil_smithIssue Monitored: neil_smith
2010-11-18 11:18sivaramanAssigned Toadrianromero => sivaraman
2010-11-18 11:23hgbotCheckin
2010-11-18 11:23hgbotNote Added: 0032697
2010-11-18 11:23hgbotStatusnew => resolved
2010-11-18 11:23hgbotResolutionopen => fixed
2010-11-18 11:23hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/cd3774744f01b3cf50ef9e4f6b6804e648949be9 [^]
2010-11-18 11:26sivaramanNote Added: 0032698
2010-11-19 16:50hudsonbotCheckin
2010-11-19 16:50hudsonbotNote Added: 0032746
2010-11-21 07:45sureshbabuNote Added: 0032768
2010-11-21 07:45sureshbabuStatusresolved => closed
2010-12-09 16:07anonymoussf_bug_id0 => 3133516
2011-01-24 16:01adrianromeroRelationship addedrelated to 0015746
2011-01-24 16:01adrianromeroRelationship addedrelated to 0015745

Notes
(0032697)
hgbot   
2010-11-18 11:23   
Repository: erp/devel/pi
Changeset: cd3774744f01b3cf50ef9e4f6b6804e648949be9
Author: Sivaraman Rajagopal <sivaraman.rajagopal <at> openbravo.com>
Date: Thu Nov 18 15:52:39 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/cd3774744f01b3cf50ef9e4f6b6804e648949be9 [^]

Fixes issue 14884: Empty invoice line when creating invoice (Create Invoices from Orders process)

As per the expected scenario, empty line should not be created in invoices. Therefore, INSERT block of stored procedure is completely removed.

No impacts.

---
M src-db/database/model/functions/C_INVOICE_CREATE.xml
---
(0032698)
sivaraman   
2010-11-18 11:26   
Steps to test:

1. Create an order for a customer that has an invoice term set to 'Customer Schedule after Delivery'
2. Post the document
3. Create the shipment
4. Generate the invoice using 'Create Invoices from Orders' process
5. Verify if there is any empty lines in the generated invoice
(0032746)
hudsonbot   
2010-11-19 16:50   
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/cd3774744f01 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/03ec59af7cde [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.18968.obx [^]
(0032768)
sureshbabu   
2010-11-21 07:45   
verified in main context, working fine