Subversion Repositories SmartDukaan

Rev

Rev 35510 | Rev 35544 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35510 Rev 35533
Line 116... Line 116...
116
function doPostAjaxRequestWithParamsHandler(urlString, params, callback_function) {
116
function doPostAjaxRequestWithParamsHandler(urlString, params, callback_function) {
117
    doAjaxRequestWithParamsHandler(urlString, "POST", params, callback_function);
117
    doAjaxRequestWithParamsHandler(urlString, "POST", params, callback_function);
118
}
118
}
119
 
119
 
120
function formatCurrency() {
120
function formatCurrency() {
121
    $('.rcurrency').each(function (index, ele) {
-
 
122
        if (!isNaN(parseInt($(ele).html()))) {
-
 
123
            $(ele).html(numberToComma($(ele).html(), true));
-
 
124
        }
-
 
125
    });
-
 
126
    $('.currency').each(function (index, ele) {
121
    $('.currency').each(function (index, ele) {
127
        if (!isNaN(parseInt($(ele).html()))) {
122
        if (!isNaN(parseInt($(ele).html()))) {
128
            $(ele).html(formatValueInCrore($(ele).html()));
123
            $(ele).html(formatValueInCrore($(ele).html()));
129
        }
124
        }
130
    });
125
    });
Line 493... Line 488...
493
}
488
}
494
 
489
 
495
function formatValueInCrore(value) {
490
function formatValueInCrore(value) {
496
    if (isNaN(value)) return value;
491
    if (isNaN(value)) return value;
497
    value = parseFloat(value);
492
    value = parseFloat(value);
498
 
-
 
-
 
493
    return numberToComma(value);
499
    if (value >= 10000000) {  // >= 1 Crore
494
    /*if (value >= 10000000) {  // >= 1 Crore
500
        var croreValue = value / 10000000;
495
        var croreValue = value / 10000000;
501
        // Remove trailing zeros: 1.500 -> 1.5, 1.000 -> 1
496
        // Remove trailing zeros: 1.500 -> 1.5, 1.000 -> 1
502
        var formatted = croreValue.toFixed(3).replace(/\.?0+$/, '');
497
        var formatted = croreValue.toFixed(3).replace(/\.?0+$/, '');
503
        return formatted + ' Cr';
498
        return formatted + ' Cr';
504
    } else {
499
    } else {
505
        // Less than 1 Crore - show full number with Indian comma format
500
        // Less than 1 Crore - show full number with Indian comma format
506
        return numberToComma(value);
501
        return numberToComma(value);
507
    }
502
    }*/
508
}
503
}
509
 
504
 
510
function getSingleDatePicker(startMoment) {
505
function getSingleDatePicker(startMoment) {
511
    var singleDatePicker = {
506
    var singleDatePicker = {
512
        "todayHighlight": true,
507
        "todayHighlight": true,