@extends('layouts.invoicepayheader') @section('page-title') {{ __('Purchase Detail') }} @endsection @push('css') @if (module_is_active('Signature')) @endif @endpush @php $company_settings = getCompanyAllSetting($purchase->created_by, $purchase->workspace); @endphp @section('action-btn')
@endsection @section('content')

{{ __('Purchase') }}

{{ __('Purchase Date') }} :{{ company_date_formate($purchase->purchase_date, $purchase->created_by, $purchase->workspace) }}

{{ \App\Models\Purchase::purchaseNumberFormat($purchase->purchase_id, $purchase->created_by, $purchase->workspace) }}

@if (empty($purchase->vender_name)) {{ __('Name ') }} : {{ !empty($vendor->name) ? $vendor->name : '' }} @else {{ __('Vendor Name ') }} : {{ !empty($purchase->vender_name) ? $purchase->vender_name : '' }} @endif

@if (!empty($vendor->billing_name) && !empty($vendor->billing_address) && !empty($vendor->billing_zip))

{{ __('Billed To') }} : {{ !empty($vendor->billing_name) ? $vendor->billing_name : '' }} {{ !empty($vendor->billing_address) ? $vendor->billing_address : '' }} {{ !empty($vendor->billing_city) ? $vendor->billing_city . ' ,' : '' }} {{ !empty($vendor->billing_state) ? $vendor->billing_state . ' ,' : '' }} {{ !empty($vendor->billing_zip) ? $vendor->billing_zip : '' }} {{ !empty($vendor->billing_country) ? $vendor->billing_country : '' }}

{{ !empty($vendor->billing_phone) ? $vendor->billing_phone : '' }}

{{ __('Tax Number ') }} : {{ !empty($vendor->tax_number) ? $vendor->tax_number : '' }}

@endif
@if (module_is_active('Signature'))

@if ($purchase->company_signature)

@else
{{ __('Not Signed') }}
@endif
{{ __('Company Signature') }}

@endif
@if(empty($purchase->vender_name))

{{ __('Email ') }} : {{ !empty($vendor->email) ? $vendor->email : '' }}

@endif
@if (!empty($company_settings['purchase_shipping_display']) && $company_settings['purchase_shipping_display'] == 'on') @if (!empty($vendor->shipping_name) && !empty($vendor->shipping_address) && !empty($vendor->shipping_zip))

{{ __('Shipped To') }} : {{ !empty($vendor->shipping_name) ? $vendor->shipping_name : '' }} {{ !empty($vendor->shipping_address) ? $vendor->shipping_address : '' }} {{ !empty($vendor->shipping_city) ? $vendor->shipping_city . ' ,' : '' }} {{ !empty($vendor->shipping_state) ? $vendor->shipping_state . ' ,' : '' }} {{ !empty($vendor->shipping_zip) ? $vendor->shipping_zip : '' }} {{ !empty($vendor->shipping_country) ? $vendor->shipping_country : '' }}

{{ !empty($vendor->shipping_phone) ? $vendor->shipping_phone : '' }}

{{ __('Tax Number ') }} : {{ !empty($vendor->tax_number) ? $vendor->tax_number : '' }}

@endif @endif
@if (module_is_active('Signature'))

@if ($purchase->vendor_signature != '')

@else
{{ __('Not Signed') }}
@endif
{{ __('Vendor Signature') }}

@endif
{{ __('Status') }} :
@if ($purchase->status == 0) {{ __(Workdo\Account\Entities\Bill::$statues[$purchase->status]) }} @elseif($purchase->status == 1) {{ __(Workdo\Account\Entities\Bill::$statues[$purchase->status]) }} @elseif($purchase->status == 2) {{ __(Workdo\Account\Entities\Bill::$statues[$purchase->status]) }} @elseif($purchase->status == 3) {{ __(Workdo\Account\Entities\Bill::$statues[$purchase->status]) }} @elseif($purchase->status == 4) {{ __(Workdo\Account\Entities\Bill::$statues[$purchase->status]) }} @endif
@if (!empty($company_settings['purchase_qr_display']) && $company_settings['purchase_qr_display'] == 'on')

{!! DNS2D::getBarcodeHTML( route('purchases.link.copy', \Illuminate\Support\Facades\Crypt::encrypt($purchase->id)), 'QRCODE', 2, 2, ) !!}

@endif

{{ __('Item Summary') }}

