
<?php $__env->startSection('title', 'Customer Details'); ?>

<?php $__env->startSection('content'); ?>
<div class="card">
    <div class="card-body">
        <div class="d-flex justify-content-between align-items-center mb-3">
            <h6 class="card-title mb-0">Customer Details</h6>
            <div class="d-flex gap-2">
                <a href="<?php echo e(route('customers.edit', $customer)); ?>" class="btn btn-warning">
                    <i class="fas fa-edit me-2"></i>
                    Edit
                </a>
                <a href="<?php echo e(route('customers.index')); ?>" class="btn btn-secondary">
                    <i class="fas fa-arrow-left me-2"></i>
                    Back to List
                </a>
            </div>
        </div>

        <div class="row">
            <div class="col-md-6">
                <div class="card border">
                    <div class="card-header bg-primary text-white">
                        <h6 class="mb-0">Basic Information</h6>
                    </div>
                    <div class="card-body">
                        <table class="table table-borderless">
                            <tr>
                                <td><strong>Name:</strong></td>
                                <td><?php echo e($customer->name); ?></td>
                            </tr>
                            <tr>
                                <td><strong>Code:</strong></td>
                                <td><?php echo e($customer->code); ?></td>
                            </tr>
                            <tr>
                                <td><strong>Email:</strong></td>
                                <td><?php echo e($customer->email ?? 'N/A'); ?></td>
                            </tr>
                            <tr>
                                <td><strong>Phone:</strong></td>
                                <td><?php echo e($customer->phone ?? 'N/A'); ?></td>
                            </tr>
                            <tr>
                                <td><strong>Tax Number:</strong></td>
                                <td><?php echo e($customer->tax_number ?? 'N/A'); ?></td>
                            </tr>
                            <tr>
                                <td><strong>Status:</strong></td>
                                <td>
                                    <?php if($customer->is_active): ?>
                                        <span class="badge bg-success">Active</span>
                                    <?php else: ?>
                                        <span class="badge bg-danger">Inactive</span>
                                    <?php endif; ?>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>

            <div class="col-md-6">
                <div class="card border">
                    <div class="card-header bg-success text-white">
                        <h6 class="mb-0">Financial Information</h6>
                    </div>
                    <div class="card-body">
                        <table class="table table-borderless">
                            <tr>
                                <td><strong>Opening Balance:</strong></td>
                                <td><?php echo e(number_format($customer->opening_balance ?? 0, 4)); ?></td>
                            </tr>
                            <tr>
                                <td><strong>Current Balance:</strong></td>
                                <td><?php echo e(number_format($customer->balance, 4)); ?></td>
                            </tr>
                            <tr>
                                <td><strong>Credit Limit:</strong></td>
                                <td><?php echo e(number_format($customer->credit_limit ?? 0, 4)); ?></td>
                            </tr>
                            <tr>
                                <td><strong>Payment Terms:</strong></td>
                                <td>
                                    <?php if($customer->pay_term_no && $customer->pay_term_type): ?>
                                        <?php echo e($customer->pay_term_no); ?> <?php echo e($customer->pay_term_type); ?>

                                    <?php else: ?>
                                        N/A
                                    <?php endif; ?>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>

        <?php if($customer->address): ?>
        <div class="row mt-3">
            <div class="col-12">
                <div class="card border">
                    <div class="card-header bg-info text-white">
                        <h6 class="mb-0">Address</h6>
                    </div>
                    <div class="card-body">
                        <p class="mb-0"><?php echo e($customer->address); ?></p>
                    </div>
                </div>
            </div>
        </div>
        <?php endif; ?>

        <div class="row mt-3">
            <div class="col-12">
                <div class="card border">
                    <div class="card-header bg-secondary text-white">
                        <h6 class="mb-0">Account Information</h6>
                    </div>
                    <div class="card-body">
                        <table class="table table-borderless">
                            <tr>
                                <td><strong>Chart of Account:</strong></td>
                                <td><?php echo e($customer->chartOfAccount->name ?? 'N/A'); ?> (<?php echo e($customer->chartOfAccount->code ?? 'N/A'); ?>)</td>
                            </tr>
                            <tr>
                                <td><strong>Created:</strong></td>
                                <td><?php echo e($customer->created_at->format('M d, Y H:i')); ?></td>
                            </tr>
                            <tr>
                                <td><strong>Last Updated:</strong></td>
                                <td><?php echo e($customer->updated_at->format('M d, Y H:i')); ?></td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\habibcables-ERP\resources\views\customers\show.blade.php ENDPATH**/ ?>