@extends('layouts.master') @section('title', 'Cost Center Reports | Alboosh - Timeless authenticity, born of the desert') @section('title-topbar', __('basic.cost center reports')) @section('css') @endsection @section('content')
| {{ __('basic.transaction') }} | {{ __('basic.account') }} | {{ __('basic.entry number') }} | {{ __('basic.description') }} | {{ __('basic.percentage') }} | {{ __('basic.debit') }} | {{ __('basic.credit') }} | {{ __('basic.amount') }} | |
|---|---|---|---|---|---|---|---|---|
|
@php
$icon = "fas fa-wallet";
$icon_color = "main-color";
@endphp
{{ $item_ent->date}} {{ $item_ent->new_id}}{{ __('basic.worker') . ": " . $item_ent->worker->full_name}} |
{{ $item_ent->account->code . " - ". $item_ent->account->name }} |
@if($item_ent->entry) {{ $item_ent->entry->new_id }} @else {{ __('basic.not selected') }} @endif | {{ $item_ent->description }} | {{ $item_ent->percentage }}% | @php $total_debit += $item_ent->debit_local; @endphp @if($item_ent->debit_local !== '0.00') {{ $item_ent->debit_local }} {{ $system_currency->code }} @endif | @php $total_credit += $item_ent->credit_local; @endphp @if($item_ent->credit_local !== '0.00') {{ $item_ent->credit_local }} {{ $system_currency->code }} @endif |
@php
//if it is credit
if ($item->origin == 0) {
if ($item_ent->credit_local > 0) {
//more credit and the acc origin is credit, balance will be +
$new_acc_balance = $item_ent->credit_local + $total_amount;
} else {
//more debit and the acc origin is credit, balance will be -
$new_acc_balance = $total_amount - $item_ent->debit_local;
}
} else {
if ($item_ent->debit_local > 0) {
//more debit and the acc origin is debit, balance will be +
$new_acc_balance = $item_ent->debit_local + $total_amount;
} else {
//more credit and the acc origin is debit, balance will be -
$new_acc_balance = $total_amount - $item_ent->credit_local;
}
}
@endphp
{{ $new_acc_balance }} {{ $system_currency->code }} @php $total_amount = $new_acc_balance; @endphp |
|
| {{ __('basic.total') }} | {{ $total_debit }} {{ $system_currency->code }} | {{ $total_credit }} {{ $system_currency->code }} | {{ $total_amount }} {{ $system_currency->code }} | |||||