Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0014422
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2010-09-03 13:142010-10-19 00:00
ReporterdbazView Statuspublic 
Assigned Toiperdomo 
PriorityhighResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revisionadbb4479b500
ProjectionnoneETAnoneTarget Version
OSLinux 32 bitDatabaseOracleJava version1.6.0_10
OS VersionKubuntu 8.10Database version10g XEAnt version1.7.1
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0014422: Strange code in F.getFormat in DynamicJS (related to number formatting)

DescriptionAt the end of DynamicJS.js (loaded in the menu) there are the mechanism to translate a maskName (of the ones defined in Format.xml) to its maskFormat

The function is

var F = {"formats":
  [
    {"name":"generalQtyEdition","output":"#0.######"},
    {"name":"qtyEdition","output":"#0.###"},
    {"name":"euroEdition","output":"#0.00"},
    {"name":"generalQtyRelation","output":"#,##0.######"},
    {"name":"priceEdition","output":"#0.00"},
    {"name":"priceExcel","output":"#,##0.##"},
    {"name":"euroRelation","output":"#,##0.00"},
    {"name":"generalQtyExcel","output":"#,##0.######"},
    {"name":"qtyExcel","output":"#,##0.###"},
    {"name":"amountInform","output":"#,##0.00"},
    {"name":"integerRelation","output":"#,##0"},
    {"name":"integerExcel","output":"#,##0"},
    {"name":"euroInform","output":"#,##0.00"},
    {"name":"integerEdition","output":"#0"},
    {"name":"priceRelation","output":"#,##0.00"},
    {"name":"qtyRelation","output":"#,##0.###"},
    {"name":"euroExcel","output":"#,##0.##"},
    {"name":"priceInform","output":"#,##0.##"},
    {"name":"integerInform","output":"#,##0"}
  ]
};
F.getFormat=function(name)
  if(typeof name==='undefined'||name==='') {
    return'qtyEdition';
  }
  for(var i=0;i<this.formats.length;i++){
    if(this.formats[i].name===name){
      return this.formats[i].output;
    }
  }
  return'qtyEdtion';
}


The strange points are the in the validation statements of the F.getFormat function:
* The return'qtyEdition'; -> an space is missing (but not crucial). Also it seems to be the wrong return (see third point).
* The return'qtyEdtion'; -> an space is missing (but not crucial) but also there is a typo and an "i" is missing. Also it seems to be the wrong return (see third point).
* This function pretends to return something like "#0.###" or whatever (depending of the name given as input)... and it seems that when name is not declared or it can not find anything, it is going to return the string "qtyEdition" or "qtyEdtion" respectively which it seems to be wrong... it should be something like:
return F.getFormat('qtyEdition');
in both cases
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0031743)
hgbot (developer)
2010-10-11 11:03

Repository: erp/devel/pi
Changeset: adbb4479b500e9f962765b80ac9874e25bcd987a
Author: Iván Perdomo <ivan.perdomo <at> openbravo.com>
Date: Thu Oct 07 12:06:37 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/adbb4479b500e9f962765b80ac9874e25bcd987a [^]

Fixes issue 14422: Fixed getFormat function when returning default values

---
M src/org/openbravo/erpCommon/utility/DynamicJS.java
---
(0031766)
hudsonbot (developer)
2010-10-11 18:48

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/adbb4479b500 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/0b4e4ae24456 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.18512.obx [^]

- Issue History
Date Modified Username Field Change
2010-09-03 13:14 dbaz New Issue
2010-09-03 13:14 dbaz Assigned To => iperdomo
2010-09-06 08:10 alostale Status new => scheduled
2010-10-11 11:03 hgbot Checkin
2010-10-11 11:03 hgbot Note Added: 0031743
2010-10-11 11:03 hgbot Status scheduled => resolved
2010-10-11 11:03 hgbot Resolution open => fixed
2010-10-11 11:03 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/adbb4479b500e9f962765b80ac9874e25bcd987a [^]
2010-10-11 18:48 hudsonbot Checkin
2010-10-11 18:48 hudsonbot Note Added: 0031766
2010-10-18 17:57 dbaz Status resolved => closed
2010-10-19 00:00 anonymous sf_bug_id 0 => 3090005


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker