django-ledger 0.5.6.3__py3-none-any.whl → 0.5.6.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 (31) hide show
  1. django_ledger/__init__.py +1 -1
  2. django_ledger/admin/coa.py +3 -3
  3. django_ledger/forms/account.py +1 -1
  4. django_ledger/forms/coa.py +1 -6
  5. django_ledger/io/roles.py +25 -9
  6. django_ledger/migrations/0015_remove_chartofaccountmodel_locked_and_more.py +22 -0
  7. django_ledger/models/accounts.py +9 -9
  8. django_ledger/models/coa.py +244 -35
  9. django_ledger/models/entity.py +43 -28
  10. django_ledger/templates/django_ledger/account/account_create.html +17 -11
  11. django_ledger/templates/django_ledger/account/account_list.html +12 -9
  12. django_ledger/templates/django_ledger/account/tags/accounts_table.html +97 -93
  13. django_ledger/templates/django_ledger/chart_of_accounts/coa_list.html +17 -0
  14. django_ledger/templates/django_ledger/{code_of_accounts → chart_of_accounts}/coa_update.html +1 -4
  15. django_ledger/templates/django_ledger/chart_of_accounts/includes/coa_card.html +74 -0
  16. django_ledger/templates/django_ledger/invoice/invoice_list.html +91 -94
  17. django_ledger/templatetags/django_ledger.py +1 -1
  18. django_ledger/tests/base.py +23 -1
  19. django_ledger/tests/test_accounts.py +16 -0
  20. django_ledger/tests/test_chart_of_accounts.py +46 -0
  21. django_ledger/urls/account.py +18 -3
  22. django_ledger/urls/chart_of_accounts.py +21 -1
  23. django_ledger/views/account.py +26 -3
  24. django_ledger/views/coa.py +79 -4
  25. django_ledger/views/mixins.py +3 -0
  26. {django_ledger-0.5.6.3.dist-info → django_ledger-0.5.6.4.dist-info}/METADATA +1 -1
  27. {django_ledger-0.5.6.3.dist-info → django_ledger-0.5.6.4.dist-info}/RECORD +31 -26
  28. {django_ledger-0.5.6.3.dist-info → django_ledger-0.5.6.4.dist-info}/AUTHORS.md +0 -0
  29. {django_ledger-0.5.6.3.dist-info → django_ledger-0.5.6.4.dist-info}/LICENSE +0 -0
  30. {django_ledger-0.5.6.3.dist-info → django_ledger-0.5.6.4.dist-info}/WHEEL +0 -0
  31. {django_ledger-0.5.6.3.dist-info → django_ledger-0.5.6.4.dist-info}/top_level.txt +0 -0
