HOME


sh-3ll 1.0
DIR:/proc/self/cwd/assets/backend/js/report/
Upload File :
Current File : //proc/self/cwd/assets/backend/js/report/retestReport.js
var baseURL=$('meta[name="base_url"]').attr('content');
var token_key=$('#token_key').val();

$('#date-report').click(function(){
    var date = $('#date').val();
    if((date=='')){
        swal({
            title: "Nothing is selected",
            type: "error",
            timer: 1500,
            showConfirmButton: false,
            customClass: 'swal-height'

        });

    }
    else {
        window.open('retestReport/dailyStatement?date=' + date + '');
    }
});
$('#date-details-report').click(function(){
    var date = $('#date').val();
    if((date=='')){
        swal({
            title: "Nothing is selected",
            type: "error",
            timer: 1500,
            showConfirmButton: false,
            customClass: 'swal-height'

        });
    }
    else {
        window.open('salesStatement/dailyDetailsStatement/'+ date+'');
    }

});
$('#date-range-report').click(function(){
    var start_date = $('#start_date').val();
    var end_date = $('#end_date').val();
    report_start_date = start_date.split('/');
    report_end_date = end_date.split('/');

    var new_start_date = new Date(report_start_date[2],report_start_date[1],report_start_date[0]);
    var new_end_date = new Date(report_end_date[2],report_end_date[1],report_end_date[0]);

    if(new_end_date<new_start_date){
        swal({
            title: "End date can't less than start date",
            type: "error",
            timer: 1500,
            showConfirmButton: false,
            customClass: 'swal-height'
        });
    }
    else if((start_date=='' || end_date=='')){
        swal({
            title: "Nothing is selected",
            type: "error",
            timer: 1500,
            showConfirmButton: false,
            customClass: 'swal-height'

        });

    }

    else {
        window.open('retestReport/dateRangeStatement?start_date=' + start_date + '&end_date=' + end_date + '');
    }
});
$('#date-range-details-report').click(function(){
    var start_date = $('#start_date').val();
    var end_date = $('#end_date').val();
    report_start_date = start_date.split('-');
    report_end_date = end_date.split('-');

    var new_start_date = new Date(report_start_date[2],report_start_date[1],report_start_date[0]);
    var new_end_date = new Date(report_end_date[2],report_end_date[1],report_end_date[0]);

    if(new_end_date<new_start_date){
        swal({
            title: "End date can't less than start date",
            type: "error",
            timer: 1500,
            showConfirmButton: false,
            customClass: 'swal-height'
        });
    }
    else if((start_date=='' || end_date=='')){
        swal({
            title: "Nothing is selected",
            type: "error",
            timer: 1500,
            showConfirmButton: false,
            customClass: 'swal-height'

        });

    }
    else {
        window.open('salesStatement/dateRangeDetailsStatement/'+ start_date+'&'+end_date+'');
    }

});
$('#month_year').click(function(){
    var month = $('#month').val();
    var year = $('#year').val();
    if((month=='' || year=='')){
        swal({
            title: "Nothing is selected",
            type: "error",
            timer: 1500,
            showConfirmButton: false,
            customClass: 'swal-height'

        });

    }
    else {
        window.open('retestReport/monthlyStatement?month=' + month+ '&year='+year+'');
    }
});
$('#month_year-details-report').click(function(){
    var month = $('#month').val();
    var year = $('#year').val();
    var month_year=month+'&'+year;
    if((month=='' || year=='')){
        swal({
            title: "Nothing is selected",
            type: "error",
            timer: 1500,
            showConfirmButton: false,
            customClass: 'swal-height'

        });

    }
    else {
        window.open('salesStatement/monthlyDetailsStatement/'+month_year+'');
    }

});
$('#year_report').click(function(){
    var year = $('#year_only').val();
    if((year=='')){
        swal({
            title: "Nothing is selected",
            type: "error",
            timer: 1500,
            showConfirmButton: false,
            customClass: 'swal-height'

        });

    }
    else {
        window.open('retestReport/yearlyStatement?year='+year+'');
    }
});
$('#year-details-report').click(function(){
    var year = $('#year_only').val();
    if((year=='')){
        swal({
            title: "Nothing is selected",
            type: "error",
            timer: 1500,
            showConfirmButton: false,
            customClass: 'swal-height'

        });

    }
    else {
        window.open('salesStatement/yearlyDetailsStatement/'+year+'');
    }
});