Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0011310Openbravo ERP07. Sales managementpublic2009-11-11 09:502010-10-19 00:00
neil_smith 
adrianromero 
normalmajoralways
closedduplicate 
5
2.50 
2.50MP24 
Core
No
0011310: 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.
duplicate of defect 00148842.50MP24 closed sivaraman Empty invoice line when creating invoice (Create Invoices from Orders process) 
Issue History
2009-11-11 09:50neil_smithNew Issue
2009-11-11 09:50neil_smithAssigned To => rafaroda
2010-02-11 18:13rafarodaAssigned Torafaroda => adrianromero
2010-05-19 15:27iatienzaIssue Monitored: iatienza
2010-10-14 14:32networkbSeverityminor => major
2010-10-14 14:32networkbTarget Version => 2.50MP24
2010-10-14 14:32networkbIssue Monitored: networkb
2010-10-15 16:53networkbIssue cloned0014884
2010-10-18 12:41adrianromeroRelationship addedduplicate of 0014884
2010-10-18 12:41adrianromeroNote Added: 0031904
2010-10-18 12:41adrianromeroStatusnew => closed
2010-10-18 12:41adrianromeroResolutionopen => duplicate
2010-10-19 00:00anonymoussf_bug_id0 => 3090004

Notes
(0031904)
adrianromero   
2010-10-18 12:41   
This issue is a duplicate of issue 14884.