@@ -990,6 +990,21 @@ class EntityModelAbstract(MP_Node,
990
990
  raise EntityModelValidationError(f'EntityModel {self.slug} does not have a default CoA')
991
991
  return self.default_coa
992
992
 
993
+ def set_default_coa(self, coa_model: Optional[Union[ChartOfAccountModel, str]], commit: bool = False):
994
+
995
+ # if str, will look up CoA Model by slug...
996
+ if isinstance(coa_model, str):
997
+ coa_model = self.chartofaccountmodel_set.get(slug=coa_model)
998
+ else:
999
+ self.validate_chart_of_accounts_for_entity(coa_model)
1000
+
1001
+ self.default_coa = coa_model
1002
+ if commit:
1003
+ self.save(update_fields=[
1004
+ 'default_coa',
1005
+ 'updated'
1006
+ ])
1007
+
993
1008
  def create_chart_of_accounts(self,
994
1009
  assign_as_default: bool = False,
995
1010
  coa_name: Optional[str] = None,
@@ -1075,10 +1090,10 @@ class EntityModelAbstract(MP_Node,
1075
1090
  coa_has_accounts = coa_accounts_qs.not_coa_root().exists()
1076
1091
 
1077
1092
  if not coa_has_accounts or force:
1078
- root_accounts = coa_accounts_qs.is_coa_root()
1093
+ root_account_qs = coa_accounts_qs.is_coa_root()
1079
1094
 
1080
1095
  root_maps = {
1081
- root_accounts.get(role__exact=k): [
1096
+ root_account_qs.get(role__exact=k): [
1082
1097
  AccountModel(
1083
1098
  code=a['code'],
1084
1099
  name=a['name'],
@@ -1100,12 +1115,14 @@ class EntityModelAbstract(MP_Node,
1100
1115
  pass
1101
1116
 
1102
1117
  account_model.clean()
1103
- coa_model.create_account(account_model)
1118
+ coa_model.allocate_account(account_model, root_account_qs=root_account_qs)
1104
1119
 
1105
1120
  else:
1106
1121
  if not ignore_if_default_coa:
1107
- raise EntityModelValidationError(f'Entity {self.name} already has existing accounts. '
1108
- 'Use force=True to bypass this check')
1122
+ raise EntityModelValidationError(
1123
+ f'Entity {self.name} already has existing accounts. '
1124
+ 'Use force=True to bypass this check'
1125
+ )
1109
1126
 
1110
1127
  # Model Validators....
1111
1128
  def validate_chart_of_accounts_for_entity(self,
@@ -1254,19 +1271,12 @@ class EntityModelAbstract(MP_Node,
1254
1271
  """
1255
1272
 
1256
1273
  if not coa_model:
1257
- account_model_qs = self.default_coa.accountmodel_set.all().select_related('coa_model', 'coa_model__entity')
1274
+ account_model_qs = self.default_coa.accountmodel_set.all().select_related(
1275
+ 'coa_model', 'coa_model__entity').not_coa_root()
1258
1276
  else:
1259
- account_model_qs = AccountModel.objects.filter(
1260
- coa_model__entity__uuid__exact=self.uuid
1261
- ).select_related('coa_model', 'coa_model__entity')
1262
-
1263
- if isinstance(coa_model, ChartOfAccountModel):
1264
- self.validate_chart_of_accounts_for_entity(coa_model=coa_model, raise_exception=True)
1265
- account_model_qs = coa_model.accountmodel_set.all()
1266
- if isinstance(coa_model, str):
1267
- account_model_qs = account_model_qs.filter(coa_model__slug__exact=coa_model)
1268
- elif isinstance(coa_model, UUID):
1269
- account_model_qs = account_model_qs.filter(coa_model__uuid__exact=coa_model)
1277
+ self.validate_chart_of_accounts_for_entity(coa_model=coa_model)
1278
+ account_model_qs = coa_model.accountmodel_set.select_related(
1279
+ 'coa_model', 'coa_model__entity').not_coa_root()
1270
1280
 
1271
1281
  if active:
1272
1282
  account_model_qs = account_model_qs.active()
@@ -1367,7 +1377,7 @@ class EntityModelAbstract(MP_Node,
1367
1377
  role: str,
1368
1378
  name: str,
1369
1379
  balance_type: str,
1370
- active: bool,
1380
+ active: bool = False,
1371
1381
  coa_model: Optional[Union[ChartOfAccountModel, UUID, str]] = None,
1372
1382
  raise_exception: bool = True) -> AccountModel:
1373
1383
  """
@@ -1409,17 +1419,14 @@ class EntityModelAbstract(MP_Node,
1409
1419
  else:
1410
1420
  coa_model = self.default_coa
1411
1421
 
1412
- account_model = AccountModel(
1422
+ return coa_model.create_account(
1413
1423
  code=code,
1414
- name=name,
1415
1424
  role=role,
1416
- active=active,
1417
- balance_type=balance_type
1425
+ name=name,
1426
+ balance_type=balance_type,
1427
+ active=active
1418
1428
  )
1419
1429
 
1420
- account_model.clean()
1421
- return coa_model.create_account(account_model=account_model)
1422
-
1423
1430
  def create_account_by_kwargs(self,
1424
1431
  account_model_kwargs: Dict,
1425
1432
  coa_model: Optional[Union[ChartOfAccountModel, UUID, str]] = None,
@@ -1457,9 +1464,9 @@ class EntityModelAbstract(MP_Node,
1457
1464
  else:
1458
1465
  coa_model = self.default_coa
1459
1466
 
1460
- account_model = AccountModel(**account_model_kwargs)
1461
- account_model.clean()
1462
- return coa_model, coa_model.create_account(account_model=account_model)
1467
+ # account_model = AccountModel(**account_model_kwargs)
1468
+ # account_model.clean()
1469
+ return coa_model, coa_model.create_account(**account_model_kwargs)
1463
1470
 
1464
1471
  # ### LEDGER MANAGEMENT ####
1465
1472
  def get_ledgers(self, posted: bool = True):
@@ -2962,6 +2969,14 @@ class EntityModelAbstract(MP_Node,
2962
2969
  'entity_slug': self.slug
2963
2970
  })
2964
2971
 
2972
+ def get_coa_list_url(self) -> str:
2973
+ return reverse(
2974
+ viewname='django_ledger:coa-list',
2975
+ kwargs={
2976
+ 'entity_slug': self.slug
2977
+ }
2978
+ )
2979
+
2965
2980
  def get_accounts_url(self) -> str:
2966
2981
  """
2967
2982
  The EntityModel Code of Accounts llist import URL.
@@ -4,17 +4,23 @@
4
4
  {% load django_ledger %}
5
5
 
6
6
  {% block view_content %}
7
- <div class="columns is-centered">
8
- <div class="column is-8-tablet is-6-desktop">
9
- <div class="box">
10
- <form action="{% url 'django_ledger:account-create' entity_slug=view.kwargs.entity_slug %}"
11
- method="post">
12
- {% csrf_token %}
13
- {{ form.as_p }}
14
- <button type="submit" class="button is-primary is-fullwidth djetler_my_1">Submit</button>
15
- <a class="button is-dark is-small is-fullwidth"
16
- href="{% url 'django_ledger:account-list' entity_slug=view.kwargs.entity_slug %}">Back</a>
17
- </form>
7
+ <div class="box">
8
+ <div class="columns is-centered is-multiline">
9
+ <div class="column is-12 has-text-centered">
10
+ <h1 class="is-size-2">{% trans 'Create Account' %}</h1>
11
+ <h2 class="is-size-3 has-text-info">{{ coa_model.name }}</h2>
12
+ <p class="is-size-4 has-text-danger is-italic">({{ coa_model.slug }})</p>
13
+ </div>
14
+ <div class="column is-8-tablet is-6-desktop">
15
+ <div class="box">
16
+ <form method="post">
17
+ {% csrf_token %}
18
+ {{ form.as_p }}
19
+ <button type="submit" class="button is-primary is-fullwidth djetler_my_1">Submit</button>
20
+ <a class="button is-dark is-small is-fullwidth"
21
+ href="{% url 'django_ledger:account-list' entity_slug=view.kwargs.entity_slug %}">Back</a>
22
+ </form>
23
+ </div>
18
24
  </div>
19
25
  </div>
20
26
  </div>
@@ -5,18 +5,21 @@
5
5
 
6
6
  {% block view_content %}
7
7
  <div class="box">
8
- <div class="columns">
9
- <div class="column">
10
- <a href="{% url 'django_ledger:account-create' entity_slug=view.kwargs.entity_slug %}"
11
- class="button is-primary is-outlined">{% trans 'Create Account' %}</a>
12
- <a href="{% url 'django_ledger:entity-dashboard' entity_slug=view.kwargs.entity_slug %}"
13
- class="button is-dark">{% trans 'Back' %}</a>
8
+ <div class="columns is-multiline">
9
+ <div class="column is-12 has-text-centered">
10
+ <h1 class="is-size-3">{% trans 'Accounts List' %}</h1>
11
+ <h2 class="is-size-1 has-text-info">{{ coa_model.name }}</h2>
12
+ <p class="is-italic has-text-danger">({{ coa_model.slug }})</p>
14
13
  </div>
15
- </div>
16
- <div class="columns">
17
- <div class="column">
14
+ <div class="column is-12">
18
15
  {% accounts_table accounts %}
19
16
  </div>
17
+ <div class="column is-12 has-text-centered">
18
+ <a href="{% url 'django_ledger:account-create' entity_slug=view.kwargs.entity_slug %}"
19
+ class="button is-success">{% trans 'Create Account' %}</a>
20
+ <a href="{% url 'django_ledger:coa-list' entity_slug=view.kwargs.entity_slug %}"
21
+ class="button is-dark">{% trans 'Back to CoA List' %}</a>
22
+ </div>
20
23
  </div>
21
24
  </div>
22
25
  {% endblock %}
@@ -3,114 +3,118 @@
3
3
 
4
4
  {% for root_role, role_list in accounts_gb %}
5
5
  {% with title=root_role %}
6
- <div class="table-container">
7
- <table class="table is-fullwidth is-striped is-narrow is-bordered django-ledger-table-bottom-margin-75">
8
- <thead>
9
- {% if title %}
10
- <tr>
11
- <td><h2 class="is-size-3 has-text-weight-light">{{ title | upper }}</h2></td>
12
- <td></td>
13
- <td></td>
14
- <td></td>
15
- <td></td>
16
- <td></td>
17
- <td></td>
18
- </tr>
19
- {% endif %}
20
- <tr>
21
- <th>{% trans 'Account Name' %}</th>
22
- <th>{% trans 'CoA' %}</th>
23
- <th>{% trans 'Balance Type' %}</th>
24
- <th>{% trans 'Active' %}</th>
25
- <th>{% trans 'Locked' %}</th>
26
- <th>{% trans 'CoA Role Default' %}</th>
27
- <th>{% trans 'Actions' %}</th>
28
- </tr>
29
- </thead>
30
- <tbody>
31
- {% for role, acc_list in role_list %}
6
+ <div class="box">
7
+
8
+ <div class="table-container">
9
+ <table class="table is-fullwidth is-striped is-narrow django-ledger-table-bottom-margin-75">
10
+ <thead>
11
+ {% if title %}
12
+ <tr>
13
+ <td><h2 class="is-size-3 has-text-weight-light">{{ title | upper }}</h2></td>
14
+ <td></td>
15
+ <td></td>
16
+ <td></td>
17
+ <td></td>
18
+ {# <td></td>#}
19
+ <td></td>
20
+ </tr>
21
+ {% endif %}
22
+
32
23
  <tr>
33
- <td class="has-text-weight-bold is-underlined">{{ role | upper }}</td>
34
- <td></td>
35
- <td></td>
36
- <td></td>
37
- <td></td>
38
- <td></td>
39
- <td></td>
24
+ <th>{% trans 'Account Name' %}</th>
25
+ <th>{% trans 'CoA' %}</th>
26
+ <th>{% trans 'Balance Type' %}</th>
27
+ <th>{% trans 'Active' %}</th>
28
+ <th>{% trans 'CoA Role Default' %}</th>
29
+ <th>{% trans 'Actions' %}</th>
40
30
  </tr>
41
-
42
- {% for account in acc_list %}
31
+ </thead>
32
+ <tbody>
33
+ {% for role, acc_list in role_list %}
43
34
  <tr>
44
- <td style="{% if account.is_indented %}padding-left: {{ account.get_html_pixel_indent }};{% endif %}">
45
- <span class="has-text-weight-bold">{{ account.code }}</span>: {{ account.name }}</td>
46
- <td>{{ account.coa_model.name }}</td>
47
- <td>{{ account.get_balance_type_display }}</td>
48
- <td class="has-text-centered">
49
- {% if account.active %}
50
- <span class="icon has-text-success-dark">
35
+ <td class="has-text-weight-bold is-underlined">{{ role | upper }}</td>
36
+ <td></td>
37
+ <td></td>
38
+ <td></td>
39
+ <td></td>
40
+ {# <td></td>#}
41
+ <td></td>
42
+ </tr>
43
+
44
+ {% for account in acc_list %}
45
+ <tr>
46
+ <td style="{% if account.is_indented %}padding-left: {{ account.get_html_pixel_indent }};{% endif %}">
47
+ <span class="has-text-weight-bold">{{ account.code }}</span>: {{ account.name }}
48
+ </td>
49
+ <td>{{ account.coa_model.name }}</td>
50
+ <td>{{ account.get_balance_type_display }}</td>
51
+ <td class="has-text-centered">
52
+ {% if account.active %}
53
+ <span class="icon has-text-success-dark">
51
54
  {% icon 'ant-design:check-circle-filled' 24 %}
52
55
  </span>
53
- {% elif not account.active %}
54
- <span class="icon has-text-danger-dark">
56
+ {% elif not account.active %}
57
+ <span class="icon has-text-danger-dark">
55
58
  {% icon 'mdi:dangerous' 24 %}
56
59
  </span>
57
- {% endif %}
58
- </td>
60
+ {% endif %}
61
+ </td>
59
62
 
60
- <td class="has-text-centered">
61
- {% if account.locked %}
62
- <span class="icon has-text-success-dark">
63
- {% icon 'bi:lock-fill' 24 %}
64
- </span>
65
- {% elif not account.locked %}
66
- <span class="icon has-text-danger-dark">
67
- {% icon 'bx:bx-lock-open-alt' 24 %}
68
- </span>
69
- {% endif %}
70
- </td>
71
- <td class="has-text-centered">
72
- {% if account.role_default %}
73
- <span class="icon has-text-success-dark">
63
+ {# <td class="has-text-centered">#}
64
+ {# {% if account.locked %}#}
65
+ {# <span class="icon has-text-success-dark">#}
66
+ {# {% icon 'bi:lock-fill' 24 %}#}
67
+ {# </span>#}
68
+ {# {% elif not account.locked %}#}
69
+ {# <span class="icon has-text-danger-dark">#}
70
+ {# {% icon 'bx:bx-lock-open-alt' 24 %}#}
71
+ {# </span>#}
72
+ {# {% endif %}#}
73
+ {# </td>#}
74
+ <td class="has-text-centered">
75
+ {% if account.role_default %}
76
+ <span class="icon has-text-success-dark">
74
77
  {% icon 'ant-design:check-circle-filled' 24 %}
75
78
  </span>
76
- {% elif not account.role_default %}
77
- <span class="icon has-text-danger-dark">
79
+ {% elif not account.role_default %}
80
+ <span class="icon has-text-danger-dark">
78
81
  {% icon 'mdi:dangerous' 24 %}
79
82
  </span>
80
- {% endif %}
81
- </td>
82
- <td>
83
- <div class="dropdown is-right is-hoverable" id="account-action-{{ account.uuid }}">
84
- <div class="dropdown-trigger">
85
- <button class="button is-small is-rounded is-outlined"
86
- aria-haspopup="true"
87
- aria-controls="dropdown-menu">
88
- <span>{% trans 'Actions' %}</span>
89
- <span class="icon is-small">{% icon 'bi:arrow-down' 24 %}</span>
90
- </button>
91
- </div>
92
- <div class="dropdown-menu" id="dropdown-menu-{{ account.uuid }}" role="menu">
93
- <div class="dropdown-content">
94
- <a href="{% url 'django_ledger:account-detail' entity_slug=entity_slug account_pk=account.uuid %}"
95
- class="dropdown-item has-text-success">{% trans 'Detail' %}</a>
96
- <a href="{% url 'django_ledger:account-update' entity_slug=entity_slug account_pk=account.uuid %}"
97
- class="dropdown-item has-text-warning">{% trans 'Update' %}</a>
98
- {% if account.can_activate %}
99
- <a href="{% url 'django_ledger:account-action-activate' entity_slug=entity_slug account_pk=account.uuid %}"
100
- class="dropdown-item has-text-success has-text-weight-bold">{% trans 'Activate' %}</a>
101
- {% endif %}
102
- {% if account.can_deactivate %}
103
- <a href="{% url 'django_ledger:account-action-deactivate' entity_slug=entity_slug account_pk=account.uuid %}"
104
- class="dropdown-item has-text-danger has-text-weight-bold">{% trans 'Deactivate' %}</a>
105
- {% endif %}
83
+ {% endif %}
84
+ </td>
85
+ <td>
86
+ <div class="dropdown is-right is-hoverable" id="account-action-{{ account.uuid }}">
87
+ <div class="dropdown-trigger">
88
+ <button class="button is-small is-rounded is-outlined"
89
+ aria-haspopup="true"
90
+ aria-controls="dropdown-menu">
91
+ <span>{% trans 'Actions' %}</span>
92
+ <span class="icon is-small">{% icon 'bi:arrow-down' 24 %}</span>
93
+ </button>
94
+ </div>
95
+ <div class="dropdown-menu" id="dropdown-menu-{{ account.uuid }}" role="menu">
96
+ <div class="dropdown-content">
97
+ <a href="{% url 'django_ledger:account-detail' entity_slug=entity_slug account_pk=account.uuid %}"
98
+ class="dropdown-item has-text-success">{% trans 'Detail' %}</a>
99
+ <a href="{% url 'django_ledger:account-update' entity_slug=entity_slug account_pk=account.uuid %}"
100
+ class="dropdown-item has-text-warning">{% trans 'Update' %}</a>
101
+ {% if account.can_activate %}
102
+ <a href="{% url 'django_ledger:account-action-activate' entity_slug=entity_slug account_pk=account.uuid %}"
103
+ class="dropdown-item has-text-success has-text-weight-bold">{% trans 'Activate' %}</a>
104
+ {% endif %}
105
+ {% if account.can_deactivate %}
106
+ <a href="{% url 'django_ledger:account-action-deactivate' entity_slug=entity_slug account_pk=account.uuid %}"
107
+ class="dropdown-item has-text-danger has-text-weight-bold">{% trans 'Deactivate' %}</a>
108
+ {% endif %}
109
+ </div>
106
110
  </div>
107
111
  </div>
108
- </div>
109
- </td>
110
- </tr>
112
+ </td>
113
+ </tr>
114
+ {% endfor %}
111
115
  {% endfor %}
112
- {% endfor %}
113
- </table>
116
+ </table>
117
+ </div>
114
118
  </div>
115
119
  {% endwith %}
116
120
  {% endfor %}
@@ -0,0 +1,17 @@
1
+ {% extends 'django_ledger/layouts/content_layout_1.html' %}
2
+ {% load i18n %}
3
+ {% load static %}
4
+
5
+ {% block view_content %}
6
+ <div class="box">
7
+ <div class="columns is-centered is-multiline">
8
+ {% for coa_model in coa_list %}
9
+ <div class="column is-6">
10
+ {% include 'django_ledger/chart_of_accounts/includes/coa_card.html' with coa_model=coa_model %}
11
+ </div>
12
+ {% endfor %}
13
+ </div>
14
+ </div>
15
+ {% endblock %}
16
+
17
+
@@ -19,7 +19,4 @@
19
19
  </div>
20
20
  </div>
21
21
  </div>
22
- {% endblock %}
23
-
24
-
25
-
22
+ {% endblock %}
@@ -0,0 +1,74 @@
1
+ {% load django_ledger %}
2
+ {% load i18n %}
3
+ {% now "Y" as current_year %}
4
+
5
+
6
+ <div class="card">
7
+ <div class="card-header" {% if coa_model.is_default %}style="background-color: #04e304"{% endif %}>
8
+ <div class="card-header-icon">
9
+ {% icon "ic:baseline-business" 36 %}
10
+ </div>
11
+ <div class="card-header-title">
12
+ {{ coa_model.name }} {% if coa_model.is_default %} | {% trans 'DEFAULT' %}{% endif %}
13
+ </div>
14
+ </div>
15
+ <div class="card-content">
16
+ <h3 class="is-size-4">{% trans 'Entity Default' %}:
17
+ {% if coa_model.is_default %}
18
+ <span class="icon has-text-success">{% icon 'lets-icons:check-fill' 24 %}</span>
19
+ {% else %}
20
+ <span class="icon has-text-danger">{% icon 'mdi:stop-remove' 24 %}</span>
21
+ {% endif %}
22
+ </h3>
23
+ <h3 class="is-size-4">{% trans 'Is Active' %}:
24
+ {% if coa_model.is_active %}
25
+ <span class="icon has-text-success">{% icon 'lets-icons:check-fill' 24 %}</span>
26
+ {% else %}
27
+ <span class="icon has-text-danger">{% icon 'mdi:stop-remove' 24 %}</span>
28
+ {% endif %}
29
+ </h3>
30
+ <h4>CoA ID: <span class="has-text-danger has-font-weight-light">{{ coa_model.slug }}</span></h4>
31
+ <h4>{% trans 'Total Accounts' %}: {{ coa_model.accountmodel_total__count }}</h4>
32
+ <h4><span class="has-text-info">{% trans 'Active Accounts' %}</span>: {{ coa_model.accountmodel_active__count }}
33
+ </h4>
34
+ <h4><span
35
+ class="has-text-danger">{% trans 'Locked Accounts' %}</span>: {{ coa_model.accountmodel_locked__count }}
36
+ </h4>
37
+ <p class="mt-2"><span class="has-text-weight-bold">
38
+ {% trans 'Created' %}</span>: {{ coa_model.created | date }}
39
+ </p>
40
+ <p><span class="has-text-weight-bold">
41
+ {% trans 'Updated' %}</span>: {{ coa_model.created | timesince }} {% trans 'ago' %}
42
+ </p>
43
+ </div>
44
+
45
+ <footer class="card-footer">
46
+ <a href="{{ coa_model.get_account_list_url }}"
47
+ class="card-footer-item has-text-success has-text-weight-bold">
48
+ {% trans 'Accounts' %}
49
+ </a>
50
+ <a href="{{ coa_model.get_create_coa_account_url }}"
51
+ class="card-footer-item has-text-info has-text-weight-bold">
52
+ {% trans 'Add Account' %}
53
+ </a>
54
+
55
+ {% if not coa_model.is_default %}
56
+ <a href="{{ coa_model.mark_as_default_url }}"
57
+ class="card-footer-item has-text-danger has-text-weight-bold">
58
+ {% trans 'Mark as Default' %}
59
+ </a>
60
+ {% endif %}
61
+
62
+ {% if coa_model.can_deactivate %}
63
+ <a href="{{ coa_model.mark_as_inactive_url }}"
64
+ class="card-footer-item has-text-warning has-text-weight-bold">
65
+ {% trans 'Mark as Inactive' %}
66
+ </a>
67
+ {% elif coa_model.can_activate %}
68
+ <a href="{{ coa_model.mark_as_active_url }}"
69
+ class="card-footer-item has-text-success has-text-weight-bold">
70
+ {% trans 'Mark as Active' %}
71
+ </a>
72
+ {% endif %}
73
+ </footer>
74
+ </div>