refactor: handle price 0 baht

This commit is contained in:
Thanaphon Frappet 2025-01-23 14:19:56 +07:00
parent c1c814ade2
commit c7438edd79
3 changed files with 3 additions and 3 deletions

View file

@ -71,7 +71,7 @@ watch(
(newValue) => { (newValue) => {
if (newValue !== undefined && typeof newValue === 'string') { if (newValue !== undefined && typeof newValue === 'string') {
const numericValue = newValue.replace(/,/g, ''); const numericValue = newValue.replace(/,/g, '');
wageRateText.value = ThaiBahtText(numericValue); wageRateText.value = ThaiBahtText(numericValue) || 'ศูนย์บาทถ้วน';
wageRate.value = parseFloat(numericValue); wageRate.value = parseFloat(numericValue);
} }
}, },

View file

@ -448,7 +448,7 @@ function print() {
class="column set-width bg-color full-height" class="column set-width bg-color full-height"
style="padding: 12px" style="padding: 12px"
> >
({{ ThaiBahtText(summaryPrice.finalPrice) }}) ({{ ThaiBahtText(summaryPrice.finalPrice) || 'ศูนย์บาทถ้วน' }})
</div> </div>
<div <div
class="row text-right border-5 items-center" class="row text-right border-5 items-center"

View file

@ -373,7 +373,7 @@ function print() {
class="column set-width bg-color full-height" class="column set-width bg-color full-height"
style="padding: 12px" style="padding: 12px"
> >
({{ ThaiBahtText(summaryPrice.finalPrice) }}) ({{ ThaiBahtText(summaryPrice.finalPrice) || 'ศูนย์บาทถ้วน' }})
</div> </div>
<div <div
class="row text-right border-5 items-center" class="row text-right border-5 items-center"