Subversion Repositories SmartDukaan

Rev

Rev 34508 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
34505 ranu 1
// franchisee sale reports ---------------------------
2
// franchisee sale reports ---------------------------
3
// franchisee sale reports ---------------------------
4
 
5
$(document).on('click', '.analysis-franchise-sales', function () {
6
 
7
    var fofoId = $(this).data("fofoid");
8
 
9
 
10
    let endPoint = `${context}/analysis-franchiseeSalesReport?fofoId=${fofoId}`;
11
 
12
    doGetAjaxRequestHandler(endPoint,
13
        function (response) {
14
            $('#' + 'main-content').html(response);
15
        });
16
});
17
 
18
 
19
$(document).on('click', '.analysis-franchisee-sales-fetch-report', function () {
20
    var startDate = $("#analysis-startDate-franchisee-sales").val();
21
 
22
    var fofoId = $(this).data("fofoid");
23
 
24
    var endDate = $("#analysis-endDate-franchisee-sales").val();
25
 
26
    let endPoint = `${context}/analysis-franchiseeSalesReport?fofoId=${fofoId}&startDate=${startDate}&endDate=${endDate}`;
27
 
28
    doGetAjaxRequestHandler(endPoint,
29
        function (response) {
30
            $('#' + 'main-content').html(response);
31
        });
32
});
33
 
34
$(document).on('click', '.analysis-download-franchisee-sales', function () {
35
    var fofoId = $(this).data("fofoid");
36
    var startDate = $("#analysis-startDate-franchisee-sales").val();
37
 
38
    var endDate = $("#analysis-endDate-franchisee-sales").val();
39
 
40
    if (startDate == "" || startDate == undefined) {
41
 
42
        alert("start date is not be empty!!");
43
        return;
44
    }
45
    if (endDate == "" || endDate == undefined) {
46
 
47
        alert("end date is not be empty!!");
48
        return;
49
    }
50
    let endPoint = `${context}/analysis-downloadFranchiseeSales?startDate=${startDate}&endDate=${endDate}&fofoId=${fofoId}`;
51
    window.location.href = endPoint;
52
});
53
 
54
 
55
// wallet summuary reports-----------------
56
// wallet summuary reports-----------------
57
// wallet summuary reports-----------------
58
 
59
$(document).on('click', ".analysis-wallet_statement", function () {
60
    var fofoId = $(this).data("fofoid");
61
    doGetAjaxRequestHandler(context + "/analysis-walletSummaryFetchReportByDate?fofoId=" + fofoId,
62
        function (response) {
63
            $('#' + 'main-content').html(response);
64
        });
65
});
66
 
67
$(document).on('click', '.analysis-wallet-summary-fetch-report', function () {
68
    var startDate = $("#analysis-startDate-wallet-summary-report").val();
69
 
70
    var fofoId = $(this).data("fofoid");
71
 
72
    var endDate = $("#analysis-endDate-wallet-summary-report").val();
73
 
74
    let endPoint = `${context}/analysis-walletSummaryFetchReportByDate?fofoId=${fofoId}&startDate=${startDate}&endDate=${endDate}`;
75
 
76
    doGetAjaxRequestHandler(endPoint,
77
        function (response) {
78
            $('#' + 'main-content').html(response);
79
        });
80
});
81
 
82
$(document).on('click', '.analysis-download-wallet-summary-report', function () {
83
    var fofoId = $(this).data("fofoid");
84
    var startDate = $("#analysis-startDate-wallet-summary-report").val();
85
 
86
    var endDate = $("#analysis-endDate-wallet-summary-report").val();
87
 
88
    if (startDate == "" || startDate == undefined) {
89
 
90
        alert("start date is not be empty!!");
91
        return;
92
    }
93
    if (endDate == "" || endDate == undefined) {
94
 
95
        alert("end date is not be empty!!");
96
        return;
97
    }
98
    let endPoint = `${context}/analysis-downloadWalletSummaryReport?startDate=${startDate}&endDate=${endDate}&fofoId=${fofoId}`;
99
    window.location.href = endPoint;
100
});
101
 
102
 
103
// account statement reports -----------------
104
// account statement reports -----------------
105
// account statement reports -----------------
106
// account statement reports -----------------
107
 
108
$(document).on('click', ".analysis-account-statement", function () {
109
    var fofoId = $(this).data("fofoid");
110
    doGetAjaxRequestHandler(context + "/analysis-account-statement?fofoId=" + fofoId,
111
        function (response) {
112
            $('#' + 'main-content').html(response);
113
        });
114
});
115
 
