/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* global alertify */ $(function () { $('#Details').hide(); $('#Header').hide(); $("#frmdt").datepicker({ dateFormat: 'dd/mm/yy', changeMonth: true, changeYear: true }); $("#todt").datepicker({ dateFormat: 'dd/mm/yy', changeMonth: true, changeYear: true }); }); $(function () { $("#From").datepicker({ dateFormat: 'dd/mm/yy', changeMonth: true, yearRange: new Date().getFullYear().toString() + ':' + new Date().getFullYear().toString(), onClose: function (selectedDate) { $("#To").datepicker("option", "minDate", selectedDate); } }); $("#To").datepicker({ dateFormat: 'dd/mm/yy', changeMonth: true, yearRange: new Date().getFullYear().toString() + ':' + new Date().getFullYear().toString(), onClose: function (selectedDate) { $("#From").datepicker("option", "maxDate", selectedDate); } }); }); function searchByGstin() { $(document).ajaxStart($.blockUI).ajaxStop($.unblockUI); var gstin = $('#gstin').val(); var frmdt = $('#frmdt').val(); var todt = $('#todt').val(); if (gstin === "" && gstin === null) { alertify.alert("Please enter GSTIN !"); } else { $.ajax({ url: "getdataByGstin?gstin=" + gstin + "&frmdt=" + frmdt + "&todt=" + todt, type: "POST", success: function (response) { // if (response.count > 0) { $('#din_no').val(""); $('#Header').show(); $('#HeaderVal').html("Showing Document Identification Number by GSTIN Search"); $('#Details').html(response); // $('#detailsTable').DataTable({ // lengthMenu: [ // [10, 25, 50, -1], // ['10 rows', '25 rows', '50 rows', '75 rows'] // ], // "language": [{"search": "Filter records:"}], // dom: 'Blfrtip', // buttons: [ // { // extend: 'excelHtml5', // title: 'Excel', // text: 'Export to excel' // // } // // ] // }); $('#Details').show(); // } else { // alertify.alert("No such record found !"); // } }, error: function (jqXHR, exception) { console.log(exception); } }); } } function searchDin() { //alert("ok"); // $(document).ajaxStart($.blockUI).ajaxStop($.unblockUI); var din = $('#din_no').val(); if (din === "" || din === null) { alertify.alert("Please enter DIN !"); } else { $.ajax({ url: "getdataByDin.htm?din="+din, type: "GET", success: function (response) { // $('#gstin').val(""); $('#frmdt').val(""); $('#todt').val(""); $('#Header').show(); $('#HeaderVal').html("Showing DIN Status"); $('#Details').html(response); $('#detailsTable').DataTable({ lengthMenu: [ [10, 25, 50, -1], ['10 rows', '25 rows', '50 rows', '75 rows'] ], "language": [{"search": "Filter records:"}], dom: 'Blfrtip', buttons: [ { extend: 'excelHtml5', title: 'Excel', text: 'Export to excel' } ] }); $('#Details').show(); // } else { // alertify.alert("No such record found !"); // } }, error: function (jqXHR, exception) { console.log(exception); } }); } }