@php $show_lot = session('business.enable_lot_number'); $show_exp = session('business.enable_product_expiry'); $status_colors = ['received' => ['#e7f5f0','#0f6e6e'], 'pending' => ['#fff3e0','#a6650f'], 'ordered' => ['#fff3e0','#a6650f']]; $status_color = $status_colors[$purchase->status][0] ?? '#eef1f2'; $status_text_color = $status_colors[$purchase->status][1] ?? '#5b6b70'; $net_total = 0; $damage_loss_value = 0; $show_damage_loss = session('business.enable_damage_loss_tracking'); foreach ($purchase->purchase_lines as $pl) { $net_total += $pl->quantity * $pl->purchase_price; $damage_loss_value += ($pl->quantity_damaged + $pl->quantity_lost) * $pl->purchase_price_inc_tax; } $pay_term = ''; if (!empty($purchase->contact->pay_term_number) && !empty($purchase->contact->pay_term_type)) { $pay_term = $purchase->contact->pay_term_number . ' ' . ucfirst($purchase->contact->pay_term_type); } @endphp
| # | @lang('product.product_name') | @if($show_lot || $show_exp)@lang('lang_v1.lot_number') / @lang('product.exp_date') | @endif@lang('purchase.purchase_quantity') | @lang('purchase.unit_cost_after_tax') | @lang('sale.tax') | @lang('purchase.line_total') |
|---|---|---|---|---|---|---|
| {{ $loop->iteration }} | {{ $purchase_line->product->name }} @if($purchase_line->product->type == 'variable') - {{ $purchase_line->variations->product_variation->name ?? '' }} - {{ $purchase_line->variations->name ?? '' }} @endif @lang('product.sku'): {{ $purchase_line->product->type == 'variable' ? ($purchase_line->variations->sub_sku ?? '') : $purchase_line->product->sku }} @if($show_damage_loss && ($purchase_line->quantity_damaged || $purchase_line->quantity_lost)) ⚠ @if($purchase_line->quantity_damaged) {{ @format_quantity($purchase_line->quantity_damaged) }} @lang('purchase.quantity_damaged') @endif @if($purchase_line->quantity_lost) {{ @format_quantity($purchase_line->quantity_lost) }} @lang('purchase.quantity_lost') @endif @if(!empty($purchase_line->damage_loss_reason)) — {{ __('lang_v1.' . $purchase_line->damage_loss_reason) }} @endif @endif | @if($show_lot || $show_exp)@if($show_lot && !empty($purchase_line->lot_number)) {{ __('lang_v1.lot_number') }}: {{ $purchase_line->lot_number }} @endif @if($show_exp && !empty($purchase_line->exp_date)) @lang('product.exp_date'): {{ @format_date($purchase_line->exp_date) }} @endif | @endif{{ @format_quantity($purchase_line->quantity) }} {{ !empty($purchase_line->sub_unit) ? $purchase_line->sub_unit->actual_name : $purchase_line->product->unit->actual_name }} | @format_currency($purchase_line->purchase_price_inc_tax) | @format_currency($purchase_line->item_tax) | @format_currency($purchase_line->purchase_price_inc_tax * $purchase_line->quantity) |