116
$(document).on('click', '.analysis-download-partner-account-statement-report', function () {
117
    var startDate = getDatesFromPicker('input[name="analysis-accountStatementPeriod"]').startDate;
118
    var endDate = getDatesFromPicker('input[name="analysis-accountStatementPeriod"]').endDate;
119
    var fofoId = $(this).data("fofoid");
120
    if (startDate == "" || startDate == undefined) {
121
        alert("start date is not be empty!!");
122
        return;
123
    }
124
    if (endDate == "" || endDate == undefined) {
125
 
126
        alert("end date is not be empty!!");
127
        return;
128
    }
129
    let endPoint = `${context}/analysis/account/statement?startDate=${startDate}&endDate=${endDate}&fofoId=${fofoId}`;
130
 
131
    window.location.href = endPoint;
132
});
133
$(document).on('click', '.analysis-fetch-partner-account-statement-report', function () {
134
    var fofoId = $(this).data("fofoid");
135
    var startDate = getDatesFromPicker('input[name="analysis-accountStatementPeriod"]').startDate;
136
    var endDate = getDatesFromPicker('input[name="analysis-accountStatementPeriod"]').endDate;
137
 
138
    if (startDate == "" || startDate == undefined) {
139
        alert("start date is not be empty!!");
140
        return;
141
    }
142
    if (endDate == "" || endDate == undefined) {
143
 
144
        alert("end date is not be empty!!");
145
        return;
146
    }
147
 
148
    doGetAjaxRequestHandler(context + "/analysis-account-statement-report?startDate=" + startDate + "&endDate=" + endDate + "&fofoId=" + fofoId,
149
        function (response) {
150
            $('.account-statement-conatiner').html(response);
151
        });
152
 
153
});
154
 
155
 
156
// loan statement here ..................///
157
// loan statement here ..................///
158
// loan statement here ..................///
159
// loan statement here ..................///
160
 
161
 
162
$(document).on('click', ".analysis-loan-statement", function () {
163
    var fofoId = $(this).data("fofoid");
164
    doGetAjaxRequestHandler(context + "/analysis-loan/loan-statement?fofoId=" + fofoId,
165
        function (response) {
166
            $('#' + 'main-content').html(response);
167
        });
168
});
169
 
170
$(document).on('click', '.analysis-partner-loan-statement-report', function () {
171
    var fofoId = $(this).data("fofoid");
172
    var startDate = getDatesFromPicker('input[name="analysis-loanStatementPeriod"]').startDate;
173
    var endDate = getDatesFromPicker('input[name="analysis-loanStatementPeriod"]').endDate;
174
 
175
    if (startDate == "" || startDate == undefined) {
176
        alert("start date is not be empty!!");
177
        return;
178
    }
179
    if (endDate == "" || endDate == undefined) {
180
 
181
        alert("end date is not be empty!!");
182
        return;
183
    }
184
    doGetAjaxRequestHandler(context + "/analysis-loan/partner-loan-statement-report?startDate=" + startDate + "&endDate=" + endDate + "&fofoId=" + fofoId,
185
        function (response) {
186
            $('.loan-statement-conatiner').html(response);
187
            $('#loanStatementSummaryReport').DataTable({
188
                "scrollX": true,
189
                "bPaginate": true,
190
                "bLengthChange": true,
191
                "bFilter": true,
192
                "bInfo": false,
193
                "bAutoWidth": false
194
            });
195
        });
196
 
197
 
198
});
199
 
200
$(document).on('click', '.analysis-download-partner-loan-statement', function () {
201
    var fofoId = $(this).data("fofoid");
202
    var startDate = getDatesFromPicker('input[name="analysis-loanStatementPeriod"]').startDate;
203
    var endDate = getDatesFromPicker('input[name="analysis-loanStatementPeriod"]').endDate;
204
 
205
    if (startDate == "" || startDate == undefined) {
206
 
207
        alert("start date is not be empty!!");
208
        return;
209
    }
210
    if (endDate == "" || endDate == undefined) {
211
 
212
        alert("end date is not be empty!!");
213
        return;
214
    }
215
    let endPoint = `${context}/analysis-loan/download-partner-loan-statement-report?startDate=${startDate}&endDate=${endDate}&fofoId=${fofoId}`;
216
 
217
    window.location.href = endPoint;
218
});
34507 ranu 219
 
220
 
