Skip to content

Firefly III: a personal finances manager

Better event.

James Cole419c1a75dd95
diff --git a/frontend/src/components/transactions/Create.vue b/frontend/src/components/transactions/Create.vue
index cfc0da61c4..075a077b84 100644
--- a/frontend/src/components/transactions/Create.vue
+++ b/frontend/src/components/transactions/Create.vue
@@ -33,15 +33,14 @@
:custom-fields="customFields"
:submitted-transaction="submittedTransaction"
v-on:uploaded-attachments="uploadedAttachment($event)"
- v-on:set-description="storeField($event)"
v-on:set-marker-location="storeLocation($event)"
v-on:set-account="storeAccountValue($event)"
v-on:switch-accounts="switchAccounts($event)"
- v-on:set-amount="storeAmount(index, $event)"
- v-on:set-foreign-currency-id="storeField($event)"
- v-on:set-foreign-amount="storeField($event)"
v-on:set-date="storeDate($event)"
v-on:set-time="storeTime($event)"
+ v-on:set-amount="storeField($event)"
+ v-on:set-foreign-currency-id="storeField($event)"
+ v-on:set-foreign-amount="storeField($event)"
v-on:set-custom-date="storeField($event)"
v-on:set-budget="storeField($event)"
v-on:set-category="storeField($event)"
@@ -50,8 +49,9 @@
v-on:set-piggy-bank="storeField($event)"
v-on:set-internal-reference="storeField($event)"
v-on:set-external-url="storeField($event)"
- v-on:set-notes="storeNotes(index, $event)"
- v-on:set-links="storeLinks(index, $event)"
+ v-on:set-notes="storeField($event)"
+ v-on:set-links="storeField($event)"
+ v-on:set-description="storeField($event)"
/>
</div>
@@ -402,55 +402,12 @@ export default {
storeField: function (payload) {
this.updateField(payload);
},
- storeDescription: function (index, value) {
- this.updateField({field: 'description', index: index, value: value});
- },
- storeForeignCurrencyId: function (index, value) {
- console.log('storeForeignCurrencyId(' + index + ',' + value + ')');
- this.updateField({field: 'foreign_currency_id', index: index, value: value});
- },
- storeAmount: function (index, value) {
- this.updateField({field: 'amount', index: index, value: value});
- },
- storeForeignAmount: function (index, value) {
- this.updateField({field: 'foreign_amount', index: index, value: value});
- },
storeDate: function (value) {
this.setDate(value.date)
},
storeTime: function (value) {
this.setTime(value.time)
},
- storeCustomDate: function (index, payload) {
- this.updateField({field: payload.field, index: index, value: payload.date});
- },
- storeBudget: function (index, value) {
- this.updateField({field: 'budget_id', index: index, value: value});
- },
- storeCategory: function (index, value) {
- this.updateField({field: 'category', index: index, value: value});
- },
- storeBill: function (index, value) {
- this.updateField({field: 'bill_id', index: index, value: value});
- },
- storeTags: function (index, value) {
- this.updateField({field: 'tags', index: index, value: value});
- },
- storePiggyBank: function (index, value) {
- this.updateField({field: 'piggy_bank_id', index: index, value: value});
- },
- storeInternalReference: function (index, value) {
- this.updateField({field: 'internal_reference', index: index, value: value});
- },
- storeExternalUrl: function (index, value) {
- this.updateField({field: 'external_url', index: index, value: value});
- },
- storeNotes: function (index, value) {
- this.updateField({field: 'notes', index: index, value: value});
- },
- storeLinks: function (index, value) {
- this.updateField({field: 'links', index: index, value: value});
- },
/**
* Calculate the transaction type based on what's currently in the store.
diff --git a/frontend/src/components/transactions/TransactionAmount.vue b/frontend/src/components/transactions/TransactionAmount.vue
index d98887d1e9..1f2d43f5c6 100644
--- a/frontend/src/components/transactions/TransactionAmount.vue
+++ b/frontend/src/components/transactions/TransactionAmount.vue
@@ -38,7 +38,7 @@
<span v-if="errors.length > 0">
<span v-for="error in errors" class="text-danger small">{{ error }}<br/></span>
</span>
- </div>
+ </div>
</template>
<script>
@@ -46,9 +46,9 @@
export default {
name: "TransactionAmount",
props: [
- 'index', 'errors', 'amount', 'transactionType',
- 'sourceCurrencySymbol',
- 'destinationCurrencySymbol',
+ 'index', 'errors', 'amount', 'transactionType',
+ 'sourceCurrencySymbol',
+ 'destinationCurrencySymbol',
],
data() {
return {
@@ -60,9 +60,9 @@ export default {
},
watch: {
transactionAmount: function (value) {
- this.$emit('set-amount', value);
+ this.$emit('set-amount', {field: 'amount', index: this.index, value: value});
},
- amount: function(value) {
+ amount: function (value) {
this.transactionAmount = value;
},
sourceCurrencySymbol: function (value) {
@@ -72,15 +72,15 @@ export default {
this.dstCurrencySymbol = value;
},
- transactionType: function(value) {
- switch (value) {
- case 'Transfer':
- case 'Withdrawal':
- this.currencySymbol =this.srcCurrencySymbol;
- break;
- case 'Deposit':
- this.currencySymbol =this.dstCurrencySymbol;
- }
+ transactionType: function (value) {
+ switch (value) {
+ case 'Transfer':
+ case 'Withdrawal':
+ this.currencySymbol = this.srcCurrencySymbol;
+ break;
+ case 'Deposit':
+ this.currencySymbol = this.dstCurrencySymbol;
+ }
},
},
}
diff --git a/frontend/src/components/transactions/TransactionLinks.vue b/frontend/src/components/transactions/TransactionLinks.vue
index b188a3239b..36e7c2fae9 100644
--- a/frontend/src/components/transactions/TransactionLinks.vue
+++ b/frontend/src/components/transactions/TransactionLinks.vue
@@ -216,9 +216,7 @@ export default {
},
watch: {
links: function (value) {
- // TODO
- this.$emit('set-links', lodashClonedeep(value));
- //this.updateField({index: this.index, field: 'links', value: lodashClonedeep(value)});
+ this.$emit('set-links', {index: this.index, field: 'links', value: lodashClonedeep(value)});
},
customFields: function (value) {
this.availableFields = value;
diff --git a/frontend/src/components/transactions/TransactionNotes.vue b/frontend/src/components/transactions/TransactionNotes.vue
index ed1e77d610..d0005ab3a9 100644
--- a/frontend/src/components/transactions/TransactionNotes.vue
+++ b/frontend/src/components/transactions/TransactionNotes.vue
@@ -58,7 +58,7 @@ export default {
this.availableFields = value;
},
notes: function (value) {
- this.$emit('set-notes', value);
+ this.$emit('set-notes', {field: 'notes', index: this.index, value: value});
}
}
}