@lang('purchase.purchase_details') (@lang('purchase.ref_no'): #{{ $purchase->ref_no }})

@lang('messages.date'): {{ @format_date($purchase->transaction_date) }}

@lang('purchase.supplier'):
{{ $purchase->contact->supplier_business_name }} {{ $purchase->contact->name }} @if(!empty($purchase->contact->landmark))
{{$purchase->contact->landmark}} @endif @if(!empty($purchase->contact->city) || !empty($purchase->contact->state) || !empty($purchase->contact->country))
{{implode(',', array_filter([$purchase->contact->city, $purchase->contact->state, $purchase->contact->country]))}} @endif @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))
Email: {{$purchase->contact->email}} @endif
@if($purchase->document) @php $document_name = !empty(explode("_", $purchase->document, 2)[1]) ? explode("_", $purchase->document, 2)[1] : $purchase->document ; @endphp  {{ __('purchase.download_document') }} @endif
@lang('business.business'):
{{ $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->business->tax_number_2))
{{$purchase->business->tax_label_2}}: {{$purchase->business->tax_number_2}} @endif @if(!empty($purchase->location->mobile))
@lang('contact.mobile'): {{$purchase->location->mobile}} @endif @if(!empty($purchase->location->email))
@lang('business.email'): {{$purchase->location->email}} @endif
@lang('purchase.ref_no'): #{{ $purchase->ref_no }}
@lang('messages.date'): {{ @format_date($purchase->transaction_date) }}
@lang('purchase.purchase_status'): {{ ucfirst( $purchase->status ) }}
@lang('purchase.payment_status'): {{ ucfirst( $purchase->payment_status ) }}

@if(session('business.enable_lot_number')) @endif @if(session('business.enable_product_expiry')) @endif @php $total_before_tax = 0.00; @endphp @foreach($purchase->purchase_lines as $purchase_line) @if(session('business.enable_lot_number')) @endif @if(session('business.enable_product_expiry')) @endif @php $total_before_tax += ($purchase_line->quantity * $purchase_line->purchase_price); @endphp @endforeach
# @lang('product.product_name') @lang('purchase.purchase_quantity') @lang( 'lang_v1.unit_cost_before_discount' ) @lang( 'lang_v1.discount_percent' ) @lang('purchase.unit_cost_before_tax') @lang('purchase.subtotal_before_tax') @lang('sale.tax') @lang('purchase.unit_cost_after_tax') @lang('purchase.unit_selling_price')@lang('lang_v1.lot_number')@lang('product.mfg_date') @lang('product.exp_date')@lang('sale.subtotal')
{{ $loop->iteration }} {{ $purchase_line->product->name }} @if( $purchase_line->product->type == 'variable') - {{ $purchase_line->variations->product_variation->name}} - {{ $purchase_line->variations->name}} @endif {{ $purchase_line->quantity }} {{ $purchase_line->pp_without_discount}} {{ $purchase_line->discount_percent}} % {{ $purchase_line->purchase_price }} {{ $purchase_line->quantity * $purchase_line->purchase_price }} {{ $purchase_line->item_tax }}
@if($purchase_line->tax_id) ( {{ $taxes[$purchase_line->tax_id]}} ) @endif
{{ $purchase_line->purchase_price_inc_tax }} {{ $purchase_line->variations->default_sell_price }}{{$purchase_line->lot_number}} @if( !empty($purchase_line->product->expiry_period_type) ) @if(!empty($purchase_line->mfg_date)) {{ @format_date($purchase_line->mfg_date) }} @endif @else @lang('product.not_applicable') @endif @if( !empty($purchase_line->product->expiry_period_type) ) @if(!empty($purchase_line->exp_date)) {{ @format_date($purchase_line->exp_date) }} @endif @else @lang('product.not_applicable') @endif {{ $purchase_line->purchase_price_inc_tax * $purchase_line->quantity }}

{{ __('sale.payment_info') }}:

@php $total_paid = 0; @endphp @forelse($purchase->payment_lines as $payment_line) @php $total_paid += $payment_line->amount; @endphp @empty @endforelse
# {{ __('messages.date') }} {{ __('purchase.ref_no') }} {{ __('sale.amount') }} {{ __('sale.payment_mode') }} {{ __('sale.payment_note') }}
{{ $loop->iteration }} {{ @format_date($payment_line->paid_on) }} {{ $payment_line->payment_ref_no }} {{ $payment_line->amount }} {{ ucfirst($payment_line->method) }} @if($payment_line->note) {{ ucfirst($payment_line->note) }} @else -- @endif
@lang('purchase.no_payments')
@if( !empty( $purchase->shipping_charges ) ) @endif
@lang('purchase.net_total_amount'): {{ $total_before_tax }}
@lang('purchase.discount'): (-) @if($purchase->discount_type == 'percentage') ({{$purchase->discount_amount}} %) @endif @if($purchase->discount_type == 'percentage') {{$purchase->discount_amount * $total_before_tax / 100}} @else {{$purchase->discount_amount}} @endif
@lang('purchase.purchase_tax'): (+) {{ $purchase->tax_amount }}
@lang('purchase.additional_shipping_charges'): (+) {{ $purchase->shipping_charges }}
@lang('purchase.purchase_total'): {{ $purchase->final_total }}
@lang('purchase.shipping_details'):

@if($purchase->shipping_details) {{ $purchase->shipping_details }} @else -- @endif

@lang('purchase.additional_notes'):

@if($purchase->additional_notes) {{ $purchase->additional_notes }} @else -- @endif

{{-- Barcode --}}