@extends('admin.layout.interface') @section('content')

Tailors

Account Summary

Tailor: {{$tailor->name}}

Total Debit: {{$tailor->accountSummary['debit']}}

Total Credit: {{$tailor->accountSummary['credit']}}

Total Remaining: {{$tailor->accountSummary['remaining']}}

{{-- @foreach ($tailor->sales as $key => $sale) @endforeach --}} @php $balance = 0; @endphp @foreach ($tailor->ledgers as $key => $ledger) @php $debit = 0; $credit = 0; if ($ledger->transaction_type == 'debit') { $debit = $ledger->amount; $balance -= $ledger->amount; }else{ $credit = $ledger->amount; $balance += $ledger->amount; } @endphp @endforeach
Sr# Date Type Reference no Debit Credit Balance
{{$key+1}} {{$sale->created_at->format("m-d-Y")}} Sale Order {{$sale->bill_no}} {{$sale->net_total}} 0
{{$key+1}} {{$ledger->created_at->format("m-d-Y")}} {{$ledger->detail}} {{$ledger->sale ? $ledger->sale->bill_no : ''}} {{$debit}} {{$credit}} {{$balance}}
{{-- Add Tailor Modals --}} @endsection @section('js') @endsection