django-ledger 0.8.0__py3-none-any.whl → 0.8.2__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 (56) hide show
  1. django_ledger/__init__.py +1 -1
  2. django_ledger/forms/account.py +45 -46
  3. django_ledger/forms/data_import.py +182 -64
  4. django_ledger/io/io_core.py +507 -374
  5. django_ledger/migrations/0026_stagedtransactionmodel_customer_model_and_more.py +56 -0
  6. django_ledger/models/__init__.py +2 -1
  7. django_ledger/models/bill.py +337 -300
  8. django_ledger/models/customer.py +47 -34
  9. django_ledger/models/data_import.py +770 -289
  10. django_ledger/models/entity.py +882 -637
  11. django_ledger/models/mixins.py +421 -282
  12. django_ledger/models/receipt.py +1083 -0
  13. django_ledger/models/transactions.py +105 -41
  14. django_ledger/models/unit.py +42 -30
  15. django_ledger/models/utils.py +12 -2
  16. django_ledger/models/vendor.py +85 -66
  17. django_ledger/settings.py +1 -0
  18. django_ledger/static/django_ledger/bundle/djetler.bundle.js +1 -1
  19. django_ledger/static/django_ledger/bundle/djetler.bundle.js.LICENSE.txt +1 -13
  20. django_ledger/templates/django_ledger/bills/bill_update.html +1 -1
  21. django_ledger/templates/django_ledger/components/period_navigator.html +5 -3
  22. django_ledger/templates/django_ledger/customer/customer_detail.html +87 -0
  23. django_ledger/templates/django_ledger/customer/customer_list.html +0 -1
  24. django_ledger/templates/django_ledger/customer/tags/customer_table.html +3 -1
  25. django_ledger/templates/django_ledger/data_import/tags/data_import_job_txs_imported.html +24 -3
  26. django_ledger/templates/django_ledger/data_import/tags/data_import_job_txs_table.html +26 -10
  27. django_ledger/templates/django_ledger/entity/entity_dashboard.html +2 -2
  28. django_ledger/templates/django_ledger/invoice/invoice_update.html +1 -1
  29. django_ledger/templates/django_ledger/layouts/base.html +3 -1
  30. django_ledger/templates/django_ledger/layouts/content_layout_1.html +1 -1
  31. django_ledger/templates/django_ledger/receipt/customer_receipt_report.html +115 -0
  32. django_ledger/templates/django_ledger/receipt/receipt_delete.html +30 -0
  33. django_ledger/templates/django_ledger/receipt/receipt_detail.html +89 -0
  34. django_ledger/templates/django_ledger/receipt/receipt_list.html +134 -0
  35. django_ledger/templates/django_ledger/receipt/vendor_receipt_report.html +115 -0
  36. django_ledger/templates/django_ledger/vendor/tags/vendor_table.html +3 -2
  37. django_ledger/templates/django_ledger/vendor/vendor_detail.html +86 -0
  38. django_ledger/templatetags/django_ledger.py +338 -191
  39. django_ledger/urls/__init__.py +1 -0
  40. django_ledger/urls/customer.py +3 -0
  41. django_ledger/urls/data_import.py +3 -0
  42. django_ledger/urls/receipt.py +102 -0
  43. django_ledger/urls/vendor.py +1 -0
  44. django_ledger/views/__init__.py +1 -0
  45. django_ledger/views/customer.py +56 -14
  46. django_ledger/views/data_import.py +119 -66
  47. django_ledger/views/mixins.py +112 -86
  48. django_ledger/views/receipt.py +294 -0
  49. django_ledger/views/vendor.py +53 -14
  50. {django_ledger-0.8.0.dist-info → django_ledger-0.8.2.dist-info}/METADATA +1 -1
  51. {django_ledger-0.8.0.dist-info → django_ledger-0.8.2.dist-info}/RECORD +55 -45
  52. django_ledger/static/django_ledger/bundle/styles.bundle.js +0 -1
  53. {django_ledger-0.8.0.dist-info → django_ledger-0.8.2.dist-info}/WHEEL +0 -0
  54. {django_ledger-0.8.0.dist-info → django_ledger-0.8.2.dist-info}/licenses/AUTHORS.md +0 -0
  55. {django_ledger-0.8.0.dist-info → django_ledger-0.8.2.dist-info}/licenses/LICENSE +0 -0
  56. {django_ledger-0.8.0.dist-info → django_ledger-0.8.2.dist-info}/top_level.txt +0 -0
