mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Better fit for run recalculations.
This commit is contained in:
@@ -490,7 +490,6 @@ let transactions = function () {
|
||||
// addedSplit, is called from the HTML
|
||||
// for source account
|
||||
const renderAccount = function (item, b, c) {
|
||||
console.log('render account');
|
||||
return item.name_with_balance + '<br><small class="text-muted">' + i18next.t('firefly.account_type_' + item.type) + '</small>';
|
||||
};
|
||||
console.log('here we are in');
|
||||
@@ -499,7 +498,7 @@ let transactions = function () {
|
||||
serverUrl: urls.account,
|
||||
onRenderItem: renderAccount,
|
||||
valueField: 'id',
|
||||
labelField: 'title',
|
||||
labelField: 'name_with_balance',
|
||||
onChange: changeSourceAccount,
|
||||
onSelectItem: selectSourceAccount,
|
||||
hiddenValue: this.entries[count].source_account.alpine_name
|
||||
@@ -509,7 +508,7 @@ let transactions = function () {
|
||||
serverUrl: urls.account,
|
||||
account_types: this.filters.destination,
|
||||
valueField: 'id',
|
||||
labelField: 'title',
|
||||
labelField: 'name_with_balance',
|
||||
onRenderItem: renderAccount,
|
||||
onChange: changeDestinationAccount,
|
||||
onSelectItem: selectDestinationAccount
|
||||
|
@@ -45,7 +45,7 @@ export function addAutocomplete(options) {
|
||||
liveServer: true,
|
||||
};
|
||||
if (typeof options.account_types !== 'undefined' && options.account_types.length > 0) {
|
||||
params.serverParams['filter[account_types]'] = options.account_types;
|
||||
params.serverParams['types'] = options.account_types;
|
||||
}
|
||||
if (typeof options.onRenderItem !== 'undefined' && null !== options.onRenderItem) {
|
||||
console.log('overrule onRenderItem.');
|
||||
|
@@ -55,7 +55,7 @@ export function changeDestinationAccount(item, ac) {
|
||||
export function selectDestinationAccount(item, ac) {
|
||||
const index = parseInt(ac._searchInput.attributes['data-index'].value);
|
||||
document.querySelector('#form')._x_dataStack[0].$data.entries[index].destination_account = {
|
||||
id: item.id, name: item.title, alpine_name: item.title, type: item.meta.type, currency_code: item.meta.currency_code,
|
||||
id: item.id, name: item.name, alpine_name: item.name, type: item.type, currency_code: item.currency_code,
|
||||
};
|
||||
document.querySelector('#form')._x_dataStack[0].changedDestinationAccount();
|
||||
}
|
||||
@@ -78,7 +78,7 @@ export function changeSourceAccount(item, ac) {
|
||||
export function selectSourceAccount(item, ac) {
|
||||
const index = parseInt(ac._searchInput.attributes['data-index'].value);
|
||||
document.querySelector('#form')._x_dataStack[0].$data.entries[index].source_account = {
|
||||
id: item.id, name: item.title, alpine_name: item.title, type: item.meta.type, currency_code: item.meta.currency_code,
|
||||
id: item.id, name: item.name, alpine_name: item.name, type: item.type, currency_code: item.currency_code,
|
||||
};
|
||||
document.querySelector('#form')._x_dataStack[0].changedSourceAccount();
|
||||
}
|
||||
|
Reference in New Issue
Block a user