@extends('layouts.list_pdf') @section('pdf-title') {{ __('Supplier Ledger') }} @endsection @section('header-info')

{{ __('Supplier Ledger') }}

{{ __('Name:') }} {{ isset($supplier) ? $supplier : ''}}

@if (isset($date_range) && !empty($date_range))

{{ __('Period:') }} {{ $date_range }}

@endif

{{ __('Print Date:') }} {{ formatDate(date('d-m-Y')) }}

@endsection @section('list-table') @php $balance = $totalPaid = $totalBill = 0; @endphp @foreach($supplierLedger as $key=>$data) @php $balance += isset($data['total']) ? $data['total'] : 0; $balance -= isset($data['amount']) ? $data['amount'] : 0; $totalPaid += isset($data['amount']) ? $data['amount'] : 0; $totalBill += isset($data['total']) ? $data['total'] : 0; @endphp @endforeach @php $supplierLedger = !empty($supplierLedger[0]['currency']['name']) ? $supplierLedger[0]['currency']['name'] : ''; @endphp
{{ __('SL No') }} {{ __('Date') }} {{ __('Purchase Order') }} {{ __('Paid Amount') }} {{ __('Bill Amount') }} {{ __('Balance') }} {{ __('Currency') }}
{{ ++$key }} {{ formatDate($data['transaction_date']) }} @if(!empty($data['purchase_order_id'])) {{ $data['purchase_order']['reference'] }} @else {{ $data['reference'] }} @endif @if(isset($data['amount'])) {{ formatCurrencyAmount($data['amount']) }} @else {{ '-' }} @endif @if(isset($data['total'])) {{ formatCurrencyAmount($data['total']) }} @else {{ '-' }} @endif {{ formatCurrencyAmount($balance) }} {{ $data['currency']['name'] }}
{{ __('Total') }} = {{ formatCurrencyAmount($totalPaid, $supplierLedger) }} {{ formatCurrencyAmount($totalBill, $supplierLedger) }} {{ formatCurrencyAmount($balance, $supplierLedger) }}
@endsection