@extends('layouts.app') @section('title', 'Bulk Create Commission Items - ISP ERP System') @section('page-title', 'Bulk Create Commission Items') @section('content')

Bulk Create Commission Items

Add multiple commission items with prices for all sub-tags

@if($errors->any())
    @foreach($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif @if(session('error')) @endif
@csrf
@error('effective_month')
{{ $message }}
@enderror Select the effective month for pricing
@foreach($subTags as $subTag) @php // Check if any bandwidth item has existing data for this sub tag $hasAnyData = false; foreach($bandwidthItems as $bwItem) { $priceKey = $bwItem->id . '_' . $subTag->id; if (isset($existingPrices[$priceKey])) { $hasAnyData = true; break; } } @endphp @endforeach @foreach($bandwidthItems as $bandwidthItem) @foreach($subTags as $subTag) @php $priceKey = $bandwidthItem->id . '_' . $subTag->id; $existingPrice = $existingPrices[$priceKey] ?? null; $lastPrice = $existingPrice ? number_format($existingPrice->price, 2, '.', '') : ''; $hasExistingData = $existingPrice !== null; @endphp @endforeach @endforeach
Item Name {{ $subTag->name }}
{{ $bandwidthItem->name }} @if($existingPrice) Last: {{ $existingPrice->effective_month ? \Carbon\Carbon::parse($existingPrice->effective_month)->format('M Y') : 'N/A' }} @endif
Cancel
@endsection