diff --git a/src/accounting/templates/accounting/transaction/expense/include/form.html b/src/accounting/templates/accounting/transaction/expense/include/form.html index 42bcac4..6af9321 100644 --- a/src/accounting/templates/accounting/transaction/expense/include/form.html +++ b/src/accounting/templates/accounting/transaction/expense/include/form.html @@ -49,5 +49,8 @@ First written: 2023/2/25 {% with summary_helper = form.summary_helper.debit %} {% include "accounting/transaction/include/summary-helper-modal.html" %} {% endwith %} - {% include "accounting/transaction/include/debit-account-modal.html" %} + {% with entry_type = "debit", + account_options = form.debit_account_options %} + {% include "accounting/transaction/include/account-selector-modal.html" %} + {% endwith %} {% endblock %} diff --git a/src/accounting/templates/accounting/transaction/include/account-selector-modal.html b/src/accounting/templates/accounting/transaction/include/account-selector-modal.html new file mode 100644 index 0000000..f059f30 --- /dev/null +++ b/src/accounting/templates/accounting/transaction/include/account-selector-modal.html @@ -0,0 +1,54 @@ +{# +The Mia! Accounting Flask Project +account-selector-modal.html: The modal for the account selector + + Copyright (c) 2023 imacat. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +Author: imacat@mail.imacat.idv.tw (imacat) +First written: 2023/2/25 +#} + diff --git a/src/accounting/templates/accounting/transaction/include/credit-account-modal.html b/src/accounting/templates/accounting/transaction/include/credit-account-modal.html deleted file mode 100644 index 2211141..0000000 --- a/src/accounting/templates/accounting/transaction/include/credit-account-modal.html +++ /dev/null @@ -1,54 +0,0 @@ -{# -The Mia! Accounting Flask Project -credit-modals.html: The modals for the credit journal entry sub-form - - Copyright (c) 2023 imacat. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -Author: imacat@mail.imacat.idv.tw (imacat) -First written: 2023/2/25 -#} - diff --git a/src/accounting/templates/accounting/transaction/include/debit-account-modal.html b/src/accounting/templates/accounting/transaction/include/debit-account-modal.html deleted file mode 100644 index 0ffc8dd..0000000 --- a/src/accounting/templates/accounting/transaction/include/debit-account-modal.html +++ /dev/null @@ -1,54 +0,0 @@ -{# -The Mia! Accounting Flask Project -credit-modals.html: The modals for the debit journal entry sub-form - - Copyright (c) 2023 imacat. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -Author: imacat@mail.imacat.idv.tw (imacat) -First written: 2023/2/25 -#} - diff --git a/src/accounting/templates/accounting/transaction/income/include/form.html b/src/accounting/templates/accounting/transaction/income/include/form.html index 0e1b36d..b09f921 100644 --- a/src/accounting/templates/accounting/transaction/income/include/form.html +++ b/src/accounting/templates/accounting/transaction/income/include/form.html @@ -49,5 +49,8 @@ First written: 2023/2/25 {% with summary_helper = form.summary_helper.credit %} {% include "accounting/transaction/include/summary-helper-modal.html" %} {% endwith %} - {% include "accounting/transaction/include/credit-account-modal.html" %} + {% with entry_type = "credit", + account_options = form.credit_account_options %} + {% include "accounting/transaction/include/account-selector-modal.html" %} + {% endwith %} {% endblock %} diff --git a/src/accounting/templates/accounting/transaction/transfer/include/form.html b/src/accounting/templates/accounting/transaction/transfer/include/form.html index 70bcdab..9e0fc0a 100644 --- a/src/accounting/templates/accounting/transaction/transfer/include/form.html +++ b/src/accounting/templates/accounting/transaction/transfer/include/form.html @@ -56,6 +56,12 @@ First written: 2023/2/25 {% with summary_helper = form.summary_helper.credit %} {% include "accounting/transaction/include/summary-helper-modal.html" %} {% endwith %} - {% include "accounting/transaction/include/debit-account-modal.html" %} - {% include "accounting/transaction/include/credit-account-modal.html" %} + {% with entry_type = "debit", + account_options = form.debit_account_options %} + {% include "accounting/transaction/include/account-selector-modal.html" %} + {% endwith %} + {% with entry_type = "credit", + account_options = form.credit_account_options %} + {% include "accounting/transaction/include/account-selector-modal.html" %} + {% endwith %} {% endblock %}