From 7f92cfa9104c9af779adf931b4e6422b5dc70d61 Mon Sep 17 00:00:00 2001 From: sunil Date: Tue, 7 Apr 2015 12:30:18 +0530 Subject: [PATCH] CRM-16239 changed order of the function parameters --- js/Common.js | 4 ++-- templates/CRM/Member/Form/Membership.tpl | 4 ++-- templates/CRM/Member/Form/MembershipRenewal.tpl | 2 +- templates/CRM/common/l10n.js.tpl | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/js/Common.js b/js/Common.js index 97ff46d0b4..4950046ee0 100644 --- a/js/Common.js +++ b/js/Common.js @@ -1333,18 +1333,18 @@ CRM.strings = CRM.strings || {}; /** * Clientside currency formatting * @param number value + * @param [optional] boolean onlyNumber - if true, we return formated amount without currency sign * @param [optional] string format - currency representation of the number 1234.56 * @return string */ var currencyTemplate; - CRM.formatMoney = function(value, format, onlyNumber) { + CRM.formatMoney = function(value, onlyNumber, format) { var decimal, separator, sign, i, j, result; if (value === 'init' && format) { currencyTemplate = format; return; } format = format || currencyTemplate; - onlyNumber = onlyNumber || false; result = /1(.?)234(.?)56/.exec(format); if (result === null) { return 'Invalid format passed to CRM.formatMoney'; diff --git a/templates/CRM/Member/Form/Membership.tpl b/templates/CRM/Member/Form/Membership.tpl index 2e302a260a..db37b4786b 100644 --- a/templates/CRM/Member/Form/Membership.tpl +++ b/templates/CRM/Member/Form/Membership.tpl @@ -397,12 +397,12 @@ else { var feeTotal = Number((taxRate/100) * (allMemberships[memType]['total_amount_numeric'] * term))+Number(allMemberships[memType]['total_amount_numeric'] * term ); } - cj("#total_amount").val(CRM.formatMoney(feeTotal, '', true)); + cj("#total_amount").val(CRM.formatMoney(feeTotal, true)); } else { if (taxRate) { var feeTotal = parseFloat(Number((taxRate/100) * allMemberships[memType]['total_amount'])+Number(allMemberships[memType]['total_amount_numeric'])).toFixed(2); - cj("#total_amount").val(CRM.formatMoney(feeTotal, '', true)); + cj("#total_amount").val(CRM.formatMoney(feeTotal, true)); } else { var feeTotal = allMemberships[memType]['total_amount']; diff --git a/templates/CRM/Member/Form/MembershipRenewal.tpl b/templates/CRM/Member/Form/MembershipRenewal.tpl index 43555d7f48..ac3bf9eef9 100644 --- a/templates/CRM/Member/Form/MembershipRenewal.tpl +++ b/templates/CRM/Member/Form/MembershipRenewal.tpl @@ -384,7 +384,7 @@ var term = cj("#num_terms").val(); if (term) { var renewTotal = allMemberships[memType]['total_amount_numeric'] * term; - cj("#total_amount").val(CRM.formatMoney(renewTotal, '', true)); + cj("#total_amount").val(CRM.formatMoney(renewTotal, true)); } else { cj("#total_amount").val(allMemberships[memType]['total_amount']); diff --git a/templates/CRM/common/l10n.js.tpl b/templates/CRM/common/l10n.js.tpl index a43891a2c2..c239bc79e5 100644 --- a/templates/CRM/common/l10n.js.tpl +++ b/templates/CRM/common/l10n.js.tpl @@ -39,7 +39,7 @@ // Initialize CRM.url and CRM.formatMoney CRM.url({ldelim}back: '{crmURL p="*path*" q="*query*" h=0 fb=1}', front: '{crmURL p="*path*" q="*query*" h=0 fe=1}'{rdelim}); - CRM.formatMoney('init', {$moneyFormat}); + CRM.formatMoney('init', false, {$moneyFormat}); // Localize select2 $.fn.select2.defaults.formatNoMatches = "{ts escape='js'}None found.{/ts}"; -- 2.25.1