<?php $__env->startSection('content'); ?>
<div class="row" style="margin-top: 10px; margin-bottom: 10px">

        <div class="col-lg-12 col-xlg-12 col-md-12">
        <!-- Column -->
        <div class="card">
          <div class="card-body little-profile text-left bg-premium-dark">
            <h3 class="card-title">Add Payment</h3>
            <div class="x_content">
            <form class="form-horizontal form-label-left"  enctype="multipart/form-data"  action="<?php echo e(url('/dealer/addPayment/'.$deal->id)); ?>" method="post">
                <?php echo e(csrf_field()); ?>

                <h4 class="card-title">Customer And EV Model</h4>
                <div class="row">
                  <div class="col-md-6">
                    <div class="form-group">
                    <label for="username" class="control-label">Customer Username: </label>                  
                          <?php echo e($customer->username); ?>

                      </div>
                  </div>
                  <div class="col-md-6">
                    <div class="form-group">
                    <label for="select_model" class="control-label">Customer Name: </label>
                          <?php echo e($customer->full_name); ?>

                          
                      </div>
                  </div>
                  <div class="col-md-3">
                      <div class="form-group">
                      <label for="select_model" class="control-label">Title: </label>
                      <?php echo e($ev_model->title); ?>

                    </div>
                  </div>
                  <div class="col-md-3">
                      <div class="form-group">
                      <label for="select_model" class="control-label">Type: </label>
                      <?php echo e($deal->kw_type); ?>

                    </div>
                  </div>
                  <?php if($deal->kw_type=='EV'): ?>
                  <div class="col-md-3">
                      <div class="form-group">
                      <label for="select_model" class="control-label">Color</label>
                      <?php echo e($deal->color); ?>

                      </div>
                  </div>
                  <div class="col-md-3">
                      <div class="form-group">
                      <label for="select_model" class="control-label">HSN</label>
                      <?php echo e($deal->hsn); ?>

                      </div>
                  </div>
                  <div class="col-md-3">
                      <div class="form-group">
                      <label for="select_model" class="control-label">Amount in INR</label>
                      <?php echo e($deal->amount); ?>

                      </div>
                  </div>
                  <div class="col-md-3">
                      <div class="form-group">
                          <label class="control-label" for="chassis_no">Chassis No.</label>
                          <?php echo e($deal->chassis_no); ?>

                          
                      </div>
                  </div>
                  <div class="col-md-3">
                      <div class="form-group">
                          <label class="control-label" for="motor_no">Motor No.</label>
                          <?php echo e($deal->motor_no); ?>

                      </div>
                  </div>
                  <div class="col-md-3">
                      <div class="form-group">
                          <label class="control-label" for="battery_make">Battery Make</label>
                          <?php echo e($deal->battery_make); ?>

                      </div>
                  </div>
                  <div class="col-md-3">
                      <div class="form-group">
                          <label class="control-label" for="battery_no">Battery No.</label>
                          <?php echo e($deal->battery_no); ?>

                      </div>
                  </div>
                  <div class="col-md-3">
                      <div class="form-group">
                          <label class="control-label" for="battery_type">Battery Type</label>
                          <?php echo e($deal->battery_type); ?>

                      </div>
                  </div>
                  <div class="col-md-3">
                      <div class="form-group">
                          <label class="control-label" for="battery_warranty">Battery Warranty</label>
                          <?php echo e($deal->battery_warranty); ?>

                      </div>
                  </div>
                  <?php else: ?>
                  No Ev Model found
                  <?php endif; ?>
                </div>
                
                <h4 class="card-title">Select Payment Method</h4>
                <?php if($deal->balance_amount>0): ?>
                <div class="row">
                  <div class="col-md-3">
                      <div class="form-group">
                          <label class="control-label" for="payment_type">Payment Mode*</label>
                          <?php echo Form::select('payment_type', $payment_methods, [], ['class' => 'form-control form-control-normal', 'id'=>'payment_type']); ?>

                          <?php if($errors->has('payment_type')): ?>
                              <p class="help-block error alert">
                                <?php echo e($errors->first('payment_type')); ?>

                              </p>
                          <?php endif; ?>
                      </div>
                  </div>
                  <div class="col-md-3">
                      <div class="form-group">
                          <label class="control-label" for="bill_amount">Amount/Loan Amount*</label>
                          <input type="text" id="bill_amount" name="bill_amount" required="required" class="form-control" value="<?php echo e($deal->balance_amount); ?>">
                            <?php if($errors->has('bill_amount')): ?>
                              <p class="help-block">
                                  <strong><?php echo e($errors->first('bill_amount')); ?></strong>
                              </p>
                            <?php endif; ?>
                      </div>
                  </div>
                  <div class="col-md-3 payOpt">
                      <div class="form-group">
                          <label class="control-label" for="bank_name">Bank Name</label>
                          <input type="text" id="bank_name" name="bank_name" class="form-control" value="">
                            <?php if($errors->has('bank_name')): ?>
                              <p class="help-block">
                                  <strong><?php echo e($errors->first('bank_name')); ?></strong>
                              </p>
                            <?php endif; ?>
                      </div>
                  </div>
                  <div class="col-md-3 payOpt">
                      <div class="form-group">
                          <label class="control-label" for="bank_branch">Branch Address</label>
                          <input type="text" id="bank_branch" name="bank_branch" class="form-control" value="">
                            <?php if($errors->has('bank_branch')): ?>
                              <p class="help-block">
                                  <strong><?php echo e($errors->first('bank_branch')); ?></strong>
                              </p>
                            <?php endif; ?>
                      </div>
                  </div>
                  <div class="col-md-3 payOpt">
                      <div class="form-group">
                          <label class="control-label" for="payment_reference">Cheque/DD/UTR/LOAN/TXN No.</label>
                          <input type="text" id="payment_reference" name="payment_reference" class="form-control" value="">
                            <?php if($errors->has('payment_reference')): ?>
                              <p class="help-block">
                                  <strong><?php echo e($errors->first('payment_reference')); ?></strong>
                              </p>
                            <?php endif; ?>
                      </div>
                  </div>
                  <div class="col-md-3 payOpt">
                      <div class="form-group">
                          <label class="control-label" for="payment_date">Cheque/DD/NEFT/LOAN/RTGS/UPI Date</label>
                          <input type="text" id="payment_date" name="payment_date" class="form-control mydatepicker" value="">
                            <?php if($errors->has('payment_date')): ?>
                              <p class="help-block">
                                  <strong><?php echo e($errors->first('payment_date')); ?></strong>
                              </p>
                            <?php endif; ?>
                      </div>
                  </div>
                  <div class="col-md-3">
                      <div class="form-group">
                          <label class="control-label" for="bill_comment">Remarks</label>
                          <input type="text" id="bill_comment" name="bill_comment" class="form-control" value="">
                          <?php if($errors->has('bill_comment')): ?>
                            <p class="help-block">
                                <strong><?php echo e($errors->first('bill_comment')); ?></strong>
                            </p>
                          <?php endif; ?>
                      </div>
                  </div>
                </div>
                <div class="form-group">
                    <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                      <button type="submit" class="btn btn-success">Submit</button>
                    </div>
                  </div>
                <?php else: ?>
                No due amount left.
                <?php endif; ?>
              </form>
              </div>
          </div>
        </div>
    </div>
