Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0006866Openbravo ERP07. Sales managementpublic2009-01-13 13:172009-02-23 11:56
networkb 
gorkaion 
immediatemajoralways
closedfixed 
5
2.40 
 
Core
No
0006866: Generate invoices process doesn't work for orders with "Customer Schedule After Delivery" invoice terms
The automatic invoicing process (Sales Management > Transactions > Generate Invoices)
does not invoice the orders that have been shipped in a single goods shipment.
1. Sales Management||Transactions||Sales Order --> create 2 orders with
    transaction document= standard order
    order date y scheduled delivery date= 13/12/2008
    bp: sailor int
    invoice terms: customer schedule after delivery
   and at least one line and COMPLETE. (No. 50041 y 50042 in tecnicia14)
2. Sales Management||Transactions||Goods Shipment--> create 1 shipment with
    bp: sailor int
    create lines from the previous orders and COMPLETE. (No. 500026)
3. Run Generate Invoices Process choosing just organization.

It creates 0 invoices.

The error is in the C_INVOICE_CREATE process in the SELECT of line 602. The JOIN
"sh.C_Order_ID=o.C_Order_ID" should be replaced by "ol.C_Order_ID=o.C_Order_ID" as in
the case stated before, the field C_ORDER_ID in M_INOUT is null as there are lines
from different orders.
comsup_sprint4
depends on backport 0006869 closed gorkaion Generate invoices process doesn't work for orders with "Customer Schedule After Delivery" invoice terms 
depends on backport 0006870 closed gorkaion Generate invoices process doesn't work for orders with "Customer Schedule After Delivery" invoice terms 
Issue History
2009-01-13 13:17networkbNew Issue
2009-01-13 13:17networkbAssigned To => rafaroda
2009-01-13 13:17networkbsf_bug_id0 => 2504422
2009-01-13 13:17networkbRegression testing => No
2009-01-13 16:10networkbversion => 2.40
2009-01-13 16:32psarobeSeverityminor => major
2009-01-13 16:33psarobeStatusnew => scheduled
2009-01-13 16:33psarobefix_in_branch => trunk
2009-01-14 11:24rafarodaAssigned Torafaroda => gorkaion
2009-01-14 19:24gorkaionStatusscheduled => resolved
2009-01-14 19:24gorkaionsvn_revision => 11894
2009-01-14 19:24gorkaionResolutionopen => fixed
2009-01-14 19:24gorkaionNote Added: 0012191
2009-01-23 11:32gorkaionTag Attached: comsup_sprint4
2009-02-20 13:52sureshbabuStatusresolved => new
2009-02-20 13:52sureshbabuResolutionfixed => open
2009-02-20 13:52sureshbabuNote Added: 0013838
2009-02-20 17:53gorkaionNote Added: 0013865
2009-02-20 18:45gorkaionNote Added: 0013870
2009-02-20 18:45gorkaionStatusnew => feedback
2009-02-23 11:56psarobeStatusfeedback => scheduled
2009-02-23 11:56psarobeStatusscheduled => resolved
2009-02-23 11:56psarobeResolutionopen => fixed
2009-02-23 11:56psarobeStatusresolved => closed

Notes
(0012191)
gorkaion   
2009-01-14 19:24   
Bugfix 6866. Fixed the C_Invoice_Create procedure, c_order_id is now optional in the M_InOut table so it is necessary to make the join to the Order using the C_OrderLine instead of the M_InOut.
This commit also fixes an UUID problem in the C_Invoice_Post procedure.
(0013838)
sureshbabu   
2009-02-20 13:52   
still i am not able to create a invoice for PO with invoice term as 'Customer schedule after delivery'

Retested in context 79.125.56.185/openbravotrunk
(0013865)
gorkaion   
2009-02-20 17:53   
I have done some tests in several machines using trunk (postgresql and oracle) and a 2.40 instance using postgresql and in all cases the invoice is generated correctly.

I've tried to test in your proposed context, but I've found an postgresql problem related to the fix of issues 0007678 and 0007679 that is fixed in the revision 13480. When this last fix is applied in that machine I'll try again to reproduce the problem.
(0013870)
gorkaion   
2009-02-20 18:45   
I have just tested in the 79.125.56.185/openbravotrunk context and it is working. Please confirm that it is fixed or provide more detailed steps to reproduce the error.