
<div class="modal fade" id="md_add_payment" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <?php echo e(Form::open(array('route' => 'payment.pay', 'class' => 'cls_form', 'id' => 'form_add_payment'))); ?>

  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Add Payment</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true"></span>
        </button>
      </div>
      <div class="modal-body ">
        <div class = "card">
          <div class ="card-body form-fieldset">
              <div class="row">

                <div class="col-sm-4">
                     <label class="label-color"><?php echo e(ucwords(str_replace('_',' ',EF::branchWhiteLabel()['module']))); ?> </label>
                  <small class="form-errors pull-right req" value=""><?php echo e($errors->first('branch',":message")); ?></small>
                  <div class="input-group mb-3">

                    <input type="text" readonly="" value="<?php echo e($branch_name); ?>" class="form-control form-control-sm">

                    
                  </div>
                </div>

                 <!-- VENDOR PAYMENTS -->
                <?php if(Crypt::decrypt($generic_type) == EF::getGenericTableIndex()['Vendor Payment']): ?> 
                <div class="col-sm-4">
                     <label class="label-color">Invoice # </label>
                  <small class="form-errors pull-right req" value=""><?php echo e($errors->first('invoice',":message")); ?></small>
                  <div class="input-group mb-3">
                   
                    <?php echo e(Form::Text('invoice',$invoice, ['class' => 'form-control form-control-sm  cls_required', 'placeholder' => 'Invoice #' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default', 'readonly' => true])); ?>

                  </div>
                </div>

                <input type="hidden" name="receipt">
                <!-- END VENDOR PAYMENTS -->

                <?php elseif(Crypt::decrypt($generic_type) == EF::getGenericTableIndex()['Inventory Payable']): ?> 

                <div class="col-sm-4">
                     <label class="label-color">Invoice # </label>
                  <small class="form-errors pull-right req" value=""><?php echo e($errors->first('invoice',":message")); ?></small>
                  <div class="input-group mb-3">
                   
                    <?php echo e(Form::Text('invoice',$invoice, ['class' => 'form-control form-control-sm  cls_required', 'placeholder' => 'Invoice #' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default', 'readonly' => true])); ?>

                  </div>
                </div>

                <input type="hidden" name="receipt">

                <?php else: ?>
                <!-- RECEIPT -->
                <div class="col-sm-4">
                     <label class="label-color">Receipt # </label>
                  <small class="form-errors pull-right req" value=""><?php echo e($errors->first('receipt',":message")); ?></small>
                  <div class="input-group mb-3">
                   
                    <?php echo e(Form::Text('receipt',$receipt, ['class' => 'form-control form-control-sm  cls_required', 'placeholder' => 'Receipt #' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default', 'readonly' => true])); ?>

                  </div>
                </div>
                <?php endif; ?>
                <!-- END Receipt -->

                


                <div class="col-sm-4">
                     <label class="label-color">Date <i style = "color:red;">*</i></label>
                  <small class="form-errors pull-right req" value="*"><?php echo e($errors->first('date',":message")); ?></small>
                  <div class="input-group mb-3">
                    <input type="date" name="date" value="<?php echo date('Y-m-d'); ?>" class="form-control form-control-sm  cls_date auto_select_date" aria-label="Default"/>
                    
                  </div>
                </div>



                <div class="col-sm-12"><h5><?php echo e($section); ?></h5></div>

                <?php if(Crypt::decrypt($generic_type) == EF::getGenericTableIndex()['Vendor Payment']): ?> 
                <div class="col-sm-6">
                     <label class="label-color">Payment Type  </label>
                  <small class="form-errors pull-right req" value=""><?php echo e($errors->first('payment_type',":message")); ?></small>
                  <div class="input-group mb-3">

                    <input type="text" readonly="" value="<?php echo e($payment_type); ?>" class="form-control form-control-sm">

                   
                    
                  </div>
                </div>

                <div class="col-sm-6">
                     <label class="label-color">Description  </label>
                  <small class="form-errors pull-right req" value=""><?php echo e($errors->first('description',":message")); ?></small>
                  <div class="input-group mb-3">

                    <input type="text" readonly="" value="<?php echo e($description); ?>" class="form-control form-control-sm">

                   

                    
                  </div>
                </div>



                <?php else: ?>
                 <div class="col-sm-6">
                     <label class="label-color">User Type  </label>
                  <small class="form-errors pull-right req" value=""><?php echo e($errors->first('user_type',":message")); ?></small>
                  <div class="input-group mb-3">

                    <input type="text" readonly="" value="<?php echo e($user_type); ?>" class="form-control form-control-sm">


                    
                  </div>
                </div>

                <div class="col-sm-6">
                     <label class="label-color">User </label>
                  <small class="form-errors pull-right req" value=""><?php echo e($errors->first('user_name',":message")); ?></small>
                  <div class="input-group mb-3">

                    <input type="text" readonly="" value="<?php echo e($user_name); ?>" class="form-control form-control-sm">


                    
                  </div>
                </div>



                <?php if(strlen(trim($booking_name)) > 0): ?>
                <div class="col-sm-6">
                     <label class="label-color">Booking Detail  </label>
                  <small class="form-errors pull-right req" value=""><?php echo e($errors->first('booking_detail',":message")); ?></small>
                  <div class="input-group mb-3">

                    <input type="text" readonly="" value="<?php echo e($booking_name); ?>" class="form-control form-control-sm">


                    
                  </div>
                </div>
                <?php endif; ?>

                <div class="col-sm-6">
                     <label class="label-color">Payment Type  </label>
                  <small class="form-errors pull-right req" value=""><?php echo e($errors->first('payment_type',":message")); ?></small>
                  <div class="input-group mb-3">

                    <input type="text" readonly="" value="<?php echo e($payment_type); ?>" class="form-control form-control-sm">


                    
                  </div>
                </div>

                <div class="col-sm-6">
                     <label class="label-color">Description  </label>
                  <small class="form-errors pull-right req" value=""><?php echo e($errors->first('description',":message")); ?></small>
                  <div class="input-group mb-3">

                    <input type="text" readonly="" value="<?php echo e($description); ?>" class="form-control form-control-sm">



                    
                  </div>
                </div>
                <?php endif; ?>




                <div class="col-sm-6">
                     <label class="label-color">Amount  </label>
                  <small class="form-errors pull-right req" value=""><?php echo e($errors->first('amount',":message")); ?></small>
                  <div class="input-group mb-3">

                    <?php echo e(Form::Text('amount',$amount, ['class' => 'form-control form-control-sm  cls_required', 'placeholder' => 'Amount' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default','onkeyup' => 'numberInWordsValue(this,"amount_in_words")'])); ?>

                  </div>
                </div>
                    <div class="<?php if(strlen(trim($booking_name)) > 0): ?> col-sm-12 <?php else: ?> col-sm-6 <?php endif; ?>">
                     <label class="label-color">Amount In Words  </label>
                  <small class="form-errors pull-right req" value=""><?php echo e($errors->first('amount_in_words',":message")); ?></small>
                   <div class="input-group mb-3">

              <input placeholder="Amount In  Words" type="text" name= "amount_in_words" value="<?php echo e(EF::numberToWords($amount)); ?>" readonly="" class="form-control-sm form-control amount_in_words" >
            </div>
                </div>

                <div class="col-sm-12"><h5>Payment Information</h5></div>


                <div class="col-sm-12">
                   <label class="label-color">Payment Mode: <i style = "color:red;">*</i></label>
                <small class="form-errors pull-right req" value="*"><?php echo e($errors->first('mode',":message")); ?></small>

                <div class="input-group mb-3">

                  <?php ($mode_list = []); ?>

                  <?php $__currentLoopData = EF::getPaymentMode(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rows): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php ($mode_list += [$rows => $rows]); ?>
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                 <?php echo e(Form::select('mode', $mode_list, '' , array('class' => 'form-control form-control-sm  form-control form-control-sm -sm  cls_selection','onChange' => 'checkPaymentMode(this,"bank_payment_section")'))); ?>

                </div>
              </div>


          <div class="col-sm-4 bank_payment_section" style="display:none;">
               <label class="label-color">Drawn On:</label>
            <small class="form-errors pull-right req" value=""><?php echo e($errors->first('drawn_on',":message")); ?></small>

            <div class="input-group mb-3">

              <?php echo e(Form::Text('drawn_on', '', ['class' => 'form-control form-control-sm  form-control form-control-sm -sm  cls_required', 'placeholder' => 'Bank Name ' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default'])); ?>

            </div>
          </div>

            <div class="col-sm-4 bank_payment_section" style="display:none;">

               <label class="label-color">Instrument:</label>
            <small class="form-errors pull-right req" value=""><?php echo e($errors->first('instrument',":message")); ?></small>

            <div class="input-group mb-3">

              <?php echo e(Form::Text('instrument', '', ['class' => 'form-control form-control-sm  form-control form-control-sm -sm  cls_required', 'placeholder' => 'Instrument # ' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default'])); ?>

            </div>
          </div>
            <div class="col-sm-4 bank_payment_section" style="display:none;">
                 <label class="label-color">Instrument Date:</label>
            <small class="form-errors pull-right req" value=""><?php echo e($errors->first('instument_date',":message")); ?></small>

            <div class="input-group mb-3">

              <?php echo e(Form::Date('instrument_date', '', ['class' => 'form-control form-control-sm  form-control form-control-sm -sm  cls_date' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default'])); ?>

            </div>

              <label class="label-color" style="display: none;"> <input  type="checkbox" name="pdc">&nbsp;PDC Amount</label>
          </div>





        </div>
          </div>
        </div>
      </div>
      <div class="modal-footer">
        <input type="hidden" name="generic" value="<?php echo e($generic); ?>">
        <input type="hidden" name="generic_type" value="<?php echo e($generic_type); ?>">
        <?php if(isset($role)): ?> <input type="hidden" name="role"    value="<?php echo e($role); ?>"> <?php endif; ?>
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        <button type="submit" class="btn btn-primary cls_submit" content="add payment">Add Payment</button>
      </div>
    </div>
  </div>
  <?php echo e(Form::close()); ?>

</div>
 <?php /**PATH /home/ubuntu/rebmgisplus/skylite/resources/views/payments/modals/add_payment.blade.php ENDPATH**/ ?>