mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Expand recurring transactions API
This commit is contained in:
36
public/js/ff/recurring/create.js
vendored
36
public/js/ff/recurring/create.js
vendored
@@ -155,15 +155,15 @@ function initializeAutoComplete() {
|
||||
);
|
||||
});
|
||||
|
||||
if ($('input[name="destination_account_name"]').length > 0) {
|
||||
if ($('input[name="destination_name"]').length > 0) {
|
||||
$.getJSON('json/expense-accounts').done(function (data) {
|
||||
$('input[name="destination_account_name"]').typeahead({source: data, autoSelect: false});
|
||||
$('input[name="destination_name"]').typeahead({source: data, autoSelect: false});
|
||||
});
|
||||
}
|
||||
|
||||
if ($('input[name="source_account_name"]').length > 0) {
|
||||
if ($('input[name="source_name"]').length > 0) {
|
||||
$.getJSON('json/revenue-accounts').done(function (data) {
|
||||
$('input[name="source_account_name"]').typeahead({source: data, autoSelect: false});
|
||||
$('input[name="source_name"]').typeahead({source: data, autoSelect: false});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -208,16 +208,16 @@ function updateFormFields() {
|
||||
|
||||
if (transactionType === 'withdrawal') {
|
||||
// hide source account name:
|
||||
$('#source_account_name_holder').hide();
|
||||
$('#source_name_holder').hide();
|
||||
|
||||
// show source account ID:
|
||||
$('#source_account_id_holder').show();
|
||||
|
||||
// show destination name:
|
||||
$('#destination_account_name_holder').show();
|
||||
$('#source_id_holder').show();
|
||||
|
||||
// hide destination ID:
|
||||
$('#destination_account_id_holder').hide();
|
||||
$('#destination_id_holder').hide();
|
||||
|
||||
// show destination name:
|
||||
$('#destination_name_holder').show();
|
||||
|
||||
// show budget
|
||||
$('#budget_id_holder').show();
|
||||
@@ -227,19 +227,19 @@ function updateFormFields() {
|
||||
}
|
||||
|
||||
if (transactionType === 'deposit') {
|
||||
$('#source_account_name_holder').show();
|
||||
$('#source_account_id_holder').hide();
|
||||
$('#destination_account_name_holder').hide();
|
||||
$('#destination_account_id_holder').show();
|
||||
$('#source_name_holder').show();
|
||||
$('#source_id_holder').hide();
|
||||
$('#destination_name_holder').hide();
|
||||
$('#destination_id_holder').show();
|
||||
$('#budget_id_holder').hide();
|
||||
$('#piggy_bank_id_holder').hide();
|
||||
}
|
||||
|
||||
if (transactionType === 'transfer') {
|
||||
$('#source_account_name_holder').hide();
|
||||
$('#source_account_id_holder').show();
|
||||
$('#destination_account_name_holder').hide();
|
||||
$('#destination_account_id_holder').show();
|
||||
$('#source_name_holder').hide();
|
||||
$('#source_id_holder').show();
|
||||
$('#destination_name_holder').hide();
|
||||
$('#destination_id_holder').show();
|
||||
$('#budget_id_holder').hide();
|
||||
$('#piggy_bank_id_holder').show();
|
||||
}
|
||||
|
32
public/js/ff/recurring/edit.js
vendored
32
public/js/ff/recurring/edit.js
vendored
@@ -156,15 +156,15 @@ function initializeAutoComplete() {
|
||||
);
|
||||
});
|
||||
|
||||
if ($('input[name="destination_account_name"]').length > 0) {
|
||||
if ($('input[name="destination_name"]').length > 0) {
|
||||
$.getJSON('json/expense-accounts').done(function (data) {
|
||||
$('input[name="destination_account_name"]').typeahead({source: data, autoSelect: false});
|
||||
$('input[name="destination_name"]').typeahead({source: data, autoSelect: false});
|
||||
});
|
||||
}
|
||||
|
||||
if ($('input[name="source_account_name"]').length > 0) {
|
||||
if ($('input[name="source_name"]').length > 0) {
|
||||
$.getJSON('json/revenue-accounts').done(function (data) {
|
||||
$('input[name="source_account_name"]').typeahead({source: data, autoSelect: false});
|
||||
$('input[name="source_name"]').typeahead({source: data, autoSelect: false});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -209,16 +209,16 @@ function updateFormFields() {
|
||||
|
||||
if (transactionType === 'withdrawal') {
|
||||
// hide source account name:
|
||||
$('#source_account_name_holder').hide();
|
||||
$('#source_name_holder').hide();
|
||||
|
||||
// show source account ID:
|
||||
$('#source_account_id_holder').show();
|
||||
$('#source_id_holder').show();
|
||||
|
||||
// show destination name:
|
||||
$('#destination_account_name_holder').show();
|
||||
$('#destination_name_holder').show();
|
||||
|
||||
// hide destination ID:
|
||||
$('#destination_account_id_holder').hide();
|
||||
$('#destination_id_holder').hide();
|
||||
|
||||
// show budget
|
||||
$('#budget_id_holder').show();
|
||||
@@ -228,19 +228,19 @@ function updateFormFields() {
|
||||
}
|
||||
|
||||
if (transactionType === 'deposit') {
|
||||
$('#source_account_name_holder').show();
|
||||
$('#source_account_id_holder').hide();
|
||||
$('#destination_account_name_holder').hide();
|
||||
$('#destination_account_id_holder').show();
|
||||
$('#source_name_holder').show();
|
||||
$('#source_id_holder').hide();
|
||||
$('#destination_name_holder').hide();
|
||||
$('#destination_id_holder').show();
|
||||
$('#budget_id_holder').hide();
|
||||
$('#piggy_bank_id_holder').hide();
|
||||
}
|
||||
|
||||
if (transactionType === 'transfer') {
|
||||
$('#source_account_name_holder').hide();
|
||||
$('#source_account_id_holder').show();
|
||||
$('#destination_account_name_holder').hide();
|
||||
$('#destination_account_id_holder').show();
|
||||
$('#source_name_holder').hide();
|
||||
$('#source_id_holder').show();
|
||||
$('#destination_name_holder').hide();
|
||||
$('#destination_id_holder').show();
|
||||
$('#budget_id_holder').hide();
|
||||
$('#piggy_bank_id_holder').show();
|
||||
}
|
||||
|
Reference in New Issue
Block a user