221
// scheme payout report--------------
222
// scheme payout report--------------
223
// scheme payout report--------------
224
// scheme payout report--------------
225
 
226
$(document).on('click', ".analysis-download-scheme-payout-report", function () {
227
    var fofoId = $(this).data("fofoid");
228
    var startDate = $("#analysis-startDate-scheme-payout").val();
229
 
230
    var endDate = $("#analysis-endDate-scheme-payout").val();
231
 
232
    if (startDate == "" || startDate == undefined) {
233
        alert("start date is not be empty!!");
234
        return;
235
    }
236
    if (endDate == "" || endDate == undefined) {
237
 
238
        alert("end date is not be empty!!");
239
        return;
240
    }
241
    let endPoint = `${context}/analysis-schemePayoutReportDownload?startDate=${startDate}&endDate=${endDate}&fofoId=${fofoId}`;
242
 
243
    window.location.href = endPoint;
244
});
245
 
246
$(document).on('click', ".analysis-scheme-payout-fetch-report", function () {
247
    var fofoId = $(this).data("fofoid");
248
    var startDate = $("#analysis-startDate-scheme-payout").val();
249
 
250
    var endDate = $("#analysis-endDate-scheme-payout").val();
251
 
252
    if (startDate == "" || startDate == undefined) {
253
        alert("start date is not be empty!!");
254
        return;
255
    }
256
    if (endDate == "" || endDate == undefined) {
257
 
258
        alert("end date is not be empty!!");
259
        return;
260
    }
261
 
262
    let endPoint = `${context}/analysis-schemePayoutReport?startDate=${startDate}&endDate=${endDate}&fofoId=${fofoId}`;
263
 
264
    doGetAjaxRequestHandler(endPoint,
265
        function (response) {
266
            $('#' + 'main-content').html(response);
267
        });
268
});
269
 
270
$(document).on('click', ".analysis-scheme-payout-report", function () {
271
    var fofoId = $(this).data("fofoid");
272
 
273
    let endPoint = `${context}/analysis-schemePayoutReport?fofoId=${fofoId}`;
274
 
275
    doGetAjaxRequestHandler(endPoint,
276
        function (response) {
277
            $('#' + 'main-content').html(response);
278
        });
279
});
34508 ranu 280
 
281
// price drop ....................price drop ....................
282
// price drop ....................price drop ....................
283
// price drop ....................price drop ....................
284
 
285
$(document).on('click', ".analysis-price-drop-report", function () {
286
    var fofoId = $(this).data("fofoid");
287
    doGetAjaxRequestHandler(context + "/analysis-priceDropFetchReportByDate?fofoId=" + fofoId,
288
        function (response) {
289
            $('#' + 'main-content').html(response);
290
        });
291
});
292
 
293
 
294
$(document).on('click', '.analysis-price-drop-fetch-report', function () {
295
    var fofoId = $(this).data("fofoid");
296
    var startDate = $("#analysis-startDate-price-drop-report").val();
297
 
298
    var endDate = $("#analysis-endDate-price-drop-report").val();
299
 
300
    if (startDate == "" || startDate == undefined) {
301
 
302
        alert("start date is not be empty!!");
303
        return;
304
    }
305
    if (endDate == "" || endDate == undefined) {
306
 
307
        alert("end date is not be empty!!");
308
        return;
309
    }
310
    let endPoint = `${context}/analysis-priceDropFetchReportByDate?startDate=${startDate}&endDate=${endDate}&fofoId=${fofoId}`;
311
 
312
 
313
    doGetAjaxRequestHandler(endPoint,
314
        function (response) {
315
            $('#' + 'main-content').html(response);
316
        });
317
 
318
});
319
 
320
$(document).on('click', '.analysis-download-price-drop-report', function () {
321
    var fofoId = $(this).data("fofoid");
322
 
323
    var startDate = $("#analysis-startDate-price-drop-report").val();
324
 
325
    var endDate = $("#analysis-endDate-price-drop-report").val();
326
 
327
    if (startDate == "" || startDate == undefined) {
328
 
329
        alert("start date is not be empty!!");
330
        return;
331
    }
332
    if (endDate == "" || endDate == undefined) {
333
 
334
        alert("end date is not be empty!!");
335
        return;
336
    }
337
    let endPoint = `${context}/analysis-downloadPriceDropReport?startDate=${startDate}&endDate=${endDate}&fofoId=${fofoId}`;
338
 
339
 
340
    window.location.href = endPoint;
341
 
342
 
343
});
34509 ranu 344
 
