@extends('layouts.nav') @section('title') {{$Type}} Statement @endsection @section('content')

Accounting Report

{{$Type}} Statement
@if (session('success'))
{{ session('success') }}
@endif @if ($errors->any())
@foreach ($errors->all() as $error)
{{ $error }}
@endforeach
@endif
@csrf

{{$name}} Statement

Date

@php use Carbon\Carbon; $todayLongDate = Carbon::now()->format(' F j, Y'); @endphp

{{$todayLongDate}}

Account

{{$code}}

Currency: {{$currnames}}

From: {{$from}} To: {{$to}}

@php $b = $openingBalance; // Initialize $b $dr=0; $cr=0; @endphp @php if($b=="Supplier") { if($b<0) { $dr=$b; $cr=0; } else { $dr=0; $cr=$b; } } else { if($b<0) { $dr=0; $cr=$b*(-1); } else { $dr=$b; $cr=0; } } @endphp @foreach ($trans as $tran) @php if($Type=="Supplier") { $b = $b+ ($tran->DR-$tran->CR); } else { $b = $b+ ($tran->CR-$tran->DR); } @endphp @php if($Type=="Supplier") { $dr=$tran->DR; $cr=$tran->CR; } else { $dr=$tran->CR; $cr=$tran->DR; } @endphp @endforeach
EntryDate Description Refference DR CR Balance
{{$from}} Opening Balance {{ number_format($dr, 2) }} {{ number_format($cr, 2) }} @if($b < 0) ({{ number_format(abs($b), 2) }}) @else {{ number_format($b, 2) }} @endif
{{$tran->EntryDate}} {{$tran->MNarration}}{{$tran->Batch}}{{ number_format($dr, 2) }} {{ number_format($cr, 2) }} @if($b < 0) ({{ number_format(abs($b), 2) }}) @else {{ number_format($b, 2) }} @endif
Balance:
@if($b < 0) ({{ number_format(abs($b), 2) }}) @else {{ number_format($b, 2) }} @endif
@endsection