Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0012318Openbravo ERP07. Sales managementpublic2010-02-17 11:372010-05-18 12:12
networkb 
harikrishnan 
highminoralways
closedfixed 
5
2.50MP11 
2.50MP17 
Core
No
0012318: A sales order with negative amount, does not appear in "Create invoices from orders"
A sales order is created with negative amount. Also, its good shipment is created and completed.

If its sales invoice is needed to create automatically, using "Create invoices from orders", it does not appear because of its negative amount.

However, same sales order appears in "Generate invoices", process. If it is selected, invoice is created without problems.

It makes no sense that this sales order appears in one process and not in the other one.

Note: revising this process, c_invoice_candidate_v there is a clausure where only possitive lines are taken.
Go to Sales Management > Transactions > Sales order.
Create a new header for Organization Main. Select as Invoice terms, "After delivery".
Fill all needed fields.
Go to Line tab.
Select one product. As ordered quantity, select -11.
Go back to header and process it.
Go to Good shipment window.
Create a new register and select same organization and BP.
Use Create lines from, and select previous line created.
Process it.
Go to Create invoices from orders form. Search.
Sales order does not appear.
Go to Generate invoices.
Select Main organization, and check that sales order appears.
No tags attached.
related to defect 0012913 closed shuehner api check build 338 failed with warnings 
Issue History
2010-02-17 11:37networkbNew Issue
2010-02-17 11:37networkbAssigned To => adrianromero
2010-02-17 12:25adrianromeroStatusnew => scheduled
2010-02-17 12:25adrianromeroNote Added: 0024484
2010-02-17 12:25adrianromerofix_in_branch => pi
2010-03-08 16:05jpabloaeTarget Version2.50MP14 => 2.50MP15
2010-03-12 09:27psarobeNote Added: 0025265
2010-04-06 07:43harikrishnanAssigned Toadrianromero => harikrishnan
2010-04-06 13:59adrianromeroNote Added: 0025896
2010-04-06 14:11hgbotCheckin
2010-04-06 14:11hgbotNote Added: 0025897
2010-04-06 14:11hgbotStatusscheduled => resolved
2010-04-06 14:11hgbotResolutionopen => fixed
2010-04-06 14:11hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ba70331d074a4ef404ba021a4f43e05348c5ecb6 [^]
2010-04-06 15:45harikrishnanNote Added: 0025904
2010-04-07 13:18sureshbabuNote Added: 0025933
2010-04-07 13:18sureshbabuStatusresolved => closed
2010-04-08 00:00anonymoussf_bug_id0 => 2983495
2010-04-08 17:29shuehnerRelationship addedrelated to 0012913
2010-04-19 21:12hudsonbotCheckin
2010-04-19 21:12hudsonbotNote Added: 0026416
2010-05-18 12:12gorka_gilTarget Version2.50MP15 => 2.50MP17

Notes
(0024484)
adrianromero   
2010-02-17 12:25   
The proposal to fix this is to modify the process "c_invoice_candidate_v" to tale not only positive lines but also negative lines.

It has to be taken into account whether the process "c_invoice_candidate_v" is used in other places or not. Not to modify the behabiour in other places, only in "Create invoices from orders"
(0025265)
psarobe   
2010-03-12 09:27   
Hi Adrian,

This affects also the button "Create lines from" in Sales invoice/Purchase invoice. And it is not correct that you cannot select negatives sales orders.
I would like you to do a little research to know who did this change and why. Doing this we can know the reasons behind the change and we can teach him why he did it wrong so it does not happen again.
This change is affecting QS flows.
(0025896)
adrianromero   
2010-04-06 13:59   
This issue has been introduced in the following changeset:
https://code.openbravo.com/erp/devel/pi/rev/03e9f606c46e [^]

When fixing issue https://issues.openbravo.com/view.php?id=8173 [^]
(0025897)
hgbot   
2010-04-06 14:11   
Repository: erp/devel/pi
Changeset: ba70331d074a4ef404ba021a4f43e05348c5ecb6
Author: Harikrishnan Raja <harikrishnan.raja <at> openbravo.com>
Date: Tue Apr 06 17:52:36 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/ba70331d074a4ef404ba021a4f43e05348c5ecb6 [^]

Fixes issue 12318: A sales order with negative amount, does not appear in \"Create invoices from orders\".

---
M src-db/database/model/views/C_INVOICE_CANDIDATE_V.xml
M src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice_data.xsql
---
(0025904)
harikrishnan   
2010-04-06 15:45   
Steps to test

*Create a standard sales order with negative quantity.
*Create a Goods Shipment for the above created sales order using create lines from.
*Now if you go to Create Invoice From orders ,the above created negative sales order will be displayed.The same order will be displayed in "Create Line From" in sales invoice window.
(0025933)
sureshbabu   
2010-04-07 13:18   
working fine
(0026416)
hudsonbot   
2010-04-19 21:12   
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/ba70331d074a [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/91d98bda46c1 [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17088.obx [^]