@extends('companyuser::layouts.master') @section('title', __('sales::customer_receipts.Show Customer Receipt')) @section('extra-styles') @endsection @section('breadcrumb') @endsection @section('content')
{{-- @can('sales.customer-receipts.edit') @endcan --}}
@if(LaravelLocalization::getCurrentLocale() === 'en') @else @endif @can('sales.customer-receipts.export') @endcan
@can('sales.customer-receipts.export') @endcan
@include('companyuser::errors.lists')
{{__('sales::customer_receipts.Reference ID')}}
{{$customerPaymentReceipt->reference}}
{{__('sales::customer_receipts.Payment Date')}}
{{$customerPaymentReceipt->formatDate($customerPaymentReceipt->date)}}
{{__('sales::customer_receipts.Customer')}}
{{$customerPaymentReceipt->customer->name}}
{{__('sales::customer_receipts.Payment Account')}}
{{$customerPaymentReceipt->account->name}}
{{__('sales::customer_receipts.Kind')}}
{{ Modules\Purchases\Enums\PaymentReceiptTypesEnum::toString($customerPaymentReceipt->kind)}}
@lang('sales::customer_receipts.Amount')
{{ ($customerPaymentReceipt->paid_amount < 0 ) ? '(' . abs($customerPaymentReceipt->paid_amount ) . ')' : $customerPaymentReceipt->paid_amount }}
@lang('sales::customer_receipts.Not Allocated Amount')
{{ ($customerPaymentReceipt->not_allocated_amount < 0 ) ? '(' . abs($customerPaymentReceipt->not_allocated_amount ) . ')' : $customerPaymentReceipt->not_allocated_amount }}
{{__('products::cost_center.Cost Center')}}
{{$costCenter?$costCenter['code'] . ' - ' . $costCenter['name_' . app()->getLocale()]: __('products::cost_center.main center') }}
{{__('sales::customer_receipts.Description')}}
{{ $customerPaymentReceipt->description }}
{{__('sales::customers.created_by')}}
@if($customerPaymentReceipt->created_by == null) @lang('accounting::assets.System') @elseif($customerPaymentReceipt->created_by == auth()->user()->id) @lang('accounting::assets.You') @else {{$customerPaymentReceipt->addedBy->uname}} @endif
@if(count($customerPaymentReceipt->payments)) @if($customerPaymentReceipt->kind == Modules\Purchases\Enums\PaymentReceiptTypesEnum::PAID) @php $permission = 'sales.invoice-returns.view'; @endphp @elseif($customerPaymentReceipt->kind == Modules\Purchases\Enums\PaymentReceiptTypesEnum::RECEIVED) @php $permission = 'sales.invoices.view'; @endphp @endif @can($permission)

@lang('sales::customer_receipts.Assigned Bills')

@if($customerPaymentReceipt->kind == Modules\Purchases\Enums\PaymentReceiptTypesEnum::PAID) @elseif($customerPaymentReceipt->kind == Modules\Purchases\Enums\PaymentReceiptTypesEnum::RECEIVED) @endif @foreach($customerPaymentReceipt->payments as $key => $payment) @endforeach
@lang('sales::invoice_returns.Reference ID') @lang('sales::invoice_returns.Amount')@lang('sales::invoices.Reference ID') @lang('sales::invoices.Amount')
kind == Modules\Purchases\Enums\PaymentReceiptTypesEnum::RECEIVED) href="{{route('company.invoices.show', ['subdomain' => $subdomain, 'invoice' => $key])}}" @elseif($customerPaymentReceipt->kind == Modules\Purchases\Enums\PaymentReceiptTypesEnum::PAID) href="{{route('company.invoice-returns.show', ['subdomain' => $subdomain, 'invoiceReturn' => $key])}}" @endif > {{$payment['reference']}} {{$payment['total']}}
@endcan @endif
@if($customerPaymentReceipt->custom_fields) @php $customFields = json_decode($customerPaymentReceipt->custom_fields, true) @endphp
@foreach($customFields as $key=>$field)
@if($field['type']=='checkbox') @else @endif {{-- --}}
@endforeach
@endif
{!! $customerPaymentReceipt->terms ?? $customerPaymentReceipt->formDesign->terms !!}
{!! $customerPaymentReceipt->notes ?? $customerPaymentReceipt->formDesign->notes !!}
@forelse ($customerPaymentReceipt->attachments as $attachment) @php $urlSegmants = explode('/', $attachment->url);$attachmentName = end($urlSegmants); $attachmentExtension = explode('.',end($urlSegmants))[1]; @endphp @empty
@lang('sales::customer_receipts.there_is_no_attachments')
@endforelse
{{---------------- popup for sending the item to whatsapp as pdf -------------------------------}}
@endsection @php $WhatsappText = __('general.whatsapp_message', [ 'receiver' => $customerPaymentReceipt->customer->name, 'sender' => $companyInfo->name, 'resource' => $customerPaymentReceipt->reference, 'model' => __('sales::customer_receipts.Show Customer Receipt Print'), 'resource_url' => $customerPaymentReceipt->publicUrl ]); @endphp @section('extra_scripts') @endsection