345
 
346
// collection summary report ------------------
347
// collection summary report ------------------
348
// collection summary report ------------------
349
// collection summary report ------------------
350
 
351
 
352
$(document).on('click', ".analysis-partner-collection-summary", function () {
353
    var fofoId = $(this).data("fofoid");
354
    doGetAjaxRequestHandler(context + "/analysis-collectionSummaryFetchReport?fofoId=" + fofoId,
355
        function (response) {
356
            $('#' + 'main-content').html(response);
357
        });
358
});
359
 
360
 
361
$(document).on('click', '.analysis-download-collection-summary', function () {
362
    var fofoId = $(this).data("fofoid");
363
    var startDate = $("#analysis-startDate-collection-summary").val();
364
 
365
    var endDate = $("#analysis-endDate-collection-summary").val();
366
 
367
    if (startDate == "" || startDate == undefined) {
368
 
369
        alert("start date is not be empty!!");
370
        return;
371
    }
372
    if (endDate == "" || endDate == undefined) {
373
 
374
        alert("end date is not be empty!!");
375
        return;
376
    }
377
    let endPoint = `${context}/analysis-downloadCollectionSummary?startDate=${startDate}&endDate=${endDate}&fofoId=${fofoId}`;
378
 
379
    window.location.href = endPoint;
380
 
381
});
382
$(document).on('click', ".analysis-collection-summary-fetch-report", function () {
383
    var fofoId = $(this).data("fofoid");
384
    var startDate = $("#analysis-startDate-collection-summary").val();
385
 
386
    var endDate = $("#analysis-endDate-collection-summary").val();
387
 
388
    if (startDate == "" || startDate == undefined) {
389
        alert("start date is not be empty!!");
390
        return;
391
    }
392
    if (endDate == "" || endDate == undefined) {
393
 
394
        alert("end date is not be empty!!");
395
        return;
396
    }
397
    let endPoint = `${context}/analysis-collectionSummaryFetchReport?startDate=${startDate}&endDate=${endDate}&fofoId=${fofoId}`;
398
 
399
 
400
    doGetAjaxRequestHandler(endPoint,
401
        function (response) {
402
            $('#' + 'main-content').html(response);
403
        });
404
 
405
 
406
});
407
 
408
 
409
// credit note report .............
410
// credit note report .............
411
// credit note report .............
412
 
413
$(document).on('click', ".analysis-credit-note", function () {
414
    var fofoId = $(this).data("fofoid");
415
    doGetAjaxRequestHandler(context + "/analysis-report/credit-note?fofoId=" + fofoId,
416
        function (response) {
417
            $('#' + 'main-content').html(response);
418
        });
419
});
420
 
421
$(document).on('click', '.analysis-credit-not-list', function () {
422
    var selectedDate = $('input[name="analysis-creditNotePeriod"]').val(); // Get the selected year-month
423
    var fofoId = $(this).data("fofoid");
424
    if (!selectedDate) {
425
        alert("Month-Year selection cannot be empty!");
426
        return;
427
    }
428
    doGetAjaxRequestHandler(context + "analysis-credit/credit-note-report?yearMonth=" + selectedDate + "&fofoId=" + fofoId,
429
        function (response) {
430
            $('.credit-note-conatiner').html(response);
431
            $('#creditNoteList').DataTable({
432
                "scrollX": true,
433
                "bPaginate": true,
434
                "bLengthChange": true,
435
                "bFilter": true,
436
                "bInfo": false,
437
                "bAutoWidth": false
438
            });
439
        });
440
 
441
});
442
 
443
$(document).on('click', '.analysis-download-credit-note', function () {
444
    var cnNumber = $(this).data("creditnumber");
445
 
446
    if (!cnNumber) {
447
        alert("CN-Number cannot be empty!");
448
        return;
449
    }
450
 
451
    let endPoint = `${context}/analysis-credit-note/download?cnNumber=${cnNumber}`;
452
 
453
    window.location.href = endPoint; // Redirect to the download URL
454
});
455
 
456
$(document).on('click', '.analysis-download-credit-note-attachement', function () {
457
    var cnNumber = $(this).data("creditnumber");
458
 
459
    if (!cnNumber) {
460
        alert("CN-Number cannot be empty!");
461
        return;
462
    }
463
 
464
    let endPoint = `${context}/analysis-credit-note/attachements?cnNumber=${cnNumber}`;
465
 
466
    window.location.href = endPoint; // Redirect to the download URL
467
});