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
+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 = () => {