@extends('layouts.admin') @section('page-title') {{ __('Retainer Detail') }} @endsection @php $settings = App\Models\Utility::settings(); @endphp @push('css-page') @endpush @push('script-page') @endpush @section('breadcrumb') @if (\Auth::guard('customer')->check()) @else @endif @if (\Auth::user()->type == 'company') @else @endif @endsection @section('action-btn')
@if ($retainer->is_convert == 0) @can('convert invoice retainer') {!! Form::open([ 'method' => 'get', 'class' => ' btn btn-sm btn-primary align-items-center', 'route' => ['retainer.convert', $retainer->id], 'id' => 'proposal-form-' . $retainer->id, ]) !!} {!! Form::close() !!} @endcan @else @can('convert invoice retainer') @endcan @endif
@endsection @section('content') @can('send invoice') @if ($retainer->status != 4)
{{ __('Create Retainer') }}

{{ __('Created on ') }}{{ \Auth::user()->dateFormat($retainer->issue_date) }}

@can('edit invoice') {{ __('Edit') }} @endcan
{{ __('Send Retainer') }}

@if ($retainer->status != 0) {{ __('Sent on') }} {{ \Auth::user()->dateFormat($retainer->send_date) }} @else @can('send invoice') {{ __('Status') }} : {{ __('Not Sent') }} @endcan @endif

@if ($retainer->status == 0) @can('send bill') {{ __('Send') }} @endcan @endif
{{ __('Get Paid') }}

{{ __('Status') }} : {{ __('Awaiting payment') }}

@if ($retainer->status != 0 && $retainer->is_convert == 0) @can('create payment invoice') {{ __('Add Payment') }}
@endcan @endif
@endif @endcan @if (\Auth::user()->type == 'company') @if ($retainer->status != 0)
@if (!empty($invoicePayment)) @endif @if ($retainer->status != 4) @endif
@endif @else
@if ( $retainer->is_convert == 0 && $retainer->getDue() > 0 && !empty($company_payment_settings) && ( $company_payment_setting['is_bank_enabled'] == 'on' || $company_payment_setting['is_stripe_enabled'] == 'on' || $company_payment_setting['is_paypal_enabled'] == 'on' || $company_payment_setting['is_paystack_enabled'] == 'on' || $company_payment_setting['is_flutterwave_enabled'] == 'on' || $company_payment_setting['is_razorpay_enabled'] == 'on' || $company_payment_setting['is_paytm_enabled'] == 'on' || $company_payment_setting['is_mercado_enabled'] == 'on' || $company_payment_setting['is_mollie_enabled'] == 'on' || $company_payment_setting['is_skrill_enabled'] == 'on' || $company_payment_setting['is_coingate_enabled'] == 'on' || $company_payment_setting['is_paymentwall_enabled'] == 'on' || $company_payment_setting['is_toyyibpay_enabled'] == 'on' || $company_payment_setting['is_payfast_enabled'] == 'on' || $company_payment_setting['is_iyzipay_enabled'] == 'on' || $company_payment_setting['is_sspay_enabled'] == 'on' || $company_payment_setting['is_paytab_enabled'] == 'on' || $company_payment_setting['is_benefit_enabled'] == 'on' || $company_payment_setting['is_cashfree_enabled'] == 'on' || $company_payment_setting['is_aamarpay_enabled'] == 'on' || $company_payment_setting['is_paytr_enabled'] == 'on' || $company_payment_setting['is_yookassa_enabled'] == 'on' || $company_payment_setting['is_xendit_enabled'] == 'on' || $company_payment_setting['is_midtrans_enabled'] == 'on' || $company_payment_setting['is_paiementpro_enabled'] == 'on' || $company_payment_setting['is_nepalste_enabled'] == 'on' || $company_payment_setting['is_cinetpay_enabled'] == 'on' || $company_payment_setting['is_fedapay_enabled'] == 'on' || $company_payment_setting['is_payhere_enabled'] == 'on' || $company_payment_setting['is_tap_enabled'] == 'on' || $company_payment_setting['is_authorizenet_enabled'] == 'on' || $company_payment_setting['is_khalti_enabled'] == 'on' || $company_payment_setting['is_ozow_enabled'] == 'on' )) @endif
@endif

{{ __('Retainer') }}

{{ AUth::user()->retainerNumberFormat($retainer->retainer_id) }}


{{ __('Issue Date') }} :
{{ \Auth::user()->dateFormat($retainer->issue_date) }}

