Skip to content

Firefly III: a personal finances manager

Some extra code for #1376

James Coleee5a4caaab8b
diff --git a/public/v1/js/ff/budgets/create.js b/public/v1/js/ff/budgets/create.js
index 79ac07ac9c..a4345a60a1 100644
--- a/public/v1/js/ff/budgets/create.js
+++ b/public/v1/js/ff/budgets/create.js
@@ -21,4 +21,22 @@
$(function () {
"use strict";
$(".content-wrapper form input:enabled:visible:first").first().focus().select();
+
+ $('#ffInput_auto_budget_type').change(updateAutoBudget);
+
+ function updateAutoBudget() {
+ var value = parseInt($('#ffInput_auto_budget_type').val());
+ if (0 === value) {
+ $('#ffInput_auto_budget_currency_id').prop('disabled', true);
+ $('#ffInput_auto_budget_amount').prop('disabled', true);
+ $('#ffInput_auto_budget_period').prop('disabled', true);
+ return;
+ }
+ $('#ffInput_auto_budget_currency_id').prop('disabled', false);
+ $('#ffInput_auto_budget_amount').prop('disabled', false);
+ $('#ffInput_auto_budget_period').prop('disabled', false);
+ }
+
+ updateAutoBudget();
+
});
\ No newline at end of file
diff --git a/public/v1/js/ff/budgets/edit.js b/public/v1/js/ff/budgets/edit.js
index 536c28a7e6..99ce079bbb 100644
--- a/public/v1/js/ff/budgets/edit.js
+++ b/public/v1/js/ff/budgets/edit.js
@@ -21,4 +21,22 @@
$(function () {
"use strict";
$(".content-wrapper form input[type='text']:enabled:visible:first").first().focus();
+
+ $('#ffInput_auto_budget_type').change(updateAutoBudget);
+
+ function updateAutoBudget() {
+ var value = parseInt($('#ffInput_auto_budget_type').val());
+ if (0 === value) {
+ $('#ffInput_auto_budget_currency_id').prop('disabled', true);
+ $('#ffInput_auto_budget_amount').prop('disabled', true);
+ $('#ffInput_auto_budget_period').prop('disabled', true);
+ return;
+ }
+ $('#ffInput_auto_budget_currency_id').prop('disabled', false);
+ $('#ffInput_auto_budget_amount').prop('disabled', false);
+ $('#ffInput_auto_budget_period').prop('disabled', false);
+ }
+
+ updateAutoBudget();
+
});
\ No newline at end of file
diff --git a/resources/views/v1/transactions/mass/edit.twig b/resources/views/v1/transactions/mass/edit.twig
index f822a71084..84bc1a78ed 100644
--- a/resources/views/v1/transactions/mass/edit.twig
+++ b/resources/views/v1/transactions/mass/edit.twig
@@ -150,7 +150,7 @@
<select class="form-control input-sm" name="budget_id[{{ journal.transaction_journal_id }}]">
<option value="0" label="({{ 'no_budget'|_ }})"
{% if journal.budget_id == 0 %}selected="selected"{% endif %}
- >({{ 'no_budget'|_ }})
+ >{{ 'no_budget'|_ }}
</option>
{% for budget in budgets %}
<option value="{{ budget.id }}"{% if budget.id == journal.budget_id %} selected="selected"{% endif %}