@extends('admin.layout.master')
@section('open-dashboard', 'open')
@section('menu-dashboard', 'bg-gradient-to-r from-[#53BF6A] to-[#275931] text-white')
@section('addCss')
@endsection
@section('content')
@if ($lowRawMaterialsCount > 0)
⚠️
{{ $lowRawMaterialsCount }} stok bahan baku berada di bawah / sama dengan batas minimum
{{ $rawMaterialLowStockThreshold }}.
@endif
Total Penjualan
Rp {{ number_format($totalSales, 0, ',', '.') }}
Periode terpilih
Total Transaksi
{{ number_format($totalTransactions, 0, ',', '.') }}
Jumlah invoice penjualan
Pembayaran Masuk
Rp {{ number_format($totalPaid, 0, ',', '.') }}
Akumulasi paid amount
Piutang
Rp {{ number_format($totalDebt, 0, ',', '.') }}
Sisa tagihan penjualan
Variant Produk Aktif
{{ number_format($totalProdukAktif, 0, ',', '.') }}
Data dari product variants
| ID |
Tanggal |
Pelanggan |
Produk |
Qty |
Total |
Pembayaran |
@forelse ($latestSales as $sale)
@php
$paymentBadge = match ($sale->payment_status) {
'lunas' => 'badge-success',
'terhutang' => 'badge-warning',
default => 'badge-danger',
};
$paymentLabel = match ($sale->payment_status) {
'lunas' => 'Lunas',
'terhutang' => 'Terhutang',
default => 'Terhutang',
};
@endphp
| {{ $sale->id }} |
{{ \Carbon\Carbon::parse($sale->sale_date)->format('d/m/Y') }} |
{{ $sale->customer_name }} |
{{ $sale->product }} |
{{ $sale->qty }} |
Rp {{ number_format($sale->total_amount, 0, ',', '.') }} |
{{ $paymentLabel }}
|
@empty
|
Belum ada data transaksi.
|
@endforelse
@forelse ($topProducts as $index => $prod)
{{ $index + 1 }}
{{ $prod->product_name }}
{{ $prod->variant_name }}
Rp {{ number_format($prod->total_revenue, 0, ',', '.') }}
{{ number_format($prod->total_qty, 0, ',', '.') }} unit
@empty
Belum ada data penjualan.
@endforelse
@forelse ($topWarehouses as $index => $warehouse)
{{ $index + 1 }}
{{ $warehouse->name }}
{{ ucfirst($warehouse->type ?? '-') }} • {{ $warehouse->city ?? '-' }}
Rp {{ number_format($warehouse->total_revenue, 0, ',', '.') }}
{{ number_format($warehouse->total_qty_terjual, 0, ',', '.') }} unit •
{{ number_format($warehouse->total_transaksi, 0, ',', '.') }} transaksi
@empty
Belum ada data penjualan gudang.
@endforelse
@php
$maxWarehouseStock = max((int) ($stockByWarehouse->max('total_stock') ?? 1), 1);
@endphp
@forelse ($stockByWarehouse as $stock)
@php
$percent = round(($stock->total_stock / $maxWarehouseStock) * 100, 1);
$fillClass = $percent <= 35 ? 'fill-red' : ($percent <= 70 ? 'fill-amber' : 'fill-green');
@endphp
{{ $stock->name }}
{{ number_format($stock->total_stock, 0, ',', '.') }} unit
@empty
Belum ada data stok produk.
@endforelse
| Bahan Baku |
Stok |
@forelse ($lowRawMaterials as $item)
| {{ $item->name }} |
{{ number_format($item->stock, 0, ',', '.') }} {{ $item->unit }} |
@empty
|
Tidak ada bahan baku kritis.
|
@endforelse
@endsection
@section('addJs')
@endsection