@extends('account::layouts.master') @php $admin_settings = getAdminAllSetting(); $company_settings = getCompanyAllSetting($bill->created_by); @endphp @section('page-title') {{ __('Bill Detail') }} @endsection @push('script-page') @endpush @push('css') @if (module_is_active('Signature')) @endif @endpush @section('action-btn') @if (\Auth::check() && isset(\Auth::user()->type) && \Auth::user()->type == 'company') @if ($bill->status != 0)
@if (!empty($billPayment)) @endif
@endif @else
@endif @endsection @section('content') @php $vendor = $bill->vendor; @endphp

{{ __('Bill') }}

{{ __('Bill Date') }} : {{ company_date_formate($bill->bill_date, $bill->created_by, $bill->workspace) }}

{{ __('Due Date') }} : {{ company_date_formate($bill->due_date, $bill->created_by, $bill->workspace) }}

{{ \Workdo\Account\Entities\Bill::billNumberFormat($bill->bill_id, $company_id, $workspace_id) }}

{{ __('Name ') }} : {{ !empty($vendor->name) ? $vendor->name : '' }}

@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 ($bill->company_signature != '')

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

@endif

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

@if (company_setting('bill_shipping_display', $company_id, $workspace_id) == '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 ($bill->vendor_signature != '')

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

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

{!! DNS2D::getBarcodeHTML( route('pay.billpay', \Illuminate\Support\Facades\Crypt::encrypt($bill->id)), 'QRCODE', 2, 2, ) !!}

@endif
@if (!empty($customFields) && count($bill->customField) > 0)
@foreach ($customFields as $field)
{{ $field->name }} @if ($field->type == 'attachment') @else

{{ !empty($bill->customField[$field->id]) ? $bill->customField[$field->id] : '-' }}

@endif
@endforeach
@endif

{{ __('Item Summary') }}

{{ __('All items here cannot be deleted.') }}
@if ($bill->bill_module == 'account' || $bill->bill_module == '') @elseif($bill->bill_module == 'taskly') @endif @php $totalQuantity = 0; $totalRate = 0; $totalTaxPrice = 0; $totalDiscount = 0; $taxesData = []; $TaxPrice_array = []; @endphp @foreach ($iteams as $key => $iteam) @if (!empty($iteam->tax)) @php $taxes = Workdo\Account\Entities\AccountUtility::tax( $iteam->tax, ); $totalQuantity += $iteam->quantity; $totalRate += $iteam->price; $totalDiscount += $iteam->discount; foreach ($taxes as $taxe) { $taxDataPrice = Workdo\Account\Entities\AccountUtility::taxRate( $taxe['rate'], $iteam->price, $iteam->quantity, $iteam->discount, ); if (array_key_exists($taxe['name'], $taxesData)) { $taxesData[$taxe['name']] = $taxesData[$taxe['name']] + $taxDataPrice; } else { $taxesData[$taxe['name']] = $taxDataPrice; } } @endphp @endif @if ($bill->bill_module == 'account' || $bill->bill_module == '') @elseif($bill->bill_module == 'taskly') @endif @php $tr_tex = array_key_exists($key, $TaxPrice_array) == true ? $TaxPrice_array[$key] : 0; @endphp @endforeach @if ($bill->bill_module == 'account' || $bill->bill_module == '') @endif @php $colspan = 6; if ($bill->bill_module == 'account' || $bill->bill_module == '') { $colspan = 7; } @endphp @if (!empty($taxesData)) @foreach ($taxesData as $taxName => $taxPrice) @endforeach @endif
#{{ __('Item Type') }} {{ __('Item') }} {{ __('Project') }} {{ __('Quantity') }} {{ __('Rate') }} {{ __('Discount') }} {{ __('Tax') }} {{ __('Description') }} {{ __('Price') }}
{{ __('after discount & tax') }}
{{ $key + 1 }}{{ !empty($iteam->product_type) ? Str::ucfirst($iteam->product_type) : '--' }} {{ !empty($iteam->product()) ? $iteam->product()->name : '' }} {{ !empty($iteam->product()) ? $iteam->product()->title : '' }} {{ $iteam->quantity }} {{ currency_format_with_sym($iteam->price, $company_id, $workspace_id) }} {{ currency_format_with_sym($iteam->discount, $company_id, $workspace_id) }} @if (!empty($iteam->tax)) @php $totalTaxRate = 0; $data = 0; @endphp @foreach ($taxes as $tax) @php $taxPrice = Workdo\Account\Entities\AccountUtility::taxRate( $tax['rate'], $iteam->price, $iteam->quantity, $iteam->discount, ); $totalTaxPrice += $taxPrice; $data += $taxPrice; @endphp @endforeach @php array_push($TaxPrice_array, $data); @endphp
{{ $tax['name'] . ' (' . $tax['rate'] . '%)' }} {{ currency_format_with_sym($taxPrice, $company_id, $workspace_id) }}
@else - @endif
{{ !empty($iteam->description) ? $iteam->description : '-' }} {{ currency_format_with_sym($iteam->price * $iteam->quantity - $iteam->discount + $tr_tex, $company_id, $workspace_id) }}
{{ __('Total') }} {{ $totalQuantity }} {{ currency_format_with_sym($totalRate, $company_id, $workspace_id) }} {{ currency_format_with_sym($totalDiscount, $company_id, $workspace_id) }} {{ currency_format_with_sym($totalTaxPrice, $company_id, $workspace_id) }}
{{ __('Sub Total') }} {{ currency_format_with_sym($bill->getSubTotal(), $company_id, $workspace_id) }}
{{ __('Discount') }} {{ currency_format_with_sym($bill->getTotalDiscount(), $company_id, $workspace_id) }}
{{ $taxName }} {{ currency_format_with_sym($taxPrice, $company_id, $workspace_id) }}
{{ __('Total') }} {{ currency_format_with_sym($bill->getTotal(), $company_id, $workspace_id) }}
{{ __('Paid') }} {{ currency_format_with_sym($bill->getTotal() - $bill->getDue() - $bill->billTotalDebitNote(), $company_id, $workspace_id) }}
{{ __('Debit Note') }} {{ currency_format_with_sym($bill->billTotalDebitNote(), $company_id, $workspace_id) }}
{{ __('Due') }} {{ currency_format_with_sym($bill->getDue(), $company_id, $workspace_id) }}
{{ __('Payment Summary') }}
@forelse($bill->payments as $key =>$payment) @empty @include('layouts.nodatafound') @endforelse
{{ __('Date') }} {{ __('Amount') }} {{ __('Account') }} {{ __('Reference') }} {{ __('Description') }}
{{ company_date_formate($payment->date, $company_id, $workspace_id) }} {{ currency_format_with_sym($payment->amount, $company_id, $workspace_id) }} {{ !empty($payment->bankAccount) ? $payment->bankAccount->bank_name . ' ' . $payment->bankAccount->holder_name : '' }} {{ $payment->reference }} {{ isset($payment->description) ? $payment->description : '-' }}
{{ __('Debit Note Summary') }}
@forelse($bill->debitNote as $key =>$debitNote) @empty @include('layouts.nodatafound') @endforelse
{{ __('Date') }} {{ __('Amount') }} {{ __('Description') }}
{{ company_date_formate($debitNote->date, $company_id, $workspace_id) }} {{ currency_format_with_sym($debitNote->amount, $company_id, $workspace_id) }} {{ $debitNote->description }}
@endsection