@@ -6,20 +6,8 @@
6
6
  */
7
7
 
8
8
  /*!
9
- * Chart.js v4.4.9
9
+ * Chart.js v4.5.0
10
10
  * https://www.chartjs.org
11
11
  * (c) 2025 Chart.js Contributors
12
12
  * Released under the MIT License
13
13
  */
14
-
15
- /**
16
- * (c) Iconify
17
- *
18
- * For the full copyright and license information, please view the license.txt
19
- * files at https://github.com/iconify/iconify
20
- *
21
- * Licensed under MIT.
22
- *
23
- * @license MIT
24
- * @version 2.3.0
25
- */
@@ -93,7 +93,7 @@
93
93
  </div>
94
94
  {% else %}
95
95
  <div class="column is-12">
96
- <div class="card animate__animated animate__tada">
96
+ <div class="card">
97
97
  <div class="card-header">
98
98
  <p class="card-header-title">{% trans 'Bill Configuration' %}</p>
99
99
  </div>
@@ -4,10 +4,12 @@
4
4
  <div class="card">
5
5
  <div class="card-content">
6
6
  <div class="has-text-centered">
7
- <h2 class="is-size-2 has-font-weight-medium">
7
+ <h2 class="is-size-4 has-font-weight-medium">
8
8
  {% if has_year %}Fiscal Year {{ to_date.year }}{% endif %}
9
- {% if has_month %}{{ to_date | date:"F Y" }}{% endif %}
10
- {% if has_quarter %}Q{{ quarter }} {{ year }}{% endif %}
9
+ </h2>
10
+ <h2 class="is-size-5">
11
+ {% if has_month %}{{ to_date | date:"F" }}{% endif %}
12
+ {% if has_quarter %}Q{{ quarter }}{% endif %}
11
13
  {% if has_date %}{{ to_date | date }}{% endif %}
12
14
  </h2>
13
15
  </div>
