Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0015539Openbravo ERP09. Financial managementpublic2010-12-29 04:252012-04-21 14:24
chelipf 
Sandrahuguet 
lowtrivialalways
closedfixed 
30Professional Appliance
 
 
Core
No
0015539: C_INVOICE_POST code clean up
v_granttotal variable is set twice.

....
        SELECT c_getwithholding(v_record_id) INTO withholdamount FROM dual;
      ELSE
        withholdamount:=0;
      END IF;

1192>>>1> v_GrandTotal:=C_Currency_Round(v_GrandTotal+v_TaxNoRecalculable, v_Currency_ID, NULL) ;
1193>>>2> SELECT COALESCE(SUM(TAXAMT), 0) INTO v_GrandTotal
      FROM C_INVOICETAX
      WHERE C_INVOICE_ID = v_Record_ID;
      v_GrandTotal:=v_GrandTotal+ v_TotalLines;
      UPDATE C_INVOICE
      SET TotalLines=v_TotalLines,
          GrandTotal=v_GrandTotal,

....
Delete the first sentence.
VMA-Reviewed
Issue History
2010-12-29 04:25chelipfNew Issue
2010-12-29 04:25chelipfAssigned To => staffrm
2010-12-29 08:51jpabloaeProjectOpenbravo Deployment Options => Openbravo ERP
2010-12-29 08:52jpabloaeModules => Core
2010-12-29 08:52jpabloaeNote Added: 0033421
2010-12-29 08:52jpabloaeAssigned Tostaffrm => dalsasua
2010-12-29 08:52jpabloaeCategoryAppliance stack => 09. Financial management
2010-12-29 08:52jpabloaeversion2.50-17-4 =>
2011-07-20 18:17dalsasuaAssigned Todalsasua => jonalegriaesarte
2011-09-27 16:53psarobeStatusnew => scheduled
2011-09-27 16:53psarobefix_in_branch => pi
2012-02-15 19:04iciordiaAssigned Tojonalegriaesarte => vmromanos
2012-02-16 16:29vmromanosTag Attached: VMA-Reviewed
2012-04-18 16:17SandrahuguetAssigned Tovmromanos => Sandrahuguet
2012-04-18 17:29SandrahuguetNote Added: 0047713
2012-04-20 15:34hgbotCheckin
2012-04-20 15:34hgbotNote Added: 0047799
2012-04-20 15:34hgbotStatusscheduled => resolved
2012-04-20 15:34hgbotResolutionopen => fixed
2012-04-20 15:34hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f179cd5a82239bf40125b3d9d81845d1782ac678 [^]
2012-04-20 15:40miruritaNote Added: 0047804
2012-04-20 15:40miruritaStatusresolved => closed
2012-04-21 14:24hudsonbotCheckin
2012-04-21 14:24hudsonbotNote Added: 0047855

Notes
(0033421)
jpabloae   
2010-12-29 08:52   
Moving to the Openbravo ERP project.
(0047713)
Sandrahuguet   
2012-04-18 17:29   
Test Plan:
-Debug C_INVOICE_POST
-Notice that v_GrandTotal:=C_Currency_Round(v_GrandTotal+v_TaxNoRecalculable, v_Currency_ID, NULL) ; is not necessary, because the following line set v_GrandTotal to.
(0047799)
hgbot   
2012-04-20 15:34   
Repository: erp/devel/pi
Changeset: f179cd5a82239bf40125b3d9d81845d1782ac678
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Fri Apr 20 12:16:11 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/f179cd5a82239bf40125b3d9d81845d1782ac678 [^]

Fixed issue 15539 Delete not necessary lines in C_INVOICE_POST

---
M src-db/database/model/functions/C_INVOICE_POST.xml
---
(0047804)
mirurita   
2012-04-20 15:40   
code review + testing OK

Postgresql
If STRICT is not specified in SELECT INTO statement, then target will be set to the first row returned by the query, or to nulls if the query returned no rows.
The value is always overwritten because you have a coalesce(value, 0)

Oracle
SELECT INTO statement must return at least one row. In the select does not return any value you get the following exception
ORA-01403: no data found
(0047855)
hudsonbot   
2012-04-21 14:24   
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/2eb57286c1fc [^]

Maturity status: Test