{{--
{{ __('Due Date') }} :
{{ \Auth::user()->dateFormat($retainer->due_date) }}

--}}
@if (!empty($customer->billing_name))
{{ __('Billed To') }} :
{{ !empty($customer->billing_name) ? $customer->billing_name : '' }}
{{ !empty($customer->billing_address) ? $customer->billing_address : '' }}
{{ !empty($customer->billing_city) ? $customer->billing_city : '' . ', ' }}, {{ !empty($customer->billing_state) ? $customer->billing_state : '', ', ' }} {{ !empty($customer->billing_zip) ? $customer->billing_zip : '' }}
{{ !empty($customer->billing_country) ? $customer->billing_country : '' }}
{{ !empty($customer->billing_phone) ? $customer->billing_phone : '' }}
{{ __('Tax Number ') }} : {{ !empty($customer->tax_number) ? $customer->tax_number : '' }}
@if(!empty($settings['tax_type']) && !empty($settings['vat_number'])){{$settings['tax_type'].' '. __('Number')}} : {{$settings['vat_number']}}
@endif
@endif @if (App\Models\Utility::getValByName('shipping_display') == 'on')
{{ __('Shipped To') }} :
{{ !empty($customer->shipping_name) ? $customer->shipping_name : '' }}
{{ !empty($customer->shipping_address) ? $customer->shipping_address : '' }}
{{ !empty($customer->shipping_city) ? $customer->shipping_city : '' . ', ' }}, {{ !empty($customer->shipping_state) ? $customer->shipping_state : '' . ', ' }} {{ !empty($customer->shipping_zip) ? $customer->shipping_zip : '' }}
{{ !empty($customer->shipping_country) ? $customer->shipping_country : '' }}
{{ !empty($customer->shipping_phone) ? $customer->shipping_phone : '' }}
{{ __('Tax Number ') }} : {{ !empty($customer->tax_number) ? $customer->tax_number : '' }}
@endif
@if ($settings['retainer_qr_display'] == 'on') {!! DNS2D::getBarcodeHTML( route('pay.invoice', \Illuminate\Support\Facades\Crypt::encrypt($retainer->id)), 'QRCODE', 2, 2, ) !!} @endif
{{ __('Status') }} :
@if ($retainer->status == 0) {{ __(\App\Models\Retainer::$statues[$retainer->status]) }} @elseif($retainer->status == 1) {{ __(\App\Models\Retainer::$statues[$retainer->status]) }} @elseif($retainer->status == 2) {{ __(\App\Models\Retainer::$statues[$retainer->status]) }} @elseif($retainer->status == 3) {{ __(\App\Models\Retainer::$statues[$retainer->status]) }} @elseif($retainer->status == 4) {{ __(\App\Models\Retainer::$statues[$retainer->status]) }} @endif
@if (!empty($customFields) && count($retainer->customField) > 0) @foreach ($customFields as $field)
{{ $field->name }} :
{{ !empty($retainer->customField) ? $retainer->customField[$field->id] : '-' }}