@@ -0,0 +1,87 @@
1
+ {% extends 'django_ledger/layouts/content_layout_1.html' %}
2
+ {% load i18n %}
3
+ {% load django_ledger %}
4
+
5
+ {% block view_content %}
6
+
7
+ <div class="box">
8
+ <div class="columns">
9
+ <div class="column is-one-third">
10
+ {% include 'django_ledger/customer/includes/card_customer.html' with customer=customer %}
11
+ </div>
12
+ <div class="column">
13
+ <div class="content">
14
+ <h3 class="title is-4">
15
+ <span class="icon is-small">{% icon 'mdi:receipt-text' 24 %}</span>
16
+ {% trans 'Receipts' %}
17
+ </h3>
18
+ {% if receipts %}
19
+ <div class="table-container">
20
+ <table class="table is-fullwidth is-narrow is-striped is-bordered">
21
+ <thead>
22
+ <tr>
23
+ <th class="has-text-centered">{% trans 'Receipt Number' %}</th>
24
+ <th class="has-text-centered">{% trans 'Date' %}</th>
25
+ <th class="has-text-centered">{% trans 'Type' %}</th>
26
+ <th class="has-text-centered">{% trans 'Actions' %}</th>
27
+ </tr>
28
+ </thead>
29
+ <tbody>
30
+ {% for receipt in receipts %}
31
+ <tr class="has-text-centered">
32
+ <td>
33
+ <a href="{{ receipt.get_absolute_url }}">{{ receipt.receipt_number }}</a>
34
+ </td>
35
+ <td>{{ receipt.receipt_date }}</td>
36
+ <td>{{ receipt.receipt_type|title }}</td>
37
+ <td>
38
+ {% if receipt.get_import_job_url %}
39
+ <a class="button is-small is-primary"
40
+ href="{{ receipt.get_import_job_url }}">{% trans 'Bank Feed Job' %}</a>
41
+ {% endif %}
42
+ </td>
43
+ </tr>
44
+ {% endfor %}
45
+ </tbody>
46
+ </table>
47
+ </div>
48
+ {% else %}
49
+ <p class="has-text-grey">{% trans 'No receipts found for this customer.' %}</p>
50
+ {% endif %}
51
+
52
+ <hr>
53
+
54
+ <h3 class="title is-4">
55
+ <span class="icon is-small">{% icon 'mdi:file-document-edit-outline' 24 %}</span>
56
+ {% trans 'Invoices' %}
57
+ </h3>
58
+ {% if invoices %}
59
+ <div class="table-container">
60
+ <table class="table is-fullwidth is-narrow is-striped is-bordered">
61
+ <thead>
62
+ <tr>
63
+ <th class="has-text-centered">{% trans 'Invoice Number' %}</th>
64
+ <th class="has-text-centered">{% trans 'Status' %}</th>
65
+ </tr>
66
+ </thead>
67
+ <tbody>
68
+ {% for invoice in invoices %}
69
+ <tr class="has-text-centered">
70
+ <td><a href="{{ invoice.get_absolute_url }}">{{ invoice.invoice_number }}</a>
71
+ </td>
72
+ <td>{{ invoice.get_invoice_status_display }}</td>
73
+ </tr>
74
+ {% endfor %}
75
+ </tbody>
76
+ </table>
77
+ </div>
78
+ {% else %}
79
+ <p class="has-text-grey">{% trans 'No invoices found for this customer.' %}</p>
80
+ {% endif %}
81
+
82
+ </div>
83
+ </div>
84
+ </div>
85
+ </div>
86
+
87
+ {% endblock %}
@@ -20,5 +20,4 @@
20
20
  {% customer_table %}
21
21
 
22
22
  </div>
23
- </div>
24
23
  {% endblock %}
@@ -18,7 +18,7 @@
18
18
  {% for customer in customers %}
19
19
  <tr class="has-text-centered">
20
20
  <td>{{ customer.customer_number }}</td>
21
- <td>{{ customer.customer_name }}</td>
21
+ <td><a href="{% url 'django_ledger:customer-detail' entity_slug=view.kwargs.entity_slug customer_pk=customer.uuid %}">{{ customer.customer_name }}</a></td>
22
22
  <td>{% if customer.address_1 %}{{ customer.address_1 }}{% endif %}</td>
23
23
  <td>{% if customer.customer_code %}{{ customer.customer_code }}{% endif %}</td>
24
24
  <td>
@@ -61,6 +61,8 @@
61
61
  id="dropdown-menu-{{ customer.uuid }}"
62
62
  role="menu">
63
63
  <div class="dropdown-content">
64
+ <a href="{% url 'django_ledger:customer-detail' entity_slug=view.kwargs.entity_slug customer_pk=customer.uuid %}"
65
+ class="dropdown-item has-text-weight-bold has-text-success">{% trans 'View' %}</a>
64
66
  <a href="{% url 'django_ledger:customer-update' entity_slug=view.kwargs.entity_slug customer_pk=customer.uuid %}"
65
67
  class="dropdown-item has-text-weight-bold has-text-info">{% trans 'Update' %}</a>
66
68
  </div>
@@ -17,7 +17,7 @@
17
17
  </thead>
18
18
  <tbody>
19
19
  {% for imported_tx in imported_txs %}
20
- <tr>
20
+ <tr id="staged-tx-{{ imported_tx.uuid }}">
21
21
  <td>{{ imported_tx.date_posted }}</td>
22
22
  <td>{{ imported_tx.name }}</td>
23
23
  <td class="{% if imported_tx.get_amount < 0.00 %}has-text-danger{% endif %} has-text-centered">
@@ -29,8 +29,29 @@
29
29
  <td>{{ imported_tx.account_model }}</td>
30
30
  <td>{{ imported_tx.transaction_model }}</td>
31
31
  <td class="has-text-centered">
