<?php if (isset($component)) { $__componentOriginale0f1cdd055772eb1d4a99981c240763e = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginale0f1cdd055772eb1d4a99981c240763e = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.admin-layout','data' => ['title' => 'Pengaturan Bonus','subtitle' => 'Atur bonus jasa dan retail. Persen retail sebaiknya berbasis margin.']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('admin-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['title' => 'Pengaturan Bonus','subtitle' => 'Atur bonus jasa dan retail. Persen retail sebaiknya berbasis margin.']); ?>
<?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::processComponentKey($component); ?>

    <form method="post" action="<?php echo e(route('bonuses.settings.update')); ?>" class="space-y-5">
        <?php echo csrf_field(); ?>
        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = $products->groupBy('type'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $type => $items): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoopIteration(); ?><?php endif; ?>
            <section class="rounded-lg bg-white p-5 shadow-sm">
                <h2 class="font-semibold"><?php echo e($type === 'service' ? 'Bonus Jasa' : 'Bonus Retail'); ?></h2>
                <div class="mt-4 overflow-x-auto">
                    <table class="w-full min-w-[760px] text-left text-sm">
                        <thead class="bg-slate-100 text-slate-600"><tr><th class="p-3">Produk</th><th>Harga</th><th>Modal</th><th>Tipe Bonus</th><th>Basis</th><th>Nilai</th></tr></thead>
                        <tbody class="divide-y">
                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoopIteration(); ?><?php endif; ?>
                                <tr>
                                    <td class="p-3 font-medium"><?php echo e($product->name); ?><div class="text-xs text-slate-500"><?php echo e($product->sku); ?></div></td>
                                    <td>Rp <?php echo e(number_format($product->price, 0, ',', '.')); ?></td>
                                    <td>Rp <?php echo e(number_format($product->cost_price, 0, ',', '.')); ?></td>
                                    <td><select name="products[<?php echo e($product->id); ?>][bonus_type]" class="rounded-md border px-3 py-2"><option value="none" <?php if($product->bonus_type === 'none'): echo 'selected'; endif; ?>>Tanpa bonus</option><option value="percent" <?php if($product->bonus_type === 'percent'): echo 'selected'; endif; ?>>Persen</option><option value="nominal" <?php if($product->bonus_type === 'nominal'): echo 'selected'; endif; ?>>Nominal / qty</option></select></td>
                                    <td><select name="products[<?php echo e($product->id); ?>][bonus_base]" class="rounded-md border px-3 py-2"><option value="sales" <?php if(($product->bonus_base ?? 'sales') === 'sales'): echo 'selected'; endif; ?>>Omzet</option><option value="margin" <?php if(($product->bonus_base ?? ($type === 'retail' ? 'margin' : 'sales')) === 'margin'): echo 'selected'; endif; ?>>Margin</option></select></td>
                                    <td><input name="products[<?php echo e($product->id); ?>][bonus_value]" type="number" min="0" step="0.01" value="<?php echo e($product->bonus_value); ?>" class="w-32 rounded-md border px-3 py-2"></td>
                                </tr>
                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                        </tbody>
                    </table>
                </div>
            </section>
        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
        <button class="rounded-md bg-slate-900 px-5 py-3 text-sm font-medium text-white">Simpan Pengaturan Bonus</button>
    </form>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginale0f1cdd055772eb1d4a99981c240763e)): ?>
<?php $attributes = $__attributesOriginale0f1cdd055772eb1d4a99981c240763e; ?>
<?php unset($__attributesOriginale0f1cdd055772eb1d4a99981c240763e); ?>
<?php endif; ?>
<?php if (isset($__componentOriginale0f1cdd055772eb1d4a99981c240763e)): ?>
<?php $component = $__componentOriginale0f1cdd055772eb1d4a99981c240763e; ?>
<?php unset($__componentOriginale0f1cdd055772eb1d4a99981c240763e); ?>
<?php endif; ?>
<?php /**PATH /Users/dedehermawan/Dokumen/project/laundry/resources/views/bonuses/settings.blade.php ENDPATH**/ ?>