adamcharnock / django-hordak

Double entry accounting in Django
http://django-hordak.readthedocs.io
MIT License
238 stars 55 forks source link

Adding utility to generate account codes #114

Closed adamcharnock closed 4 months ago

adamcharnock commented 4 months ago

I need this for my current project, and figured it would be useful to others too

Simple form:

from hordak.utilities.account_codes import get_next_account_code

get_next_account_code("09")
>>> "10"

get_next_account_code("19", alpha=True)
>>> "1A"

Generator:

for code in AccountCodeGenerator(start_at='00'):
    print(code)

for code in AccountCodeGenerator(start_at='00', alpha=True):
    print(code)
codecov-commenter commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.11%. Comparing base (81b90df) to head (66dbe6a). Report is 3 commits behind head on master.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #114 +/- ## ========================================== + Coverage 93.01% 93.11% +0.10% ========================================== Files 59 61 +2 Lines 3836 3895 +59 Branches 249 256 +7 ========================================== + Hits 3568 3627 +59 Misses 224 224 Partials 44 44 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

adamcharnock commented 4 months ago

Just so you're aware @PetrDlouhy