32
- <a href="{% url 'django_ledger:je-detail' entity_slug=import_job_model.entity_slug ledger_pk=imported_tx.transaction_model.journal_entry.ledger_id je_pk=imported_tx.transaction_model.journal_entry_id %}"
33
- class="button is-small is-primary">{% trans 'View JE' %}</a>
32
+ <div class="dropdown is-hoverable is-right">
33
+ <div class="dropdown-trigger">
34
+ <button class="button is-small" aria-haspopup="true" aria-controls="actions-{{ imported_tx.uuid }}">
35
+ <span>{% trans 'Actions' %}</span>
36
+ <span class="icon is-small">{% icon 'mdi:chevron-down' 14 %}</span>
37
+ </button>
38
+ </div>
39
+ <div class="dropdown-menu" id="actions-{{ imported_tx.uuid }}" role="menu">
40
+ <div class="dropdown-content">
41
+ <a href="{% url 'django_ledger:je-detail' entity_slug=import_job_model.entity_slug ledger_pk=imported_tx.transaction_model.journal_entry.ledger_id je_pk=imported_tx.transaction_model.journal_entry_id %}"
42
+ class="dropdown-item">{% trans 'View JE' %}</a>
43
+ {% if imported_tx.has_receipt %}
44
+ <a href="{% url 'django_ledger:receipt-detail' entity_slug=import_job_model.entity_slug receipt_pk=imported_tx.receiptmodel.uuid %}"
45
+ class="dropdown-item">{% trans 'View Receipt' %}</a>
46
+ {% endif %}
47
+ <hr class="dropdown-divider">
48
+ <form method="post" action="{% url 'django_ledger:data-import-staged-tx-undo' entity_slug=import_job_model.entity_slug job_pk=import_job_model.uuid staged_tx_pk=imported_tx.uuid %}">
49
+ {% csrf_token %}
50
+ <button type="submit" class="dropdown-item has-text-danger">{% trans 'Undo Import' %}</button>
51
+ </form>
52
+ </div>
53
+ </div>
54
+ </div>
34
55
  </td>
35
56
  </tr>
36
57
  {% endfor %}
@@ -5,9 +5,9 @@
5
5
  <form method="post">
6
6
 
7
7
  {{ staged_txs_formset.non_form_errors }}
