django-ledger 0.7.2__py3-none-any.whl → 0.7.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of django-ledger might be problematic. Click here for more details.

Files changed (106) hide show
  1. django_ledger/__init__.py +1 -1
  2. django_ledger/contrib/django_ledger_graphene/journal_entry/schema.py +2 -3
  3. django_ledger/contrib/django_ledger_graphene/transaction/schema.py +9 -7
  4. django_ledger/forms/account.py +4 -1
  5. django_ledger/forms/journal_entry.py +19 -12
  6. django_ledger/forms/transactions.py +8 -12
  7. django_ledger/io/io_core.py +17 -12
  8. django_ledger/io/io_library.py +3 -3
  9. django_ledger/migrations/0001_initial.py +1 -1
  10. django_ledger/migrations/0019_alter_transactionmodel_amount_and_more.py +33 -0
  11. django_ledger/models/bill.py +17 -2
  12. django_ledger/models/chart_of_accounts.py +4 -0
  13. django_ledger/models/closing_entry.py +8 -6
  14. django_ledger/models/data_import.py +1 -0
  15. django_ledger/models/invoice.py +12 -4
  16. django_ledger/models/journal_entry.py +843 -481
  17. django_ledger/models/ledger.py +45 -4
  18. django_ledger/models/mixins.py +5 -5
  19. django_ledger/models/transactions.py +303 -305
  20. django_ledger/models/unit.py +42 -22
  21. django_ledger/static/django_ledger/bundle/djetler.bundle.js +1 -1
  22. django_ledger/static/django_ledger/bundle/styles.bundle.js +1 -1
  23. django_ledger/templates/django_ledger/account/tags/account_txs_table.html +1 -1
  24. django_ledger/templates/django_ledger/account/tags/accounts_table.html +1 -1
  25. django_ledger/templates/django_ledger/bills/bill_detail.html +1 -1
  26. django_ledger/templates/django_ledger/bills/bill_update.html +1 -1
  27. django_ledger/templates/django_ledger/components/icon.html +1 -1
  28. django_ledger/templates/django_ledger/data_import/tags/data_import_job_txs_imported.html +8 -1
  29. django_ledger/templates/django_ledger/financial_statements/balance_sheet.html +1 -0
  30. django_ledger/templates/django_ledger/financial_statements/tags/balance_sheet_statement.html +4 -4
  31. django_ledger/templates/django_ledger/financial_statements/tags/income_statement.html +118 -0
  32. django_ledger/templates/django_ledger/includes/nav.html +9 -5
  33. django_ledger/templates/django_ledger/invoice/includes/card_invoice.html +69 -69
  34. django_ledger/templates/django_ledger/invoice/invoice_detail.html +1 -1
  35. django_ledger/templates/django_ledger/journal_entry/je_create.html +2 -3
  36. django_ledger/templates/django_ledger/journal_entry/je_delete.html +2 -3
  37. django_ledger/templates/django_ledger/journal_entry/je_detail.html +1 -1
  38. django_ledger/templates/django_ledger/journal_entry/je_detail_txs.html +8 -8
  39. django_ledger/templates/django_ledger/journal_entry/je_list.html +16 -13
  40. django_ledger/templates/django_ledger/journal_entry/je_update.html +2 -3
  41. django_ledger/templates/django_ledger/journal_entry/tags/je_table.html +24 -24
  42. django_ledger/templates/django_ledger/journal_entry/tags/je_txs_table.html +17 -14
  43. django_ledger/templates/django_ledger/ledger/tags/ledgers_table.html +38 -37
  44. django_ledger/templates/django_ledger/transactions/tags/txs_table.html +69 -0
  45. django_ledger/templatetags/django_ledger.py +35 -48
  46. django_ledger/urls/account.py +4 -4
  47. django_ledger/views/account.py +8 -8
  48. django_ledger/views/journal_entry.py +84 -101
  49. django_ledger/views/ledger.py +16 -21
  50. django_ledger/views/mixins.py +17 -28
  51. {django_ledger-0.7.2.dist-info → django_ledger-0.7.4.dist-info}/METADATA +8 -3
  52. {django_ledger-0.7.2.dist-info → django_ledger-0.7.4.dist-info}/RECORD +56 -104
  53. assets/node_modules/node-gyp/gyp/gyp_main.py +0 -45
  54. assets/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +0 -367
  55. assets/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py +0 -206
  56. assets/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +0 -1270
  57. assets/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +0 -1547
  58. assets/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +0 -59
  59. assets/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +0 -153
  60. assets/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py +0 -271
  61. assets/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +0 -574
  62. assets/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +0 -666
  63. assets/node_modules/node-gyp/gyp/pylib/gyp/common.py +0 -654
  64. assets/node_modules/node-gyp/gyp/pylib/gyp/common_test.py +0 -78
  65. assets/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +0 -165
  66. assets/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py +0 -109
  67. assets/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +0 -55
  68. assets/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
  69. assets/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py +0 -808
  70. assets/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +0 -1173
  71. assets/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +0 -1321
  72. assets/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +0 -120
  73. assets/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +0 -103
  74. assets/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +0 -464
  75. assets/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py +0 -89
  76. assets/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py +0 -58
  77. assets/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +0 -2518
  78. assets/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +0 -3978
  79. assets/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +0 -44
  80. assets/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +0 -2936
  81. assets/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +0 -55
  82. assets/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +0 -1394
  83. assets/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +0 -25
  84. assets/node_modules/node-gyp/gyp/pylib/gyp/input.py +0 -3137
  85. assets/node_modules/node-gyp/gyp/pylib/gyp/input_test.py +0 -98
  86. assets/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +0 -771
  87. assets/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +0 -1271
  88. assets/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py +0 -174
  89. assets/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py +0 -61
  90. assets/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +0 -374
  91. assets/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +0 -1939
  92. assets/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py +0 -302
  93. assets/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +0 -3197
  94. assets/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py +0 -65
  95. assets/node_modules/node-gyp/gyp/setup.py +0 -42
  96. assets/node_modules/node-gyp/gyp/test_gyp.py +0 -260
  97. assets/node_modules/node-gyp/gyp/tools/graphviz.py +0 -102
  98. assets/node_modules/node-gyp/gyp/tools/pretty_gyp.py +0 -156
  99. assets/node_modules/node-gyp/gyp/tools/pretty_sln.py +0 -181
  100. assets/node_modules/node-gyp/gyp/tools/pretty_vcproj.py +0 -339
  101. assets/node_modules/node-gyp/test/fixtures/test-charmap.py +0 -31
  102. assets/node_modules/node-gyp/update-gyp.py +0 -46
  103. {django_ledger-0.7.2.dist-info → django_ledger-0.7.4.dist-info}/AUTHORS.md +0 -0
  104. {django_ledger-0.7.2.dist-info → django_ledger-0.7.4.dist-info}/LICENSE +0 -0
  105. {django_ledger-0.7.2.dist-info → django_ledger-0.7.4.dist-info}/WHEEL +0 -0
  106. {django_ledger-0.7.2.dist-info → django_ledger-0.7.4.dist-info}/top_level.txt +0 -0
