Compare commits
5 Commits
5571c0d01f
...
884e37fe1b
Author | SHA1 | Date | |
---|---|---|---|
884e37fe1b | |||
cc6a73211e | |||
2299b86d0f | |||
6d293a1aac | |||
a2311aee24 |
45
docs/source/accounting.transaction.forms.rst
Normal file
45
docs/source/accounting.transaction.forms.rst
Normal file
@ -0,0 +1,45 @@
|
||||
accounting.transaction.forms package
|
||||
====================================
|
||||
|
||||
Submodules
|
||||
----------
|
||||
|
||||
accounting.transaction.forms.currency module
|
||||
--------------------------------------------
|
||||
|
||||
.. automodule:: accounting.transaction.forms.currency
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
accounting.transaction.forms.journal\_entry module
|
||||
--------------------------------------------------
|
||||
|
||||
.. automodule:: accounting.transaction.forms.journal_entry
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
accounting.transaction.forms.reorder module
|
||||
-------------------------------------------
|
||||
|
||||
.. automodule:: accounting.transaction.forms.reorder
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
accounting.transaction.forms.transaction module
|
||||
-----------------------------------------------
|
||||
|
||||
.. automodule:: accounting.transaction.forms.transaction
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
Module contents
|
||||
---------------
|
||||
|
||||
.. automodule:: accounting.transaction.forms
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
@ -1,6 +1,15 @@
|
||||
accounting.transaction package
|
||||
==============================
|
||||
|
||||
Subpackages
|
||||
-----------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 4
|
||||
|
||||
accounting.transaction.forms
|
||||
accounting.transaction.utils
|
||||
|
||||
Submodules
|
||||
----------
|
||||
|
||||
@ -12,30 +21,6 @@ accounting.transaction.converters module
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
accounting.transaction.forms module
|
||||
-----------------------------------
|
||||
|
||||
.. automodule:: accounting.transaction.forms
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
accounting.transaction.operators module
|
||||
---------------------------------------
|
||||
|
||||
.. automodule:: accounting.transaction.operators
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
accounting.transaction.summary\_editor module
|
||||
---------------------------------------------
|
||||
|
||||
.. automodule:: accounting.transaction.summary_editor
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
accounting.transaction.template\_filters module
|
||||
-----------------------------------------------
|
||||
|
||||
|
53
docs/source/accounting.transaction.utils.rst
Normal file
53
docs/source/accounting.transaction.utils.rst
Normal file
@ -0,0 +1,53 @@
|
||||
accounting.transaction.utils package
|
||||
====================================
|
||||
|
||||
Submodules
|
||||
----------
|
||||
|
||||
accounting.transaction.utils.account\_option module
|
||||
---------------------------------------------------
|
||||
|
||||
.. automodule:: accounting.transaction.utils.account_option
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
accounting.transaction.utils.offset\_alias module
|
||||
-------------------------------------------------
|
||||
|
||||
.. automodule:: accounting.transaction.utils.offset_alias
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
accounting.transaction.utils.operators module
|
||||
---------------------------------------------
|
||||
|
||||
.. automodule:: accounting.transaction.utils.operators
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
accounting.transaction.utils.original\_entries module
|
||||
-----------------------------------------------------
|
||||
|
||||
.. automodule:: accounting.transaction.utils.original_entries
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
accounting.transaction.utils.summary\_editor module
|
||||
---------------------------------------------------
|
||||
|
||||
.. automodule:: accounting.transaction.utils.summary_editor
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
Module contents
|
||||
---------------
|
||||
|
||||
.. automodule:: accounting.transaction.utils
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
@ -4,6 +4,14 @@ accounting.utils package
|
||||
Submodules
|
||||
----------
|
||||
|
||||
accounting.utils.cast module
|
||||
----------------------------
|
||||
|
||||
.. automodule:: accounting.utils.cast
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
accounting.utils.flash\_errors module
|
||||
-------------------------------------
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
[metadata]
|
||||
name = mia-accounting-flask
|
||||
version = 0.5.0
|
||||
version = 0.6.0
|
||||
author = imacat
|
||||
author_email = imacat@mail.imacat.idv.tw
|
||||
description = The Mia! Accounting Flask project.
|
||||
|
@ -206,4 +206,19 @@ class AccountSelector {
|
||||
this.#clearButton.disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the account selector instances.
|
||||
*
|
||||
* @param entryEditor {JournalEntryEditor} the journal entry editor
|
||||
* @return {{debit: AccountSelector, credit: AccountSelector}}
|
||||
*/
|
||||
static getInstances(entryEditor) {
|
||||
const selectors = {}
|
||||
const modals = Array.from(document.getElementsByClassName("accounting-account-selector"));
|
||||
for (const modal of modals) {
|
||||
selectors[modal.dataset.entryType] = new AccountSelector(entryEditor, modal.dataset.entryType);
|
||||
}
|
||||
return selectors;
|
||||
}
|
||||
}
|
||||
|
@ -200,13 +200,13 @@ class JournalEntryEditor {
|
||||
* The summary editors
|
||||
* @type {{debit: SummaryEditor, credit: SummaryEditor}}
|
||||
*/
|
||||
#summaryEditors = {};
|
||||
#summaryEditors;
|
||||
|
||||
/**
|
||||
* The account selectors
|
||||
* @type {{debit: AccountSelector, credit: AccountSelector}}
|
||||
*/
|
||||
#accountSelectors = {};
|
||||
#accountSelectors;
|
||||
|
||||
/**
|
||||
* The original entry selector
|
||||
@ -236,12 +236,8 @@ class JournalEntryEditor {
|
||||
this.#accountError = document.getElementById(this.#prefix + "-account-error")
|
||||
this.#amount = document.getElementById(this.#prefix + "-amount");
|
||||
this.#amountError = document.getElementById(this.#prefix + "-amount-error");
|
||||
for (const entryType of ["debit", "credit"]) {
|
||||
this.#summaryEditors[entryType] = new SummaryEditor(this, entryType);
|
||||
}
|
||||
for (const entryType of ["debit", "credit"]) {
|
||||
this.#accountSelectors[entryType] = new AccountSelector(this, entryType);
|
||||
}
|
||||
this.#summaryEditors = SummaryEditor.getInstances(this);
|
||||
this.#accountSelectors = AccountSelector.getInstances(this);
|
||||
this.originalEntrySelector = new OriginalEntrySelector();
|
||||
this.#originalEntryControl.onclick = () => this.originalEntrySelector.onOpen(this, this.originalEntryId)
|
||||
this.#originalEntryDelete.onclick = () => this.clearOriginalEntry();
|
||||
|
@ -242,6 +242,21 @@ class SummaryEditor {
|
||||
}
|
||||
this.tabPlanes.general.switchToMe();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the summary editor instances.
|
||||
*
|
||||
* @param entryEditor {JournalEntryEditor} the journal entry editor
|
||||
* @return {{debit: SummaryEditor, credit: SummaryEditor}}
|
||||
*/
|
||||
static getInstances(entryEditor) {
|
||||
const editors = {}
|
||||
const forms = Array.from(document.getElementsByClassName("accounting-summary-editor"));
|
||||
for (const form of forms) {
|
||||
editors[form.dataset.entryType] = new SummaryEditor(entryEditor, form.dataset.entryType);
|
||||
}
|
||||
return editors;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -19,7 +19,7 @@ account-selector-modal.html: The modal for the account selector
|
||||
Author: imacat@mail.imacat.idv.tw (imacat)
|
||||
First written: 2023/2/25
|
||||
#}
|
||||
<div id="accounting-account-selector-{{ entry_type }}-modal" class="modal fade" data-entry-type="{{ entry_type }}" tabindex="-1" aria-labelledby="accounting-account-selector-{{ entry_type }}-modal-label" aria-hidden="true">
|
||||
<div id="accounting-account-selector-{{ entry_type }}-modal" class="modal fade accounting-account-selector" data-entry-type="{{ entry_type }}" tabindex="-1" aria-labelledby="accounting-account-selector-{{ entry_type }}-modal-label" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
|
@ -19,7 +19,7 @@ summary-editor-modal.html: The modal of the summary editor
|
||||
Author: imacat@mail.imacat.idv.tw (imacat)
|
||||
First written: 2023/2/28
|
||||
#}
|
||||
<form id="accounting-summary-editor-{{ summary_editor.type }}">
|
||||
<form id="accounting-summary-editor-{{ summary_editor.type }}" class="accounting-summary-editor" data-entry-type="{{ summary_editor.type }}">
|
||||
<div id="accounting-summary-editor-{{ summary_editor.type }}-modal" class="modal fade" tabindex="-1" aria-labelledby="accounting-summary-editor-{{ summary_editor.type }}-modal-label" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
@ -32,7 +32,7 @@ First written: 2023/2/28
|
||||
<div class="modal-body">
|
||||
<div class="d-flex justify-content-between mb-3">
|
||||
<input id="accounting-summary-editor-{{ summary_editor.type }}-summary" class="form-control" type="text" aria-labelledby="accounting-summary-editor-{{ summary_editor.type }}-modal-label">
|
||||
<button id="accounting-summary-editor-{{ summary_editor.type }}-offset" class="btn btn-primary ms-2" type="button" data-bs-toggle="modal" data-bs-target="#accounting-original-entry-selector-modal">
|
||||
<button id="accounting-summary-editor-{{ summary_editor.type }}-offset" class="btn btn-primary text-nowrap ms-2" type="button" data-bs-toggle="modal" data-bs-target="#accounting-original-entry-selector-modal">
|
||||
{{ A_("Offset...") }}
|
||||
</button>
|
||||
</div>
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user