Git Product home page Git Product logo

arrobalytics / django-ledger Goto Github PK

View Code? Open in Web Editor NEW
893.0 78.0 203.0 15.95 MB

Django Ledger is a double entry accounting system built on the Django Web Framework.

Home Page: https://www.djangoledger.com

License: GNU General Public License v3.0

Python 76.70% HTML 19.83% JavaScript 0.09% TypeScript 0.83% SCSS 0.01% Less 0.06% Jupyter Notebook 2.47% Dockerfile 0.01% Shell 0.01%
finance django django-framework django-application django-project accounting forecasting ledger-journal bookkeeping cashmanagement

django-ledger's People

Contributors

25-do avatar anfas-mp avatar bairagisachin1730 avatar beachwood619 avatar dependabot[bot] avatar djbios avatar elarroba avatar justinmerrell avatar lianto2020 avatar mateehullah avatar mnooel avatar nikhil-malladi avatar padmanabh-b avatar pieterck avatar pranav7712 avatar rkisdp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-ledger's Issues

Adding More Columns for capturing Other Important Details of the Vendor , Customer, Items

The Ledger Currently captures the basic details of Vendor and Customer..

More fields can be added either through the creation of Mixins or directly to the model like below:

Vendor Model:
Banking Data (for making Payment), Sales Tax Related Data like Registration Number (for Returns Filing), More Correspondance Informations,

Customer Model:
Similarly for the Customer, adding more relevant Columns , like Sales Tax Information

Items Model:
Additional Fields can be added to capture the specifications of the items .

bill referencing Temp?

Hi,

pls see Temp ref at the end:

CREATE TABLE "django_ledger_billmodel" ("created" datetime NOT NULL, "updated" datetime NULL, "terms" varchar(10) NOT NULL, "amount_due" decimal NOT NULL, "amount_paid" decimal NOT NULL, "amount_receivable" decimal NOT NULL, "amount_unearned" decimal NOT NULL, "amount_earned" decimal NOT NULL, "paid" bool NOT NULL, "paid_date" date NULL, "date" date NOT NULL, "due_date" date NOT NULL, "void" bool NOT NULL, "void_date" date NULL, "accrue" bool NOT NULL, "progress" decimal NOT NULL, "uuid" char(32) NOT NULL PRIMARY KEY, "bill_number" varchar(20) NOT NULL UNIQUE, "xref" varchar(50) NULL, "additional_info" text NOT NULL CHECK ((JSON_VALID("additional_info") OR "additional_info" IS NULL)), "cash_account_id" char(32) NULL REFERENCES "django_ledger_accountmodel" ("uuid") DEFERRABLE INITIALLY DEFERRED, "ledger_id" char(32) NOT NULL UNIQUE REFERENCES "django_ledger_ledgermodel" ("uuid") DEFERRABLE INITIALLY DEFERRED, "prepaid_account_id" char(32) NULL REFERENCES "django_ledger_accountmodel" ("uuid") DEFERRABLE INITIALLY DEFERRED, "unearned_account_id" char(32) NULL REFERENCES "django_ledger_accountmodel" ("uuid") DEFERRABLE INITIALLY DEFERRED, "vendor_id" char(32) NOT NULL REFERENCES "Temp" ("uuid") DEFERRABLE INITIALLY DEFERRED, DELETED INTEGER)

Thoughts?

Cash Vs. Accrual invoicing/Bills features

Killer Feature:
The ability to create an invoice and accept payment and determine how to report in cash vs accrual. E.g. Create an invoice for $12,000 and collect $12,000 but be able to show the $12,000 as a liability and then realize income on that invoice as the work is produced or on a set schedule or however you choose to realize it. And also be able to show the invoice and payment as a cash basis reporting at the same time.

Workflow for this feature:
When this invoice is open it will show like this in the balance sheet:
Debit - AR(Asset Account)
Credit - Deferred Income(Liability Account)

Invoice is paid:
Debit - Cash
Credit - AR
*Invoice will no longer show up in the AR aging report

Then realize income from invoice:
Debit - Deferred Income
Credit - Income

You can do progress billing from this invoice or a set schedule of billing for this invoice. Right now, Quickbooks does not offer this feature. CPA's have to manually convert these numbers in a spreadsheet.

Also, have the exact feature REVERSED for Bills and expenses, e.g. prepaid expenses for things like insurance paid up front for the entire year are then expensed out each month during the life of the policy.

User Friendly Code to be made available for Vendors , Customers Item Models

