
<?php $__env->startSection('title', 'View Delivery Note'); ?>

<?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">Delivery Note Details</h6>
            <a href="<?php echo e(route('delivery-notes.index')); ?>" class="btn btn-secondary">Back to List</a>
        </div>

        <div class="row g-3">
            <div class="col-md-6">
                <p><strong>DN Number:</strong> <?php echo e($deliveryNote->dn_number); ?></p>
                <p><strong>PO Number:</strong> <?php echo e($deliveryNote->purchaseOrder->po_number); ?></p>
                <p><strong>Delivery Date:</strong> <?php echo e($deliveryNote->delivery_date->format('Y-m-d')); ?></p>
                <p><strong>Status:</strong> <?php echo e(ucfirst($deliveryNote->status)); ?></p>
            </div>
            <div class="col-md-6">
                <p><strong>Created At:</strong> <?php echo e($deliveryNote->created_at->format('Y-m-d H:i:s')); ?></p>
                <p><strong>Updated At:</strong> <?php echo e($deliveryNote->updated_at->format('Y-m-d H:i:s')); ?></p>
                <?php if($deliveryNote->remarks): ?>
                    <p><strong>Remarks:</strong> <?php echo e($deliveryNote->remarks); ?></p>
                <?php endif; ?>
            </div>
        </div>

        <div class="table-responsive mt-4">
            <table class="table table-bordered">
                <thead class="table-light">
                    <tr>
                        <th>Item</th>
                        <th>PO Quantity</th>
                        <th>DN Quantity</th>
                        <th>Unit</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $deliveryNote->purchaseOrder->items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e($item->item->name); ?></td>
                        <td><?php echo e($item->quantity); ?></td>
                        <td><?php echo e($item->gatePassItems->sum('dn_quantity')); ?></td>
                        <td><?php echo e(optional($item->uom)->name); ?></td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </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\delivery_notes\show.blade.php ENDPATH**/ ?>