Penambahn P1 Dev

This commit is contained in:
Ariyutta
2026-10-20 10:24:22 +07:00
parent 8418a63fc0
commit ee0e6deacc
43 changed files with 5406 additions and 44 deletions
@@ -0,0 +1,22 @@
<?php
namespace App\Services\P1Dev;
class P1DawaiPaymentComparison
{
public static function reference(?array $dawai, array $local): ?array
{
if ($dawai === null) {
return null;
}
// Use the newest payment ID regardless of whether older amounts match locally.
$latest = null;
foreach ($dawai['riwayat_pembayaran'] ?? [] as $payment) {
if ($latest === null || (int) ($payment['id'] ?? 0) > (int) ($latest['id'] ?? 0)) {
$latest = $payment;
}
}
return $latest ?? $dawai;
}
}