@lang('modules.report.itemReportMessage') @php $formattedStartTime = \Carbon\Carbon::parse($startTime)->format('h:i A'); $formattedEndTime = \Carbon\Carbon::parse($endTime)->format('h:i A'); @endphp ({{ $startDate === $endDate ? __('modules.report.salesDataFor') . " $startDate, " . __('modules.report.timePeriod') . " $formattedStartTime - $formattedEndTime" : __('modules.report.salesDataFrom') . " $startDate " . __('app.to') . " $endDate, " . __('modules.report.timePeriodEachDay') . " $formattedStartTime - $formattedEndTime" }})
{{ currency_format($menuItems->sum(fn($item) => $item->orders->sum(fn($order) => $order->amount)), restaurant()->currency_id) }}
{{ $menuItems->sum(fn($item) => $item->orders->sum('quantity')) }}
| @lang('modules.menu.itemName') | @lang('modules.menu.categoryName') | @lang('modules.report.quantitySold') | @lang('modules.report.sellingPrice') | @lang('modules.report.totalRevenue') |
|---|---|---|---|---|
|
{{ $item->item_name }} ({{ $variation->variation }})
|
{{ $item->category->category_name ?? '' }} |
{{ $item->orders->where('menu_item_variation_id', $variation->id)->sum('quantity') ?? 0 }}
|
@php
$variationOrders = $item->orders->where('menu_item_variation_id', $variation->id);
$totalQuantity = $variationOrders->sum('quantity');
$totalAmount = $variationOrders->sum('amount');
$averagePrice = $totalQuantity > 0 ? ($totalAmount / $totalQuantity) : $variation->price;
$originalPrice = $variation->price;
$hasPromotion = abs($averagePrice - $originalPrice) > 0.01;
@endphp
@if($hasPromotion && $totalQuantity > 0)
{{ currency_format($originalPrice, restaurant()->currency_id) }}
{{ currency_format($averagePrice, restaurant()->currency_id) }}
@else
{{ currency_format($averagePrice, restaurant()->currency_id) }}
@endif
|
{{ currency_format($totalAmount, restaurant()->currency_id) }}
|
|
{{ $item->item_name }}
|
{{ $item->category->category_name ?? '' }} |
{{ $item->orders->sum('quantity') }}
|
@php
$totalQuantity = $item->orders->sum('quantity');
$totalAmount = $item->orders->sum('amount');
$averagePrice = $totalQuantity > 0 ? ($totalAmount / $totalQuantity) : $item->price;
$originalPrice = $item->price;
$hasPromotion = abs($averagePrice - $originalPrice) > 0.01;
@endphp
@if($hasPromotion && $totalQuantity > 0)
{{ currency_format($originalPrice, restaurant()->currency_id) }}
{{ currency_format($averagePrice, restaurant()->currency_id) }}
@else
{{ currency_format($averagePrice, restaurant()->currency_id) }}
@endif
|
{{ currency_format($totalAmount, restaurant()->currency_id) }}
|
| @lang('messages.noItemAdded') | ||||