@extends('backend.master') @section('document-title') Invoice List @endsection @section('page-title') {{ $client->name }}'s {{ $client->type=='Supplier'? 'Credit Purchase':'Credit Sale' }} Invoice List @endsection @section('active-breadcrumb-item') {{ $client->type }} List @endsection {{--This file must be included if Bootstrap Datatable is needed--}} @include('backend.includes.data-table') {{--Main Content of the page goes here--}} @section('content')
Name: {{ $client->name }} Mobile: {{ $client->mobile }} Address: {{ $client->address }} Area: Feni
@php($balance=$client->initial_balance) @php($title=$client->balance_type) @foreach($payments as $payment) @php($row=null) {{-- @php($clientBalance = clientBalance($client->id))--}} {{-- @php($newBalance = balanceCalculate($balance,$title,$payment))--}} @php($total=0) @if($client->type=='Customer') @if($payment->row_id!=null) @php($total=$payment->sale->total) @endif @php($due = ($total - $payment->amount)) @php($newBalance = customerNewBalance($due,clientLastBalance($client->id,$payment->id))) @elseif($client->type=='Supplier') @if($payment->row_id!=null) @php($total=$payment->purchase->total) @endif @php($due = ($total - $payment->amount)) @php($newBalance = supplierNewBalance($due,clientLastBalance($client->id,$payment->id))) @endif {{--Product Name--}} @endforeach
Sl. Date Particulars {{ $client->type=='Supplier'? 'Chalan(Tk)' : 'Bill(Tk)' }} {{ $client->type=='Supplier'? 'Payment(Tk)' : 'Receive(Tk)' }} {{ 'Media' }} Balance(Tk) Action
Payable Receivable
1 {{ dateFormat($client->created_at,'d/m/Y') }} {{ 'Initial Balance' }} {{ $client->balance_type=='Debit'? $client->initial_balance : '' }} {{ $client->balance_type=='Credit'? $client->initial_balance : '' }}
{{ $sl = $loop->iteration + 1 }} {{ dateFormat($payment->created_at,'d/m/Y') }} @if($client->type=='Supplier') {{ isset($row)? $row->product->name : 'Paid' }} @else @if(isset($row)) @foreach($row->details as $detail) {{ $detail->purchase->product->name }}, @endforeach @else {{ 'Received' }} @endif @endif {{ isset($row)? $row->total : '' }} {{ $payment->amount }} @if($payment->media=='Cash') @if($payment->amount>0) {{ $payment->media }} @endif @else {{ $payment->bankPayment->bankAccount->bank->code }}-{{ $payment->bankPayment->bankAccount->ac_no }} @endif {{ $newBalance['title']=='Debit' ? $newBalance['balance']:'' }} {{ $newBalance['title']=='Credit' ? $newBalance['balance']:'' }} {{-- --}} {{-- --}} {{-- --}} {{-- --}}
@endsection {{--this script override all--}} @section('script') @include('backend.client.script') @endsection {{--this style override all--}} @section('style') @include('backend.client.style') @endsection