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
@@ -1,302 +0,0 @@
1
- # Copyright (c) 2014 Google Inc. All rights reserved.
2
- # Use of this source code is governed by a BSD-style license that can be
3
- # found in the LICENSE file.
4
-
5
- """Xcode-ninja wrapper project file generator.
6
-
7
- This updates the data structures passed to the Xcode gyp generator to build
8
- with ninja instead. The Xcode project itself is transformed into a list of
9
- executable targets, each with a build step to build with ninja, and a target
10
- with every source and resource file. This appears to sidestep some of the
11
- major performance headaches experienced using complex projects and large number
12
- of targets within Xcode.
13
- """
14
-
15
- import errno
16
- import gyp.generator.ninja
17
- import os
18
- import re
19
- import xml.sax.saxutils
20
-
21
-
22
- def _WriteWorkspace(main_gyp, sources_gyp, params):
23
- """ Create a workspace to wrap main and sources gyp paths. """
24
- (build_file_root, build_file_ext) = os.path.splitext(main_gyp)
25
- workspace_path = build_file_root + ".xcworkspace"
26
- options = params["options"]
27
- if options.generator_output:
28
- workspace_path = os.path.join(options.generator_output, workspace_path)
29
- try:
30
- os.makedirs(workspace_path)
31
- except OSError as e:
32
- if e.errno != errno.EEXIST:
33
- raise
34
- output_string = (
35
- '<?xml version="1.0" encoding="UTF-8"?>\n' + '<Workspace version = "1.0">\n'
36
- )
37
- for gyp_name in [main_gyp, sources_gyp]:
38
- name = os.path.splitext(os.path.basename(gyp_name))[0] + ".xcodeproj"
39
- name = xml.sax.saxutils.quoteattr("group:" + name)
40
- output_string += " <FileRef location = %s></FileRef>\n" % name
41
- output_string += "</Workspace>\n"
42
-
43
- workspace_file = os.path.join(workspace_path, "contents.xcworkspacedata")
44
-
45
- try:
46
- with open(workspace_file) as input_file:
47
- input_string = input_file.read()
48
- if input_string == output_string:
49
- return
50
- except OSError:
51
- # Ignore errors if the file doesn't exist.
52
- pass
53
-
54
- with open(workspace_file, "w") as output_file:
55
- output_file.write(output_string)
56
-
57
-
58
- def _TargetFromSpec(old_spec, params):
59
- """ Create fake target for xcode-ninja wrapper. """
60
- # Determine ninja top level build dir (e.g. /path/to/out).
61
- ninja_toplevel = None
62
- jobs = 0
63
- if params:
64
- options = params["options"]
65
- ninja_toplevel = os.path.join(
66
- options.toplevel_dir, gyp.generator.ninja.ComputeOutputDir(params)
67
- )
68
- jobs = params.get("generator_flags", {}).get("xcode_ninja_jobs", 0)
69
-
70
- target_name = old_spec.get("target_name")
71
- product_name = old_spec.get("product_name", target_name)
72
- product_extension = old_spec.get("product_extension")
73
-
74
- ninja_target = {}
75
- ninja_target["target_name"] = target_name
76
- ninja_target["product_name"] = product_name
77
- if product_extension:
78
- ninja_target["product_extension"] = product_extension
79
- ninja_target["toolset"] = old_spec.get("toolset")
80
- ninja_target["default_configuration"] = old_spec.get("default_configuration")
81
- ninja_target["configurations"] = {}
82
-
83
- # Tell Xcode to look in |ninja_toplevel| for build products.
84
- new_xcode_settings = {}
85
- if ninja_toplevel:
86
- new_xcode_settings["CONFIGURATION_BUILD_DIR"] = (
87
- "%s/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" % ninja_toplevel
88
- )
89
-
90
- if "configurations" in old_spec:
91
- for config in old_spec["configurations"]:
92
- old_xcode_settings = old_spec["configurations"][config].get(
93
- "xcode_settings", {}
94
- )
95
- if "IPHONEOS_DEPLOYMENT_TARGET" in old_xcode_settings:
96
- new_xcode_settings["CODE_SIGNING_REQUIRED"] = "NO"
97
- new_xcode_settings["IPHONEOS_DEPLOYMENT_TARGET"] = old_xcode_settings[
98
- "IPHONEOS_DEPLOYMENT_TARGET"
99
- ]
100
- for key in ["BUNDLE_LOADER", "TEST_HOST"]:
101
- if key in old_xcode_settings:
102
- new_xcode_settings[key] = old_xcode_settings[key]
103
-
104
- ninja_target["configurations"][config] = {}
105
- ninja_target["configurations"][config][
106
- "xcode_settings"
107
- ] = new_xcode_settings
108
-
109
- ninja_target["mac_bundle"] = old_spec.get("mac_bundle", 0)
110
- ninja_target["mac_xctest_bundle"] = old_spec.get("mac_xctest_bundle", 0)
111
- ninja_target["ios_app_extension"] = old_spec.get("ios_app_extension", 0)
112
- ninja_target["ios_watchkit_extension"] = old_spec.get("ios_watchkit_extension", 0)
113
- ninja_target["ios_watchkit_app"] = old_spec.get("ios_watchkit_app", 0)
114
- ninja_target["type"] = old_spec["type"]
115
- if ninja_toplevel:
116
- ninja_target["actions"] = [
117
- {
118
- "action_name": "Compile and copy %s via ninja" % target_name,
119
- "inputs": [],
120
- "outputs": [],
121
- "action": [
122
- "env",
123
- "PATH=%s" % os.environ["PATH"],
124
- "ninja",
125
- "-C",
126
- new_xcode_settings["CONFIGURATION_BUILD_DIR"],
127
- target_name,
128
- ],
129
- "message": "Compile and copy %s via ninja" % target_name,
130
- },
131
- ]
132
- if jobs > 0:
133
- ninja_target["actions"][0]["action"].extend(("-j", jobs))
134
- return ninja_target
135
-
136
-
137
- def IsValidTargetForWrapper(target_extras, executable_target_pattern, spec):
138
- """Limit targets for Xcode wrapper.
139
-
140
- Xcode sometimes performs poorly with too many targets, so only include
141
- proper executable targets, with filters to customize.
142
- Arguments:
143
- target_extras: Regular expression to always add, matching any target.
144
- executable_target_pattern: Regular expression limiting executable targets.
145
- spec: Specifications for target.
146
- """
147
- target_name = spec.get("target_name")
148
- # Always include targets matching target_extras.
149
- if target_extras is not None and re.search(target_extras, target_name):
150
- return True
151
-
152
- # Otherwise just show executable targets and xc_tests.
153
- if int(spec.get("mac_xctest_bundle", 0)) != 0 or (
154
- spec.get("type", "") == "executable"
155
- and spec.get("product_extension", "") != "bundle"
156
- ):
157
-
158
- # If there is a filter and the target does not match, exclude the target.
159
- if executable_target_pattern is not None:
160
- if not re.search(executable_target_pattern, target_name):
161
- return False
162
- return True
163
- return False
164
-
165
-
166
- def CreateWrapper(target_list, target_dicts, data, params):
167
- """Initialize targets for the ninja wrapper.
168
-
169
- This sets up the necessary variables in the targets to generate Xcode projects
170
- that use ninja as an external builder.
171
- Arguments:
172
- target_list: List of target pairs: 'base/base.gyp:base'.
173
- target_dicts: Dict of target properties keyed on target pair.
174
- data: Dict of flattened build files keyed on gyp path.
175
- params: Dict of global options for gyp.
176
- """
177
- orig_gyp = params["build_files"][0]
178
- for gyp_name, gyp_dict in data.items():
179
- if gyp_name == orig_gyp:
180
- depth = gyp_dict["_DEPTH"]
181
-
182
- # Check for custom main gyp name, otherwise use the default CHROMIUM_GYP_FILE
183
- # and prepend .ninja before the .gyp extension.
184
- generator_flags = params.get("generator_flags", {})
185
- main_gyp = generator_flags.get("xcode_ninja_main_gyp", None)
186
- if main_gyp is None:
187
- (build_file_root, build_file_ext) = os.path.splitext(orig_gyp)
188
- main_gyp = build_file_root + ".ninja" + build_file_ext
189
-
190
- # Create new |target_list|, |target_dicts| and |data| data structures.
191
- new_target_list = []
192
- new_target_dicts = {}
193
- new_data = {}
194
-
195
- # Set base keys needed for |data|.
196
- new_data[main_gyp] = {}
197
- new_data[main_gyp]["included_files"] = []
198
- new_data[main_gyp]["targets"] = []
199
- new_data[main_gyp]["xcode_settings"] = data[orig_gyp].get("xcode_settings", {})
200
-
201
- # Normally the xcode-ninja generator includes only valid executable targets.
202
- # If |xcode_ninja_executable_target_pattern| is set, that list is reduced to
203
- # executable targets that match the pattern. (Default all)
204
- executable_target_pattern = generator_flags.get(
205
- "xcode_ninja_executable_target_pattern", None
206
- )
207
-
208
- # For including other non-executable targets, add the matching target name
209
- # to the |xcode_ninja_target_pattern| regular expression. (Default none)
210
- target_extras = generator_flags.get("xcode_ninja_target_pattern", None)
211
-
212
- for old_qualified_target in target_list:
213
- spec = target_dicts[old_qualified_target]
214
- if IsValidTargetForWrapper(target_extras, executable_target_pattern, spec):
215
- # Add to new_target_list.
216
- target_name = spec.get("target_name")
217
- new_target_name = f"{main_gyp}:{target_name}#target"
218
- new_target_list.append(new_target_name)
219
-
220
- # Add to new_target_dicts.
221
- new_target_dicts[new_target_name] = _TargetFromSpec(spec, params)
222
-
223
- # Add to new_data.
224
- for old_target in data[old_qualified_target.split(":")[0]]["targets"]:
225
- if old_target["target_name"] == target_name:
226
- new_data_target = {}
227
- new_data_target["target_name"] = old_target["target_name"]
228
- new_data_target["toolset"] = old_target["toolset"]
229
- new_data[main_gyp]["targets"].append(new_data_target)
230
-
231
- # Create sources target.
232
- sources_target_name = "sources_for_indexing"
233
- sources_target = _TargetFromSpec(
234
- {
235
- "target_name": sources_target_name,
236
- "toolset": "target",
237
- "default_configuration": "Default",
238
- "mac_bundle": "0",
239
- "type": "executable",
240
- },
241
- None,
242
- )
243
-
244
- # Tell Xcode to look everywhere for headers.
245
- sources_target["configurations"] = {"Default": {"include_dirs": [depth]}}
246
-
247
- # Put excluded files into the sources target so they can be opened in Xcode.
248
- skip_excluded_files = not generator_flags.get(
249
- "xcode_ninja_list_excluded_files", True
250
- )
251
-
252
- sources = []
253
- for target, target_dict in target_dicts.items():
254
- base = os.path.dirname(target)
255
- files = target_dict.get("sources", []) + target_dict.get(
256
- "mac_bundle_resources", []
257
- )
258
-
259
- if not skip_excluded_files:
260
- files.extend(
261
- target_dict.get("sources_excluded", [])
262
- + target_dict.get("mac_bundle_resources_excluded", [])
263
- )
264
-
265
- for action in target_dict.get("actions", []):
266
- files.extend(action.get("inputs", []))
267
-
268
- if not skip_excluded_files:
269
- files.extend(action.get("inputs_excluded", []))
270
-
271
- # Remove files starting with $. These are mostly intermediate files for the
272
- # build system.
273
- files = [file for file in files if not file.startswith("$")]
274
-
275
- # Make sources relative to root build file.
276
- relative_path = os.path.dirname(main_gyp)
277
- sources += [
278
- os.path.relpath(os.path.join(base, file), relative_path) for file in files
279
- ]
280
-
281
- sources_target["sources"] = sorted(set(sources))
282
-
283
- # Put sources_to_index in it's own gyp.
284
- sources_gyp = os.path.join(os.path.dirname(main_gyp), sources_target_name + ".gyp")
285
- fully_qualified_target_name = f"{sources_gyp}:{sources_target_name}#target"
286
-
287
- # Add to new_target_list, new_target_dicts and new_data.
288
- new_target_list.append(fully_qualified_target_name)
289
- new_target_dicts[fully_qualified_target_name] = sources_target
290
- new_data_target = {}
291
- new_data_target["target_name"] = sources_target["target_name"]
292
- new_data_target["_DEPTH"] = depth
293
- new_data_target["toolset"] = "target"
294
- new_data[sources_gyp] = {}
295
- new_data[sources_gyp]["targets"] = []
296
- new_data[sources_gyp]["included_files"] = []
297
- new_data[sources_gyp]["xcode_settings"] = data[orig_gyp].get("xcode_settings", {})
298
- new_data[sources_gyp]["targets"].append(new_data_target)
299
-
300
- # Write workspace to file.
301
- _WriteWorkspace(main_gyp, sources_gyp, params)
302
- return (new_target_list, new_target_dicts, new_data)