@endforeach @endif
{{ __('Product Summary') }}
{{ __('All items here cannot be deleted.') }}
@php $totalQuantity = 0; $totalRate = 0; $totalTaxPrice = 0; $totalDiscount = 0; $taxesData = []; @endphp @foreach ($iteams as $key => $iteam) @if (!empty($iteam->tax)) @php $taxes = App\Models\Utility::tax($iteam->tax); $totalQuantity += $iteam->quantity; $totalRate += $iteam->price; $totalDiscount += $iteam->discount; foreach ($taxes as $taxe) { $taxDataPrice = App\Models\Utility::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 @endforeach @if (!empty($taxesData)) @foreach ($taxesData as $taxName => $taxPrice) @endforeach @endif {{-- --}}
# {{ __('Product') }} {{ __('Quantity') }} {{ __('Rate') }} {{ __('Discount') }} {{ __('Tax') }} {{ __('Description') }} {{ __('Price') }}
{{ __('before tax & discount') }}
{{ $key + 1 }} {{ !empty($iteam->product) ? $iteam->product->name : '' }} {{ $iteam->quantity }} ({{ $iteam->product->unit->name }}) {{ \Auth::user()->priceFormat($iteam->price) }} {{ \Auth::user()->priceFormat($iteam->discount) }} @if (!empty($iteam->tax)) @php $totalTaxRate = 0;@endphp @foreach ($taxes as $tax) @php $taxPrice = App\Models\Utility::taxRate($tax->rate, $iteam->price, $iteam->quantity); $totalTaxPrice += $taxPrice; @endphp @endforeach
{{ $tax->name . ' (' . $tax->rate . '%)' }} {{ \Auth::user()->priceFormat($taxPrice) }}
@else - @endif
{{ !empty($iteam->description) ? $iteam->description : '-' }} {{ \Auth::user()->priceFormat($iteam->price * $iteam->quantity) }}
{{ __('Total') }} {{ $totalQuantity }} {{ \Auth::user()->priceFormat($totalRate) }} {{ \Auth::user()->priceFormat($totalDiscount) }} {{ \Auth::user()->priceFormat($totalTaxPrice) }}
{{ __('Sub Total') }} {{ \Auth::user()->priceFormat($retainer->getSubTotal()) }}
{{ __('Discount') }} {{ \Auth::user()->priceFormat($retainer->getTotalDiscount()) }}
{{ $taxName }} {{ \Auth::user()->priceFormat($taxPrice) }}
{{ __('Total') }} {{ \Auth::user()->priceFormat($retainer->getTotal()) }}
{{ __('Paid') }} {{ \Auth::user()->priceFormat($retainer->getTotal() - $retainer->getDue()) }}
{{ __('Credit Note') }}{{\Auth::user()->priceFormat(($retainer->invoiceTotalCreditNote()))}}
{{ __('Due') }} {{ \Auth::user()->priceFormat($retainer->getDue()) }}
{{ __('Receipt Summary') }}
@can('delete payment invoice') @endcan @foreach ($retainer->payments as $key => $payment) @php $paymentpath = \App\Models\Utility::get_file('uploads/retainerpayment'); $path = \App\Models\Utility::get_file('/uploads/bank_receipt'); @endphp @can('delete invoice product') @endcan @endforeach @foreach ($retainer->bankpayment as $key => $bankpayment) @php $paymentpath = \App\Models\Utility::get_file('uploads/retainerpayment'); $path = \App\Models\Utility::get_file('/uploads/bank_receipt'); @endphp @can('delete invoice product') @endcan @endforeach
{{ __('Date') }} {{ __('Amount') }} {{ __('Payment Type') }} {{ __('Account') }} {{ __('Reference') }} {{ __('Description') }} {{ __('Receipt') }} {{ __('OrderId') }}{{ __('Action') }}
{{ \Auth::user()->dateFormat($payment->date) }} {{ \Auth::user()->priceFormat($payment->amount) }} {{ $payment->payment_type }} {{ !empty($payment->bankAccount) ? $payment->bankAccount->bank_name . ' ' . $payment->bankAccount->holder_name : '--' }} {{ !empty($payment->reference) ? $payment->reference : '--' }} {{ AUth::user()->retainerNumberFormat($retainer->retainer_id) }} {{ !empty($payment->description) ? $payment->description : '--' }} @if ($payment->add_receipt && $payment->payment_type=='Manually') @elseif(!empty($payment->add_receipt)) @else -- @endif {{ !empty($payment->order_id) ? $payment->order_id : '--' }}
{!! Form::open([ 'method' => 'post', 'route' => ['retainer.payment.destroy', $retainer->id, $payment->id], 'id' => 'delete-form-' . $payment->id, ]) !!} {!! Form::close() !!}
{{ \Auth::user()->dateFormat($bankpayment->created_at) }} {{ \Auth::user()->priceFormat($bankpayment->amount) }} {{ 'Bank Transfer' }} {{ !empty($bankpayment->bankAccount) ? $bankpayment->bankAccount->bank_name . ' ' . $bankpayment->bankAccount->holder_name : '--' }} {{ !empty($bankpayment->reference) ? $bankpayment->reference : '--' }} {{ AUth::user()->retainerNumberFormat($retainer->retainer_id) }} {{ !empty($bankpayment->description) ? $bankpayment->description : '--' }} @if (!empty($bankpayment->receipt)) @else -- @endif {{ !empty($bankpayment->order_id) ? $bankpayment->order_id : '--' }}
{!! Form::open([ 'method' => 'delete', 'route' => ['retainer.delete', $bankpayment->id], 'id' => 'delete-form-' . $bankpayment->id, ]) !!} {!! Form::close() !!}
{{--
{{__('Credit Note Summary')}}
@if (Gate::check('edit credit note') || Gate::check('delete credit note')) @endif @forelse($retainer->creditNote as $key =>$creditNote) @empty @endforelse
{{__('Date')}} {{__('Amount')}} {{__('Description')}}{{__('Action')}}
{{\Auth::user()->dateFormat($creditNote->date)}} {{\Auth::user()->priceFormat($creditNote->amount)}} {{$creditNote->description}} @can('edit credit note') @endcan @can('delete credit note')
{!! Form::open(['method' => 'DELETE', 'route' => array('invoice.delete.credit.note', $creditNote->invoice,$creditNote->id),'id'=>'delete-form-'.$creditNote->id]) !!} {!! Form::close() !!}
@endcan

{{__('No Data Found')}}

--}} @auth('customer') @if ($retainer->getDue() > 0) @endif @endauth @endsection