Subversion Repositories SmartDukaan

Rev

Rev 34509 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 34509 Rev 34524
Line 463... Line 463...
463
 
463
 
464
    let endPoint = `${context}/analysis-credit-note/attachements?cnNumber=${cnNumber}`;
464
    let endPoint = `${context}/analysis-credit-note/attachements?cnNumber=${cnNumber}`;
465
 
465
 
466
    window.location.href = endPoint; // Redirect to the download URL
466
    window.location.href = endPoint; // Redirect to the download URL
467
});
467
});
-
 
468
 
-
 
469
 
-
 
470
// schemes ...........//
-
 
471
// schemes ...........//
-
 
472
// schemes ...........//
-
 
473
 
-
 
474
 
-
 
475
$(document).on('click', ".analysis-schemes", function () {
-
 
476
    var fofoId = $(this).data('fofoid');
-
 
477
    schemesNew("main-content", fofoId);
-
 
478
    console.log("Active Schemes Button Clicked...")
-
 
479
});
-
 
480
 
-
 
481
 
-
 
482
function schemesNew(domId, fofoId) {
-
 
483
    doGetAjaxRequestHandler(context + "/getAnalysisSchemes?fofoId=" + fofoId, function (response) {
-
 
484
        $('#' + domId).html(response);
-
 
485
    });
-
 
486
}
-
 
487
 
-
 
488
$(document).on("keyup", "#analysis-scheme-item-search-text", function (e) {
-
 
489
    var keyCode = e.keyCode || e.which;
-
 
490
    if (keyCode == 13) {
-
 
491
        $("#analysis-scheme-item-search-button").click();
-
 
492
    }
-
 
493
});
-
 
494
 
-
 
495
$(document).on("keyup", "#analysis-scheme-search-text", function (e) {
-
 
496
    var keyCode = e.keyCode || e.which;
-
 
497
    if (keyCode == 13) {
-
 
498
        $("#analysis-scheme-search-button").click();
-
 
499
    }
-
 
500
});
-
 
501
 
-
 
502
$(document).on('click', "#analysis-scheme-imei-search-button", function () {
-
 
503
    var fofoId = $(this).data('fofoid');
-
 
504
    var searchText = $("#analysis-scheme-imei-search-text").val();
-
 
505
    var date = $(".analysis-schemes-date").val();
-
 
506
    if (typeof (searchText) == "undefined" || !searchText) {
-
 
507
        searchText = "";
-
 
508
        alert("please select imei");
-
 
509
        return;
-
 
510
    }
-
 
511
    if (typeof imei != "undefined") {
-
 
512
        console.log(imei);
-
 
513
        loadSchemeImeiSearchInfoNew(imei, date, fofoId);
-
 
514
    } else {
-
 
515
        console.log("reeffff")
-
 
516
        alert("Data No Found")
-
 
517
    }
-
 
518
});
-
 
519
 
-
 
520
function loadSchemeImeiSearchInfoNew(selectedImei, date, fofoId) {
-
 
521
 
-
 
522
    loadSearchImeiSchemeNew("main-content", selectedImei, date, fofoId);
-
 
523
}
-
 
524
 
-
 
525
function loadSearchImeiSchemeNew(domId, selected_imei, date, fofoId) {
-
 
526
    var category = $('#partner-category').val();
-
 
527
    var searchText = $("#analysis-scheme-imei-search-text").val();
-
 
528
 
-
 
529
    var category = $('#partner-category').val();
-
 
530
 
-
 
531
    console.log(category)
-
 
532
 
-
 
533
    if (typeof (searchText) == "undefined" || !searchText) {
-
 
534
        searchText = "";
-
 
535
    }
-
 
536
    if (typeof (category) == "undefined" || !category) {
-
 
537
        category = "";
-
 
538
    }
-
 
539
    if ((searchText) && (category)) {
-
 
540
        doGetAjaxRequestHandler(context + "/getAnalysisSchemes?fofoId=" + fofoId + "&searchImei="
-
 
541
            + selected_imei + "&partnerType=" + category, function (
-
 
542
            response) {
-
 
543
            $('#' + domId).html(response);
-
 
544
 
-
 
545
            $('#partner-category').val(category);
-
 
546
            $('#scheme-imei-search-text').val(selected_imei);
-
 
547
        });
-
 
548
    } else if ((searchText)) {
-
 
549
        doGetAjaxRequestHandler(`${context}/getAnalysisSchemes?fofoId=${fofoId}&searchImei=${selected_imei}&date=${date}`, function (response) {
-
 
550
            $('#' + domId).html(response);
-
 
551
            $('#scheme-imei-search-text').val(selected_imei);
-
 
552
 
-
 
553
        });
-
 
554
    }
-
 
555
}
-
 
556
 
-
 
557
$(document).on('click', "#analysis-scheme-search-button",
-
 
558
    function () {
-
 
559
        var searchText = $("#analysis-scheme-search-text").val();
-
 
560
        var fofoId = $(this).data('fofoid');
-
 
561
        if (typeof (searchText) == "undefined" || !searchText) {
-
 
562
            searchText = "";
-
 
563
        }
-
 
564
        doGetAjaxRequestHandler(context + "/getAnalysisSchemes?fofoId=" + fofoId + "&searchScheme="
-
 
565
            + searchText, function (response) {
-
 
566
            $('#' + "main-content").html(response);
-
 
567
        });
-
 
568
    });
