Finquest

{{ $event['name'] }} {{ count($event['member']) }} members

Split Summary

Created On: {{ $event['created_at'] }}
Updated On: {{ $event['updated_at'] }}
@php function findObject($array, $from_id, $to_id) { $i = 1; foreach ($array as $element) { if ($to_id == $element->from_id && $from_id == $element->to_id) { return $i; } $i++; } return false; } $i = 0; $splitTran = []; if (isset($event['splitData']) && !empty($event['splitData'])) { foreach ($event['splitData'] as $key => $val) { if (isset($val->amount) && $val->amount > 0) { if ($i == 0) { $splitTran[$i] = new stdClass(); $splitTran[$i]->from_name = $val->from_name; $splitTran[$i]->to_name = $val->to_name; $splitTran[$i]->amount = $val->amount; $splitTran[$i]->from_id = $val->from_id; $splitTran[$i]->to_id = $val->to_id; $i++; } else { $findObject = findObject($splitTran, $val->from_id, $val->to_id); if ($findObject != false) { $curKey = $findObject - 1; if ($val->amount > $splitTran[$curKey]->amount) { $newAmt = $val->amount - $splitTran[$curKey]->amount; $splitTran[$curKey]->from_name = $val->from_name; $splitTran[$curKey]->to_name = $val->to_name; $splitTran[$curKey]->amount = $newAmt; $splitTran[$curKey]->from_id = $val->from_id; $splitTran[$curKey]->to_id = $val->to_id; }else{ $newAmt = $splitTran[$curKey]->amount - $val->amount; $splitTran[$curKey]->amount = $newAmt; } } else { $splitTran[$i] = new stdClass(); $splitTran[$i]->from_name = $val->from_name; $splitTran[$i]->to_name = $val->to_name; $splitTran[$i]->amount = $val->amount; $splitTran[$i]->from_id = $val->from_id; $splitTran[$i]->to_id = $val->to_id; $i++; } } } } } print_r($splitTran); $i = 1; @endphp @if (isset($splitTran) && !empty($splitTran)) @foreach ($splitTran as $key => $val) @if (isset($val->amount) && $val->amount > 0) @endif @endforeach @endif
No From To Amount
{{ $i++ }} {{ $val->from_name }} {{ $val->to_name }} {{ sprintf('%01.2f', $val->amount) }}

Transactions

@php $total = 0; @endphp @if (isset($event['transaction']) && !empty($event['transaction'])) @foreach ($event['transaction'] as $key => $val) @php $total = $total + $val['amount']; @endphp @endforeach @endif
Name Date Category Note Split Between Amount
{{ $val['payer'] }} {{ $val['transaction_date'] }} {{ $val['category'] }} {{ $val['note'] }} @if (isset($val['splitbetween']) && !empty($val['splitbetween'])) @foreach ($val['splitbetween'] as $k => $v) {{ $v }}, @endforeach @endif {{ sprintf('%01.2f', $val['amount']) }}
Total {{ sprintf('%01.2f', $total) }}

TOTAL EXPENSE(MEMBER WISE)

@php $i = 1; @endphp @if (isset($event['expenseData']) && !empty($event['expenseData'])) @foreach ($event['expenseData'] as $key => $val) @if (isset($val->amount) && $val->amount > 0) @endif @endforeach @endif
Name Amount
{{ $val->name }} {{ sprintf('%01.2f', $val->amount) }}

TOTAL INCOME(MEMBER WISE)

@php $i = 1; @endphp @if (isset($event['incomeData']) && !empty($event['incomeData'])) @foreach ($event['incomeData'] as $key => $val) @if (isset($val->amount) && $val->amount > 0) @endif @endforeach @endif
Name Amount
{{ $val->name }} {{ sprintf('%01.2f', $val->amount) }}