mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-21 19:47:48 +00:00
Can store and submit transactions.
This commit is contained in:
382
public/v1/js/app.js
vendored
382
public/v1/js/app.js
vendored
File diff suppressed because it is too large
Load Diff
@@ -105,9 +105,6 @@
|
|||||||
accountTypeFilters() {
|
accountTypeFilters() {
|
||||||
let types = this.accountTypeFilters.join(',');
|
let types = this.accountTypeFilters.join(',');
|
||||||
this.accountAutoCompleteURI = document.getElementsByTagName('base')[0].href + "json/accounts?types=" + types + "&query=";
|
this.accountAutoCompleteURI = document.getElementsByTagName('base')[0].href + "json/accounts?types=" + types + "&query=";
|
||||||
},
|
|
||||||
name() {
|
|
||||||
console.log('Trigger watch on name.');
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:
|
methods:
|
||||||
|
@@ -22,12 +22,12 @@
|
|||||||
<form method="POST" action="transactions/store" accept-charset="UTF-8" class="form-horizontal" id="store"
|
<form method="POST" action="transactions/store" accept-charset="UTF-8" class="form-horizontal" id="store"
|
||||||
enctype="multipart/form-data">
|
enctype="multipart/form-data">
|
||||||
<input name="_token" type="hidden" value="xxx">
|
<input name="_token" type="hidden" value="xxx">
|
||||||
<div class="row" v-if="invalid_submission !== ''">
|
<div class="row" v-if="error_message !== ''">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="alert alert-danger alert-dismissible" role="alert">
|
<div class="alert alert-danger alert-dismissible" role="alert">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
|
||||||
aria-hidden="true">×</span></button>
|
aria-hidden="true">×</span></button>
|
||||||
<strong>Error!</strong> {{ invalid_submission }}
|
<strong>Error!</strong> {{ error_message }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<div class="alert alert-success alert-dismissible" role="alert">
|
<div class="alert alert-success alert-dismissible" role="alert">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
|
||||||
aria-hidden="true">×</span></button>
|
aria-hidden="true">×</span></button>
|
||||||
<strong>Success!</strong> {{ success_message }}
|
<strong>Success!</strong> <span v-html="success_message"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -195,7 +195,6 @@
|
|||||||
<div class="box-footer">
|
<div class="box-footer">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button class="btn btn-success" @click="submit">Submit</button>
|
<button class="btn btn-success" @click="submit">Submit</button>
|
||||||
<button class="btn btn-primary" @click="addTransaction">Add another split</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -374,8 +373,8 @@
|
|||||||
.then(response => {
|
.then(response => {
|
||||||
if (this.createAnother) {
|
if (this.createAnother) {
|
||||||
// do message:
|
// do message:
|
||||||
this.success_message = 'The transaction has been stored.';
|
this.success_message = '<a href="transactions/show/' + response.data.data.id + '">The transaction</a> has been stored.';
|
||||||
this.invalid_submission = '';
|
this.error_message = '';
|
||||||
if (this.resetFormAfter) {
|
if (this.resetFormAfter) {
|
||||||
this.addTransaction();
|
this.addTransaction();
|
||||||
}
|
}
|
||||||
@@ -424,11 +423,11 @@
|
|||||||
},
|
},
|
||||||
parseErrors: function (errors) {
|
parseErrors: function (errors) {
|
||||||
this.setDefaultErrors();
|
this.setDefaultErrors();
|
||||||
this.invalid_submission = "";
|
this.error_message = "";
|
||||||
if (errors.message.length > 0) {
|
if (errors.message.length > 0) {
|
||||||
this.invalid_submission = "There was something wrong with your submission. Please check out the errors below.";
|
this.error_message = "There was something wrong with your submission. Please check out the errors below.";
|
||||||
} else {
|
} else {
|
||||||
this.invalid_submission = '';
|
this.error_message = '';
|
||||||
}
|
}
|
||||||
let transactionIndex;
|
let transactionIndex;
|
||||||
let fieldName;
|
let fieldName;
|
||||||
@@ -543,10 +542,14 @@
|
|||||||
allowed_types: []
|
allowed_types: []
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (this.transactions.length === 1) {
|
||||||
|
// set first date.
|
||||||
|
let today = new Date();
|
||||||
|
this.transactions[0].date = today.getFullYear() + '-' + ("0" + (today.getMonth() + 1)).slice(-2) + '-' + ("0" + today.getDate()).slice(-2);
|
||||||
|
}
|
||||||
if (e) {
|
if (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
console.log(this.transactions);
|
|
||||||
},
|
},
|
||||||
setTransactionType: function (type) {
|
setTransactionType: function (type) {
|
||||||
this.transactionType = type;
|
this.transactionType = type;
|
||||||
@@ -675,7 +678,7 @@
|
|||||||
group_title: "",
|
group_title: "",
|
||||||
transactions: [],
|
transactions: [],
|
||||||
group_title_errors: [],
|
group_title_errors: [],
|
||||||
invalid_submission: "",
|
error_message: "",
|
||||||
success_message: "",
|
success_message: "",
|
||||||
cash_account_id: 0,
|
cash_account_id: 0,
|
||||||
createAnother: false,
|
createAnother: false,
|
||||||
|
Reference in New Issue
Block a user