-
 
569
 
-
 
570
$(document).on('click', "#analysis-scheme-item-search-button", function () {
-
 
571
    var searchText = $("#analysis-scheme-item-search-text").val();
-
 
572
    var fofoId = $(this).data('fofoid');
-
 
573
    var date = $(".analysis-schemes-date").val();
-
 
574
    if (typeof (searchText) == "undefined" || !searchText) {
-
 
575
        searchText = "";
-
 
576
        alert("please select item");
-
 
577
        return;
-
 
578
    }
-
 
579
    if (typeof currentItem != "undefined") {
-
 
580
        console.log(currentItem);
-
 
581
        loadSchemeItemSearchInfoNew(currentItem, date, fofoId);
-
 
582
    } else {
-
 
583
        console.log("reeffff")
-
 
584
        alert("Data No Found")
-
 
585
    }
-
 
586
});
-
 
587
 
-
 
588
 
-
 
589
function loadSchemeItemSearchInfoNew(selectedModel, date, fofoId) {
-
 
590
    loadSearchItemSchemeNew("main-content", selectedModel, date, fofoId);
-
 
591
}
-
 
592
 
-
 
593
function loadSearchItemSchemeNew(domId, selectedModel, date, fofoId) {
-
 
594
    var searchText = $("#analysis-scheme-item-search-text").val();
-
 
595
    var category = $('#partner-category').val();
-
 
596
 
-
 
597
    if (typeof (searchText) == "undefined" || !searchText) {
-
 
598
        searchText = "";
-
 
599
    }
-
 
600
    if (typeof (category) == "undefined" || !category) {
-
 
601
        category = "";
-
 
602
    }
-
 
603
    if (searchText && category) {
-
 
604
        doGetAjaxRequestHandler(`${context}/getAnalysisSchemes?fofoId=${fofoId}&searchModel=${selectedModel}&partnerType=${category}&date=${date}`, function (response) {
-
 
605
            $('#' + domId).html(response);
-
 
606
            $('#partner-category').val(category);
-
 
607
        });
-
 
608
    } else if (searchText) {
-
 
609
        doGetAjaxRequestHandler(`${context}/getAnalysisSchemes?fofoId=${fofoId}&searchModel=${selectedModel}&date=${date}`, function (response) {
-
 
610
            $('#' + domId).html(response);
-
 
611
            $('#partner-category').val(category);
-
 
612
        });
-
 
613
 
-
 
614
    }
-
 
615
 
-
 
616
}
-
 
617
 
-
 
618
 
-
 
619
// price circular table start ............
-
 
620
// price circular table start ............
-
 
621
// price circular table start ............
-
 
622
 
-
 
623
$(document).on('click', ".analysis-submit-circular-request", function () {
-
 
624
    let brand = $("#brands").val();
-
 
625
    var fofoId = $(this).data('fofoid');
-
 
626
    let priceCircularUrl = `${context}/analysisPriceCircularByBrand?brand=${brand}&fofoId=${fofoId}`;
-
 
627
    if (typeof partnerId == "number") {
-
 
628
        priceCircularUrl = `${priceCircularUrl}&fofoId=${partnerId}`;
-
 
629
    }
-
 
630
    doGetAjaxRequestHandler(priceCircularUrl,
-
 
631
        function (response) {
-
 
632
            console.log(response)
-
 
633
            $('.price-circular-container').html(response);
-
 
634
        });
-
 
635
});
-
 
636
 
-
 
637
 
-
 
638
$(document).on('click', ".analysis-partner-price-circular", function () {
-
 
639
    var fofoId = $(this).data('fofoid');
-
 
640
    bootbox.confirm({
-
 
641
        message: "<div class = 'disclosurehindata'> <img src='resources/images/disclosure.png' style='width:100%'> </div>"
-
 
642
        ,
-
 
643
        buttons: {
-
 
644
            confirm: {
-
 
645
                label: 'I agree',
-
 
646
                className: 'btn-success'
-
 
647
            },
-
 
648
            cancel: {
-
 
649
                label: 'I disagree',
-
 
650
                className: 'btn-danger'
-
 
651
            }
-
 
652
        },
-
 
653
        callback: function (result) {
-
 
654
            if (result == true) {
-
 
655
                analysisloadPartnerPriceCircular("main-content", fofoId);
-
 
656
            }
-
 
657
        }
-
 
658
    });
-
 
659
 
-
 
660
});
-
 
661
 
-
 
662
 
-
 
663
function analysisloadPartnerPriceCircular(domId, fofoId) {
-
 
664
 
-
 
665
    doGetAjaxRequestHandler(context + "/analysisPartnerPriceCircular?fofoId=" + fofoId,
-
 
666
        function (response) {
-
 
667
            $('#' + domId).html(response);
-
 
668
        });
-
 
669
}
-
 
670