Subversion Repositories SmartDukaan

Rev

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

Rev 35548 Rev 35769
Line 28... Line 28...
28
        });
28
        });
29
 
29
 
30
 
30
 
31
    $(document).on('click', ".submitDateWiseLead", function () {
31
    $(document).on('click', ".submitDateWiseLead", function () {
32
 
32
 
33
 
-
 
-
 
33
        var startDate = $("#startDate").val();
34
        var leadDate = $("#dateWiseLead").val();
34
        var endDate = $("#endDate").val();
35
        var status = $("#statusFilter").val();
35
        var status = $("#statusFilter").val();
36
        var color = $("#colorFilter").val();
36
        var color = $("#colorFilter").val();
37
 
37
 
38
        if (color == null) {
38
        if (color == null) {
39
            color = "";
39
            color = "";
40
        }
40
        }
41
 
41
 
-
 
42
        if (startDate && endDate) {
-
 
43
            var start = new Date(startDate);
-
 
44
            var end = new Date(endDate);
-
 
45
            var diffMonths = (end.getFullYear() - start.getFullYear()) * 12 + (end.getMonth() - start.getMonth());
-
 
46
            if (diffMonths > 6) {
-
 
47
                alert("Date range must not exceed 6 months");
-
 
48
                return;
-
 
49
            }
-
 
50
            if (end < start) {
-
 
51
                alert("End date must be after start date");
-
 
52
                return;
-
 
53
            }
-
 
54
        }
42
 
55
 
43
        console.log(leadDate);
-
 
44
 
-
 
45
        doGetAjaxRequestHandler(context + "/getOpenLead?leadStatus=" + status + "&color=" + color + "&leadDate=" + leadDate, function (response) {
56
        doGetAjaxRequestHandler(context + "/getOpenLead?leadStatus=" + status + "&color=" + color + "&startDate=" + startDate + "&endDate=" + endDate, function (response) {
46
            $('#' + 'main-content').html(response);
57
            $('#' + 'main-content').html(response);
47
        });
58
        });
48
 
59
 
49
 
60
 
50
    })
61
    })
51
    ;$(document).on('click', ".downloadDateWiseLead", function () {
62
    ;$(document).on('click', ".downloadDateWiseLead", function () {
52
 
63
 
53
 
-
 
-
 
64
        var startDate = $("#startDate").val();
54
        var leadDate = $("#dateWiseLead").val();
65
        var endDate = $("#endDate").val();
55
        var status = $("#statusFilter").val();
66
        var status = $("#statusFilter").val();
56
        var color = $("#colorFilter").val();
67
        var color = $("#colorFilter").val();
57
 
68
 
58
        if (color == null) {
69
        if (color == null) {
59
            color = "";
70
            color = "";
60
        }
71
        }
61
        // console.log(leadDate);
-
 
62
        // doGetAjaxRequestHandler(context + "/downloadDateWiseLead?leadStatus=" + status + "&color=" + color + "&leadDate=" + leadDate, function(response) {
-
 
63
        // 	$('#' + 'main-content').html(response);
-
 
64
        // });
-
 
65
 
72
 
66
        console.log(leadDate);
73
        if (startDate && endDate) {
-
 
74
            var start = new Date(startDate);
-
 
75
            var end = new Date(endDate);
-
 
76
            var diffMonths = (end.getFullYear() - start.getFullYear()) * 12 + (end.getMonth() - start.getMonth());
-
 
77
            if (diffMonths > 6) {
-
 
78
                alert("Date range must not exceed 6 months");
-
 
79
                return;
-
 
80
            }
-
 
81
            if (end < start) {
-
 
82
                alert("End date must be after start date");
-
 
83
                return;
-
 
84
            }
-
 
85
        }
-
 
86
 
67
        let endPoint = `${context}/downloadDateWiseLead?leadStatus=${status}&color=${color}&leadDate=${leadDate}`;
87
        let endPoint = `${context}/downloadDateWiseLead?leadStatus=${status}&color=${color}&startDate=${startDate}&endDate=${endDate}`;
68
        window.location.href = endPoint;
88
        window.location.href = endPoint;
69
 
89
 
70
    });
90
    });
71
 
91
 
72
 
92
 
Line 435... Line 455...
435
        $("#assignTo").val("");
455
        $("#assignTo").val("");
436
        $("#editStatus").val("");
456
        $("#editStatus").val("");
437
        $("#reason").val("");
457
        $("#reason").val("");
438
        $("#editCity").val("");
458
        $("#editCity").val("");
439
        $("#editState").val("");
459
        $("#editState").val("");
-
 
460
        $("#editSource").val("");
440
        $("#editScheduleTime").hide();
461
        $("#editScheduleTime").hide();
441
 
462
 
442
 
463
 
443
        localStorage.removeItem("frontph");
464
        localStorage.removeItem("frontph");
444
        localStorage.removeItem("leftShoth");
465
        localStorage.removeItem("leftShoth");
Line 477... Line 498...
477
            var editStatus = $("#editStatus").val();
498
            var editStatus = $("#editStatus").val();
478
            var city = $('input[name="editCity"]').val();
499
            var city = $('input[name="editCity"]').val();
479
            var state = $("#editState").val();
500
            var state = $("#editState").val();
480
            var reason = $("#reason").val();
501
            var reason = $("#reason").val();
481
 
502
 
-
 
503
            var startDate = $("#startDate").val();
482
            var leadDate = $("#dateWiseLead").val();
504
            var endDate = $("#endDate").val();
483
            var leadStatus = $("#statusFilter").val();
505
            var leadStatus = $("#statusFilter").val();
484
            var color = $("#colorFilter").val();
506
            var color = $("#colorFilter").val();
485
            var communicationType = $("#communicationType").val();
507
            var communicationType = $("#communicationType").val();
486
 
508
 
487
            var conversionprobability = $("#conversionprobability").val();
509
            var conversionprobability = $("#conversionprobability").val();
-
 
510
            var editSource = $("#editSource").val();
488
 
511
 
489
            console.log(conversionprobability)
512
            console.log(conversionprobability)
490
 
513
 
491
 
514
 
492
            console.log(leadDate)
515
            console.log(startDate)
493
            console.log(leadStatus)
516
            console.log(leadStatus)
494
 
517
 
495
            console.log(color)
518
            console.log(color)
496
            console.log(reason)
519
            console.log(reason)
497
 
520
 
Line 535... Line 558...
535
 
558
 
536
            if (state && state.trim() !== "") {
559
            if (state && state.trim() !== "") {
537
                leadActivityData.state = state;
560
                leadActivityData.state = state;
538
            }
561
            }
539
 
562
 
-
 
563
            if (editSource && editSource.trim() !== "") {
-
 
564
                leadActivityData.source = editSource;
-
 
565
            }
-
 
566
 
540
 
567
 
541
            if (editStatus == "followUp") {
568
            if (editStatus == "followUp") {
542
                leadActivityData['scheldule'] = getDatesFromPicker('input[name="editScheduleTime"]').startDate
569
                leadActivityData['scheldule'] = getDatesFromPicker('input[name="editScheduleTime"]').startDate
543
                leadActivityData['communicationType'] = communicationType
570
                leadActivityData['communicationType'] = communicationType
544
 
571