mirror of
https://github.com/frappe/books.git
synced 2024-11-08 14:50:56 +00:00
fix(ux): disable submit button
This commit is contained in:
parent
9874d71821
commit
8d1e0ca8c8
@ -168,6 +168,7 @@
|
||||
<Button
|
||||
class="w-full bg-blue-500"
|
||||
style="padding: 1.35rem"
|
||||
:disabled="disableSubmitButton"
|
||||
@click="$emit('createTransaction')"
|
||||
>
|
||||
<slot>
|
||||
@ -181,6 +182,7 @@
|
||||
<Button
|
||||
class="w-full bg-green-500"
|
||||
style="padding: 1.35rem"
|
||||
:disabled="disableSubmitButton"
|
||||
@click="$emit('createTransaction', true)"
|
||||
>
|
||||
<slot>
|
||||
@ -290,10 +292,20 @@ export default defineComponent({
|
||||
|
||||
return false;
|
||||
},
|
||||
disableSubmitButton(): boolean {
|
||||
if (
|
||||
!this.sinvDoc.grandTotal?.isZero() &&
|
||||
this.transferAmount.isZero() &&
|
||||
this.cashAmount.isZero()
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
setCashOrTransferAmount(payemtMethod = 'Cash') {
|
||||
if (payemtMethod === 'Transfer') {
|
||||
setCashOrTransferAmount(paymentMethod = 'Cash') {
|
||||
if (paymentMethod === 'Transfer') {
|
||||
this.$emit('setCashAmount', fyo.pesa(0));
|
||||
this.$emit('setTransferAmount', this.sinvDoc?.grandTotal);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user