Filter out lelong that only have hargajualan that is null
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user