{{ __('All items here cannot be deleted.') }}
@php $totalQuantity = 0; $totalRate = 0; $totalTaxPrice = 0; $totalDiscount = 0; $taxesData = []; $TaxPrice_array = []; @endphp @foreach ($iteams as $key => $iteam) @if (!empty($iteam->tax)) @php $taxes = App\Models\Purchase::taxs($iteam->tax); $totalQuantity += $iteam->quantity; $totalRate += $iteam->price; $totalDiscount += $iteam->discount; foreach ($taxes as $taxe) { $taxDataPrice = App\Models\Purchase::taxRate( $taxe->rate, $iteam->price, $iteam->quantity, ); if (array_key_exists($taxe->name, $taxesData)) { $taxesData[$taxe->name] = $taxesData[$taxe->name] + $taxDataPrice; } else { $taxesData[$taxe->name] = $taxDataPrice; } } @endphp @endif @php $tr_tex = array_key_exists($key, $TaxPrice_array) == true ? $TaxPrice_array[$key] : 0; @endphp @endforeach @if (!empty($taxesData)) @foreach ($taxesData as $taxName => $taxPrice) @endforeach @endif
# {{ __('Item Type') }} {{ __('Item') }} {{ __('Quantity') }} {{ __('Rate') }} {{ __('Tax') }} {{ __('Discount') }} {{ __('Description') }} {{ __('Price') }}
{{ __('after discount & tax') }}
{{ $key + 1 }} {{ !empty($iteam->product_type) ? Str::ucfirst($iteam->product_type) : '--' }} {{ !empty($iteam->product) ? $iteam->product->name : '' }} {{ $iteam->quantity }} {{ currency_format_with_sym($iteam->price, $purchase->created_by, $purchase->workspace) }} @if (!empty($iteam->tax)) @php $totalTaxRate = 0; $data = 0; @endphp @foreach ($taxes as $tax) @php $taxPrice = App\Models\Purchase::taxRate( $tax->rate, $iteam->price, $iteam->quantity, ); $totalTaxPrice += $taxPrice; $data += $taxPrice; @endphp @endforeach @php array_push($TaxPrice_array, $data); @endphp
{{ $tax->name . ' (' . $tax->rate . '%)' }} {{ currency_format_with_sym($taxPrice, $purchase->created_by, $purchase->workspace) }}
@else - @endif
{{ currency_format_with_sym($iteam->discount, $purchase->created_by, $purchase->workspace) }} {{ !empty($iteam->description) ? $iteam->description : '-' }} {{ currency_format_with_sym($iteam->price * $iteam->quantity - $iteam->discount + $tr_tex, $purchase->created_by, $purchase->workspace) }}
{{ __('Total') }} {{ $totalQuantity }} {{ currency_format_with_sym($totalRate, $purchase->created_by, $purchase->workspace) }} {{ currency_format_with_sym($totalTaxPrice, $purchase->created_by, $purchase->workspace) }} {{ currency_format_with_sym($totalDiscount, $purchase->created_by, $purchase->workspace) }}
{{ __('Sub Total') }} {{ currency_format_with_sym($purchase->getSubTotal(), $purchase->created_by, $purchase->workspace) }}
{{ __('Discount') }} {{ currency_format_with_sym($purchase->getTotalDiscount(), $purchase->created_by, $purchase->workspace) }}
{{ $taxName }} {{ currency_format_with_sym($taxPrice, $purchase->created_by, $purchase->workspace) }}
{{ __('Total') }} {{ currency_format_with_sym($purchase->getTotal(), $purchase->created_by, $purchase->workspace) }}
{{ __('Paid') }} {{ currency_format_with_sym($purchase->getTotal() - $purchase->getDue(), $purchase->created_by, $purchase->workspace) }}
{{ __('Due') }} {{ currency_format_with_sym($purchase->getDue(), $purchase->created_by, $purchase->workspace) }}
{{ __('Receipt Summary') }}
@forelse($purchase->payments as $key =>$payment) @empty @include('layouts.nodatafound') @endforelse
{{ __('Payment Receipt') }} {{ __('Date') }} {{ __('Amount') }} {{ __('Account') }} {{ __('Reference') }} {{ __('Description') }}
@if (!empty($payment->add_receipt)) @else - @endif {{ company_date_formate($payment->date, $purchase->created_by, $purchase->workspace) }} {{ currency_format_with_sym($payment->amount, $purchase->created_by, $purchase->workspace) }} {{ !empty($payment->bankAccount) ? $payment->bankAccount->bank_name . ' ' . $payment->bankAccount->holder_name : '' }} {{ $payment->reference }} {{ isset($payment->description) ? $payment->description : '-' }}
@endsection