mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 00:12:11 +08:00
modify balance modification transaction
This commit is contained in:
@@ -246,9 +246,15 @@ export class Transaction implements TransactionInfoResponse {
|
||||
}
|
||||
|
||||
public toModifyRequest(actualTime?: number): TransactionModifyRequest {
|
||||
let categoryId = this.getCategoryId();
|
||||
|
||||
if (this.type === TransactionType.ModifyBalance) {
|
||||
categoryId = '0';
|
||||
}
|
||||
|
||||
return {
|
||||
id: this.id,
|
||||
categoryId: this.getCategoryId(),
|
||||
categoryId: categoryId,
|
||||
time: actualTime ? actualTime : this.time,
|
||||
utcOffset: this.utcOffset,
|
||||
sourceAccountId: this.sourceAccountId,
|
||||
|
||||
@@ -1050,7 +1050,11 @@ export const useTransactionsStore = defineStore('transactions', () => {
|
||||
|
||||
if (transaction.type !== TransactionType.Expense &&
|
||||
transaction.type !== TransactionType.Income &&
|
||||
transaction.type !== TransactionType.Transfer) {
|
||||
transaction.type !== TransactionType.Transfer &&
|
||||
transaction.type !== TransactionType.ModifyBalance) {
|
||||
reject({ message: 'An error occurred' });
|
||||
return;
|
||||
} else if (!isEdit && transaction.type === TransactionType.ModifyBalance) {
|
||||
reject({ message: 'An error occurred' });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -480,7 +480,7 @@
|
||||
</v-btn>
|
||||
</v-btn-group>
|
||||
<v-btn color="warning" variant="tonal" :disabled="loading || submitting"
|
||||
v-if="mode === TransactionEditPageMode.View && originalTransactionEditable && transaction.type !== TransactionType.ModifyBalance"
|
||||
v-if="mode === TransactionEditPageMode.View && originalTransactionEditable"
|
||||
@click="edit">{{ tt('Edit') }}</v-btn>
|
||||
<v-btn color="error" variant="tonal" :disabled="loading || submitting"
|
||||
v-if="mode === TransactionEditPageMode.View && originalTransactionEditable" @click="remove">
|
||||
|
||||
@@ -299,7 +299,7 @@
|
||||
@click="duplicate(transaction)"></f7-swipeout-button>
|
||||
<f7-swipeout-button color="orange" close
|
||||
:text="tt('Edit')"
|
||||
v-if="transaction.editable && transaction.type !== TransactionType.ModifyBalance"
|
||||
v-if="transaction.editable"
|
||||
@click="edit(transaction)"></f7-swipeout-button>
|
||||
<f7-swipeout-button color="red" class="padding-left padding-right"
|
||||
v-if="transaction.editable"
|
||||
|
||||
Reference in New Issue
Block a user