-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Relaxing Dependency Constraints * Issue 208 ofx files (#209) * fix: initial attempt * Allow .qfx files in data_import form. The accept attribute in the file-input field now includes .qfx files. This permits users to import data from files in .qfx format in addition to the previously supported .ofx format. * remove debugging lines, remove debug code, add sample ofx for tests --------- Co-authored-by: Miguel Sanda <[email protected]> * v0.6.3 (#214) * Add proxy functions to JournalEntry model The commit introduces proxy functions to the JournalEntry model in the Django Ledger code. Specifically, it adds 'post', 'unpost', 'lock', and 'unlock' methods, each serving as a proxy to their counterpart methods 'mark_as_posted', 'mark_as_unposted', 'mark_as_locked', and 'mark_as_unlocked'. This simplifies the interface for interacting with JournalEntry objects. * Minor code optimization & Django Ledger admin fields. * access the queryset instance using .all() which returns a queryset. (#213) * Correct urls for going back in entity and ledger balance sheet view (#215) * Add signal handling for various models' statuses Added signals for different status changes of Django Ledger models to enable real-time, event-driven system behavior. Signals are now sent each time an action is performed in the Ledger, Invoice, Bill, Journal Entry, Purchase Order, and Estimate. These changes will allow us to trigger specific actions depending on these changes. * Update Python version and package versions in Pipfile Updated the Python version from 3.11 to 3.12 in Pipfile and Pipfile.lock. Also, updated the package versions of 'django', 'faker' and 'pillow' in Pipfile.lock for improved functionality and security. * Update Django Ledger version to 0.6.3 This commit updates the version number of the Django Ledger project in both __init__.py and pyproject.toml files. The version has been incremented from 0.6.2 to 0.6.3. * Update signal comments in models Updated the comments in the signals.py file to clearly specify that the signals correspond to Journal Entry Models. Additional context was also included for the signals module to enhance clarity for developers in understanding the importance of events or states in the models. * Update documentation structure Rearrange sections in documentation, focusing on IO and models. For docs/source/models.rst, the automodule section for django_ledger.models.signals was added. Meanwhile, in docs/source/io.rst, sections were reshuffled and terms updated for better clarity. These steps aim to enhance documentation readability and accuracy. --------- Co-authored-by: Eric paul <[email protected]> Co-authored-by: Ubaid ur Rehman <[email protected]> --------- Co-authored-by: Tom Hodder <[email protected]> Co-authored-by: Eric paul <[email protected]> Co-authored-by: Ubaid ur Rehman <[email protected]>
- Loading branch information
1 parent
9281f08
commit b71bf96
Showing
26 changed files
with
1,334 additions
and
681 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
Contributions to this module: | ||
* Miguel Sanda <[email protected]> | ||
* Pranav P Tulshyan <[email protected]> | ||
This module implements the BillModel, which represents an Invoice received from a Supplier/Vendor, on which | ||
the Vendor states the amount owed by the recipient for the purposes of supplying goods and/or services. | ||
|
@@ -39,6 +38,14 @@ | |
from django_ledger.models.items import ItemTransactionModelQuerySet, ItemTransactionModel, ItemModel, ItemModelQuerySet | ||
from django_ledger.models.mixins import (CreateUpdateMixIn, AccrualMixIn, MarkdownNotesMixIn, | ||
PaymentTermsMixIn, ItemizeMixIn) | ||
from django_ledger.models.signals import ( | ||
bill_status_draft, | ||
bill_status_in_review, | ||
bill_status_approved, | ||
bill_status_paid, | ||
bill_status_canceled, | ||
bill_status_void, | ||
) | ||
from django_ledger.models.utils import lazy_loader | ||
from django_ledger.settings import (DJANGO_LEDGER_DOCUMENT_NUMBER_PADDING, DJANGO_LEDGER_BILL_NUMBER_PREFIX) | ||
|
||
|
@@ -612,9 +619,8 @@ def get_migration_data(self, | |
account_unit_total=Sum('total_amount') | ||
) | ||
|
||
def update_amount_due(self, | ||
itemtxs_qs: Optional[Union[ItemTransactionModelQuerySet, List[ItemTransactionModel]]] = None | ||
) -> ItemTransactionModelQuerySet: | ||
def update_amount_due(self, itemtxs_qs: Optional[ | ||
Union[ItemTransactionModelQuerySet, List[ItemTransactionModel]]] = None) -> ItemTransactionModelQuerySet: | ||
""" | ||
Updates the BillModel amount due. | ||
|
@@ -1071,6 +1077,9 @@ def mark_as_draft(self, date_draft: Optional[date] = None, commit: bool = False, | |
'updated' | ||
] | ||
) | ||
bill_status_draft.send_robust(sender=self.__class__, | ||
instance=self, | ||
commited=commit, **kwargs) | ||
|
||
def get_mark_as_draft_html_id(self) -> str: | ||
""" | ||
|
@@ -1176,6 +1185,9 @@ def mark_as_review(self, | |
'updated' | ||
] | ||
) | ||
bill_status_in_review.send_robust(sender=self.__class__, | ||
instance=self, | ||
commited=commit, **kwargs) | ||
|
||
def get_mark_as_review_html_id(self) -> str: | ||
""" | ||
|
@@ -1283,6 +1295,9 @@ def mark_as_approved(self, | |
force_migrate=self.accrue | ||
) | ||
self.ledger.post(commit=commit, raise_exception=raise_exception) | ||
bill_status_approved.send_robust(sender=self.__class__, | ||
instance=self, | ||
commited=commit, **kwargs) | ||
|
||
def get_mark_as_approved_html_id(self) -> str: | ||
""" | ||
|
@@ -1406,6 +1421,9 @@ def mark_as_paid(self, | |
force_migrate=True | ||
) | ||
self.lock_ledger(commit=True) | ||
bill_status_paid.send_robust(sender=self.__class__, | ||
instance=self, | ||
commited=commit, **kwargs) | ||
|
||
def get_mark_as_paid_html_id(self) -> str: | ||
""" | ||
|
@@ -1507,6 +1525,9 @@ def mark_as_void(self, | |
force_migrate=True) | ||
self.save() | ||
self.lock_ledger(commit=False, raise_exception=False) | ||
bill_status_void.send_robust(sender=self.__class__, | ||
instance=self, | ||
commited=commit, **kwargs) | ||
|
||
def get_mark_as_void_html_id(self) -> str: | ||
""" | ||
|
@@ -1574,6 +1595,9 @@ def mark_as_canceled(self, date_canceled: Optional[date] = None, commit: bool = | |
self.clean() | ||
if commit: | ||
self.save() | ||
bill_status_canceled.send_robust(sender=self.__class__, | ||
instance=self, | ||
commited=commit, **kwargs) | ||
|
||
def get_mark_as_canceled_html_id(self) -> str: | ||
""" | ||
|
@@ -1890,13 +1914,3 @@ def billmodel_presave(instance: BillModel, **kwargs): | |
|
||
|
||
pre_save.connect(receiver=billmodel_presave, sender=BillModel) | ||
|
||
# def billmodel_predelete(instance: BillModel, **kwargs): | ||
# ledger_model = instance.ledger | ||
# ledger_model.unpost(commit=False) | ||
# ledger_model.remove_wrapped_model_info() | ||
# ledger_model.itemtransactonmodel_set.all().delete() | ||
# instance.ledger.delete() | ||
# | ||
# | ||
# pre_delete.connect(receiver=billmodel_predelete, sender=BillModel) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
""" | ||
Django Ledger created by Miguel Sanda <[email protected]>. | ||
Copyright© EDMA Group Inc licensed under the GPLv3 Agreement. | ||
Contributions to this module: | ||
* Miguel Sanda <[email protected]> | ||
""" | ||
|
||
from datetime import datetime, time | ||
from decimal import Decimal | ||
from itertools import groupby, chain | ||
|
Oops, something went wrong.