8
- {% if staged_txs_formset.errors %}
9
- {{ staged_txs_formset.errors }}
10
- {% endif %}
8
+ {# {% if staged_txs_formset.errors %}#}
9
+ {# {{ staged_txs_formset.errors }}#}
10
+ {# {% endif %}#}
11
11
  {{ staged_txs_formset.management_form }}
12
12
 
13
13
  {% csrf_token %}
@@ -23,9 +23,11 @@
23
23
  <th>Split Amount</th>
24
24
  <th>Map To</th>
25
25
  <th>Unit</th>
26
+ <th>Receipt Type</th>
27
+ <th>Customer/Vendor</th>
26
28
  <th>Import</th>
27
- <th>Bundle Split</th>
28
- <th>Add Split</th>
29
+ <th>Bundle</th>
30
+ <th>Split</th>
29
31
  <th>Delete</th>
30
32
  </tr>
31
33
  </thead>
@@ -33,7 +35,7 @@
33
35
  <tbody>
34
36
 
35
37
  {% for txf in staged_txs_formset %}
36
- <tr class="{% if txf.instance.is_children %}has-background-primary{% elif txf.instance.has_children %}has-background-primary-light{% endif %}">
38
+ <tr id="staged-tx-{{ txf.instance.uuid }}" class="{% if txf.instance.is_children %}has-background-primary{% elif txf.instance.has_children %}has-background-primary-light{% endif %}">
37
39
  <td>{{ forloop.counter }}</td>
38
40
  {% for hidden_field in txf.hidden_fields %}{{ hidden_field }}{% endfor %}
39
41
  {% if txf.instance.is_children %}
@@ -54,16 +56,30 @@
54
56
 
55
57
  <td>
56
58
  {% if txf.instance.get_prospect_je_activity_display %}
59
+ <span class="has-text-success">{% icon 'lets-icons:check-fill' 16 %}</span>
57
60
  <span class="is-italic">{% trans 'Transaction Activity' %}:</span>
58
61
  <span class="has-text-weight-bold">
59
- {{ txf.instance.get_prospect_je_activity_display }}
62
+ {{ txf.instance.get_prospect_je_activity_display }}
60
63
  </span>
64
+ {% elif not txf.instance.is_children %}
65
+ <span class="has-text-danger">{% icon 'ooui:block' 16 %}</span>
66
+ <span>Invalid or Pending Account Mapping.</span>
61
67
  {% endif %}
62
68
  {{ txf.account_model }}
69
+ {% if txf.errors %}
70
+ {% for i,err in txf.errors.items %}
71
+ <span class="has-text-danger">{{ err }}</span>
72
+ {% endfor %}
73
+ {% endif %}
63
74
  </td>
64
- <td>{{ txf.unit_model }}{% if txf.instance.is_children %}
65
- <span class="content is-small">{{ txf.instance.unit_model.name }}</span>
66
- {% endif %}
75
+ <td>{{ txf.unit_model }}</td>
76
+ <td>{{ txf.receipt_type }}</td>
77
+ <td class="has-text-centered">
78
+ {% if txf.SHOW_CUSTOMER_FIELD %}
79
+ {{ txf.customer_model }}
80
+ {% elif txf.SHOW_VENDOR_FIELD %}
81
+ {{ txf.vendor_model }}
82
+ {% endif %}
67
83
  </td>
68
84
  <td class="has-text-centered">{{ txf.tx_import }}</td>
69
85
  <td class="has-text-centered">{{ txf.bundle_split }}</td>
@@ -7,7 +7,8 @@
7
7
  <section class="section">
8
8
  <div class="container is-fluid p-0">
9
9
  <div class="columns">
10
- <div class="column is-3 is-hidden-mobile is-hidden-tablet-only">
10
+ <div class="column is-2 is-hidden-mobile is-hidden-tablet-only">
11
+
11
12
  <div class="columns is-multiline">
12
13
  <div class="column is-12">
13
14
  {% if view.kwargs.unit_slug or request.GET.unit %}
@@ -21,7 +22,6 @@
21
22
  </div>
22
23
  </div>
23
24
 
24
-
25
25
  </div>
26
26
  <div class="column">
27
27
  <div class="columns is-multiline is-centered">
@@ -92,7 +92,7 @@
92
92
  </div>
93
93
  {% else %}
94
94
  <div class="column is-12">
95
- <div class="card animate__animated animate__tada">
95
+ <div class="card">
96
96
  <div class="card-header">
97
97
  <p class="card-header-title">{% trans 'Invoice Configuration' %}</p>
98
98
  </div>
@@ -7,12 +7,13 @@
7
7
  <head>
8
8
  <meta charset="utf-8">
9
9
  <meta name="viewport" content="width=device-width, initial-scale=1">
10
- <title>{% block page_title %}{% session_entity_name %} | {{ page_title }}{% endblock %}</title>
10
+ <title>{% block page_title %}{{ page_title }} | {{ entity_model.name | default:'' }}{% endblock %}</title>
11
11
 
12
12
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@1.0.4/css/bulma.min.css">
13
13
  <link rel="stylesheet" href="{% static 'django_ledger/css/djl_styles.css' %}">
14
14
  <link rel="stylesheet"
15
15
  href="https://cdn.rawgit.com/jenil/bulmaswatch/gh-pages/{{ DJANGO_LEDGER_THEME }}/bulmaswatch.min.css">
16
+ <script src="https://code.iconify.design/iconify-icon/2.3.0/iconify-icon.min.js"></script>
16
17
 
17
18
  <link rel="shortcut icon" type="image/jpg" href="{% static 'django_ledger/logo/favicon.png' %}">
18
19
 
@@ -43,6 +44,7 @@
43
44
  {% block script_bottom %}
44
45
  <script src="{% static 'django_ledger/bundle/djetler.bundle.js' %}"></script>
45
46
 
47
+
46
48
  <script>
47
49
  {% if entity_slug %}
48
50
  let entitySlug = "{{ view.kwargs.entity_slug }}"
@@ -8,7 +8,7 @@
8
8
 
9
9
  {# SIDE MENU #}
10
10
  {% if not hide_menu %}
11
- <div class="column is-3 is-hidden-mobile is-hidden-tablet-only">
11
+ <div class="column is-2 is-hidden-mobile is-hidden-tablet-only">
12
12
  <div class="columns is-multiline">
13
13
  {% block aux_menu %}{% endblock %}
14
14
  <div class="column is-12">
@@ -0,0 +1,115 @@
1
+ {% extends 'django_ledger/layouts/content_layout_1.html' %}
2
+ {% load i18n %}
3
+ {% load django_ledger %}
4
+
5
+ {% block view_content %}
6
+ <div class="box">
7
+ <div class="level">
8
+ <div class="level-left">
9
+ <div class="level-item">
10
+ {% if month %}
11
+ <h1 class="is-size-1 has-text-weight-thin">{{ month|date:'F Y' }} {% trans 'Customer Receipts' %} — {{ customer_model.customer_name }}</h1>
12
+ {% elif year %}
13
+ <h1 class="is-size-1 has-text-weight-thin">{{ year|date:'Y' }} {% trans 'Customer Receipts' %} — {{ customer_model.customer_name }}</h1>
14
+ {% else %}
15
+ <h1 class="is-size-1 has-text-weight-thin">{% trans 'Customer Receipts' %} — {{ customer_model.customer_name }}</h1>
16
+ {% endif %}
17
+ </div>
18
+ </div>
19
+ <div class="level-right">
20
+ {% if page_obj %}
21
+ {% if page_obj.has_previous %}
22
+ <div class="level-item">
23
+ <a href="?page={{ page_obj.previous_page_number }}"
24
+ class="button is-small is-dark is-outlined">
25
+ <span class="icon is-small">{% icon 'ant-design:left-circle-outlined' 24 %}</span>
26
+ </a>
27
+ </div>
28
+ {% endif %}
29
+ <div class="level-item">
30
+ <p class="is-italic">page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}</p>
31
+ </div>
32
+ {% if page_obj.has_next %}
33
+ <div class="level-item">
34
+ <a href="?page={{ page_obj.next_page_number }}"
35
+ class="button is-small is-dark is-outlined">
36
+ <span class="icon is-small">{% icon 'ant-design:right-circle-outlined' 24 %}</span>
37
+ </a>
38
+ </div>
39
+ {% endif %}
40
+ {% endif %}
41
+ </div>
42
+ </div>
43
+
44
+ <table class="table is-fullwidth is-striped">
45
+ <thead>
46
+ <tr>
47
+ <th>{% trans 'Date' %}</th>
48
+ <th>{% trans 'Receipt #' %}</th>
49
+ <th>{% trans 'Type' %}</th>
50
+ <th>{% trans 'Imported' %}</th>
51
+ <th>{% trans 'Actions' %}</th>
52
+ </tr>
53
+ </thead>
54
+ <tbody>
55
+ {% for r in receipt_list %}
56
+ <tr>
57
+ <td>{{ r.receipt_date }}</td>
58
+ <td><a href="{{ r.get_absolute_url }}">{{ r.receipt_number }}</a></td>
59
+ <td>{{ r.get_receipt_type_display }}</td>
60
+ <td>
61
+ {% if r.staged_transaction_model %}
62
+ <a href="{{ r.get_staged_tx_url }}">
63
+ {% trans 'Staged TX' %}
64
+ </a>
65
+ <span class="is-size-7 has-text-grey"> · </span>
66
+ <a href="{{ r.get_import_job_url }}">
67
+ {% trans 'Bank Feed Job' %}
68
+ </a>
69
+ {% else %}
70
+
71
+ {% endif %}
72
+ </td>
73
+ <td>
74
+ <a class="button is-small is-danger is-outlined" href="{{ r.get_delete_url }}">
75
+ {% trans 'Undo/Delete' %}
76
+ </a>
77
+ </td>
78
+ </tr>
79
+ {% empty %}
80
+ <tr>
81
+ <td colspan="5" class="has-text-centered">{% trans 'No receipts found.' %}</td>
82
+ </tr>
83
+ {% endfor %}
84
+ </tbody>
85
+ </table>
86
+
87
+ {% if year %}
88
+ <h5 class="is-size-5">{% trans 'Go to quarter:' %}</h5>
89
+ <p>
90
+ {% for q in '1234' %}
91
+ <a href="{% url 'django_ledger:receipt-report-customer-quarter' entity_slug=view.kwargs.entity_slug customer_pk=customer_model.uuid year=year quarter=q %}">Q{{ q }}{% if not forloop.last %} > {% endif %}</a>
92
+ {% endfor %}
93
+ </p>
94
+ <h5 class="is-size-5">{% trans 'Go to month:' %}</h5>
95
+ <p>
96
+ <a href="{% url 'django_ledger:receipt-report-customer' entity_slug=view.kwargs.entity_slug customer_pk=customer_model.uuid %}">{% trans 'All' %} |</a>
97
+ {% for date in date_list %}
98
+ <a href="{% url 'django_ledger:receipt-report-customer-month' entity_slug=view.kwargs.entity_slug customer_pk=customer_model.uuid year=date.year month=date.month %}">
99
+ {{ date | date:'F' }}{% if not forloop.last %} > {% endif %}
100
+ </a>
101
+ {% endfor %}
102
+ </p>
103
+ {% else %}
104
+ <h5 class="is-size-5">{% trans 'Go to year:' %}</h5>
105
+ <p>
106
+ <a href="{% url 'django_ledger:receipt-report-customer' entity_slug=view.kwargs.entity_slug customer_pk=customer_model.uuid %}">{% trans 'All' %} |</a>
107
+ {% for date in date_list %}
108
+ <a href="{% url 'django_ledger:receipt-report-customer-year' entity_slug=view.kwargs.entity_slug customer_pk=customer_model.uuid year=date.year %}">
109
+ {{ date.year }}{% if not forloop.last %} > {% endif %}
110
+ </a>
111
+ {% endfor %}
112
+ </p>
113
+ {% endif %}
114
+ </div>
115
+ {% endblock %}
@@ -0,0 +1,30 @@
1
+ {% extends 'django_ledger/layouts/content_layout_1.html' %}
2
+ {% load i18n %}
3
+ {% load django_ledger %}
4
+
5
+ {% block view_content %}
6
+ <div class="columns is-centered">
7
+ <div class="column is-6">
8
+ <form action="{{ receipt.get_delete_url }}"
9
+ method="post">
10
+ {% csrf_token %}
11
+ <div class="card">
12
+ <div class="card-content has-text-centered">
13
+ <p class="title has-text-weight-light">{% trans 'Are you sure you want to delete' %}
14
+ {% trans 'Receipt' %} {{ receipt.receipt_number }}?</p>
15
+ </div>
16
+ <div class="card-content has-text-centered">
17
+ <p class="subtitle">{% trans 'All transactions posted by this receipt will be removed from its ledger if deletion is allowed.' %}</p>
18
+ </div>
19
+ <div class="card-content has-text-centered">
20
+ <a href="{{ receipt.get_absolute_url }}"
21
+ class="button is-primary">{% trans 'Go Back' %}</a>
22
+ <button type="submit" class="button is-danger">{% trans 'Delete' %}</button>
23
+ </div>
24
+
25
+ </div>
26
+ </form>
27
+ </div>
28
+
29
+ </div>
30
+ {% endblock %}
@@ -0,0 +1,89 @@
1
+ {% extends 'django_ledger/layouts/content_layout_1.html' %}
2
+ {% load i18n %}
3
+ {% load django_ledger %}
4
+
5
+ {% block view_content %}
6
+ <div class="columns is-centered">
7
+ <div class="column is-8">
8
+ <div class="card">
9
+ <div class="card-content">
10
+ <h2 class="title has-text-weight-light">{% trans 'Receipt' %} {{ receipt.receipt_number }}</h2>
11
+ <p><strong>{% trans 'Date' %}:</strong> {{ receipt.receipt_date }}</p>
12
+ <p><strong>{% trans 'Type' %}:</strong> {{ receipt.get_receipt_type_display }}</p>
13
+
14
+ {# CUSTOMER INFO #}
15
+ {% if receipt.customer_model %}
16
+ <p><strong>{% trans 'Customer' %}:</strong>
17
+ <a href="{{ receipt.get_customer_list_url }}">{{ receipt.customer_model.customer_name }}</a>
18
+ <span class="is-size-7 has-text-grey"> ·
19
+ <a href="{{ receipt.get_customer_report_url }}">{% trans 'Report' %}</a>
20
+ </span>
21
+ </p>
22
+ {% endif %}
23
+
24
+ {# VENDOR INFO #}
25
+ {% if receipt.vendor_model %}
26
+ <p><strong>{% trans 'Vendor' %}:</strong>
27
+ <a href="{{ receipt.get_vendor_list_url }}">{{ receipt.vendor_model.vendor_name }}</a>
28
+ <span class="is-size-7 has-text-grey"> ·
29
+ <a href="{{ receipt.get_vendor_report_url }}">{% trans 'Report' %}</a>
30
+ </span>
31
+ </p>
32
+ {% endif %}
33
+
34
+ <p><strong>{% trans 'Ledger' %}:</strong>
35
+ <a href="{{ receipt.ledger_model.get_absolute_url }}">{{ receipt.ledger_model.name }}</a>
36
+ </p>
37
+
38
+ </div>
39
+ <div class="card-content">
40
+ <h3 class="title is-5 has-text-weight-light">{% trans 'Transaction Journal' %}</h3>
41
+ {% if tx_list %}
42
+ <table class="table is-fullwidth is-striped is-narrow">
43
+ <thead>
44
+ <tr>
45
+ <th>{% trans 'Date/Time' %}</th>
46
+ <th>{% trans 'Journal Entry' %}</th>
47
+ <th>{% trans 'Account' %}</th>
48
+ <th class="has-text-right">{% trans 'Debit' %}</th>
49
+ <th class="has-text-right">{% trans 'Credit' %}</th>
50
+ <th>{% trans 'Unit' %}</th>
51
+ </tr>
52
+ </thead>
53
+ <tbody>
54
+ {% for tx in tx_list %}
55
+ <tr>
56
+ <td>{{ tx.journal_entry.timestamp }}</td>
57
+ <td>
58
+ <a href="{{ tx.get_journal_entry_detail_url }}">{{ tx.journal_entry.description|default:'—' }}</a>
59
+ </td>
60
+ <td>{{ tx.account.code }} - {{ tx.account.name }}</td>
61
+ <td class="has-text-right">{% if tx.is_debit %}{{ tx.amount }}{% endif %}</td>
62
+ <td class="has-text-right">{% if tx.is_credit %}{{ tx.amount }}{% endif %}</td>
63
+ <td>{{ tx.journal_entry.entity_unit.name|default:'—' }}</td>
64
+ </tr>
65
+ {% endfor %}
66
+ </tbody>
67
+ </table>
68
+ {% else %}
69
+ <p class="has-text-grey">{% trans 'No transactions found for this receipt.' %}</p>
70
+ {% endif %}
71
+ {% if import_job %}
72
+ <p class="mt-4">
73
+ <strong>{% trans 'Imported From' %}:</strong>
74
+ <a href="{{ receipt.get_import_job_url }}">
75
+ {% trans 'Bank Feed Job' %} — {{ import_job.description|default:import_job.uuid }}
76
+ </a>
77
+ </p>
78
+ {% endif %}
79
+ </div>
80
+ <div class="card-content">
81
+ <a href="{{ receipt.get_list_url }}"
82
+ class="button is-primary is-outlined">{% trans 'Back to Receipts' %}</a>
83
+ <a href="{{ receipt.get_delete_url }}"
84
+ class="button is-danger is-outlined">{% trans 'Undo/Delete' %}</a>
85
+ </div>
86
+ </div>
87
+ </div>
88
+ </div>
89
+ {% endblock %}