<?php $__env->startSection('title', 'Riwayat Pemakaian Bahan Baku'); ?>
<?php $__env->startSection('active17', 'active'); ?>
<?php $__env->startSection('content'); ?>

    <div class="content-wrapper">
        <div class="container-xxl flex-grow-1 container-p-y">
            <!-- Invoice List Table -->
            <div class="card">
                <div class="header-menu d-flex justify-content-between align-items-center">
                    <h5 class="card-header">Riwayat Pemakaian Bahan Baku</h5>
                </div>

                <?php
                    $groupedTrx = $data->groupBy('details.transaksi.kode_transaksi');
                ?>

                <div class="table-responsive">
                    <table class="table table-hover" id="Mytable">
                        <thead class="table-primary text-center">
                            <tr>
                                <th scope="col">Laundry</th>
                                <th scope="col">Tgl. pemakaian</th>
                                <th scope="col">K. Trnsksi</th>
                                <th scope="col">K. Detail Trnsksi</th>
                                <th scope="col">Paket</th>
                                <th scope="col">Bahan Baku</th>

                                <th scope="col">Total Volume/Qty (Pemakaian)</th>
                                <th scope="col">Volume Awal</th>
                                <th scope="col">Volume Akhir</th>
                                
                            </tr>
                        </thead>
                        <tbody>

                            <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td><?php echo e($data->nama_laundry); ?></td>
                                    <td><?php echo e(Carbon\Carbon::parse($data->tgl_pemakaian)->format('d M Y')); ?></td>
                                    <td><?php echo e($data->details->transaksi->kode_transaksi); ?></td>
                                    

                                    <td>
                                        <span class="tex-center"> <?php echo e($data->details->id); ?></span>

                                    </td>
                                    <td><?php echo e($data->paket->nama_paket); ?></td>
                                    <td>
                                        <?php
                                            $bahan_baku_paket = App\Models\BahanBakuPaket::where(
                                                'paket_id',
                                                $data->paket_id,
                                            )
                                                ->where('barang_id', $data->barang_id)
                                                ->first();
                                        ?>
                                        <?php echo e($data->barang->nama_barang); ?>

                                        (<?php echo e($bahan_baku_paket->qty . ' ' . $data->satuan); ?>)
                                    </td>



                                    <td><?php echo e($data->qty); ?> <?php echo e($data->satuan); ?></td>

                                    <td>
                                        <span class="badge bg-secondary">
                                            <?php echo e($data->volume_awal); ?> <?php echo e($data->barang->satuan); ?>

                                        </span>

                                    </td>
                                    <td>
                                        <span class="badge bg-warning">
                                            <?php echo e($data->volume_akhir); ?> <?php echo e($data->barang->satuan); ?>

                                        </span>

                                    </td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                </div>

            </div>

        <?php $__env->stopSection(); ?>

<?php echo $__env->make('component.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp_2\htdocs\Laundry\resources\views/pemakaian_barang/index.blade.php ENDPATH**/ ?>