@extends('layouts.main') @php $admin_settings = getAdminAllSetting(); $company_settings = getCompanyAllSetting(creatorId()); @endphp @section('page-title') {{ __('Bill Detail') }} @endsection @section('page-breadcrumb') {{ __('Bill Detail') }} @endsection @push('scripts') @endpush @push('css') @if (module_is_active('Signature')) @endif @endpush @section('page-action')
@if (\Auth::user()->type != 'company') @endif
@endsection @section('content') @if (\Auth::user()->type == 'company') @if ($bill->status != 4)

{{ __('Create Bill') }}

{{ __('Created on ') }}{{ company_date_formate($bill->bill_date) }}

@permission('bill edit') {{ __('Edit') }} @endpermission
{{ __('Send Bill') }}

@if ($bill->status != 0) {{ __('Sent on') }} {{ company_date_formate($bill->send_date) }} @else {{ __('Status') }} : {{ __('Not Sent') }} @endif

@stack('recurring_type') @if ($bill->status == 0) @permission('bill send') {{ __('Send') }} @endpermission @endif
{{ __('Pay Bill') }}

{{ __('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 ($bill->status != 0) @permission('bill payment create') {{ __(' Add Payment') }}
@endpermission @endif
@endif @endif @if (\Auth::user()->type == 'company')
@endif @if (\Auth::user()->type == 'company') @if ($bill->status != 0)
@if ($bill->status != 4) @endif
@endif @endif

{{ __('Bill') }}

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

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

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

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

@if (!empty($vendor->billing_name))

{{ __('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') == 'on')

{{ __('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
@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 @if ($bill->bill_module == 'account' || $bill->bill_module == '') @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 @if ($bill->bill_module == 'account' || $bill->bill_module == '') @php $chartAccount = \Workdo\Account\Entities\ChartOfAccount::find( $iteam->chart_account_id, ); @endphp @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 @if ($bill->bill_module == 'account' || $bill->bill_module == '') @endif @php $colspan = 6; if ( $bill->bill_module == 'account' || $bill->bill_module == '' ) { $colspan = 9; } @endphp @if (!empty($taxesData)) @foreach ($taxesData as $taxName => $taxPrice) @endforeach @endif
# {{ __('Item Type') }} {{ __('Item') }} {{ __('Project') }}{{ __('Quantity') }} {{ __('Rate') }} {{ __('Discount') }} {{ __('Tax') }} {{ __('Chart Of Account') }} {{ __('Account Amount') }} {{ __('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) }} {{ currency_format_with_sym($iteam->discount) }} @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) }}
@else - @endif
{{ !empty($chartAccount) ? $chartAccount->name : '-' }} {{ currency_format_with_sym($iteam->amount) }} {{ !empty($iteam->description) ? $iteam->description : '-' }} {{ currency_format_with_sym($iteam->price * $iteam->quantity - $iteam->discount + $tr_tex) }}
{{ __('Total') }} {{ $totalQuantity }} {{ currency_format_with_sym($totalRate) }} {{ currency_format_with_sym($totalDiscount) }} {{ currency_format_with_sym($totalTaxPrice) }} {{ currency_format_with_sym($bill->getAccountTotal()) }}
{{ __('Sub Total') }} {{ currency_format_with_sym($bill->getSubTotal()) }}
{{ __('Discount') }} {{ currency_format_with_sym($bill->getTotalDiscount()) }}
{{ $taxName }} {{ currency_format_with_sym($taxPrice) }}
{{ __('Total') }} {{ currency_format_with_sym($bill->getTotal()) }}
{{ __('Paid') }} {{ currency_format_with_sym($bill->getTotal() - $bill->getDue() - $bill->billTotalDebitNote()) }}
{{ __('Debit note Applied') }} {{ currency_format_with_sym($bill->billTotalDebitNote()) }}
{{ __('Debit note issued') }} {{ currency_format_with_sym($bill->billTotalCustomerDebitNote()) }}
{{ __('Due') }} {{ currency_format_with_sym($bill->getDue()) }}
{{ __('Payment Summary') }}
@permission('bill payment delete') @endpermission @forelse($bill->payments as $key =>$payment) @empty @include('layouts.nodatafound') @endforelse
{{ __('Payment Receipt') }} {{ __('Date') }} {{ __('Amount') }} {{ __('Account') }} {{ __('Reference') }} {{ __('Description') }}{{ __('Action') }}
@if (!empty($payment->add_receipt)) @else - @endif {{ company_date_formate($payment->date) }} {{ currency_format_with_sym($payment->amount) }} {{ !empty($payment->bankAccount) ? $payment->bankAccount->bank_name . ' ' . $payment->bankAccount->holder_name : '' }} {{ $payment->reference }} {{ isset($payment->description) ? $payment->description : '-' }} @permission('bill payment delete')
{{ Form::open(['route' => ['bill.payment.destroy', $bill->id, $payment->id], 'class' => 'm-0']) }} {{ Form::close() }}
@endpermission
{{ __('Debit Note Summary') }}
@if (Laratrust::hasPermission('debitnote edit') || Laratrust::hasPermission('debitnote delete')) @endif @forelse($bill->debitNote as $key =>$debitNote) @empty @include('layouts.nodatafound') @endforelse
{{ __('Debit Note') }} {{ __('Date') }} {{ __('Amount') }} {{ __('Description') }}{{ __('Action') }}
{{ !empty($debitNote->debitNote) ? \Workdo\Account\Entities\CustomerDebitNotes::debitNumberFormat($debitNote->debitNote->debit_id) : '-' }} {{ company_date_formate($debitNote->date) }} {{ currency_format_with_sym($debitNote->amount) }} {{ isset($debitNote->description) ? $debitNote->description : '-' }} @permission('debitnote edit') @endpermission @permission('debitnote delete')
{{ Form::open(['route' => ['bill.delete.debit.note', $debitNote->bill, $debitNote->id], 'class' => 'm-0']) }} @method('DELETE') {{ Form::close() }}
@endpermission
{{ __('Attachments') }}
{{ __('Drop files here to upload') }}
@forelse($bill_attachment as $key =>$attachment) @empty @include('layouts.nodatafound') @endforelse
{{ __('#') }} {{ __('File Name') }} {{ __('File Size') }} {{ __('Date Created') }} {{ __('Action') }}
{{ ++$key }} {{ $attachment->file_name }} {{ $attachment->file_size }} {{ company_date_formate($attachment->created_at) }}
{{ Form::open(['route' => ['bill.attachment.destroy', $attachment->id], 'class' => 'm-0']) }} @method('DELETE') {{ Form::close() }}
@stack('add_recurring_pills')
@if (\Auth::user()->type != 'company')
{{ __('Receipt Summary') }}
@forelse($bill->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) }} {{ currency_format_with_sym($payment->amount) }} {{ !empty($payment->bankAccount) ? $payment->bankAccount->bank_name . ' ' . $payment->bankAccount->holder_name : '' }} {{ $payment->reference }} {{ isset($payment->description) ? $payment->description : '-' }}
@endif @endsection