EVOLUTION-NINJA
Edit File: invoice_reports.php
<?php $this->load->view('includes/admin_header');?> <link rel="stylesheet" href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script type="text/javascript" src="<?php echo base_url('admin_assets/js/xlsx.full.min.js');?>"></script> <div class="main-content"> <div class="main-content-inner"> <div class="page-content"> <div class="row"> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="export_table" class="export_table"></table></div> <form id="invoice_reports"> <div class="col-xs-12"> <!-- PAGE CONTENT BEGINS --> <div class="row" style="background-color:#f8f8f8;padding-top: 10px;padding-bottom: 10px;"> <div class="col-sm-12 col-md-2"> <span style="font-size:25px;">Invoice Report</span> </div> <div class="col-sm-7"></div> </div> <div class="row"> <div class="col-sm-12 col-xs-12 col-md-4"> <label class="col-sm-4">From Date <span style="color:red">*</span></label> <div class="col-sm-8 yes_form"> <input type="text" name="from_date" id="sel1" class="form-control from_date" id="sel1" autocomplete="off" required > </div> </div> <div class="col-sm-12 col-xs-12 col-md-4"> <label class="col-sm-4">To Date<span style="color:red">*</span></label> <div class="col-sm-8 yes_form"> <input type="text" name="to_date" id="sel2" class="form-control to_date" id="sel2" autocomplete="off" required > </div> </div> <div class="col-sm-12 col-xs-12 col-md-4"> <label class="col-sm-4"> Select Invoice Type <span style="color:red"></span></label> <div class="col-sm-8 yes_form"> <select name="invoice_type" class="form-control"> <option value=""> Select</option> <option value=""> All</option> <option value="Normal"> Normal</option> <option value="Profomo"> Proforma</option> <option value="Cash"> Cash</option> </select> </div> </div> </div> <div class="row" style="background-color:#f8f8f8;padding-top: 10px;padding-bottom: 10px;"> <div class="col-sm-10"></div> <div class="col-sm-2"> <button type="submit" class="btn btn-sm submit">Submit</button> <button type="reset" class="btn btn-sm">Cancel</button> </div> </div> </div> </form> <!-- PAGE CONTENT ENDS --> <div class="toat_count"></div> </div> <div class="row search-page" id="search-page-1"> <div class="col-xs-12"> <div class="row"> <div id="addele_more"> <div id="jaytab3" style="margin-top:2%;"> <div class="grid_div"></div> <table id="list3"> </table> <div id="pager3"></div> <div id="dialogSelectRow3" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> </div><!-- /.col --> </div><!-- /.col --> </div><!-- /.col --> </div><!-- /.row --> </div><!-- /.page-content --> </div><!-- /.main-content --> <link rel="stylesheet" href="<?php echo base_url('admin_assets/css/datepicker3.css');?>" /> <link rel="stylesheet" href="<?php echo base_url('admin_assets/css/fullcalendar.min.css');?>" /> <script src="<?php echo base_url('admin_assets/event/assets/js/bootstrap-datepicker.js');?>"></script> <script src="<?php echo base_url('admin_assets/event/assets/js/fullcalendar.min.js');?>"></script> <script type="text/javascript"> $('#sel1').datepicker({ format: "dd-mm-yyyy", }).on('changeDate', function(ev){ $('#sel1').datepicker('hide'); }); $('#sel2').datepicker({ format: "dd-mm-yyyy", }).on('changeDate', function(ev){ $('#sel2').datepicker('hide'); }); </script> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('jqgrid/css/ui.jqgrid.css'); ?>" /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('jqgrid/css/ui.jqgrid-bootstrap.css'); ?>" /> <script type="text/ecmascript" src="<?php echo base_url('jqgrid/js/jquery.jqGrid.min.js'); ?>"></script> <!-- This is the localization file of the grid controlling messages, labels, etc. <!-- We support more than 40 localizations --> <script type="text/ecmascript" src="<?php echo base_url('jqgrid/js/i18n/grid.locale-en.js'); ?>"></script> <!-- A link to a jQuery UI ThemeRoller theme, more than 22 built-in and many more custom --> <!-- The link to the CSS that the grid needs --> <script type="text/javascript"> $('#invoice_reports').submit(function(e){ var from_date = $(".from_date").val(); var to_date = $(".to_date").val(); e.preventDefault(); $(".submit").attr('disabled', 'disabled'); $(".submit").text("Submitting..."); formdata = new FormData($(this)[0]); $.ajax({ type : 'post', url : '<?php echo site_url("generate-invoice-reports1")?>', data : formdata, contentType: false, processData: false, success:function(response){ response=jQuery.parseJSON(response); //console.log(response); if(response.result == 1) { $(".submit").text("Submit"); $(".submit").removeAttr('disabled'); $("#list3").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); jQuery("#list3").jqGrid({ url:"<?php echo site_url('generate-invoice-reports');?>", datatype: "json", colNames:['id','Invoice Name','Invoice Number','Address','Invoice Date','GSTN','Description','Invoice Type','SAC','Bill Amount','CGST%','CGST Amount','SGST%','SGST Amount','Total Amount'], colModel:[ {name:'id',index:'id', hidden:true,width:100,editable:false,}, {name:'name',index:'name', width:200, editable:false}, {name:'invoice_no',index:'invoice_no', width:150, editable:false}, {name:'address',index:'address', width:200, editable:false}, {name:'invoice_date', index:'invoice_date', width:100, formatter: 'date', formatoptions: { newformat: 'd-m-Y'}}, {name:'gstn',index:'gstn', width:160, editable:false}, {name:'description',index:'description',editable:false,editrules:{}, width:150,formatter: function (cellvalue, options, rowObject) { if(rowObject.description){ var description=jQuery.parseJSON(rowObject.description); var retVal = ''; $.each(description, function(key, val){ retVal +=val; }); return retVal; } else{ return ''; } }}, {name:'invoice_type',index:'invoice_type', width:160, editable:false}, {name:'sac',index:'sac',editable:false,editrules:{}, width:100,formatter: function (cellvalue, options, rowObject) { if(rowObject.sac){ var sac=jQuery.parseJSON(rowObject.sac); console.log(sac); var retVal = ''; $.each(sac, function(key, val){ retVal +=val; retVal +=' '; }); return retVal; } else{ return ''; } }}, {name:'price',index:'price',editable:true,editrules:{} , width:100,formatter: function (cellvalue, options, rowObject) { if(rowObject.price){var value=rowObject.price; var price=jQuery.parseJSON(rowObject.price); var retVal = ''; $.each(price, function(key, val){ var value=val.replace(/,/g , ''); x=value.toString(); var lastThree = x.substring(x.length-3); var otherNumbers = x.substring(0,x.length-3); if(otherNumbers != '') lastThree = ',' + lastThree; var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree; retVal +=res; retVal +=' '; }); return retVal; }}}, {name:'cgst',index:'cgst', width:60, editable:false}, {name:'cgst_amount',index:'cgst_amount',editable:true,editrules:{} , width:80,formatter: function (cellvalue, options, rowObject) { if(rowObject.cgst_amount){var value=rowObject.cgst_amount; var value=value.replace(/,/g , ''); x=value.toString(); var lastThree = x.substring(x.length-3); var otherNumbers = x.substring(0,x.length-3); if(otherNumbers != '') lastThree = ',' + lastThree; var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree; return res; } else{ var res = ''; return res; }}}, {name:'sgst',index:'sgst', width:60, editable:false}, {name:'sgst_amount',index:'sgst_amount',editable:true,editrules:{} , width:80,formatter: function (cellvalue, options, rowObject) { if(rowObject.sgst_amount){var value=rowObject.sgst_amount; var value=value.replace(/,/g , ''); x=value.toString(); var lastThree = x.substring(x.length-3); var otherNumbers = x.substring(0,x.length-3); if(otherNumbers != '') lastThree = ',' + lastThree; var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree; return res; } else{ var res = ''; return res; }}}, {name:'grand_total',index:'grand_total',editable:true,editrules:{} , width:80,formatter: function (cellvalue, options, rowObject) { if(rowObject.grand_total){var value=rowObject.grand_total; var value=value.replace(/,/g , ''); x=value.toString(); var lastThree = x.substring(x.length-3); var otherNumbers = x.substring(0,x.length-3); if(otherNumbers != '') lastThree = ',' + lastThree; var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree; return res; } else{ var res = ''; return res; }}}, ], rowNum:20, rowList:[20,50,100,200,300], rownumbers: true, pager: '#pager3', sortname:'id', viewrecords: true, loadonce:true, gridview: true, sortorder:"desc", caption:"Invoice Report", subGrid: true, subGridRowExpanded: function(subgrid_id, row_id) { var subgrid_table_id; //alert(row_id); id=row_id; //alert(id); subgrid_table_id = subgrid_id+"_t"; jQuery("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table>"); jQuery("#"+subgrid_table_id).jqGrid({ //alert(id); url:"<?php echo site_url('view-invoice-payment');?>/"+id, mtype : "get", datatype: "json", colNames:['SI','Name','Payment Type','Amount','Cheque No','Cheque Date','DD No','DD Date','UTR No','Online Date','Bank Name','Branch Name'], colModel:[ {name:'id',index:'id', width:50, hidden:true,editable:false,key:true}, {name:'name',index:'name', width:200, editable:false}, {name:'payment_type',index:'payment_type', width:150, editable:false}, {name:'paid_amount',index:'paid_amount', width:150, editable:false}, {name:'cheque_no',index:'cheque_no', width:140, editable:false}, {name:'cheque_date',index:'cheque_date', width:120, editable:false}, {name:'dd_no',index:'dd_no', width:140, editable:false}, {name:'dd_date',index:'dd_date', width:120, editable:false}, {name:'utr_no',index:'utr_no', width:140, editable:false}, {name:'online_date',index:'online_date', width:120,editable:false}, {name:'bank_name',index:'bank_name', width:200, editable:false}, {name:'branch_name',index:'branch_name', width:200, editable:false}, ], height: 'auto', rowNum:20, sortname: 'num', sortorder: "asc" }); } }); $("#list3").jqGrid("setLabel", "rn", "SL"); $("#list3").jqGrid('filterToolbar',{searchOperators : false,stringResult: true, searchOnEnter: false, defaultSearch: "cn"}); //for multisearch code,remove if not required $("#list3").jqGrid('navGrid','#pager3', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ).navButtonAdd('#pager3', { caption:"Export", buttonicon:"", onClickButton: export_page, position: "last", title:"", cursor: "pointer", id:"client_delete" } ); } else { $(".submit").text("Submit"); $(".submit").removeAttr('disabled'); $("#list3").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); jQuery("#list3").jqGrid({ url:"<?php echo site_url('generate-invoice-reports');?>", datatype: "json", colNames:['id','Invoice Name','Invoice Number','Address','Invoice Date','GSTN','Description','Sac','Bill Amount','CGST%','CGST Amount','SGST%','SGST Amount','Total Amount'], colModel:[ {name:'id',index:'id', hidden:true,width:100,editable:false,}, {name:'name',index:'name', width:200, editable:false}, {name:'invoice_no',index:'invoice_no', width:200, editable:false}, {name:'address',index:'address', width:200, editable:false}, {name:'invoice_date',index:'invoice_date', width:100, editable:false}, {name:'gstn',index:'gstn', width:200, editable:false}, {name:'description',index:'description',editable:false,editrules:{}, width:150,formatter: function (cellvalue, options, rowObject) { if(rowObject.description){ var description=jQuery.parseJSON(rowObject.description); console.log(description); var retVal = ''; $.each(description, function(key, val){ retVal +=val; }); return retVal; } else{ return ''; } }}, {name:'sac',index:'sac',editable:false,editrules:{}, width:150,formatter: function (cellvalue, options, rowObject) { if(rowObject.sac){ var sac=jQuery.parseJSON(rowObject.sac); console.log(sac); var retVal = ''; $.each(sac, function(key, val){ retVal +=val; }); return retVal; } else{ return ''; } }}, {name:'price',index:'price',editable:true,editrules:{} , width:100,formatter: function (cellvalue, options, rowObject) { if(rowObject.price){var value=rowObject.price; var price=jQuery.parseJSON(rowObject.price); console.log(price); var retVal = ''; $.each(price, function(key, val){ var value=val.replace(/,/g , ''); x=value.toString(); var lastThree = x.substring(x.length-3); var otherNumbers = x.substring(0,x.length-3); if(otherNumbers != '') lastThree = ',' + lastThree; var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree; retVal +=res; }); return retVal; }}}, {name:'cgst',index:'cgst', width:100, editable:false}, {name:'cgst_amount',index:'cgst_amount',editable:true,editrules:{} , width:100,formatter: function (cellvalue, options, rowObject) { if(rowObject.cgst_amount){var value=rowObject.cgst_amount; var value=value.replace(/,/g , ''); x=value.toString(); var lastThree = x.substring(x.length-3); var otherNumbers = x.substring(0,x.length-3); if(otherNumbers != '') lastThree = ',' + lastThree; var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree; return res; } else{ var res = ''; return res; }}}, {name:'sgst',index:'sgst', width:100, editable:false}, {name:'sgst_amount',index:'sgst_amount',editable:true,editrules:{} , width:100,formatter: function (cellvalue, options, rowObject) { if(rowObject.sgst_amount){var value=rowObject.sgst_amount; var value=value.replace(/,/g , ''); x=value.toString(); var lastThree = x.substring(x.length-3); var otherNumbers = x.substring(0,x.length-3); if(otherNumbers != '') lastThree = ',' + lastThree; var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree; return res; } else{ var res = ''; return res; }}}, {name:'total',index:'total',editable:true,editrules:{} , width:100,formatter: function (cellvalue, options, rowObject) { if(rowObject.total){var value=rowObject.total; var value=value.replace(/,/g , ''); x=value.toString(); var lastThree = x.substring(x.length-3); var otherNumbers = x.substring(0,x.length-3); if(otherNumbers != '') lastThree = ',' + lastThree; var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree; return res; } else{ var res = ''; return res; }}}, ], rowNum:20, rowList:[20,50,100,200,300], rownumbers: true, pager: '#pager3', sortname:'id', viewrecords: true, loadonce:true, gridview: true, sortorder:"desc", caption:"Invoice List", subGrid: true, subGridRowExpanded: function(subgrid_id, row_id) { var subgrid_table_id; //alert(row_id); id=row_id; //alert(id); subgrid_table_id = subgrid_id+"_t"; jQuery("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table>"); jQuery("#"+subgrid_table_id).jqGrid({ //alert(id); url:"<?php echo site_url('view-invoice-payment');?>/"+id, mtype : "get", datatype: "json", colNames:['SI','Name','Payment Type','Amount','Cheque No','Cheque Date','DD No','DD Date','UTR No','Online Date','Bank Name','Branch Name'], colModel:[ {name:'id',index:'id', width:50, hidden:true,editable:false,key:true}, {name:'name',index:'name', width:200, editable:false}, {name:'payment_type',index:'payment_type', width:150, editable:false}, {name:'paid_amount',index:'paid_amount', width:150, editable:false}, {name:'cheque_no',index:'cheque_no', width:140, editable:false}, {name:'cheque_date',index:'cheque_date', width:120, editable:false}, {name:'dd_no',index:'dd_no', width:140, editable:false}, {name:'dd_date',index:'dd_date', width:120, editable:false}, {name:'utr_no',index:'utr_no', width:140, editable:false}, {name:'online_date',index:'online_date', width:120,editable:false}, {name:'bank_name',index:'bank_name', width:200, editable:false}, {name:'branch_name',index:'branch_name', width:200, editable:false}, ], height: 'auto', rowNum:20, sortname: 'num', sortorder: "asc" }); } }); $("#list3").jqGrid("setLabel", "rn", "SL"); $("#list3").jqGrid('filterToolbar',{searchOperators : false,stringResult: true, searchOnEnter: false, defaultSearch: "cn"}); //for multisearch code,remove if not required $("#list3").jqGrid('navGrid','#pager3', {edit:false,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['cn', 'eq', 'ne', 'lt', 'gt', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); } } }); test(); }); function test(){ $('.toat_count').empty(); id = jQuery("#list3").jqGrid('getDataIDs'); var type= $('#type').val(); $.ajax({ type : 'post', url : "<?php echo site_url("yaskawa/get_invoice_report_details")?>", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); var cgst=0; var sgst=0; var tota=0; var total_collected=0; var total_pending=0; var sub_tota=0; var content=''; $.each(response,function(key,vas){ cgst+=parseInt(vas.cgst_amount); sgst+=parseInt(vas.sgst_amount); tota+=parseInt(vas.grand_total); var price=jQuery.parseJSON(vas.price); $.each(price,function(key,va){ if(va == NaN || va == 'NaN') { } else { sub_tota+=parseInt(va); } }); if(vas.invoice_status=='CLEARED'||vas.invoice_status=='PARTIAL'){ total_collected+=parseInt(vas.total_amount); } if(vas.invoice_status=='PENDING'){ total_pending+=parseInt(vas.total_amount); } }); content +='<p style="text-align:center;"><b>Sub Total Amount :</b>'; x=sub_tota.toString(); var lastThree = x.substring(x.length-3); var otherNumbers = x.substring(0,x.length-3); if(otherNumbers != '') lastThree = ',' + lastThree; var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree; content +=res; content +='<span style="padding:0px 20px;"><b>CGST Amount :</b>'; x=cgst.toString(); var lastThree = x.substring(x.length-3); var otherNumbers = x.substring(0,x.length-3); if(otherNumbers != '') lastThree = ',' + lastThree; var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree; content +=res+'</span>'; content +='<span style="padding:0px 20px;"><b>SGST Amount :</b>'; x=sgst.toString(); var lastThree = x.substring(x.length-3); var otherNumbers = x.substring(0,x.length-3); if(otherNumbers != '') lastThree = ',' + lastThree; var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree; content +=res+'</span>'; content +='<b>Total Amount :</b>'; x=tota.toString(); var lastThree = x.substring(x.length-3); var otherNumbers = x.substring(0,x.length-3); if(otherNumbers != '') lastThree = ',' + lastThree; var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree; content +=res+'</p>'; content +='<p style="text-align:center;"><b>Total Collected :</b>'; x=total_collected.toString(); var lastThree = x.substring(x.length-3); var otherNumbers = x.substring(0,x.length-3); if(otherNumbers != '') lastThree = ',' + lastThree; var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree; content +=res content +='<span style="padding:0px 10px;"><b>Total Pending :</b>'; x=total_pending.toString(); var lastThree = x.substring(x.length-3); var otherNumbers = x.substring(0,x.length-3); if(otherNumbers != '') lastThree = ',' + lastThree; var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree; content +=res+'</span></p>'; $('.toat_count').append(content); } }); } var cgst=0; var sgst=0; var tota=0; var sub_tota=0; function export_page() { id = jQuery("#list3").jqGrid('getDataIDs'); var type= $('#type').val(); $.ajax({ type : 'post', url : "<?php echo site_url("yaskawa/get_invoice_report_details")?>", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th> <th>Account Name</th> <th>Invoice Number</th> <th>Address</th> <th>Invoice Date</th> <th>GSTN</th><th>Description</th><th>SAC</th><th>Bill Amount</th><th>CGST</th><th>CGST Amount</th><th>SGST</th><th>SGST Amount</th><th>Total</th><th>Created By</th><th>Payment Type</th><th>Amount</th><th>Paid To</th><th>Cheque Number</th><th>Cheque Date</th><th>Bank</th><th>Branch</th><th>DD No</th><th>DD Date</th><th>UTR No</th><th>Online Date</th><th>Collected By</th><th>Added By</th></tr></thead>'; $.each(response,function(key,vas){ var desc=jQuery.parseJSON(vas.description); var sac=jQuery.parseJSON(vas.sac); var price=jQuery.parseJSON(vas.price); var peyment=vas.payments; var key=key+1; content +='<tr><td>'+key+'</td> <td>'+vas.name+'</td> <td>'+vas.invoice_no+'</td> <td>'+vas.address+'</td> <td>'+vas.invoice_date+'</td><td>'+vas.gstn+'</td>'; content +='<td>'; $.each(desc,function(key,val){ content +=val; }); content +='</td>'; content +='<td>'; $.each(sac,function(key,val){ content+=val; }); content +='</td>'; content +='<td>'; $.each(price,function(key,val){ content+=val; sub_tota+=val; }); content +='</td>'; content +='<td>'+vas.cgst+'</td> <td>'+vas.cgst_amount+'</td><td>'+vas.sgst+'</td><td>'+vas.sgst_amount+'</td><td>'+vas.grand_total+'</td><td>'+vas.created_by+'</td>'; cgst+=parseInt(vas.cgst_amount); sgst+=parseInt(vas.sgst_amount); tota+=parseInt(vas.grand_total); content+='<td>'; if(peyment!='null'){ $.each(peyment,function(key,va){ content+=va.payment_type content+='</br>'; }); }else{ content+=''; } content+='</td>'; content +='<td>'; if(peyment!='null'){ $.each(peyment,function(key,va){ content+=va.amount content+='</br>'; }); }else{ content+=''; } content +='</td>'; content +='<td>'; if(peyment!='null'){ $.each(peyment,function(key,va){ content+=va.favour_of content+='</br>'; }); }else{ content+=''; } content +='</td>'; content +='<td>'; if(peyment!='null'){ $.each(peyment,function(key,va){ content+=va.cheque_no content+='</br>'; }); }else{ content+=''; } content +='</td>'; content +='<td>'; if(peyment!='null'){ $.each(peyment,function(key,va){ content+=va.cheque_date content+='</br>'; }); }else{ content+=''; } content +='</td>'; content +='<td>'; if(peyment!='null'){ $.each(peyment,function(key,va){ content+=va.bank_name content+='</br>'; }); }else{ content+=''; } content +='</td>'; content +='<td>'; if(peyment!='null'){ $.each(peyment,function(key,va){ content+=va.branch_name content+='</br>'; }); }else{ content+=''; } content +='</td>'; content +='<td>'; if(peyment!='null'){ $.each(peyment,function(key,va){ content+=va.dd_no content+='</br>'; }); }else{ content+=''; } content +='</td>'; content +='<td>'; if(peyment!='null'){ $.each(peyment,function(key,va){ content+=va.dd_date content+='</br>'; }); }else{ content+=''; } content +='</td>'; content +='<td>'; if(peyment!='null'){ $.each(peyment,function(key,va){ content+=va.utr_no content+='</br>'; }); }else{ content+=''; } content +='</td>'; content +='<td>'; if(peyment!='null'){ $.each(peyment,function(key,va){ content+=va.online_date content+='</br>'; }); }else{ content+=''; } content +='</td>'; content +='<td>'; if(peyment!='null'){ $.each(peyment,function(key,va){ content+=va.collected_by content+='</br>'; }); }else{ content+=''; } content +='</td>'; content +='<td>'; if(peyment!='null'){ $.each(peyment,function(key,va){ content+=va.added_by content+='</br>'; }); }else{ content+=''; } content +='</td>'; content +='</tr>'; count++; }); content +='<tr>'; content +='<td></td>'; content +='<td></td>'; content +='<td></td>'; content +='<td></td>'; content +='<td></td>'; content +='<td></td>'; content +='<td></td>'; content +='<td></td>'; content +='<td>Total</td>'; x=sub_tota.toString(); var lastThree = x.substring(x.length-3); var otherNumbers = x.substring(0,x.length-3); if(otherNumbers != '') lastThree = ',' + lastThree; var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree; content +='<td>'+res+'</td>'; x=cgst.toString(); var lastThree = x.substring(x.length-3); var otherNumbers = x.substring(0,x.length-3); if(otherNumbers != '') lastThree = ',' + lastThree; var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree; content +='<td>'+res+'</td>'; content +='<td></td>'; x=sgst.toString(); var lastThree = x.substring(x.length-3); var otherNumbers = x.substring(0,x.length-3); if(otherNumbers != '') lastThree = ',' + lastThree; var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree; content +='<td>'+res+'</td>'; x=tota.toString(); var lastThree = x.substring(x.length-3); var otherNumbers = x.substring(0,x.length-3); if(otherNumbers != '') lastThree = ',' + lastThree; var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree; content +='<td>'+res+'</td>'; content +='</tr>'; $('.export_table').empty(); $('.export_table').append(content); // $('.toat_count').empty(); // $('.toat_count').append(content1); export_data(); } }); } // function export_data() { // $("#export_table").table2excel({ // exclude: ".noExl", // name: "Excel Document Name", // filename: "Invoice Report", // fileext: ".xlsx", // exclude_img: true, // exclude_links: true, // exclude_inputs: true // }); doit('xlsx'); } function doit(type, fn, dl) { var elt = document.getElementById('export_table'); var wb = XLSX.utils.table_to_book(elt, {sheet:"Sheet JS"}); return dl ? XLSX.write(wb, {bookType:type, bookSST:true, type: 'base64'}) : XLSX.writeFile(wb, fn || ('Invoice Report.' + (type || 'xlsx'))); } </script> <style type="text/css"> #treeview-searchable .node-disabled { display: none; } .hoverr:hover .addd { display:block; } .addd{ display:none; } .add_more { padding: 0px 7px !important; font-size: 12px !important; } #block{display:none;padding-left:10px;} .pd-7{ padding-right:7px !important; padding-left:7px !important; } .pd-9{ padding:2px 9px !important; } #jaytab3 { width: 100% !important; overflow-x: scroll; } .ui-jqdialog .ui-jqdialog-titlebar { height: 29px !important; background-color: #001a00; color: white; padding-left: 10px; } .fm-button { height: 21px !important; padding: 1px; margin-right: 10px !important; height: 21px !important; width: 50%; margin-top: -7px !important; } .ui-jqdialog-content td.navButton { padding-top: 12px !important; } .ui-jqgrid .ui-jqgrid-titlebar { height: 7px !important; background:steelblue !important; color:white !important; } .ui-jqgrid-bdiv { height: auto !important; } .ui-widget-overlay { z-index:0 !important; } .ui-widget-header { background: #1e7ad7 !important; } .ui-jqgrid-hdiv ui-state-default { //width: 873px !important; cursor: default!important } ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight { border: 1px solid #fed22f; background: #ffe45c; } .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { font-weight: bold; color: black; } .ui-jqgrid { //width: 988px !important; overflow-x: scroll !important; } @media only screen and (min-width:641px) and (max-width:991px){ .ui-jqgrid{ text-indent: 0; color: #307ECC; float: none; right: 2px; } #jaytab3{ margin-top: 0 !important; margin-left: 0 !important; //overflow-x: hidden; width: 100% !important; padding-left:0 !important; padding-right:9px !important; } } @media only screen and (min-width:320px) and (max-width:641px){ .ui-jqgrid{ } .yes_form input{ width:100% !important; border:none !important; border-bottom:1px solid gray !important; margin-bottom:5%; } .yes_form select{ width:100% !important; border:none !important; border-bottom:1px solid gray !important; margin-bottom:5%; } .yes_form textarea{ width:100% !important; border:none !important; border-bottom:1px solid gray !important; margin-bottom:5%; } </style> <?php $this->load->view('includes/admin_footer');?>