/
home
/
sjslayjy
/
public_html
/
mosaram
/
resources
/
views
/
dashboard
/
invoice
/
Upload File
HOME
@extends('dashboard.layouts.app') @section('title','Company Invoice Ledger') @section('style') {{Html::style("assets/css/bootstrap-datepicker3.min.css")}} @endsection @section('content') <div class="main-content"> <div class="main-content-inner"> <div class="breadcrumbs ace-save-state" id="breadcrumbs"> <ul class="breadcrumb"> <li> <i class="ace-icon fa fa-home home-icon"></i> <a href="#">{{__('messages.Home')}}</a> </li> <li class="active"> Company Invoice Ledger</li> </ul> </div> <div class="page-content"> @if (session('success')) <div class="alert alert-success"> {{ session('success') }} </div> @endif @if (session('error')) <div class="alert alert-danger"> {{ session('error') }} </div> @endif <div class="row"> <div class="col-xs-12"> <h3 class="header smaller lighter blue"> Company Invoice Ledger</h3> <form action="" method="POST" role="form" id="FilterForm"> <div class="row"> {{csrf_field()}} <div class="col-md-2"> <div class="form-group"> <label for="transfer_type">Transfer Type</label> <select class="form-control select2" name="transfer_type" id="transfer_type" onchange="handleTranferType(this.value)"> <option value="1">Company To Dealer</option> <option value="2">Dealer To Dealer</option> </select> @if($errors->has('transfer_type')) <span class="label label-danger">{{ $errors->first('transfer_type') }}</span> @endif </div> </div> <div class="col-md-3" id="from_dealer_div" style="display: none;"> <div class="form-group"> <label for="from_dealer">From Dealer</label> <select class="form-control select2" name="from_dealer" id="from_dealer"> @foreach($dealers as $dealer) <option value="{{$dealer->id}}" >{{$dealer->name}} ({{$dealer->address1}})</option> @endforeach() </select> <span class="label label-danger" id="add_from_dealer_error" style="display: none;"></span> </div> </div> <div class="col-md-3" id="from_company_div"> <div class="form-group"> <label for="product_company_id"> Poduct Company</label> <select class="form-control select2" name="product_company_id" id="product_company_id"> <option value=""> Select Poduct Company</option> @foreach($product_companies as $product_company) <option value="{{$product_company['id']}}" {{isset($product_company_id) && $product_company_id==$product_company['id'] ? "selected":""}}>{{$product_company['name']}}</option> @endforeach() </select> @if ($errors->has('product_company_id')) <span class="label label-danger">{{ $errors->first('product_company_id') }}</span> @endif </div> </div> <div class="col-md-3"> <div class="form-group"> <label for="dealer_id"> Dealer</label> <select class="form-control select2" name="mydealer_id" id="mydealer_id" > <option value=""> Select Dealer</option> @foreach($mydealers as $mydealer) <option value="{{$mydealer->id}}" {{ isset($mydealer_id) && $mydealer_id==$mydealer->id ? "selected":""}}>{{$mydealer->name}} ( {{$mydealer->address1}} )</option> @endforeach </select> @if($errors->has('mydealer_id')) <span class="label label-danger">{{ $errors->first('mydealer_id') }}</span> @endif </div> </div> <div class="col-md-2"> <div class="form-group"> <label for="date">From Date</label> <input type="text" class="form-control date-picker" name="from_date" id="" placeholder="Date" readonly="readonly" value="{{isset($from_date) ? $from_date : ""}}"> @if ($errors->has('from_date')) <span class="label label-danger">{{ $errors->first('from_date') }}</span> @endif </div> </div> <div class="col-md-2"> <div class="form-group"> <label for="date">To Date</label> <input type="text" class="form-control date-picker" name="to_date" id="" placeholder="Date" readonly="readonly" value="{{isset($to_date) ? $to_date : ""}}"> @if ($errors->has('to_date')) <span class="label label-danger">{{ $errors->first('to_date') }}</span> @endif </div> </div> <div class="col-md-1"> <div class="form-group"> <button type="submit" class="btn btn-primary">Submit</button> </div> </div> </form> </div> </div> <div class="clearfix"> <div class="pull-right tableTools-container"> </div> </div> <div class="table-header"> Company Invoice Ledger <div class="widget-toolbar no-border"> <a class="btn btn-xs bigger btn-success" data-toggle="modal" href="#addTransaction1"> Opening Balance <i class="ace-icon fa fa-eye icon-on-right"></i> </a> <a class="btn btn-xs bigger btn-warning" data-toggle="modal" href="#addPayment2"> Add Payment <i class="ace-icon fa fa-eye icon-on-right"></i> </a> <!-- <a class="btn btn-xs bigger btn-warning" data-toggle="modal" href="#advancedPayment3"> Advanced Payment <i class="ace-icon fa fa-eye icon-on-right"></i> </a> --> </div> </div> <div class="table-responsive"> <div class="dataTables_borderWrap"> <table id="dynamic-table" class="table table-striped table-bordered table-hover"> <thead> <tr> <th>Date</th> <th>Product Company</th> <th>Dealer</th> <th>Particular</th> <th>Debit</th> <th>Credit</th> </tr> </thead> <tbody> @if(isset($ledgers)) @php $total_debit = 0; $total_credit = 0; $closing_balance = 0; @endphp @foreach($ledgers as $ledger) <tr> <td>{{date('d/m/Y',strtotime($ledger->created_at))}}</td> <td>@if($ledger->product_company_id) {{getModelById('ProductCompany',$ledger->product_company_id)->name}} @else {{getModelById('ProductCompany',$ledger->product_brand_id)->name}} @endif </td> <td>{{getModelById('Dealer',$ledger->dealer_id)->name}} ({{getModelById('Dealer',$ledger->dealer_id)->address1}})</td> <td>{{$ledger->particular}}</td> <td>{{$ledger->debit}} @if($ledger->debit > 0) @php $total_debit = $total_debit + $ledger->debit; @endphp @endif </td> <td>{{$ledger->credit}} @if($ledger->credit > 0) @php $total_credit = $total_credit + $ledger->credit; @endphp @endif </td> </tr> @endforeach <tr> <td></td> <td></td> <td></td> <td><b>Opening Balance</b></td> <td>@if($opening_balance < 0) {{abs($opening_balance)}} @endif</td> <td>@if($opening_balance > 0) {{abs($opening_balance)}} @endif </td> </tr> <tr> <td></td> <td></td> <td></td> <td><b>Total</b></td> <td>@if($opening_balance > 0) {{ $total_debit = $total_debit+abs($opening_balance) }} @else {{$total_debit}} @endif</td> <td>@if($opening_balance < 0 ) {{ $total_credit = $total_credit + abs($opening_balance) }} @else {{$total_credit}} @endif</td> </tr> <tr> <td></td> <td></td> <td></td> <td ><b>Closing Balance</b></td> @php $closing_balance = $total_debit - $total_credit ; @endphp <td>@if($closing_balance > 0) {{abs($closing_balance)}} @endif </td> <td>@if($closing_balance < 0) {{abs($closing_balance)}} @endif</td> </tr> <tr> <td></td> <td></td> <td></td> <td ><b>Remaining Advance Balance</b></td> <td>@if(isset($advanced_payment)){{$advanced_payment}} @else {{$advanced_payment }} @endif </td> </tr> @endif </tbody> </table> </div> </div> </div> <!-- /.page-content --> </div> </div><!-- /.main-content --> <div class="modal fade" id="addTransaction1"> <div class="modal-dialog modal-md"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">Opening Balance</h4> </div> <div class="modal-body"> <form action="{{URL('/user/add-company-opening-amount')}}" role="form" id="recivePayment" method="POST"> @csrf <div class="row"> <div class="col-md-12"> <div class="form-group"> <label for="transfer_type">Transfer Type</label> <select class="form-control select2" name="transfer_type" id="transfer_type1" onchange="handleTranferType1(this.value)"> <option value="1">Company To Dealer</option> <option value="2">Dealer To Dealer</option> </select> @if($errors->has('transfer_type')) <span class="label label-danger">{{ $errors->first('transfer_type') }}</span> @endif </div> </div> <div class="col-md-6" id="from_dealer_div1" style="display: none;"> <div class="form-group"> <label for="from_dealer">From Dealer</label> <select class="form-control select2" name="from_dealer" id="from_dealer1"> @foreach($dealers as $dealer) <option value="{{$dealer->id}}" >{{$dealer->name}} ({{$dealer->address1}})</option> @endforeach() </select> <span class="label label-danger" id="add_from_dealer_error1" style="display: none;"></span> </div> </div> <div class="col-md-6" id="from_company_div1"> <div class="form-group"> <label for="product_company_id"> Poduct Company</label> <select class="form-control select2" name="product_company_id" id="product_company_id1"> <option value=""> Select Poduct Company</option> @foreach($product_companies as $product_company) <option value="{{$product_company['id']}}" {{isset($product_company_id) && $product_company_id==$product_company['id'] ? "selected":""}}>{{$product_company['name']}}</option> @endforeach() </select> @if ($errors->has('product_company_id')) <span class="label label-danger">{{ $errors->first('product_company_id') }}</span> @endif </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="dealer_id"> Dealer</label> <select class="form-control select2" name="mydealer_id" id="mydealer_id1" > <option value=""> Select Dealer</option> @foreach($mydealers as $mydealer) <option value="{{$mydealer->id}}" {{ isset($mydealer_id) && $mydealer_id==$mydealer->id ? "selected":""}}>{{$mydealer->name}} ( {{$mydealer->address1}} )</option> @endforeach </select> @if($errors->has('mydealer_id')) <span class="label label-danger">{{ $errors->first('mydealer_id') }}</span> @endif </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="amount">Opening Balance</label> <input type="text" class="form-control" name="opening_amount" onkeypress="return onlyCurrency(event)" id="opening_amount1" placeholder="Opening Balance"> <span class="label label-danger" id="add_amount_error1" style="display: none;"></span> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="retailer_id"> Type</label> <select class="form-control select2" name="type" id="type1"> <option value=""> Select Mode</option> <option value="credit">Credit</option> <option value="debit">Debit</option> </select> <span class="label label-danger" style="display:none"></span> </div> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="submit" id="addBankBtn1" class="btn btn-primary">Submit</button> </div> </form> </div> </div> </div> </div> <div class="modal fade" id="addPayment2"> <div class="modal-dialog modal-md"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">Add Amount1</h4> </div> <div class="modal-body"> <form action="{{URL('/user/add-company-payment')}}" role="form" id="addPayment" method="POST"> {{csrf_field()}} <div class="row"> <div class="col-md-8"> <div class="form-group"> <label for="transfer_type">Transfer Type</label> <select class="form-control select2" name="transfer_type" id="transfer_type2" onchange="handleTranferType2(this.value)"> <option value="1">Company To Dealer</option> <option value="2">Dealer To Dealer</option> </select> @if($errors->has('transfer_type')) <span class="label label-danger">{{ $errors->first('transfer_type') }}</span> @endif </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="transfer_type">Journal Entry</label> <input type="checkbox" name='general_entry' class='generalEntry' onchange="generalEntry()"> </div> </div> <div class="col-md-6" id="from_dealer_div2" style="display: none;"> <div class="form-group"> <label for="from_dealer">From Dealer</label> <select class="form-control select2" name="from_dealer" id="from_dealer2"> @foreach($dealers as $dealer) <option value="{{$dealer->id}}" >{{$dealer->name}} ({{$dealer->address1}})</option> @endforeach() </select> <span class="label label-danger" id="add_from_dealer_error2" style="display: none;"></span> </div> </div> <div class="col-md-6" id="from_company_div2"> <div class="form-group"> <label for="product_company_id"> Poduct Company</label> <select class="form-control select2" name="product_company_id" id="product_company_id2"> <option value=""> Select Poduct Company</option> @foreach($product_companies as $product_company) <option value="{{$product_company['id']}}" {{isset($product_company_id) && $product_company_id==$product_company['id'] ? "selected":""}}>{{$product_company['name']}}</option> @endforeach() </select> @if ($errors->has('product_company_id')) <span class="label label-danger">{{ $errors->first('product_company_id') }}</span> @endif </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="dealer_id1"> Dealer</label> <select class="form-control select2" name="mydealer_id" id="mydealer_id2" > <option value=""> Select Dealer</option> @foreach($mydealers as $mydealer) <option value="{{$mydealer->id}}" {{ isset($mydealer_id) && $mydealer_id==$mydealer->id ? "selected":""}}>{{$mydealer->name}} ( {{$mydealer->address1}} )</option> @endforeach </select> @if($errors->has('mydealer_id')) <span class="label label-danger">{{ $errors->first('mydealer_id') }}</span> @endif </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="">Payment Date</label> <input type="text" class="form-control checkIfValid date-picker" name="payment_date" id="payment_date2" placeholder="Payment Date" required="required" readonly> <span class="label label-danger" style="display: none;"></span> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="amount">Amount</label> <input type="text" class="form-control" name="amount" onkeypress="return onlyCurrency(event)" id="amount2" placeholder="Amount"> <span class="label label-danger" id="add_amount_error2" style="display: none;"></span> </div> </div> </div> <div class="col-md-6 generalEntryHide"> <div class="form-group"> <label for="retailer_id">Bank</label> <select class="form-control select2" name="bank_id" id="bank_id2"> <option value=""> Select Bank</option> @foreach($bank_accounts as $bank_account) <option value="{{$bank_account->id}}">{{$bank_account->bank->name}} - {{$bank_account->account_number}}</option> @endforeach </select> <span class="label label-danger" style="display:none"></span> </div> </div> <div class="col-md-6 generalEntryHide"> <div class="form-group "> <label for="retailer_id">Mode</label> <select class="form-control select2" name="payment_mode" id="payment_mode2"> <option value=""> Select Mode</option> <option value="Cash">Cash</option> <option value="NEFT">NEFT</option> <option value="Cheque">CHEQUE</option> <option value="RTGS">RTGS</option> </select> <span class="label label-danger" style="display:none"></span> </div> </div> <div class="col-md-4 "> <div class="form-group"> <label for="retailer_id">Type</label> <select class="form-control select2" name="type1" id="type2"> <option value=""> Select Type</option> <option value="credit">Credit</option> <option value="debit">Debit</option> </select> <span class="label label-danger" style="display:none"></span> </div> </div> <div class="col-md-8"> <div class="form-group"> <label for="particular">Particular</label> <input type="text" class="form-control" name="particular" id="particular2" placeholder="particular"> <span class="label label-danger" id="add_particular_error1" style="display: none;"></span> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="submit" class="btn btn-primary">Submit</button> </div> </form> </div> </div> </div> </div> <!-- <div class="modal fade" id="addPayment2"> <div class="modal-dialog modal-md"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">Add Amount</h4> </div> <div class="modal-body"> <form action="{{URL('/user/add-company-payment')}}" role="form" id="addPayment" method="POST"> {{csrf_field()}} <div class="row"> <div class="col-md-12"> <div class="form-group"> <label for="transfer_type">Transfer Type</label> <select class="form-control select2" name="transfer_type" id="transfer_type2" onchange="handleTranferType2(this.value)"> <option value="1">Company To Dealer</option> <option value="2">Dealer To Dealer</option> </select> @if($errors->has('transfer_type')) <span class="label label-danger">{{ $errors->first('transfer_type') }}</span> @endif </div> </div> <div class="col-md-6" id="from_dealer_div2" style="display: none;"> <div class="form-group"> <label for="from_dealer">From Dealer</label> <select class="form-control select2" name="from_dealer" id="from_dealer2"> @foreach($dealers as $dealer) <option value="{{$dealer->id}}" >{{$dealer->name}} ({{$dealer->address1}})</option> @endforeach() </select> <span class="label label-danger" id="add_from_dealer_error2" style="display: none;"></span> </div> </div> <div class="col-md-6" id="from_company_div2"> <div class="form-group"> <label for="product_company_id"> Poduct Company</label> <select class="form-control select2" name="product_company_id" id="product_company_id2"> <option value=""> Select Poduct Company</option> @foreach($product_companies as $product_company) <option value="{{$product_company['id']}}" {{isset($product_company_id) && $product_company_id==$product_company['id'] ? "selected":""}}>{{$product_company['name']}}</option> @endforeach() </select> @if ($errors->has('product_company_id')) <span class="label label-danger">{{ $errors->first('product_company_id') }}</span> @endif </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="dealer_id1"> Dealer</label> <select class="form-control select2" name="mydealer_id" id="mydealer_id2" > <option value=""> Select Dealer</option> @foreach($mydealers as $mydealer) <option value="{{$mydealer->id}}" {{ isset($mydealer_id) && $mydealer_id==$mydealer->id ? "selected":""}}>{{$mydealer->name}} ( {{$mydealer->address1}} )</option> @endforeach </select> @if($errors->has('mydealer_id')) <span class="label label-danger">{{ $errors->first('mydealer_id') }}</span> @endif </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="">Payment Date</label> <input type="text" class="form-control checkIfValid date-picker" name="payment_date" id="payment_date2" placeholder="Payment Date" required="required" readonly> <span class="label label-danger" style="display: none;"></span> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="amount">Amount</label> <input type="text" class="form-control" name="amount" onkeypress="return onlyCurrency(event)" id="amount2" placeholder="Amount"> <span class="label label-danger" id="add_amount_error2" style="display: none;"></span> </div> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="retailer_id">Bank</label> <select class="form-control select2" name="bank_id" id="bank_id2"> <option value=""> Select Bank</option> @foreach($bank_accounts as $bank_account) <option value="{{$bank_account->id}}">{{$bank_account->bank->name}} - {{$bank_account->account_number}}</option> @endforeach </select> <span class="label label-danger" style="display:none"></span> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="retailer_id">Mode</label> <select class="form-control select2" name="payment_mode" id="payment_mode2"> <option value=""> Select Mode</option> <option value="Cash">Cash</option> <option value="NEFT">NEFT</option> <option value="Cheque">CHEQUE</option> <option value="RTGS">RTGS</option> </select> <span class="label label-danger" style="display:none"></span> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="retailer_id">Type</label> <select class="form-control select2" name="type1" id="type2"> <option value=""> Select Type</option> <option value="credit">Credit</option> <option value="debit">Debit</option> </select> <span class="label label-danger" style="display:none"></span> </div> </div> <div class="col-md-12"> <div class="form-group"> <label for="particular">Particular</label> <input type="text" class="form-control" name="particular" id="particular2" placeholder="particular"> <span class="label label-danger" id="add_particular_error1" style="display: none;"></span> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="submit" class="btn btn-primary">Submit</button> </div> </form> </div> </div> </div> </div> --> @section('script') {{ Html::script("assets/js/jquery.dataTables.min.js")}} {{ Html::script("assets/js/jquery.dataTables.bootstrap.min.js")}} {{ Html::script("assets/js/dataTables.buttons.min.js")}} {{ Html::script("assets/js/buttons.flash.min.js")}} {{ Html::script("assets/js/buttons.html5.min.js")}} {{ Html::script("assets/js/buttons.print.min.js")}} {{ Html::script("assets/js/buttons.colVis.min.js")}} {{ Html::script("assets/js/dataTables.select.min.js")}} {{ Html::script("assets/js/ace-elements.min.js")}} {{ Html::script("assets/js/ace.min.js")}} {{ Html::script("assets/js/bootstrap-datepicker.min.js")}} <script type="text/javascript"> function handleTranferType(type) { if(type == 1){ $('#from_dealer_div').hide(); $('#from_company_div').show(); }else{ $('#from_dealer_div').show(); $('#from_company_div').hide(); } } function handleTranferType1(type) { if(type == 1){ $('#from_dealer_div1').hide(); $('#from_company_div1').show(); }else{ $('#from_dealer_div1').show(); $('#from_company_div1').hide(); } } function handleTranferType2(type) { if(type == 1){ $('#from_dealer_div2').hide(); $('#from_company_div2').show(); }else{ $('#from_dealer_div2').show(); $('#from_company_div2').hide(); } } function handleTranferType3(type) { if(type == 1){ $('#from_dealer_div3').hide(); $('#from_company_div3').show(); }else{ $('#from_dealer_div3').show(); $('#from_company_div3').hide(); } } jQuery(function($) { $('#recivePayment').submit(function(){ $.ajax({ url: $(this).attr('action'), method: 'POST', data: $(this).serialize(), dataType:'json', success: function(data){ console.log(data); if(data.success == true){ swal('Success',data.msg,'success'); } if(data.success==false){ swal('Error',data.msg,'error'); } } , error:function(error){ console.log(data); } }); return false; }); $('.date-picker').datepicker({ format:'dd/mm/yyyy', autoclose: true, todayHighlight: true }) .next().on(ace.click_event, function(){ $(this).prev().focus(); }); $('.input-daterange').datepicker({ format:'yyyy-mm-dd', autoclose:true }); var myTable = $('#dynamic-table').DataTable( { bAutoWidth: false, "aaSorting": [], "bProcessing": true, "bProcessing": true, "sAutoWidth": false, "bDestroy":true, "sPaginationType": "bootstrap", // full_numbers "iDisplayStart ": 10, "iDisplayLength": 10, "bPaginate": false, "bPaginate": false, "bPaginate": false, //hide pagination "bFilter": false, //hide Search bar "bInfo": false, // hide showing entries } ); $.fn.dataTable.Buttons.defaults.dom.container.className = 'dt-buttons btn-overlap btn-group btn-overlap'; new $.fn.dataTable.Buttons( myTable, { buttons: [ { "extend": "colvis", "text": "<i class='fa fa-search bigger-110 blue'></i> <span class='hidden'>Show/hide columns</span>", "className": "btn btn-white btn-primary btn-bold", columns: ':not(:first):not(:last)' }, { "extend": "copy", "text": "<i class='fa fa-copy bigger-110 pink'></i> <span class='hidden'>Copy to clipboard</span>", "className": "btn btn-white btn-primary btn-bold" }, { "extend": "csv", "text": "<i class='fa fa-database bigger-110 orange'></i> <span class='hidden'>Export to CSV</span>", "className": "btn btn-white btn-primary btn-bold" }, { "extend": "excel", "text": "<i class='fa fa-file-excel-o bigger-110 green'></i> <span class='hidden'>Export to Excel</span>", "className": "btn btn-white btn-primary btn-bold" }, { "extend": "pdfHtml5", "text": "<i class='fa fa-file-pdf-o bigger-110 red'></i> <span class='hidden'>Export to PDF</span>", "className": "btn btn-white btn-primary btn-bold", title:'Party Invoice Ledger', download: 'open' }, { "extend": "print", "text": "<i class='fa fa-print bigger-110 grey'></i> <span class='hidden'>Print</span>", "className": "btn btn-white btn-primary btn-bold", autoPrint: false, message: 'This print was produced using the Print button for DataTables' } ] } ); myTable.buttons().container().appendTo( $('.tableTools-container') ); //style the message box var defaultCopyAction = myTable.button(1).action(); myTable.button(1).action(function (e, dt, button, config) { defaultCopyAction(e, dt, button, config); $('.dt-button-info').addClass('gritter-item-wrapper gritter-info gritter-center white'); }); var defaultColvisAction = myTable.button(0).action(); myTable.button(0).action(function (e, dt, button, config) { defaultColvisAction(e, dt, button, config); if($('.dt-button-collection > .dropdown-menu').length == 0) { $('.dt-button-collection') .wrapInner('<ul class="dropdown-menu dropdown-light dropdown-caret dropdown-caret" />') .find('a').attr('href', '#').wrap("<li />") } $('.dt-button-collection').appendTo('.tableTools-container .dt-buttons') }); }) $('#addPayment').submit(function(){ $.ajax({ url: $(this).attr('action'), method: 'POST', data: $(this).serialize(), dataType:'json', success: function(data){ console.log(data); if(data.success == true){ $('#addPayment2').modal('toggle'); swal('Success',data.msg,'success'); } if(data.success==false){ swal('Error',data.msg,'error'); } } , error:function(error){ console.log(error); } }); return false; }); </script> <script type="text/javascript"> function generalEntry() { if($('.generalEntry').is(":checked")) $(".generalEntryHide").hide(); else $(".generalEntryHide").show(); } function filter(){ $('#invoice_id').val(''); $('#FilterForm').submit(); } </script> @endsection @endsection