Skip to content

Firefly III: a personal finances manager

Some last minute commits before I go home

Sander Dorigoe468223f763b
diff --git a/resources/assets/v3/js/pages/transactions/create.js b/resources/assets/v3/js/pages/transactions/create.js
index 944f20e352..499942fb98 100644
--- a/resources/assets/v3/js/pages/transactions/create.js
+++ b/resources/assets/v3/js/pages/transactions/create.js
@@ -55,7 +55,8 @@ import bootstrap from "bootstrap/dist/js/bootstrap.bundle.js";
import {removeSplit} from "./shared/remove-split.js";
import {loadTransactionLinks} from './shared/load-transaction-links.js';
import Autocomplete from "bootstrap5-autocomplete";
-
+import formatMoney from "../../util/format-money.js";
+import {format} from "date-fns";
let create = function () {
return {
@@ -245,20 +246,22 @@ let create = function () {
// TODO don't do this on a timeout!
}, 500);
},
+ saveNewLink(e) {
+ // add entry to temporary table.
+ },
createAutocomplete(fieldIdentifier, url) {
let token = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
const renderJournal = function (item, b, c) {
- return item.description + '<br><small class="text-muted">'+item.currency_code +' '+item.amount+ ' @ ' +item.date+'</small>';
+ return item.description + '<br><small class="text-muted">' + formatMoney(item.amount, item.currency_code) + ' @ ' + format(new Date(item.date), this.i18next.t('config.date_time_fns')) +'</small>';
};
- console.log('Make autocomplete.');
Autocomplete.init('#' + fieldIdentifier, {
server: url + '?_token=' + token,
labelField: 'name',
valueField: 'id',
liveServer: true,
- onRenderItem: renderJournal,
+ onRenderItem: renderJournal.bind(this),
fetchOptions: {
method: 'GET',
credentials: 'include',
diff --git a/resources/views/components/transaction/split.blade.php b/resources/views/components/transaction/split.blade.php
index 51c174812e..b23d351bd3 100644
--- a/resources/views/components/transaction/split.blade.php
+++ b/resources/views/components/transaction/split.blade.php
@@ -196,7 +196,7 @@
<input type="text" name="search" :id="'linksModal_search_' + index" class="form-control linked-transactions-search" placeholder="TODO Search here..." aria-label="TODO Search here...">
</div>
<div class="col w-15 text-end">
- <input type="submit" name="submit" value="TODO Save" class="btn btn-primary">
+ <input type="submit" name="submit" :data-index="index" @click.prevent="saveNewLink" value="TODO Save" class="btn btn-primary">
</div>
</div>
</div>