@extends('layouts.app')
@section('title', __('Business Reports'))
@section('content')
@php($period = __('Period').': '.$from.' - '.$to)
@foreach([
['Sales', $salesTotal, 'fa-chart-column', 'text-success', __('Invoices').': '.$salesCount],
['Purchases', $purchaseTotal, 'fa-cart-arrow-down', 'text-warning', __('Purchases').': '.$purchaseCount],
['Expenses', $expenses, 'fa-money-bill-transfer', 'text-danger', __('Operating expenses')],
['Gross Profit', $grossProfit, 'fa-scale-balanced', $grossProfit >= 0 ? 'text-success' : 'text-danger', __('Sales minus cost of goods')],
['Net Profit', $netProfit, 'fa-file-invoice-dollar', $netProfit >= 0 ? 'text-success' : 'text-danger', __('After expenses')],
['Inventory Value', $inventoryValue, 'fa-warehouse', 'text-success', __('Low Stock Items').': '.$lowStockCount],
['Customer Due', $receivable, 'fa-user-clock', 'text-danger', __('Accounts Receivable')],
['Supplier Due', $payable, 'fa-truck-field', 'text-danger', __('Supplier Payables')],
] as [$label, $value, $icon, $class, $caption])
{{ __($label) }}
{{ number_format($value, 2) }} {{ $moneyCode }}
{{ $caption }}
@endforeach