Subversion Repositories SmartDukaan

Rev

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

Rev 34046 Rev 34236
Line 771... Line 771...
771
	doGetAjaxRequestHandler(context + url, function(response) {
771
	doGetAjaxRequestHandler(context + url, function(response) {
772
		console.log('response json',response)
772
		console.log('response json',response)
773
		$('#' + 'reportico-content').html(response);
773
		$('#' + 'reportico-content').html(response);
774
		$reportModal = $('#reportico-modal').modal('show');
774
		$reportModal = $('#reportico-modal').modal('show');
775
	});
775
	});
776
});
-
 
777
776
});
-
 
777
 
-
 
778
$(document).on('click', ".credit-note", function () {
-
 
779
    doGetAjaxRequestHandler(context + "/report/credit-note",
-
 
780
        function (response) {
-
 
781
            $('#' + 'main-content').html(response);
-
 
782
        });
-
 
783
});
-
 
784
 
-
 
785
$(document).on('click', '.credit-not-list', function () {
-
 
786
    var selectedDate = $('input[name="creditNotePeriod"]').val(); // Get the selected year-month
-
 
787
 
-
 
788
    if (!selectedDate) {
-
 
789
        alert("Month-Year selection cannot be empty!");
-
 
790
        return;
-
 
791
    }
-
 
792
 
-
 
793
 
-
 
794
    if (typeof partnerId != "undefined") {
-
 
795
        doGetAjaxRequestHandler(context + "credit/credit-note-report?yearMonth=" + selectedDate + "&fofoId=" + partnerId,
-
 
796
            function (response) {
-
 
797
                $('.credit-note-conatiner').html(response);
-
 
798
                $('#creditNoteList').DataTable({
-
 
799
                    "scrollX": true,
-
 
800
                    "bPaginate": true,
-
 
801
                    "bLengthChange": true,
-
 
802
                    "bFilter": true,
-
 
803
                    "bInfo": false,
-
 
804
                    "bAutoWidth": false
-
 
805
                });
-
 
806
            });
-
 
807
    } else {
-
 
808
        doGetAjaxRequestHandler(context + "credit/credit-note-report?yearMonth=" + selectedDate + "&fofoId=0",
-
 
809
            function (response) {
-
 
810
                $('.credit-note-conatiner').html(response);
-
 
811
                $('#creditNoteList').DataTable({
-
 
812
                    "scrollX": true,
-
 
813
                    "bPaginate": true,
-
 
814
                    "bLengthChange": true,
-
 
815
                    "bFilter": true,
-
 
816
                    "bInfo": false,
-
 
817
                    "bAutoWidth": false
-
 
818
                });
-
 
819
            });
-
 
820
    }
-
 
821
 
-
 
822
});
-
 
823
 
-
 
824
$(document).on('click', '.download-credit-note', function () {
-
 
825
    var cnNumber = $(this).data("creditnumber");
-
 
826
 
-
 
827
    if (!cnNumber) {
-
 
828
        alert("CN-Number cannot be empty!");
-
 
829
        return;
-
 
830
    }
-
 
831
 
-
 
832
    let endPoint = `${context}/credit-note/download?cnNumber=${cnNumber}`;
-
 
833
 
-
 
834
    window.location.href = endPoint; // Redirect to the download URL
-
 
835
});
-
 
836
 
-
 
837
 
-
 
838