Is your feature request related to a problem? Please describe.
Looking at the vendor model, it appears that we have a UUID which is a primary key for the model. These UUIDs are not user friendly and cannot be an identification point for the end user. Hence, a user-friendly code should have been made available for your Vendor and Customer Models.

Describe the solution you'd like
For each vendor or the Customer, apart from having a UUID (a pk) , it should also be having a user-friendly code like a V100001, V100002, V100003 for Vendors, C1000001, C1000002, C1000003 for the Customers
These can also be there in the Items models.

Additional context
Such Codes can be seen in many Accounting Softwares and makes it easy for user to identify a particular Vendor , Customer or Item.

migrate bug? gCompatibility issues about django 4.0.4

Describe the bug

To Reproduce
Steps to reproduce the behavior:

  1. pip install -r requirements.txt
Django>=3.0
ofxtools>=0.8.22
setuptools>=50.3.2
jsonschema>=3.2.0
Markdown~=3.3.4
Pillow>=8.4.0
graphene-django>=2.15.0
Faker>=8.16.0
behave>=1.2.6
  1. python manage.py migrate
Traceback (most recent call last):
  File "E:\git\code\github.com\django-ledger\manage.py", line 22, in <module>
    main()
  File "E:\git\code\github.com\django-ledger\manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "E:\git\code\github.com\django-ledger\.env\lib\site-packages\django\core\management\__init__.py", line 446, in execute_from_command_line
    utility.execute()
  File "E:\git\code\github.com\django-ledger\.env\lib\site-packages\django\core\management\__init__.py", line 420, in execute
    django.setup()
  File "E:\git\code\github.com\django-ledger\.env\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "E:\git\code\github.com\django-ledger\.env\lib\site-packages\django\apps\registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "E:\git\code\github.com\django-ledger\.env\lib\site-packages\django\apps\config.py", line 228, in create
    import_module(entry)
  File "E:\programming\python\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "E:\git\code\github.com\django-ledger\.env\lib\site-packages\graphene_django\__init__.py", line 1, in <module>
    from .fields import DjangoConnectionField, DjangoListField
  File "E:\git\code\github.com\django-ledger\.env\lib\site-packages\graphene_django\fields.py", line 18, in <module>
    from .utils import maybe_queryset
  File "E:\git\code\github.com\django-ledger\.env\lib\site-packages\graphene_django\utils\__init__.py", line 2, in <module>
    from .utils import (
  File "E:\git\code\github.com\django-ledger\.env\lib\site-packages\graphene_django\utils\utils.py", line 6, in <module>
    from django.utils.encoding import force_text
ImportError: cannot import name 'force_text' from 'django.utils.encoding' (E:\git\code\github.com\django-ledger\.env\lib\site-packages\django\utils\encoding.py)

or

(.env) E:\git\code\github.com\django-ledger>python manage.py migrate
Traceback (most recent call last):
  File "E:\git\code\github.com\django-ledger\manage.py", line 22, in <module>
    main()
  File "E:\git\code\github.com\django-ledger\manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "E:\git\code\github.com\django-ledger\.env\lib\site-packages\django\core\management\__init__.py", line 446, in execute_from_command_line
    utility.execute()
  File "E:\git\code\github.com\django-ledger\.env\lib\site-packages\django\core\management\__init__.py", line 420, in execute
    django.setup()
  File "E:\git\code\github.com\django-ledger\.env\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "E:\git\code\github.com\django-ledger\.env\lib\site-packages\django\apps\registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "E:\git\code\github.com\django-ledger\.env\lib\site-packages\django\apps\config.py", line 228, in create
    import_module(entry)
  File "E:\programming\python\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'graphql_auth'

Expected behavior
Generate the corresponding db file sqlite.db

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: window 11
  • Version
Package         Version
--------------- -------
aniso8601       7.0.0
asgiref         3.5.1
attrs           21.4.0
behave          1.2.6
Django          4.0.4
Faker           13.7.0
graphene        2.1.9
graphene-django 2.15.0
graphql-core    2.3.2
graphql-relay   2.0.1
jsonschema      4.5.1
Markdown        3.3.7
ofxtools        0.9.5
parse           1.19.0
parse-type      0.6.0
Pillow          9.1.0
pip             21.3.1
promise         2.3
pyrsistent      0.18.1
python-dateutil 2.8.2
Rx              1.6.1
setuptools      60.5.0
singledispatch  3.7.0
six             1.16.0
sqlparse        0.4.2
text-unidecode  1.3
tzdata          2022.1
wheel           0.37.1

Additional context
https://stackoverflow.com/questions/70382084/import-error-force-text-from-django-utils-encoding
https://docs.djangoproject.com/en/4.0/ref/utils/#module-django.utils.encoding

Unique Number for the different accounting objects like PO, SO, JV

Is your feature request related to a problem? Please describe.
In any accouting software, we have different types of objects like a Purchase Order (PO) , a sales Order (SO), a Journal Entry (JV) for every transaction, Assets , Invoices . For a unique Identification of all these objects, a UUID has been assigned in the model. But , again, these UUIDs are not user friendly and hence difficult to be used as a point of reference by user.

For e.g I posted the entry , please check doc number ........, . So, such document numbers should be there which are serially numbers (and not Randomly generated)

The Invoice Model already has this feature currently or generating a number apart from the UUID, but again the same is being generated randomly. It should be an AUTO INCREMENT Instead.

Describe the solution you'd like:
The probable Solution I have thought of:

All these objects should have an Auto Increment number (ID) which are visible to user each time they create such objects . Like Journal entry number 520063200 posted. , Assets number 70005261 created.

In terms of the uniqueness of these numbers , below is proposed:

  1. Journal Entries: These are huge in number , so Journal entries should be unique across an entity for a particular Financial Year. At the start of FY , it will auto reset to 100000000 , 100000001 , 100000002 . (If we have multiple units within an entity, then, within a unit, there should not be any duplicate JV number, but we can have same JV number across units. So, the Unique together will be JVNumber_Unit_FinancialYear

  2. PO Number : Purchase Orders tends to span over more years and as a best Practice, it is always suggested to have a unique PO number across Entity and across Financial years. No repetition should be allowed.

  3. Invoice Number : These should be serially numbered as most of the Sales Tax Law require a serially numbered invoice. These should be unique for a FY and get reset at start of FY.

  4. Sales Order Number : Can be discussed and either made Unique in FY (like Invoice ) or Unique Across (Like PO)

  5. Assets Number : Assets Accounting (if added in later updates) should always be Unique across an entity for lifetime.

Faker library missing

Hi there

and congrats. Great idea.

Please update requirements.txt due to:

    raise ImproperlyConfigured('Must install Faker library to generate random data.')
django.core.exceptions.ImproperlyConfigured: Must install Faker library to generate random data.

Thx

TypeError after Get request to '/ledger/entity/create/' with all the optional fields checked.

Describe the bug
TypeError: InvoiceModelAbstract.update_amount_due() got an unexpected keyword argument 'itemtxs_list'
TypeError after Get request to '/ledger/entity/create/' with all the optional fields checked.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'localhost:8000/ledger/entity/create'
  2. fill necessary details.
  3. Click on 'Create'
  4. See error on webpage if in debug mode or in the terminal

Expected behavior
An entity should be created with dummy data already populated

Desktop (please complete the following information):

  • OS: Fedora Linux 37
  • Browser: FireFox
  • Version: 106

Additional context
Full Stack Trace
Traceback (most recent call last):
File "/home/sourabh/Project/env/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/home/sourabh/Project/env/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/sourabh/Project/env/lib/python3.11/site-packages/django/views/generic/base.py", line 103, in view
return self.dispatch(request, *args, **kwargs)
File "/home/sourabh/Project/env/lib/python3.11/site-packages/django/contrib/auth/mixins.py", line 109, in dispatch
return super().dispatch(request, *args, **kwargs)
File "/home/sourabh/Project/env/lib/python3.11/site-packages/django/contrib/auth/mixins.py", line 73, in dispatch
return super().dispatch(request, *args, **kwargs)
File "/home/sourabh/Project/env/lib/python3.11/site-packages/django/views/generic/base.py", line 142, in dispatch
return handler(request, *args, **kwargs)
File "/home/sourabh/Project/env/lib/python3.11/site-packages/django/views/generic/edit.py", line 184, in post
return super().post(request, *args, **kwargs)
File "/home/sourabh/Project/env/lib/python3.11/site-packages/django/views/generic/edit.py", line 153, in post
return self.form_valid(form)
File "/home/sourabh/Project/env/lib/python3.11/site-packages/django_ledger/views/entity.py", line 98, in form_valid
entity_generator.populate_entity()
File "/home/sourabh/Project/env/lib/python3.11/site-packages/django_ledger/io/data_generator.py", line 135, in populate_entity
self.create_invoice(date_draft=start_dttm)
File "/home/sourabh/Project/env/lib/python3.11/site-packages/django_ledger/io/data_generator.py", line 653, in create_invoice
invoice_model.update_amount_due(itemtxs_list=invoice_items)

Exception Type: TypeError at /ledger/entity/create/
Exception Value: InvoiceModelAbstract.update_amount_due() got an unexpected keyword argument 'itemtxs_list'

User Driven Nomenclature Customization facility for object Numbers

We have multiple types of Numbers / alias creation in the accounting system.

It is a best practice to have a rule defined for each type of number , so that the validation checks can be maintained.

For e/g. An Account code should always be 10 digit long.
Account code starting with 1* reflects equities and Reserves
Account code starting with 2* reflects liabilities
Account code starting with 3* reflects assets
Account code starting with 4* reflects Incomes
Account code starting with 5* reflects expenses

Similarly, a JV number should be 10 digit long .
JV for Bill booking should start with 3*
JV for Sales Invoice booking should start with 4*
JV for Bank related booking should start with 5*
Other Misc JV should be 8*

Also, Rules of Nomenclature like, Vendor Code should have a prefix of "V" or "S"
Customer code should have a prefix of "C"
Assets code should have a prefix of "C"

Invoices should have prefix as "AB/2022/"

PO number to be 8 digit long starting from 2*
SO number to be 8 digit long starting from 2*

Similarly for all the other objects like Items, materials , Banking GLs

All these should be customizable by the admin of the entity under a setting tab . (However, as a best practice ,once set, these should not be allowed to change in future)

A basic tool belt at top of each reports

Is your feature request related to a problem? Please describe.

This issue has been partly covered by #79 but would want to just make it complete in terms of utility and pervasiveness.
Currently, the reports that are being displayed are a simple table that reads through all rows of the model.
As of now there are only basic reports like Vendor , Customer Master, but in future, there will be multiple reports like Sales register (Invoice Wise Sales with Customer Number) , Purchase Register (Vendor Wise Bills and amounts)

As of now, These reports lack basic table operations buttons. There is no basic Sorting, Filtering, Subtotal, Summing Up.

Describe the solution you'd like

A tool belt with icons which can perform the most Basic SQL operations like the Sum of a Totalizer Column, Grouping of Columns, Sort By, Filtering any Columns, Find in Table, Show / Hide Columns . Multi Level Sorting..!

This tool belt should be visible for all reports that are displayed ...
The user Interface can be discussed upon..

Also , a Download to Button with option to download as Excel, Feather , Pickle, Csv, Txt, Pdf , even Copy to Clipboard option file needs to be built on..!

A cherry on cake would be , if using the Google API, the report can be opened in a Google Spreadsheet (in a click) to a new tab

Please create a requirements.txt file

Describe the bug
I am new to using Django Ledger. I am really excited about contributing to this project. I just got started and noticed that, we need to install a number of packages. Can I request we create a requirements.txt file, so that anyone new, can just install all the packages using
pip install -r requirements.txt

Using BaseClass for Views / Forms / Models

Is your feature request related to a problem? Please describe.
No.
By checking out the code i've noticed that most of the classes use common fields, properties, contexts

Describe the solution you'd like
I'm workig on a similar project (it's like mini erp system) and I try to use shred base classes as much as I can, to avoid make repeated contexts in views, declare the same field in all models (like id, created_at, create_by, modified_at_modified_by, ...)...

Additional context
Example

A Base Class Model :

class BaseModel(models.Model):
    id = models.AutoField(_('Id'), primary_key=True)
    active = models.BooleanField(_('Active'), default=True, blank=True, null=True)
    created_at = models.DateField( _('Created at'), auto_now_add=True, blank=True, null=True)
    updated_at = models.DateField( _('Updated at'), auto_now=True, blank=True, null=True)
    created_by = models.ForeignKey('base.User', on_delete=models.PROTECT, related_name='%(class)s_created_by', verbose_name=_('Created by'))
    updated_by = models.ForeignKey('base.User', on_delete=models.PROTECT, related_name='%(class)s_updated_by', verbose_name=_('Updated by'))
    base_company = models.ForeignKey('base.Company', on_delete=models.PROTECT, blank=True, null=True, verbose_name=_('Company'), related_name="%(class)s_company")

    class Meta:
        ordering = ['pk']
        abstract = True

Item Model inherits BaseModel :

class Item(BaseModel):
    ...
    class Meta:
      verbose_name = _("Item")
      verbose_name_plural = _("Items")

A Base View regroups all the shared contexts and the template :

class BaseListView(ListView):
    template_name = 'base/list.html'

    def get_context_data(self, **kwargs):
        context = super().get_context_data(**kwargs)
        object_name = self.model._meta.object_name
        verbose_name = self.model._meta.verbose_name
        verbose_name_plural = self.model._meta.verbose_name_plural
        context['page_title'] = _('{}'.format(verbose_name_plural))
        context["btn_create_title"] = _('New {}'.format(verbose_name))
        context["btn_update_title"] = _('Update {}'.format(verbose_name))
        context['btn_detail_url'] = '{}:detail'.format(object_name)
        context['add_url'] = reverse_lazy('{}:add'.format(object_name))
        context['edit_url'] = '{}:edit'.format(object_name)
        return context

    def get_queryset(self):
        queryset = self.model.objects.filter()
        return queryset

    class Meta:
        abstract = True

And since all list pages are rendred the same way, (A table with some action buttons) why not using the same template ?

You see that what evev the self.object is in ModelView, it will generate page title, action buttons' titles (Create new ..., Update ..., Delete ...) the same way. What happens if you guys decide to use "Edit .." for the edit button rather than "Update ...", you have to change this in all the Views.

Same things for CreateView, UpdateView, they use the same template (it's a little bit tricky, but I made to work properly)

This way, I can create a new Model -> View -> Form and make it works (List of objects, Create, Update & Delete Object) in few minutes

I'd love to help if I can, let me know what you think.

Next steps on this project

That awesome project!! Really interesting.

Looking into Roadmap features looks good as new features. I'm looking how contribute with this project.. What's the next features that you plan to develop in this project?

Filtering functionalities

Pages tohave search bars such as customers , vendors pages etc. for easier data navigation and filtering

Simple Error

error

im using VS2019 It seems like a simple issue. Not sure how to fix it.

A server error occurred. Please contact the administrator.

Describe the bug
After I install for development I usually get a bug "A server error occurred. Please contact the administrator."
Trying to log into the home page.

To Reproduce
Steps to reproduce the behavior:
Navigate to your projects directory.
Clone the repo from github and CD into project.
git clone https://github.com/arrobalytics/django-ledger.git && cd django-ledger
Install PipEnv, if not already installed:
pip install -U pipenv
Create virtual environment.
pipenv install
If using a specific version of Python you may specify the path.

pipenv install --python PATH_TO_INTERPRETER

Activate environment.
pipenv shell
Apply migrations.
python manage.py migrate
Create a Development Django user.
python manage.py createsuperuser
Run development server.
python manage.py runserver
Try to log in.

Expected behavior
I should of been able to log into the terminal

Screenshots
https://imgur.com/a/UALYhGc

Desktop (please complete the following information):
-Windows 10
-Chrome

DRF integration

Im planning to use the django ledger in my lease and property management system using django rest framework as backend and next.js standalone as front end

But i found it hard to understand the code since i noticed there are not comments on code

Any clear documentation for models since i plan to use it with django rest framework so i need to understand the code rather than use it
If any commented code or docs im interested to join the team

Best regards

Import Stripe Data - IIF, Monthly Report, Main CSV Reports

https://dashboard.stripe.com/reports/

https://dashboard.stripe.com/settings/legacy_exports

Would love to have an alternative to quickbooks that can import stripe financial data and understand what it all means. You may need to ask stripe support for access to the older monthly report. Otherwise the main reports page has all the new data points.

Then there is sigma where users could write their own custom SQL queries for financial data. That may be harder to import because a user could write a query for anything.

Adding products/services to the generated invoice

Is your feature request related to a problem? Please describe.

The project looks promising and we are interested in it, however, we are unable to create products/services and link them to generated invoice.

Describe the solution you'd like
We would like to know if this is part of your plan, and if yes, when to expect that to be delivered.

Describe alternatives you've considered
We are open to contribute in this part.

Translations table?

Hi,

any plans for internationalization? How do I get the list of ALL captions (messages?) used to start working on it?

thx

"Fill WIth Sample Data" throws 500

Describe the bug
When creating a new entity, if you select the "Fill With Sample Data" option, you get forwarded to an error page.
The entity will be created but there is not data inside.
If you refresh the page, you still see an error but another entity is created.

To Reproduce
Steps to reproduce the behavior:

  1. Create New Entity with "Fill With Sample Data" selected
  2. Select 'Create'
  3. Error:
Internal Server Error: /ledger/entity/create/
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", line 179, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)

  File "/usr/local/lib/python3.8/site-packages/django/views/generic/base.py", line 73, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/django/contrib/auth/mixins.py", line 52, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/django/views/generic/base.py", line 101, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/django/views/generic/edit.py", line 172, in post
    return super().post(request, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/django/views/generic/edit.py", line 142, in post
    return self.form_valid(form)
  File "/usr/local/lib/python3.8/site-packages/django_ledger/views/entity.py", line 72, in form_valid
    generate_sample_data(
  File "/usr/local/lib/python3.8/site-packages/django_ledger/utils.py", line 266, in generate_sample_data
    capital_acc = choice(accounts_gb['eq_capital'])
KeyError: 'eq_capital'
[09/Jan/2021 04:38:16] "POST /ledger/entity/create/ HTTP/1.1" 500 100178

Expected behavior
A new entity to be created with a set of sample data.

Screenshots
If applicable, add screenshots to help explain your problem.
image

Desktop (please complete the following information):

  • OS: MacOS Catalina
  • Browser: Chrome
  • Version v0.4.0.1

import from ledger/hledger and similar plain text accounting formats

There are quite a few bookkeeping tools that use plain text files to store the ledger: https://plaintextaccounting.org

It would be useful to have scripts to import from those, in the first place the CoA, then transactions.

One could then import ledger examples and use them to create test cases:

  • run hledger on the example -> get account balances
  • import example ledger into django-ledger, run the reports -> compare balances with reference

Also interesting: import separate ledgers for each accounting period, consolidate them and get back the reports split over the accounting periods.

python manage.py runserver Not working.

Describe the bug
After I Set Up Django Ledger for Development. I get to:

python manage.py test django_ledger

And when I run it i get an error.
(django-ledger-rXgOjIEC) C:\Users\qwerty\Documents\django-ledger2\django-ledger>python manage.py test django_ledger
Traceback (most recent call last):
File "C:\Users\qwerty\Documents\django-ledger2\django-ledger\manage.py", line 11, in main
from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\qwerty\Documents\django-ledger2\django-ledger\manage.py", line 22, in
main()
File "C:\Users\qwerty\Documents\django-ledger2\django-ledger\manage.py", line 13, in main
raise ImportError(
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?

To Reproduce
Steps to reproduce the behavior:

  1. Set Up Django Ledger for Development
  2. Install tzdata yourself
  3. Open CMD
  4. Use: python manage.py test django_ledger
  5. See error: (django-ledger-rXgOjIEC) C:\Users\qwerty\Documents\django-ledger2\django-ledger>python manage.py test django_ledger
    Traceback (most recent call last):
    File "C:\Users\qwerty\Documents\django-ledger2\django-ledger\manage.py", line 11, in main
    from django.core.management import execute_from_command_line
    ModuleNotFoundError: No module named 'django'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\qwerty\Documents\django-ledger2\django-ledger\manage.py", line 22, in
main()
File "C:\Users\qwerty\Documents\django-ledger2\django-ledger\manage.py", line 13, in main
raise ImportError(
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?

Expected behavior
A working demo.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • Windows 10
  • Chrome

Import Credit Card Transactions & Cryptocurrency Payments

Credit cards are used for automatic payments as opposed to writing checks and snail mail.

It would be nice to have some way to import business credit card transactions and track spend and maybe even categorize expenses. Even better to do it automatically.

Cryptocurrency payments may be more popular in the future and that would be cool to track also even though that is harder since the price fluctuates.

Getting TypeError: 'type' object is not subscriptable :while migration first time

I am getting This Type error wile migration first time

  • Windows
  • python 3.8.7
  • Django 3.1
   from django_ledger.utils import set_default_entity
  File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django_ledger\utils.py", line 65, in <module>
    bill_desc: str = None) -> tuple[LedgerModel, BillModel]:
TypeError: 'type' object is not subscriptable

Full Version:

(env) C:\Users\User\Documents\sandbox\env\hishab>python manage.py migrate django_ledger Traceback (most recent call last): File "manage.py", line 21, in <module> main() File "manage.py", line 17, in main execute_from_command_line(sys.argv) File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line utility.execute() File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django\core\management\__init__.py", line 395, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django\core\management\base.py", line 330, in run_from_argv self.execute(*args, **cmd_options) File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django\core\management\base.py", line 371, in execute output = self.handle(*args, **options) File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django\core\management\base.py", line 85, in wrapped res = handle_func(*args, **kwargs) File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django\core\management\commands\migrate.py", line 75, in handle self.check(databases=[database]) File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django\core\management\base.py", line 392, in check all_issues = checks.run_checks( File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django\core\checks\registry.py", line 70, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django\core\checks\urls.py", line 13, in check_url_config return check_resolver(resolver) File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django\core\checks\urls.py", line 23, in check_resolver return check_method() File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django\urls\resolvers.py", line 408, in check for pattern in self.url_patterns: File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django\utils\functional.py", line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django\urls\resolvers.py", line 589, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django\utils\functional.py", line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django\urls\resolvers.py", line 582, in urlconf_module return import_module(self.urlconf_name) File "c:\users\user\appdata\local\programs\python\python38\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 783, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "C:\Users\User\Documents\sandbox\env\hishab\hishab\urls.py", line 21, in <module> path('ledger/', include('django_ledger.urls', namespace='django_ledger')), File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django\urls\conf.py", line 34, in include urlconf_module = import_module(urlconf_module) File "c:\users\user\appdata\local\programs\python\python38\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 783, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django_ledger\urls\__init__.py", line 11, in <module> from django_ledger import views File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django_ledger\views\__init__.py", line 9, in <module> from django_ledger.views.account import * File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django_ledger\views\account.py", line 19, in <module> from django_ledger.views.mixins import ( File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django_ledger\views\mixins.py", line 25, in <module> from django_ledger.utils import set_default_entity File "C:\Users\User\Documents\sandbox\env\lib\site-packages\django_ledger\utils.py", line 65, in <module> bill_desc: str = None) -> tuple[LedgerModel, BillModel]: TypeError: 'type' object is not subscriptable

JSONField package is not imported

Describe the bug
JSONField package is not installed with requirements and not imported in models.

To Reproduce
Steps to reproduce the behavior:

  1. pip install git+https://github.com/arrobalytics/django-ledger.git
  2. Add to installed apps:
INSTALLED_APPS = [
    ...,
    'django_ledger',
    ...,
]
  1. Start server wit python3 manage.py runserver
  2. See error

Expected behavior
Server should start up without errors.

Logs

> python3 manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "/usr/local/Cellar/[email protected]/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/local/Cellar/[email protected]/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.8/site-packages/django/utils/autoreload.py", line 53, in wrapper
    fn(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
    autoreload.raise_last_exception()
  File "/usr/local/lib/python3.8/site-packages/django/utils/autoreload.py", line 76, in raise_last_exception

    raise _exception[1]
  File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 357, in execute
    autoreload.check_errors(django.setup)()
  File "/usr/local/lib/python3.8/site-packages/django/utils/autoreload.py", line 53, in wrapper
    fn(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python3.8/site-packages/django/apps/registry.py", line 114, in populate
    app_config.import_models()
  File "/usr/local/lib/python3.8/site-packages/django/apps/config.py", line 211, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/local/Cellar/[email protected]/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/lib/python3.8/site-packages/django_ledger/models/__init__.py", line 19, in <module>
    from django_ledger.models.customer import CustomerModel
  File "/usr/local/lib/python3.8/site-packages/django_ledger/models/customer.py", line 32, in <module>
    class CustomerModel(ContactInfoMixIn, CreateUpdateMixIn):
  File "/usr/local/lib/python3.8/site-packages/django_ledger/models/customer.py", line 43, in CustomerModel
    additional_info = models.JSONField(null=True, blank=True)
AttributeError: module 'django.db.models' has no attribute 'JSONField'

Desktop info:

  • OS: macOS Catalina

Include City, State/Province, Zip Code & Country as Separate Fields

  • When creating an entity, an "address line 1" and "address line 2" row exists but "address line 2" is meant to receive City, State Zip info rather than what people often enter for "address line 2" which is a secondary address such as "Suite B".
  • The default text says City, State Zip but the text color is faint so this message may be lost on some users.

Journals entries timestamps are all recorded as midnight regardless of the timezone

Description
When creating a journal entry, the timezone is not picked up correctly and it is marked as midnight always
To Reproduce
Steps to reproduce the behavior:
1.From the UI
2. Goto Ledgers
3. Click on Journal Entries
4. Add a Journal Entry
5. Check the time

Expected behaviour
Time to be reported matching the actual time the journal entry was created at

Desktop (please complete the following information):

  • OS: MacOs
  • Browser: Chrome

I can't install

I can't install what I did, I don't have much python knowledge, which version to install and which packages to install. I'm trying on the Windows version, but I keep getting an error.

Audit Trail and Logging records

Just to increase the user acceptability of Accounting Software, it is important that it makes a trail of changes made to any document..

Can start with the basic logging of the changes to table values and then gradually increase the scope of the logging to keep track of the activities within the accounting software for admin purpose..!

'EntityModel' object has no attribute 'get_accounts'

'EntityModel' object has no attribute 'get_accounts' but IOMixIn requires get_accounts attribute

@jonathandavidlewis

quickstart.quickstart("albertsalazar")
Traceback (most recent call last):
File "", line 1, in
File "/home/albertsalazar/AccountantProject/venv/lib/python3.7/site-packages/django_ledger/examples/quickstart.py", line 100, in quickstart
je_activity='inv')
File "/home/albertsalazar/AccountantProject/venv/lib/python3.7/site-packages/django_ledger/models/mixins/io.py", line 98, in create_je
account_models = getattr(self, 'get_accounts')
AttributeError: 'EntityModel' object has no attribute 'get_accounts'

KeyError at /admin/django_ledger/entitymodel/<UUID>/change/

Describe the bug

Unable to add or modify Entities in the Django Admin. Attempting to create or modify an entry results in the error:

KeyError at /admin/django_ledger/entitymodel/add/
"Key 'slug' not found in 'EntityModelForm'. Choices are: accrual_method, address_1, address_2, admin, city, country, default_coa, depth, email, fy_start_month, hidden, last_closing_date, meta, name, numchild, path, phone, picture, state, website, zip_code."
Request Method:	GET
Request URL:	http://127.0.0.1:8000/admin/django_ledger/entitymodel/add/
Django Version:	4.2.6
Exception Type:	KeyError
Exception Value:	
"Key 'slug' not found in 'EntityModelForm'. Choices are: accrual_method, address_1, address_2, admin, city, country, default_coa, depth, email, fy_start_month, hidden, last_closing_date, meta, name, numchild, path, phone, picture, state, website, zip_code."

To Reproduce
Steps to reproduce the behavior:

  1. Run the dev server
  2. Login to the Django admin in a browser
  3. Click on Add next to Entities
  4. See error

Expected behavior
A form to manage entities

Screenshots
image

Desktop (please complete the following information):

  • OS: macos
  • Browser chrome
  • Version latest

Additional context

Commenting out line 38 here will allow the form to load, but I have not been able to figure out how to expose the slug field in the form. I see that it is being added via abstract model mixin, but I'm unable to figure out how to make it available to EntityModelForm.

Thank you!

Logic behind UUID?

Hi all,

I am puzzled with the logic for using uuid? Why not using auto increment?
Some notes about this easily found:
https://stackoverflow.com/questions/3936182/using-a-uuid-as-a-primary-key-in-django-models-generic-relations-impact

As I see it, ledger is not the App publicly available, so not quite sure what is it protected? It will be very difficult to manage in-house ledger. Just like I've found the Bill Temp FK, which can't be found that easily just by the look.

If we look at Bill model, all xxx_id take way more space than all other fields combined. Lets try to sort this by sql!? Impossible task.

Just my 2c btw, your project tho

Thoughts?

Multiple Currencies / Multiple Companies / Multiple Chart of accounts templates support

Curiously is there any plan for support following features?

  1. Multiple currencies:
    • if a company has multiple currencies, and the financial report requires to convert other currencies to the dominate currency.
  2. Multiple companies:
    • consoled cash flow & P&L & Balance sheet
  3. More than one chart of accounts templates
    • this is useful to adapt to the situation of multiple companies in different regions.

Allow accurate simultaneous reporting as cash or accrual

from this article:

https://wffacpa.com/how-a-glaring-hole-in-quickbooks-online-makes-life-difficult-for-accrual-basis-companies-that-are-cash-basis-taxpayers-and-how-to-work-around-it/

"Quickbooks Online (โ€œQBOโ€) does many things well. The improvements Intuit has brought to their cloud-based offering over the past few years have amounted to a near-total overhaul of what was originally an unusable replacement for the classic Quickbooks Desktop. That said, there is still (what I consider to be) a glaring hole in QBO at a basic, fundamental level: the inability to decide for ourselves if a journal entry should affect both accrual and cash basis reports or if it should only affect accrual basis reports. The lack of our ability to choose for ourselves makes it much more difficult to manage the books of a company who need to accurately track both cash basis and accrual basis figures."

"...cash basis taxpayers are still required to capitalize and depreciate fixed assets, and recording depreciation does not affect cash, but should affect cash basis reports."

I've spoken with two CPA's who have complained about the accrual vs cash reporting methods with Quickbooks. One client's CPA adjusted the books and shows him making almost $400k more in income and we're not sure why she did that but I believe it has something to do this issue. If this can be a standard feature that would really make it competitive.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.