@@ -125,6 +125,7 @@ class LedgerModelManager(models.Manager):
125
125
  qs = super().get_queryset()
126
126
  return qs.select_related('entity').annotate(
127
127
  Count('journal_entries'),
128
+ _entity_slug=F('entity__slug'),
128
129
  earliest_timestamp=Min('journal_entries__timestamp',
129
130
  filter=Q(journal_entries__posted=True)),
130
131
  )
@@ -167,7 +168,7 @@ class LedgerModelManager(models.Manager):
167
168
 
168
169
  class LedgerModelAbstract(CreateUpdateMixIn, IOMixIn):
169
170
  """
170
- Base implmentation of the LedgerModel.
171
+ Base implementation of the LedgerModel.
171
172
 
172
173
  Attributes
173
174
  ----------
@@ -231,6 +232,14 @@ class LedgerModelAbstract(CreateUpdateMixIn, IOMixIn):
231
232
  ledger_str = f'LedgerModel: {self.uuid}'
232
233
  return f'{ledger_str} | Posted: {self.posted} | Locked: {self.locked}'
233
234
 
235
+ @property
236
+ def entity_slug(self):
237
+ try:
238
+ return getattr(self, '_entity_slug')
239
+ except AttributeError:
240
+ pass
241
+ return self.entity.slug
242
+
234
243
  def has_wrapped_model_info(self):
235
244
  if self.additional_info is not None:
236
245
  return self._WRAPPED_MODEL_KEY in self.additional_info
@@ -435,9 +444,6 @@ class LedgerModelAbstract(CreateUpdateMixIn, IOMixIn):
435
444
  return True
436
445
  return False
437
446
 
438
- def can_edit_journal_entries(self) -> bool:
439
- return not self.is_locked()
440
-
441
447
  def post(self, commit: bool = False, raise_exception: bool = True, **kwargs):
442
448
  """
