Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0026884Openbravo ERPA. Platformpublic2014-06-17 10:022014-06-26 15:52
daniOpenbravo 
shankarb 
highmajorsometimes
closedfixed 
5
3.0PR14Q2 
3.0PR14Q33.0PR14Q3 
AugustoMauch
Core
No
0026884: Can not save credit type Fields (Operon)
Operon has a problem when saving fields of type credit. The system does not save any record if the last field modified is a type credit field (credit, debit, etc).



- Go to Financial Account window (for example).
- Click on "Add transaction" button.
- Once the transaction is added, save the record.
- After saving, try to modify field Deposit amount (or credit amount): The system does not allow to save the field.
- However, try to change that field and after that, modify another field with no credit reference type: Now the system allow us to save.
As Augusto was investigating this issue the solution was adding a new parameter to a function in the following file:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitten/ob-formitem-number.js

There is a function that contains 5 parameters but one of them is not always necessary and it is not defined in that way. However, in this case that parameter is necessary, so once it is added to that function the problem is solved.

Try to replace the following code:

// Make sure the number is rounded using the number of decimal digits specified in the number typeInstance
if (isc.isA.String(this.getValue())) {
value = OB.Utilities.Number.OBPlainToOBMasked(this.getValue(), this.typeInstance.maskNumeric, this.typeInstance.decSeparator,
this.typeInstance.groupSeparator);
this.setValue(OB.Utilities.Number.OBMaskedToJS(value, this.typeInstance.decSeparator, this.typeInstance.groupSeparator));
if (this.form.setTextualValue) {
this.form.setTextualValue(this.name, value, this.typeInstance);
}
}

using this new one:

// Make sure the number is rounded using the number of decimal digits specified in the number typeInstance
if (isc.isA.String(this.getValue())) {
//if the string is a math expression do not perform rounding yet.
if (this.getValue().indexOf('=') === -1) {
value = OB.Utilities.Number.OBPlainToOBMasked(this.getValue(), this.typeInstance.maskNumeric, this.typeInstance.decSeparator,
this.typeInstance.groupSeparator, OB.Format.defaultGroupingSize);
} else {
value = this.getValue();
}
this.setValue(OB.Utilities.Number.OBMaskedToJS(value, this.typeInstance.decSeparator, this.typeInstance.groupSeparator));
if (this.form.setTextualValue) {
this.form.setTextualValue(this.name, value, this.typeInstance);
}
}

And replace too this code:

// first check if the number is valid
if (!isc.isA.String(value)) {
// format the value displayed
this.setElementValue(this.mapValueToDisplay(value));
}

Using this new one:

// first check if the number is valid
if (!isc.isA.String(value)) {
// format the value to be displayed.
value = OB.Utilities.Number.OBPlainToOBMasked(value, this.typeInstance.maskNumeric, this.typeInstance.decSeparator,
this.typeInstance.groupSeparator, OB.Format.defaultGroupingSize);
this.setElementValue(this.mapValueToDisplay(value));
}
No tags attached.
Issue History
2014-06-17 10:02daniOpenbravoNew Issue
2014-06-17 10:02daniOpenbravoAssigned To => AugustoMauch
2014-06-17 10:02daniOpenbravoModules => Core
2014-06-17 10:02daniOpenbravoTriggers an Emergency Pack => No
2014-06-17 18:54jonalegriaesarteResolution time => 1405461600
2014-06-24 19:37shankarbAssigned ToAugustoMauch => shankarb
2014-06-24 19:59shankarbReview Assigned To => AugustoMauch
2014-06-24 19:59shankarbIssue Monitored: AugustoMauch
2014-06-24 20:02hgbotCheckin
2014-06-24 20:02hgbotNote Added: 0068287
2014-06-24 20:02hgbotStatusnew => resolved
2014-06-24 20:02hgbotResolutionopen => fixed
2014-06-24 20:02hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/6806e1475383528d8bc931f3032db9841578cdca [^]
2014-06-25 16:29hudsonbotCheckin
2014-06-25 16:29hudsonbotNote Added: 0068314
2014-06-26 15:52AugustoMauchNote Added: 0068357
2014-06-26 15:52AugustoMauchStatusresolved => closed
2014-06-26 15:52AugustoMauchFixed in Version => PR14Q3

Notes
(0068287)
hgbot   
2014-06-24 20:02   
Repository: erp/devel/pi
Changeset: 6806e1475383528d8bc931f3032db9841578cdca
Author: Shankar Balachandran <shankar.balachandran <at> openbravo.com>
Date: Tue Jun 24 23:31:11 2014 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/6806e1475383528d8bc931f3032db9841578cdca [^]

Fixes Issue 26884: Can not save credit type Fields (Operon)

Set the last parameter to OB.Utilities.Number.OBPlainToOBMasked method calls in number reference.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js
---
(0068314)
hudsonbot   
2014-06-25 16:29   
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/ad0fdac14ade [^]
Maturity status: Test
(0068357)
AugustoMauch   
2014-06-26 15:52   
Code reviewed and verified in pi@174b96a6fa01