fix: show payable amount after discount on payment views

Hide the payable row when there is no discount, clamp create-form discounts, and cap notes length.
This commit is contained in:
2026-08-16 07:04:16 +03:30
parent 92eb394466
commit 74c26a8e48
3 changed files with 12 additions and 2 deletions
+2 -1
View File
@@ -33,7 +33,7 @@
<span class="text-muted text-xs block mb-1">تخفیف</span>
<span class="font-semibold text-orange-500 text-lg">{{ toPersianDigits((payment.discount || 0).toLocaleString()) }} تومان</span>
</div>
<div>
<div v-if="payment.discount">
<span class="text-muted text-xs block mb-1">مبلغ قابل پرداخت</span>
<span class="font-bold text-color text-xl">{{ toPersianDigits(payableAmount.toLocaleString()) }} تومان</span>
</div>
@@ -120,6 +120,7 @@
v-model="trxForm.notes"
rows="3"
class="w-full text-sm"
maxlength="5000"
placeholder="یادداشت داخلی درباره این تراکنش…"
/>
</div>
+5
View File
@@ -151,6 +151,7 @@
v-model="createForm.notes"
rows="3"
class="w-full text-sm"
maxlength="5000"
placeholder="یادداشت داخلی درباره این صورتحساب…"
/>
</div>
@@ -267,6 +268,7 @@ const onClassesSelected = () => {
if (!createForm.classes || createForm.classes.length === 0) {
createForm.amount = 0;
createForm.discount = 0;
return;
}
let totalFee = 0;
@@ -279,6 +281,9 @@ const onClassesSelected = () => {
if (totalFee > 0) {
createForm.amount = totalFee;
}
if ((createForm.discount || 0) > (createForm.amount || 0)) {
createForm.discount = createForm.amount || 0;
}
};
const resetCreateForm = () => {