@use('App\Services\Date') @php use Carbon\Carbon; @endphp @extends('companyuser::layouts.master') @section('title', __('purchases::bill_returns.show_bill_return')) @section('extra-styles') @endsection @section('breadcrumb') @endsection @section('content')
@can('purchases.bill-returns.view') @endcan
@include('companyuser::errors.lists') @include('companyuser::errors.all')
{{__('purchases::bill_returns.Reference ID')}}

{{$billReturn->reference}}

{{__('purchases::bill_returns.Supplier Invoice Reference Number')}}
{{ ($billReturn->supplier_invoice_reference_number != "null") ? $billReturn->supplier_invoice_reference_number : "" }}
{{__('purchases::bill_returns.Description')}}

{{$billReturn->description}}

{{__('purchases::bill_returns.Supplier')}}

{{$billReturn->supplier->name}}

@if(!$billReturn->paymentTerm)
{{__('purchases::purchase_bills.Payment Account')}}
{{$billReturn->paymentAccount->name ?? ''}}
@else
{{__('purchases::purchase_bills.due_date')}}
{{ Date::format($billReturn->date->addDays($billReturn->paymentTerm->days ?? 0), 'date') }}
@endif
{{__('products::cost_center.Cost Center')}}
{{$costCenter?$costCenter['code'] . ' - ' . $costCenter['name_' . app()->getLocale()]: __('products::cost_center.main center') }}
{{__('sales::customers.created_by')}}
@if($billReturn->created_by == null) @lang('accounting::assets.System') @elseif($billReturn->created_by == auth()->user()->id) @lang('accounting::assets.You') @else {{$billReturn->addedBy->uname}} @endif
@if($billReturn->purchase_bill_id)
@lang('purchases::bill_returns.bill_reference')
@endif

@lang('purchases::bill_returns.Supplier Details'):

@php $mobile = $billReturn->supplier->mobile ? str_replace("+", "00", App\Enums\PhoneCode::get($billReturn->supplier->country_code)) . '-' . $billReturn->supplier->mobile : '' @endphp
@lang('purchases::bill_returns.phone'): {{$mobile}}
@lang('purchases::bill_returns.email'): {{$billReturn->supplier->email}}
@php $counterOfColumn=8; if(!$billReturn->formDesign->product_description) { $counterOfColumn--; } if(!$billReturn->formDesign->discount) { $counterOfColumn--; } if(!$billReturn->formDesign->tax_amount) { $counterOfColumn--; } if(!$billReturn->formDesign->product_image) { $counterOfColumn--; } @endphp @if($billReturn->formDesign->product_image) @if($billReturn->formDesign->product_description) @endif @if($billReturn->formDesign->discount) @endif @if($billReturn->formDesign->tax_amount) @endif @foreach($billReturn->billReturnDetails as $record) @if($billReturn->formDesign->product_image) @endif @if($billReturn->formDesign->product_description) @endif @if($billReturn->formDesign->discount) @endif @if($billReturn->formDesign->tax_amount) @endif @endforeach
@lang('products::product.Image') @endif @lang('purchases::bill_returns.product_name')@lang('purchases::bill_returns.description')@lang('purchases::bill_returns.qty') @lang('purchases::bill_returns.unit_price')@lang('purchases::bill_returns.discount')@lang('purchases::bill_returns.vat') @lang('purchases::bill_returns.vat_value')@lang('purchases::bill_returns.amount')
{{ $record->product->name }}{{ $record->description }}{{ number_format((float)$record->quantity,2,".",",") }} {{ number_format((float)$record->price,2,".",",") }}{{ $record->discount }}{{ ($record->tax)?$record->tax->percentage:0 }} {{ number_format((float)$record->vat_value,2,".",",") }} @if($billReturn->formDesign->tax_status == \Modules\Settings\Enums\TaxStatusesEnum::INCLUDE_VAT) {{number_format((float)$record->total,2,".",",")}} @else {{number_format((float)$record->gross,2,".",",") }} @endif
@lang('purchases::bill_returns.gross') {{ number_format((float)$billReturn->total_amount,2,".",",") }} {!! __('settings::currencies.' . $billReturn->currency_code) !!}
@lang('purchases::bill_returns.vat') {{ number_format((float)$billReturn->total_vat,2,".",",") }} {!! __('settings::currencies.' . $billReturn->currency_code) !!}
@lang('purchases::bill_returns.total_amount') {{ number_format((float)$billReturn->total,2,".",",") }} {!! __('settings::currencies.' . $billReturn->currency_code) !!}
@can('purchases.supplier-receipts.view')
@can('purchases.bill-returns.create') outstanding !== 0) @click="exampleModalShowing = true; receipts = {{json_encode($billReturn->avliableReceipts)}}; outstanding={{$billReturn->outstanding}}; total={{$billReturn->total}}; allocated={{$billReturn->paid_amount}} route={{ json_encode(route('company.bill-returns.assign-receipts', ['subdomain' => $subdomain, 'billReturn' => $billReturn->id] )) }}; billReference={{ json_encode($billReturn->reference)}} " @endif > @endcan
@can('purchases.supplier-receipts.delete') @endcan @foreach($billReturn->payments as $key => $record) @can('purchases.supplier-receipts.delete') @if(!$record['is_from_bill']) @endif @endcan @endforeach
@lang('purchases::supplier_receipts.Reference ID') @lang('purchases::supplier_receipts.Amount')@lang('Actions')
{{ $record['reference'] }} {{ $record['total'] }}
{{---------------- popup to deleted receipt -------------------------------}}
@endcan @if($billReturn->custom_fields) @php $customFields = json_decode($billReturn->custom_fields, true) @endphp
@foreach($customFields as $key=>$field)
@if($field['type']=='checkbox') @else @endif
@endforeach
@endif
{!! $billReturn->terms ?? $billReturn->formDesign->terms !!}
{!! $billReturn->notes ?? $billReturn->formDesign->notes !!}
@forelse ($billReturn->attachments as $attachment) @empty
@lang('purchases::purchase_bills.there_is_no_attachments')
@endforelse
@endsection @section('extra_scripts') @endsection