Subversion Repositories SmartDukaan

Rev

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

Rev 36787 Rev 36789
Line 481... Line 481...
481
        function () {
481
        function () {
482
 
482
 
483
            // Gate the assign/status submit on approved geo. Modal stays open so the
483
            // Gate the assign/status submit on approved geo. Modal stays open so the
484
            // user can still work the other sub-forms (lead detail, etc.).
484
            // user can still work the other sub-forms (lead detail, etc.).
485
            var clickedBtn = $(this);
485
            var clickedBtn = $(this);
-
 
486
            // notInterested is a close-out — no geo / no beat / no assignee
-
 
487
            // needed. Skip the geo gate and submit straight through with just
-
 
488
            // the activity (status + reason + remark).
-
 
489
            var currentStatus = $('#editStatus').val();
-
 
490
            if (currentStatus === 'notInterested') {
-
 
491
                submitLeadEdit();
-
 
492
                return;
-
 
493
            }
486
            if (clickedBtn.data('geoChecking')) return;
494
            if (clickedBtn.data('geoChecking')) return;
487
            clickedBtn.data('geoChecking', true);
495
            clickedBtn.data('geoChecking', true);
488
            doAjaxRequestHandler(
496
            doAjaxRequestHandler(
489
                context + "/lead-geo/check/" + leadId,
497
                context + "/lead-geo/check/" + leadId,
490
                "GET",
498
                "GET",
Line 531... Line 539...
531
            if (remark === "" && assignTo === "" && editStatus === "") {
539
            if (remark === "" && assignTo === "" && editStatus === "") {
532
                alert("All fields is required");
540
                alert("All fields is required");
533
                return;
541
                return;
534
            }
542
            }
535
 
543
 
-
 
544
        // For notInterested (close-out) the lead doesn't need an assignee
-
 
545
        // — it's just a status + reason + remark write. Only enforce
-
 
546
        // assignTo for the other statuses where scheduling matters.
536
            if (assignTo === "") {
547
        if (assignTo === "" && editStatus !== "notInterested") {
537
                alert("assignTo is required");
548
                alert("assignTo is required");
538
                return;
549
                return;
539
            }
550
            }
540
 
551
 
541
            if (remark === "") {
552
            if (remark === "") {
Line 548... Line 559...
548
                alert("status is required");
559
                alert("status is required");
549
                return;
560
                return;
550
            }
561
            }
551
 
562
 
552
            if (editStatus === "notInterested") {
563
            if (editStatus === "notInterested") {
553
                if (reason == null) {
564
                if (reason == null || reason === "") {
554
                    alert("Reason  is required");
565
                    alert("Reason  is required");
555
                    return;
566
                    return;
556
                }
567
                }
557
            }
568
            }
558
            var leadActivityData = {}
569
            var leadActivityData = {}