@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
{{ $purchase->business->name }}
{{ $purchase->location->name }} @if(!empty($purchase->location->landmark))
{{ $purchase->location->landmark }} @endif @if(!empty($purchase->location->city) || !empty($purchase->location->state) || !empty($purchase->location->country))
{{ implode(', ', array_filter([$purchase->location->city, $purchase->location->state, $purchase->location->country])) }} @endif @if(!empty($purchase->business->tax_number_1))
{{ $purchase->business->tax_label_1 }}: {{ $purchase->business->tax_number_1 }} @endif @if(!empty($purchase->location->mobile))
{{ $purchase->location->mobile }} @endif
@lang('purchase.grn_title')
@lang('purchase.grn')
@if(!empty($purchase->status))
{{ __('lang_v1.' . $purchase->status) }}
@endif
{{ $purchase->ref_no }}
{{ @format_date($purchase->transaction_date) }}
{{ $purchase_order_nos ?: '--' }}
{{ $purchase_order_dates ?: '--' }}
{{ !empty($purchase->status) ? __('lang_v1.' . $purchase->status) : '--' }}
{{ !empty($purchase->payment_status) ? __('lang_v1.' . $purchase->payment_status) : '--' }}
{{ $pay_term ?: '--' }}
{{ $purchase->location->name }}
@lang('purchase.supplier')
{{ $purchase->contact->name }}
{!! $purchase->contact->contact_address !!} @if(!empty($purchase->contact->tax_number))
@lang('contact.tax_no'): {{ $purchase->contact->tax_number }}@endif @if(!empty($purchase->contact->mobile))
@lang('contact.mobile'): {{ $purchase->contact->mobile }}@endif @if(!empty($purchase->contact->email))
@lang('business.email'): {{ $purchase->contact->email }}@endif
@lang('purchase.received_by')
{{ $purchase->location->name }}
{!! $purchase->location->location_address !!} @if(!empty($purchase->sales_person))
{{ __('purchase.received_by') }}: {{ $purchase->sales_person->user_full_name }}@endif
{{ __('messages.date') }}: {{ @format_datetime($purchase->created_at) }}
@if($show_lot || $show_exp) @endif @foreach($purchase->purchase_lines as $purchase_line) @if($show_lot || $show_exp) @endif @endforeach
# @lang('product.product_name')@lang('lang_v1.lot_number') / @lang('product.exp_date')@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 && !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 {{ @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)
@lang('purchase.additional_notes')
{{ $purchase->additional_notes ?: '--' }}
@lang('purchase.net_total_amount')@format_currency($net_total)
@if(!empty($purchase->discount_amount))
@lang('purchase.discount') @if($purchase->discount_type == 'percentage') -@format_currency($purchase->discount_amount * $net_total / 100) ({{ $purchase->discount_amount }}%) @else -@format_currency($purchase->discount_amount) @endif
@endif @if(!empty($purchase_taxes)) @foreach($purchase_taxes as $tax_name => $tax_amount)
{{ $tax_name }}@format_currency($tax_amount)
@endforeach @endif @if(!empty($purchase->shipping_charges))
@lang('purchase.additional_shipping_charges')@format_currency($purchase->shipping_charges)
@endif @if($show_damage_loss && $damage_loss_value > 0)
@lang('purchase.damage_loss_value')@format_currency($damage_loss_value)
@endif
@lang('purchase.purchase_total')@format_currency($purchase->final_total)
@lang('purchase.received_by'){{ $purchase->sales_person->user_full_name ?? '' }}
@lang('purchase.checked_by')
@lang('purchase.approved_by')
@lang('purchase.supplier')