From 90cf1e7653da919464a90fa54afc8a1135872a76 Mon Sep 17 00:00:00 2001 From: Jason Antman Date: Mon, 20 Aug 2018 17:45:08 -0400 Subject: [PATCH] fixes #196 - don't include inactive budgets in Transation Modal budget selects, unless already using that budget --- CHANGES.rst | 1 + .../flaskapp/static/js/transactions_modal.js | 30 +++++++++++++++++-- .../flaskapp/templates/payperiod.html | 4 +++ .../flaskapp/templates/reconcile.html | 4 +++ .../flaskapp/templates/transactions.html | 4 +++ biweeklybudget/flaskapp/views/payperiods.py | 6 +++- biweeklybudget/flaskapp/views/reconcile.py | 6 +++- biweeklybudget/flaskapp/views/transactions.py | 22 ++++++++++---- 8 files changed, 66 insertions(+), 11 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 91506a7e..fd708138 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,6 +6,7 @@ Unreleased Changes * `Issue #198 `_ - Fix broken method of retrieving current US Prime Rate. Previously we used marketwatch.com for this but they've introduced javascript-based bot protection on their site (which is ironic since we were reading a value from the page's ``meta`` tags, which are specifically intended to be read by machines). Switch to using wsj.com instead and (ugh) parsing a HTML table. This *will* break when the format of the table changes. As previously, we cache this value in the DB for 48 hours in order to be a good citizen. * `Issue #197 `_ - Add notification for case where balance of all budget-funding accounts is *more* than sum of standing budgets, current payperiod remaining, and unreconciled. This is the opposite of the similar notification that already exists, intended to detect if there is money in accounts not accounted for in the budgets. +* `Issue #196 `_ - Don't include inactive budgets in Budget select elements on Transaction Modal form, unless it's an existing Transaction using that budget. 1.0.0 (2018-07-07) ------------------ diff --git a/biweeklybudget/flaskapp/static/js/transactions_modal.js b/biweeklybudget/flaskapp/static/js/transactions_modal.js index 348fdc7f..4879a01d 100644 --- a/biweeklybudget/flaskapp/static/js/transactions_modal.js +++ b/biweeklybudget/flaskapp/static/js/transactions_modal.js @@ -41,6 +41,7 @@ var validation_count = 0; // helper for acceptance testing of validation logic * Generate the HTML for the form on the Modal */ function transModalDivForm() { + return new FormBuilder('transForm') .addHidden('trans_frm_id', 'id', '') .addDatePicker('trans_frm_date', 'date', 'Date') @@ -52,7 +53,7 @@ function transModalDivForm() { { inputHtml: 'onchange="transModalHandleSplit()"' } ) .addHTML('
') - .addLabelToValueSelect('trans_frm_budget', 'budget', 'Budget', budget_names_to_id, 'None', true) + .addLabelToValueSelect('trans_frm_budget', 'budget', 'Budget', active_budget_names_to_id, 'None', true) .addHTML( '