<?php $__env->startSection('content'); ?>
<div class="row justify-content-center">
    <div class="col-lg-7">
        <div class="card">
            <div class="card-body">
                <h1 class="h4 mb-3">Buy Currency</h1>
                <form method="POST" action="<?php echo e(route('transactions.buy.store')); ?>">
                    <?php echo csrf_field(); ?>
                    <div class="row g-3">
                        <div class="col-md-6">
                            <label class="form-label" for="currency_id">Currency</label>
                            <select class="form-select" id="currency_id" name="currency_id" required>
                                <option value="">Select currency</option>
                                <?php $__currentLoopData = $currencies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $currency): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($currency->id); ?>" <?php if(old('currency_id') == $currency->id): echo 'selected'; endif; ?>>
                                        <?php echo e($currency->code); ?> - <?php echo e($currency->name); ?>

                                    </option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                        <div class="col-md-6">
                            <label class="form-label" for="account_id">Payment Account</label>
                            <select class="form-select" id="account_id" name="account_id" required>
                                <option value="">Select account</option>
                                <?php $__currentLoopData = $accounts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $account): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($account->id); ?>" <?php if(old('account_id') == $account->id): echo 'selected'; endif; ?>>
                                        <?php echo e($account->name); ?> - <?php echo e(number_format((float) $account->balance, 2)); ?> <?php echo e($account->currency->code); ?>

                                    </option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                        <div class="col-md-6">
                            <label class="form-label" for="quantity">Quantity</label>
                            <input class="form-control text-end atm-decimal" id="quantity" name="quantity" inputmode="numeric" placeholder="0.00" value="<?php echo e(old('quantity')); ?>" required>
                        </div>
                        <div class="col-md-6">
                            <label class="form-label" for="rate">Buying Rate</label>
                            <input class="form-control text-end atm-decimal" id="rate" name="rate" inputmode="numeric" placeholder="0.00" value="<?php echo e(old('rate')); ?>" required>
                        </div>
                        <div class="col-md-6">
                            <label class="form-label" for="handling_fee">Handling Fee</label>
                            <input class="form-control text-end atm-decimal" id="handling_fee" name="handling_fee" inputmode="numeric" placeholder="0.00" value="<?php echo e(old('handling_fee', 0)); ?>" required>
                        </div>
                        <div class="col-md-6">
                            <label class="form-label" for="fee_currency">Fee Currency</label>
                            <select class="form-select" id="fee_currency" name="fee_currency" required>
                                <?php $__currentLoopData = $feeCurrencies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $feeCurrency): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($feeCurrency); ?>" <?php if(old('fee_currency', 'LKR') === $feeCurrency): echo 'selected'; endif; ?>>
                                        <?php echo e($feeCurrency); ?>

                                    </option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                    </div>
                    <div class="d-flex justify-content-end mt-4">
                        <button class="btn btn-primary" type="submit">Save Buy Transaction</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH F:\christopher\currencychanger\resources\views/transactions/buy.blade.php ENDPATH**/ ?>