Subversion Repositories SmartDukaan

Rev

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

Rev 34813 Rev 34859
Line 91... Line 91...
91
        loaderDialogObj.modal('show');
91
        loaderDialogObj.modal('show');
92
}
92
}
93
 
93
 
94
$(document).ajaxStart(ajaxStartHandler);
94
$(document).ajaxStart(ajaxStartHandler);
95
 
95
 
96
function doAjaxRequestWithParamsHandler(urlString, httpType, params,
96
function doAjaxRequestWithParamsHandler(urlString, httpType, params, callback_function) {
97
                                        callback_function) {
-
 
98
    $.ajax({
97
    $.ajax({
99
        url: urlString,
98
        url: urlString,
100
        async: true,
99
        async: true,
101
        cache: false,
100
        cache: false,
102
        data: params,
101
        data: params,
Line 213... Line 212...
213
            callback_function(response);
212
            callback_function(response);
214
        }
213
        }
215
    });
214
    });
216
}
215
}
217
 
216
 
218
function doAjaxUploadRequestJsonHandler(urlString, httpType, file, json,
217
function doAjaxUploadRequestJsonHandler(urlString, httpType, file, json, callback_function) {
219
                                        callback_function) {
-
 
220
    var formData = new FormData();
218
    var formData = new FormData();
221
    formData.append("file", file);
219
    formData.append("file", file);
222
    formData.append('json', new Blob([json]));
220
    formData.append('json', new Blob([json]));
223
    $.ajax({
221
    $.ajax({
224
        url: urlString,
222
        url: urlString,
Line 599... Line 597...
599
                moment()],
597
                moment()],
600
            'Last 3 Months': [moment().subtract(3, 'month').startOf('month'),
598
            'Last 3 Months': [moment().subtract(3, 'month').startOf('month'),
601
                moment()],
599
                moment()],
602
            'Last 6 Months': [moment().subtract(6, 'month').startOf('month'),
600
            'Last 6 Months': [moment().subtract(6, 'month').startOf('month'),
603
                moment()]
601
                moment()]
604
        }
602
        };
605
    }
603
    }
606
    return rangedDatePicker;
604
    return rangedDatePicker;
607
}
605
}
608
 
606
 
609
function showPosition(position) {
607
function showPosition(position) {
610
    if (typeof latitude == "undefined") {
608
    if (typeof latitude == "undefined") {
611
        var coords = {
609
        var coords = {
612
            latitude: position.coords.latitude,
610
            latitude: position.coords.latitude,
613
            longitude: position.coords.longitude
611
            longitude: position.coords.longitude
614
        }
612
        };
615
        doAjaxRequestWithJsonHandler('partner/location', 'PUT', JSON
613
        doAjaxRequestWithJsonHandler('partner/location', 'PUT', JSON
616
            .stringify(coords), function () {
614
            .stringify(coords), function () {
617
            latitude = position.coords.latitude;
615
            latitude = position.coords.latitude;
618
            longitude = position.coords.longitude;
616
            longitude = position.coords.longitude;
619
        });
617
        });
Line 626... Line 624...
626
    bootBoxObj = {
624
    bootBoxObj = {
627
        size: "small",
625
        size: "small",
628
        title: "Choose Warehouse",
626
        title: "Choose Warehouse",
629
        callback: callback,
627
        callback: callback,
630
        inputType: 'select',
628
        inputType: 'select',
631
        inputOptions: typeof inputOptions == "undefined" ? undefined
629
        inputOptions: typeof inputOptions == "undefined" ? undefined : inputOptions
632
            : inputOptions
-
 
633
    }
630
    };
634
    if (typeof inputOptions == "undefined") {
631
    if (typeof inputOptions == "undefined") {
635
        doGetAjaxRequestHandler(context + "/authorisedWarehouses", function (
632
        doGetAjaxRequestHandler(context + "/authorisedWarehouses", function (
636
            response) {
633
            response) {
637
            response = JSON.parse(response);
634
            response = JSON.parse(response);
638
            inputOptions = [];
635
            inputOptions = [];