Remove number_format state formatting from the total amount input field.

This commit is contained in:
Yoga Pangestu 2026-02-19 09:52:29 +07:00
parent a1d01654d5
commit ee5e3952ac

View File

@ -140,7 +140,6 @@ public static function configure(Schema $schema): Schema
$paidAmount = (int) str()->replace('.', '', (string) ($state ?? 0));
$totalAmount = (int) str()->replace('.', '', (string) ($get('total_amount') ?? 0));
// Update is_paid based on paid_amount (hanya jika tidak dari toggle)
if (! $get('is_paid')) {
$set('is_paid', $paidAmount >= $totalAmount && $totalAmount > 0);
}
@ -154,10 +153,7 @@ public static function configure(Schema $schema): Schema
}
})
->currencyMask(thousandSeparator: '.', decimalSeparator: ',', precision: 0)
->dehydrateStateUsing(fn ($state) => (int) str()->replace('.', '', (string) ($state ?? 0)))
->formatStateUsing(
fn ($state) => number_format((int) ($state ?? 0), 0, ',', '.')
),
->dehydrateStateUsing(fn ($state) => (int) str()->replace('.', '', (string) ($state ?? 0))),
TextInput::make('remaining_amount')
->label('Sisa Pembayaran')