<?php $__env->startSection('title'); ?>
Process Cash Book
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="d-sm-flex align-items-center justify-content-between mb-4">
                        <h1 class="h3 mb-0 text-gray-800">Process Cash Book</h1>

                      </div>

                    <div class="card shadow mb-4">

                        <div class="card-header py-3 d-flex justify-content-between align-items-center">
                            <h6 class="m-0 font-weight-bold text-primary" id="formHeader">Process Cash Book</h6>

                        </div>
                        <?php if(session('success')): ?>
                            <div class="alert alert-success" id="successMessage"  style="margin: 20px;">
                                <?php echo e(session('success')); ?>

                            </div>
                        <?php endif; ?>

                        <?php if($errors->any()): ?>

                                    <div class="form-group"  id="successMessage"  style="margin: 20px;">
                                        <div class="card bg-warning text-white shadow">
                                            <div class="card-body">

                                                <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <div style="color: red; "><?php echo e($error); ?></div>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                            </div>
                                        </div>
                                    </div>
                                    <?php endif; ?>
                            <form class="card-body" action="<?php echo e(route('saveProcessCashBook')); ?>" method="post"  id="accountTypeForm">
                            <?php echo csrf_field(); ?>
                            <input type="hidden" id="accountId" name="id" value="">

                                <div class="form-group row">
                                    <div class="col-sm-6 mb-3 mb-sm-0">
                                    <select class="form-control form-control-user" id="account" name="account"  value="<?php echo e(old('account')); ?>"  required>
                                        <option value="" disabled selected>Select Cash Book</option>

                                        <?php $__currentLoopData = $gls; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $gl): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                                        <option value="<?php echo e($gl->AccCode); ?>"><?php echo e($gl->Name); ?></option>

                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                    </div>
                                    <div class="col-sm-6">

                                    <input type="date" class="form-control form-control-user" id="date" placeholder="Entry Date" name="date"  value="<?php echo e(old('date', \Carbon\Carbon::now()->format('Y-m-d'))); ?>" required>
                                   </div>
                                </div>

                               <div class="form-group row">
                                <div class="col-sm-6 mb-3 mb-sm-0">
                                    <select class="form-control form-control-user" id="contra" name="contra" value="<?php echo e(old('contra')); ?>" required>
                                        <option value="" disabled selected>Select Module</option>
                                        <option value="Reff">Use Reference</option>
                                        <?php $__currentLoopData = $Accounts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $glsac): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php if($type === 'Suppliers'): ?>
                                                <option value="<?php echo e($glsac->AccCode); ?>"><?php echo e($glsac->AccCode); ?> / <?php echo e($glsac->Name ?? 'N/A'); ?></option>
                                            <?php elseif($type === 'GL'): ?>
                                                <option value="<?php echo e($glsac->AccCode); ?>"><?php echo e($glsac->AccCode); ?> / <?php echo e($glsac->AccName ?? 'N/A'); ?></option>
                                            <?php else: ?>
                                                
                                                <option value="<?php echo e($glsac->AccCode); ?>"><?php echo e($glsac->AccCode); ?> / <?php echo e($glsac->AccName ?? $glsac->Name ?? 'N/A'); ?></option>
                                            <?php endif; ?>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>

                                    <div class="col-sm-6">
                                        <input type="text" class="form-control form-control-user" id="narr" placeholder="Description" name="narr"  value="<?php echo e(old('narr')); ?>" required >
                                   </div>

                                </div>

                                <div class="form-group row">
                                    <div class="col-sm-6 mb-3 mb-sm-0">

                                    <input type="text" class="form-control form-control-user" id="reff" placeholder="Refference" name="reff"  value="<?php echo e(old('reff')); ?>" required >

                                    </div>
                                    <div class="col-sm-6">

                                        <input type="text" class="form-control form-control-user" id="amount" placeholder="0.00" name="amount"  value="<?php echo e(old('amount')); ?>" required >

                                        </div>


                                </div>
                                <div class="form-group row">
                                    <div class="col-sm-6 mb-3 mb-sm-0">

                                    <select class="form-control form-control-user" id="curr" name="curr"  value="<?php echo e(old('curr')); ?>"  required>
                                        <option value="" disabled selected>Select Currency</option>

                                        <?php $__currentLoopData = $currencys; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $currency): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                                        <option value="<?php echo e($currency->ID); ?>"><?php echo e($currency->Name); ?></option>

                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                    </div>
                                    <div class="col-sm-6">
                                    <select class="form-control form-control-user" id="tr" name="tr"  value="<?php echo e(old('tr')); ?>"  required>
                                        <option value="" disabled selected>Select TR Code</option>
                                        <option value="DR">Receipt</option>
                                        <option value="CR">Payment</option>
                                    </select>
                                        </div>
                                </div>

                               <div style="display: flex;">
                               <input type="submit" style="width: 100px;height: 40px; margin-right: 10px; margin-top: 6px" value="Proccess" class="btn btn-primary btn-user btn-block" id="submitButton"/>
                                <input style="width: 100px;"    type="reset" value="Refresh" class="btn btn-secondary btn-user btn-block"  onclick="hideMessages()"/>
                               </div>
                                <hr>
                             </form>
                    </div>
                    <?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.nav', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\pinetops\re.pro\resources\views/ProcessCashBook.blade.php ENDPATH**/ ?>