Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0021333Openbravo ERP07. Sales managementpublic2012-08-09 09:062012-09-26 17:18
xabiermerino 
jecharri 
highminoralways
closedfixed 
5
3.0MP13 
3.0MP16 
xabiermerino
Core
No
0021333: Error creating an invoice line of a product with 'price adjustment' and price 0
When you try to create a line from an order with the price 0, if there is a price adjustment that affects, this error appears:

Error
ERROR: null value in column "priceoffer" violates not-null constraint Where: SQL statement "INSERT INTO C_INVOICELINE_OFFER (C_INVOICELINE_OFFER_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, C_INVOICELINE_ID, LINE, M_OFFER_ID, PRICEOFFER, AMTOFFER) VALUES ( $1 , $2 , $3 , $4 , TO_DATE(NOW()), $5 , TO_DATE(NOW()), $6 , $7 , $8 , $9 , ROUND( $10 , $11 ), ROUND( $12 , $11 ))" PL/pgSQL function "c_invoiceline_trg2" line 194 at SQL statement
-As admin create a price adjustment:
   - Discount %: 100
   - Included Products: Only those defined
   - Products: Zumo de PiƱa 0.5L

-Create an order of this product and change the price to 0.
-Create an invoice and try to create the line using the button 'Create lines from'
No tags attached.
Issue History
2012-08-09 09:06xabiermerinoNew Issue
2012-08-09 09:06xabiermerinoAssigned To => mirurita
2012-08-09 09:06xabiermerinoModules => Core
2012-08-09 09:06xabiermerinoResolution time => 1350943200
2012-08-09 09:06xabiermerinoIssue Monitored: networkb
2012-08-09 14:11miruritaAssigned Tomirurita => jonalegriaesarte
2012-08-10 10:15jonalegriaesarteAssigned Tojonalegriaesarte => jecharri
2012-09-07 11:06hgbotCheckin
2012-09-07 11:06hgbotNote Added: 0051911
2012-09-07 11:06hgbotStatusnew => resolved
2012-09-07 11:06hgbotResolutionopen => fixed
2012-09-07 11:06hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ea1e6b9dbf5884804b58b7288461a8ccf7935db2 [^]
2012-09-10 16:19jecharriNote Added: 0051967
2012-09-14 09:24xabiermerinoClosed by => xabiermerino
2012-09-14 09:24xabiermerinoNote Added: 0052104
2012-09-14 09:24xabiermerinoStatusresolved => closed
2012-09-26 17:18hudsonbotCheckin
2012-09-26 17:18hudsonbotNote Added: 0052698

Notes
(0051911)
hgbot   
2012-09-07 11:06   
Repository: erp/devel/pi
Changeset: ea1e6b9dbf5884804b58b7288461a8ccf7935db2
Author: Javier Etxarri <javier.echarri <at> openbravo.com>
Date: Mon Sep 03 15:25:27 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/ea1e6b9dbf5884804b58b7288461a8ccf7935db2 [^]

Fixes issue 21333: Error creating an invoice
line of a product with 'price adjustment' and price 0

---
M src-db/database/model/functions/M_GET_OFFER_STD_PRICE.xml
---
(0051967)
jecharri   
2012-09-10 16:19   
test plan:
-with steps to reproduce is enough.

You can try to execute with differents values of discount but the code change only affect to discount with value 100.
(0052104)
xabiermerino   
2012-09-14 09:24   
verified
(0052698)
hudsonbot   
2012-09-26 17:18   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/b780e90c6452 [^]

Maturity status: Test