443
449
  Posts the LedgerModel.
@@ -628,6 +634,7 @@ class LedgerModelAbstract(CreateUpdateMixIn, IOMixIn):
628
634
  def get_entity_last_closing_date(self) -> Optional[date]:
629
635
  return self.entity.last_closing_date
630
636
 
637
+ # URLS....
631
638
  def get_absolute_url(self) -> str:
632
639
  """
633
640
  Determines the absolute URL of the LedgerModel instance.
@@ -690,6 +697,20 @@ class LedgerModelAbstract(CreateUpdateMixIn, IOMixIn):
690
697
  'entity_slug': self.entity.slug
691
698
  })
692
699
 
700
+ def get_journal_entry_list_url(self) -> str:
701
+ return reverse('django_ledger:je-list',
702
+ kwargs={
703
+ 'entity_slug': self.entity_slug,
704
+ 'ledger_pk': self.uuid,
705
+ })
706
+
707
+ def get_journal_entry_create_url(self) -> str:
708
+ return reverse('django_ledger:je-create',
709
+ kwargs={
710
+ 'entity_slug': self.entity_slug,
711
+ 'ledger_pk': self.uuid
712
+ })
713
+
693
714
  def get_balance_sheet_url(self):
694
715
  return reverse(
695
716
  viewname='django_ledger:ledger-bs',
@@ -720,11 +741,31 @@ class LedgerModelAbstract(CreateUpdateMixIn, IOMixIn):
720
741
  def get_delete_message(self):
721
742
  return _(f'Are you sure you want to delete Ledger {self.name} from Entity {self.get_entity_name()}?')
722
743
 
744
+ # Action URL...
745
+ def get_action_post_journal_entries_url(self):
746
+ return reverse(
747
+ viewname='django_ledger:ledger-action-post-journal-entries',
748
+ kwargs={
749
+ 'entity_slug': self.entity_slug,
750
+ 'ledger_pk': self.uuid
751
+ }
752
+ )
753
+
754
+ def get_action_lock_journal_entries_url(self):
755
+ return reverse(
756
+ viewname='django_ledger:ledger-action-lock-journal-entries',
757
+ kwargs={
758
+ 'entity_slug': self.entity_slug,
759
+ 'ledger_pk': self.uuid
760
+ }
761
+ )
762
+
723
763
 
724
764
  class LedgerModel(LedgerModelAbstract):
725
765
  """
726
766
  Base LedgerModel from Abstract.
727
767
  """
768
+
728
769
  class Meta(LedgerModelAbstract.Meta):
729
770
  swappable = 'DJANGO_LEDGER_LEDGER_MODEL'
730
771
  abstract = False
@@ -898,11 +898,11 @@ class AccrualMixIn(models.Model):
898
898
  ]):
899
899
  raise ValidationError('Must provide all accounts Cash, Prepaid, UnEarned.')
900
900
 
901
- if self.accrue:
902
- if self.is_approved():
903
- self.progress = Decimal.from_float(1.00)
904
- else:
905
- self.progress = Decimal.from_float(0.00)
901
+ # if self.accrue:
902
+ # if self.is_approved():
903
+ # self.progress = Decimal.from_float(1.00)
904
+ # else:
905
+ # self.progress = Decimal.from_float(0.00)
906
906
 
907
907
  if self.amount_paid > self.amount_due:
908
908
  raise ValidationError(f'Amount paid {self.amount_paid} cannot exceed amount due {self.amount_due}')