</div>
<div class="card">
    <div class="card-body">
        <div class="table-responsive">
            <table class="table table-bordered" id="users-table">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>Amount</th>
                            <th>Balance Amount</th>
                            <th>Comment</th>
                            <th>Payment Type</th>
                            <th>Bank Name</th>
                            <th>Bank Branch</th>
                            <th>Reference</th>
                            <th>Date</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                </table>
        </div>
    </div>
</div>
<div class="modal fade" id="loadModalAjax" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="display: none;" aria-hidden="true">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
    </div>
    <!-- /.modal-content -->
   </div>
  <!-- /.modal-dialog -->
</div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('javascript'); ?>

    <!-- Date picker plugins css -->
    <link href="<?php echo e(url('assets')); ?>/plugins/bootstrap-datepicker/bootstrap-datepicker.min.css" rel="stylesheet" type="text/css" />
    <!-- Daterange picker plugins css -->
    <link href="<?php echo e(url('assets')); ?>/plugins/timepicker/bootstrap-timepicker.min.css" rel="stylesheet">
    <link href="<?php echo e(url('assets')); ?>/plugins/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">
    <!-- Date Picker Plugin JavaScript -->
    <script src="<?php echo e(url('assets')); ?>/plugins/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>
    <!-- Date range Plugin JavaScript -->
    <script src="<?php echo e(url('assets')); ?>/plugins/timepicker/bootstrap-timepicker.min.js"></script>
    <script src="<?php echo e(url('assets')); ?>/plugins/bootstrap-daterangepicker/daterangepicker.js"></script>
    <script src="<?php echo e(url('assets')); ?>/js/jqBootstrapValidation.js"></script>

    <link href="<?php echo e(url('assets')); ?>/plugins/EasyAutocomplete/easy-autocomplete.min.css" rel="stylesheet">
    <script src="<?php echo e(url('assets')); ?>/plugins/EasyAutocomplete/jquery.easy-autocomplete.min.js"></script>
    <script src="<?php echo e(url('assets')); ?>/js/typeahead.bundle.js"></script>

    <script>
  $(document).ready(function() {
        
        $('div.payOpt').hide();
        $('.mydatepicker, #datepicker').datepicker({format: 'yyyy-mm-dd'});
        $('select#payment_type').on('change', function() {
          if( this.value == 'Cash' || this.value == ''){
            $('div.payOpt').hide();
          }else{
            $('div.payOpt').show();
          }
        });
        var t = $('#users-table').DataTable({
                processing: true,
                serverSide: true,
                ajax: '<?php echo url('/'); ?>/dealer/billSentPaymentAnyData/<?php echo e($deal->id); ?>',
                dom: 'Bfrtip',
                'lengthMenu': [ [10, 25, 50, -1], [10, 25, 50, "All"] ],

                columns: [
                    { data: 'id', name: 'id', searchable:false },
                    { data: 'amount', name: 'amount' },
                    { data: 'balance_amount', name: 'balance_amount' },
                    { data: 'user_comment', name: 'user_comment' },
                    { data: 'payment_type', name: 'payment_type' },
                    { data: 'bank_name', name: 'bank_name', searchable:false },
                    { data: 'bank_branch', name: 'bank_branch', searchable:false },
                    { data: 'payment_reference', name: 'payment_reference', searchable:false },
                    { data: 'payment_date', name: 'payment_date', searchable:false },
                    { data: 'action', name: 'action' },
                ],
                "columnDefs": [
                    {
                        "render": function ( data, type, row, meta) {
                            return meta.row + meta.settings._iDisplayStart + 1;
                         },
                        "targets": 0
                    },
                    // {
                    //     "render": function ( data, type, row ) {
                    //         return data.replace(".00", "")+'%';
                    //     },
                    //     "targets": 3
                    // },

                    // {
                    //     "render": function ( data, type, row ) {
                    //     if(data==0){
                    //         return '<span class="table-primary">Pending</span>';
                    //     }else if(data==2){
                    //         return '<span class="table-danger">Declined</span>';
                    //     }else{
                    //         return '<span class="table-success">Approved</span>';
                    //     }
                    //     },
                    //     "targets": 6
                    // }
                ],
                'order': [[0, 'asc']],
                drawCallback: function( settings ) {
                    //openModal();
                  }
            });



  });

            

    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.dealer', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH G:\xampp\htdocs\yeselectricv.loc\resources\views/dealers/addPayment.blade.php ENDPATH**/ ?>