Followers

Tuesday, April 15, 2014

Adding New Currency 





To add a new currency (not supported by default) to WebSphere Commerce as a site supported currency:
Procedure
  1. Add your national currency as a site-supported currency:
    insert into setcurr (setccurr, setccode, setcexp) values (<Alphabetic currency code as per ISO 4217>,
    <Numeric currency code as per ISO 4217>,<The exponential value by which a subunit of the currency (such as cents)is multiplied to get the main currency unit>)

For example:
insert into setcurr (setccurr, setccode, setcexp) values ('THB',818, -2);

  1. Add a description to your national currency at the site level for your language_id. You can add a description to your national currency in as many languages as your system supports.
    insert into setcurrdsc (setccurr, language_id, description) values(<Alphabetic currency code>, <language_id>,<description>)

Ex:
insert into setcurrdsc (setccurr, language_id, description) values('THB',-1015,'Thailand Baht');

  1. Add a currency formatting rule
    insert into curformat (storeent_id, setccurr, roundingmultiple,numbrusg_id,roundingmethod, decimalplaces) values (<storeentity> ,
    <Alphabetic currency code>, <Rounding multiple according to national law or practice. For example, specify 5 to round dollars to the nearest five cent piece.
    The default value is 1>, <How to round to a multiple of ROUNDINGMULTIPLE: R = round normally - up or down - to the nearest multiple T = truncate
    - round down for positive amounts, round up for negative amounts>,
    <The number of decimal places in a rounded or truncated monetary
    amount>);

For example:
insert into curformat (storeent_id, setccurr, roundingmultiple,numbrusg_id, roundingmethod, decimalplaces, minapproveamount) values(-1,'THB',1,-1,'R',0,NULL)
insert into curformat (storeent_id, setccurr, roundingmultiple,numbrusg_id, roundingmethod, decimalplaces, minapproveamount) values(-1,'THB',1,-4,'R',0,NULL)
insert into curformat (storeent_id, setccurr, roundingmultiple,numbrusg_id,roundingmethod, decimalplaces, minapproveamount) values(-1,'THB',1,-5,'R',0,NULL)

Like USD:
insert into curformat (storeent_id, setccurr, roundingmultiple,numbrusg_id,roundingmethod, decimalplaces, minapproveamount) values(-1,'THB',1,-1,'R',2,NULL);

  1. Add a currency formatting description.
    insert into curfmtdesc (storeent_id, numbrusg_id, setccurr, language_id,currencysymbol,customizedcurrstr, currencyprefixpos, currencysuffixpos,displaylocale,
    currencyprefixneg, currencysuffixneg, radixpoint, groupingchar,numberpattern, description) values (-1,-1, 'THB', -1015, 'B', null, 'B', null,null, 'B-', null, null, null, '#,##0.00', '
    Thailand Baht');
    For more information refer to the 
    CURFMTDESC table.


  1. Add a conversion rule between the default currency of the store and the created currency:
    insert into curconvert (storeent_id, fromccurr, tocurr, factor,multiplyordivide, bidirectional, updatable, curconvert_id)values(-1,'USD','THB','44.62','M','Y','Y',-12);





For Example: Adding THB for language -1015 (custom) and -1 (en_US)

---Thailand Baht -THB---

insert into setcurr (setccurr, setccode, setcexp) values ('THB',764, -2);

insert into setcurrdsc (setccurr, language_id, description) values('THB',-1015,'Thailand Baht');
insert into setcurrdsc (setccurr, language_id, description) values('THB',-1,'Thailand Baht');

insert into curformat (storeent_id, setccurr, roundingmultiple,numbrusg_id,roundingmethod, decimalplaces, minapproveamount) values(-1,'THB',1,-1,'R',2,NULL);

insert into curfmtdesc (storeent_id, numbrusg_id, setccurr, language_id,currencysymbol,customizedcurrstr, currencyprefixpos, currencysuffixpos,displaylocale,currencyprefixneg, currencysuffixneg, radixpoint, groupingchar,numberpattern, description) values (-1,-1, 'THB', -1015, 'THB', null, 'THB', null,null, 'THB-', null, null, null, '#,##0.00', 'Thailand Baht');
insert into curfmtdesc (storeent_id, numbrusg_id, setccurr, language_id,currencysymbol,customizedcurrstr, currencyprefixpos, currencysuffixpos,displaylocale,currencyprefixneg, currencysuffixneg, radixpoint, groupingchar,numberpattern, description) values (-1,-1, 'THB', -1, 'THB', null, 'THB', null,null, 'THB-', null, null, null, '#,##0.00', 'Thailand Baht');

insert into curconvert (storeent_id, fromcurr, tocurr, factor,multiplyordivide, bidirectional, updatable, curconvert_id)values(-1,'USD','THB','44.62','M','Y','Y',-12);        





No comments:

Post a Comment