diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 1063e4c..35a472f 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -36,6 +36,9 @@ class HomeController extends Controller ->json(); ['gadai' => $customer_gadai, 'lelong' => $customer_lelong] = $customerInfo; + + // only get lelong that is harga jualan that is not null or 0 + $customer_lelong = array_filter($customer_lelong, fn($x) => $x['hargajualan'] != null && $x['hargajualan'] != 0); $formatMoney = fn($x) => number_format($x, 2); $getTotal = fn($x) => array_reduce($x, fn($accumulator, $current_item) => $accumulator + $current_item['bakipjm'], 0);