{{ __('PURCHASE')}}

@if ($settings['purchase_qr_display'] == 'on')

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

@endif
@if (!empty($settings['company_name']) && !empty($settings['company_email']) && !empty($settings['company_address'])) @endif

{{ __('FROM')}}:
@if(!empty($settings['company_name'])){{$settings['company_name']}}@endif
@if(!empty($settings['company_email'])){{$settings['company_email']}}@endif
@if(!empty($settings['company_telephone'])){{$settings['company_telephone']}}@endif
@if(!empty($settings['company_address'])){{$settings['company_address']}}@endif @if(!empty($settings['company_city']))
{{$settings['company_city']}}, @endif @if(!empty($settings['company_state'])){{$settings['company_state']}}@endif @if(!empty($settings['company_country']))
{{$settings['company_country']}}@endif @if(!empty($settings['company_zipcode'])) - {{$settings['company_zipcode']}}@endif
@if(!empty($settings['registration_number'])){{__('Registration Number')}} : {{$settings['registration_number']}} @endif
@if(!empty($settings['tax_type']) && !empty($settings['vat_number'])){{$settings['tax_type'].' '. __('Number')}} : {{$settings['vat_number']}}
@endif

@if(!empty($customFields) && count($purchase->customField)>0) @foreach($customFields as $field) @endforeach @endif
{{ __('Number: ')}} {{\App\Models\Purchase::purchaseNumberFormat($purchase->purchase_id,$purchase->created_by,$purchase->workspace)}}
{{ __('Purchase Date:')}} {{company_date_formate($purchase->purchase_date,$purchase->created_by,$purchase->workspace)}}
{{$field->name}} : @if ($field->type == 'attachment') @else {{!empty($purchase->customField)?$purchase->customField[$field->id]:'-'}} @endif

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

@if (!empty($vendor->billing_name) && !empty($vendor->billing_address) && !empty($vendor->billing_zip)) {{ __('Bill 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 : '' }}

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

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

@endif @if($settings['purchase_shipping_display']=='on') @if (!empty($vendor->shipping_name) && !empty($vendor->shipping_address) && !empty($vendor->shipping_zip)) {{__('Ship 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 : '' }}

@endif @endif
@if(isset($purchase->itemData) && count($purchase->itemData) > 0) @foreach($purchase->itemData as $key => $item) @php $subtotal = $item->price * $item->quantity; $discount = $item->discount ?? 0; $tax_total = 0; if (!empty($item->itemTax)) { foreach ($item->itemTax as $tax) { $tax_amount = (float) preg_replace('/[^0-9.]/', '', $tax['price']); $tax_total += $tax_amount; } } $final_total = $subtotal - $discount + $tax_total; @endphp @if ($item->description != null) @endif @endforeach @else @endif
{{__('Item Type')}} {{__('Item')}} {{__('Quantity')}} {{__('Rate')}} {{__('Discount')}} {{__('Tax')}}(%) {{__('Price')}}{{ __('After discount & tax')}}
{{!empty($item->product_type) ? Str::ucfirst($item->product_type) : '--' }} {{$item->name}} {{$item->quantity}} {{currency_format_with_sym($item->price,$purchase->created_by,$purchase->workspace)}} {{($item->discount!=0)?currency_format_with_sym($item->discount,$purchase->created_by,$purchase->workspace):'-'}} @if(!empty($item->itemTax)) @foreach($item->itemTax as $taxes) {{$taxes['name']}} ({{$taxes['rate']}}) {{$taxes['price']}} @endforeach @else

-

@endif
{{currency_format_with_sym($final_total,$purchase->created_by,$purchase->workspace)}}
{{$item->description}}
- - - -

-

-

- -
-
{{__('Total')}} {{$purchase->totalQuantity}} {{currency_format_with_sym($purchase->totalRate,$purchase->created_by,$purchase->workspace)}} {{currency_format_with_sym($purchase->totalDiscount,$purchase->created_by,$purchase->workspace)}} {{currency_format_with_sym($purchase->totalTaxPrice,$purchase->created_by,$purchase->workspace) }} {{currency_format_with_sym($purchase->getSubTotal()-$purchase->getTotalDiscount()+$purchase->getTotalTax(),$purchase->created_by,$purchase->workspace)}}
@if($purchase->getTotalDiscount()) @endif @if(!empty($purchase->taxesData)) @foreach($purchase->taxesData as $taxName => $taxPrice) @endforeach @endif
{{__('Subtotal')}}: {{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->getSubTotal()-$purchase->getTotalDiscount()+$purchase->getTotalTax()),$purchase->created_by,$purchase->workspace)}}
{{__('Paid')}}: {{currency_format_with_sym(($purchase->getTotal()-$purchase->getDue()),$purchase->created_by,$purchase->workspace)}}
{{__('Due Amount')}}: {{currency_format_with_sym($purchase->getDue(),$purchase->created_by,$purchase->workspace)}}
@if(!isset($preview)) @include('purchases.script') @endif