Compare commits
No commits in common. "f19b936ff806638cff18dfac4506e0ada50867e6" and "20e1811fc76442cb14da300fa2b719149dc11bc5" have entirely different histories.
f19b936ff8
...
20e1811fc7
@ -710,13 +710,3 @@ def invoice_item_formset_table(context, itemtxs_formset):
|
|||||||
"total_amount__sum": context["total_amount__sum"],
|
"total_amount__sum": context["total_amount__sum"],
|
||||||
"itemtxs_formset": itemtxs_formset,
|
"itemtxs_formset": itemtxs_formset,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@register.filter
|
|
||||||
def filter_by_status(queryset, status):
|
|
||||||
if status == "active":
|
|
||||||
return queryset.filter(active=True)
|
|
||||||
elif status == "locked":
|
|
||||||
return queryset.filter(locked=True)
|
|
||||||
else:
|
|
||||||
return queryset
|
|
||||||
|
|||||||
@ -4366,7 +4366,6 @@ class AccountListView(LoginRequiredMixin, PermissionRequiredMixin, ListView):
|
|||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super().get_context_data(**kwargs)
|
context = super().get_context_data(**kwargs)
|
||||||
context["url_kwargs"] = self.kwargs
|
context["url_kwargs"] = self.kwargs
|
||||||
context["coa_pk"] = self.kwargs["coa_pk"]
|
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
||||||
@ -4413,7 +4412,17 @@ class AccountCreateView(
|
|||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
dealer = get_user_type(self.request)
|
dealer = get_user_type(self.request)
|
||||||
|
instance = form.save(commit=False)
|
||||||
coa = ChartOfAccountModel.objects.get(entity=dealer.entity,pk=self.kwargs["coa_pk"]) or self.request.entity.get_default_coa()
|
coa = ChartOfAccountModel.objects.get(entity=dealer.entity,pk=self.kwargs["coa_pk"]) or self.request.entity.get_default_coa()
|
||||||
|
# coa.insert_account(account_model=instance)
|
||||||
|
account = coa.entity.create_account(
|
||||||
|
coa_model=coa,
|
||||||
|
code=instance.code,
|
||||||
|
name=instance.name,
|
||||||
|
role=instance.role,
|
||||||
|
balance_type=_(instance.balance_type),
|
||||||
|
active=True,
|
||||||
|
)
|
||||||
form.instance.entity_model = dealer.entity
|
form.instance.entity_model = dealer.entity
|
||||||
form.instance.coa_model = coa
|
form.instance.coa_model = coa
|
||||||
form.instance.depth = 0
|
form.instance.depth = 0
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 390 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 334 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 368 KiB |
@ -46,7 +46,7 @@
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-lg">
|
<div class="modal-dialog modal-xl">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title" id="exampleModalLabel">{% trans "Our Refund Policy" %}</h5>
|
<h5 class="modal-title" id="exampleModalLabel">{% trans "Our Refund Policy" %}</h5>
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
{% load django_ledger %}
|
{% load django_ledger %}
|
||||||
{% load custom_filters %}
|
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% now "Y" as current_year %}
|
{% now "Y" as current_year %}
|
||||||
<div class="card shadow-sm border-0 mb-4">
|
<div class="card shadow-sm border-0 mb-4">
|
||||||
@ -9,7 +8,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex-grow-1">
|
<div class="flex-grow-1">
|
||||||
<h5 class="fw-bold mb-0">
|
<h5 class="fw-bold mb-0">
|
||||||
|
{{ coa_model.name }}
|
||||||
{% if coa_model.is_default %}
|
{% if coa_model.is_default %}
|
||||||
<span class="badge bg-light text-primary ms-2 d-none d-sm-inline">{% trans 'DEFAULT' %}</span>
|
<span class="badge bg-light text-primary ms-2 d-none d-sm-inline">{% trans 'DEFAULT' %}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -48,15 +47,15 @@
|
|||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<span class="fw-bold"><i class="fas fa-list-alt me-1"></i> {% trans 'Total Accounts' %}:</span>
|
<span class="fw-bold"><i class="fas fa-list-alt me-1"></i> {% trans 'Total Accounts' %}:</span>
|
||||||
<span class="ms-2">{{ coa_model.accountmodel_set.all|length }}</span>
|
<span class="ms-2">{{ coa_model.accountmodel_total__count }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<span class="fw-bold text-info"><i class="fas fa-check-circle me-1"></i> {% trans 'Active Accounts' %}:</span>
|
<span class="fw-bold text-info"><i class="fas fa-check-circle me-1"></i> {% trans 'Active Accounts' %}:</span>
|
||||||
<span class="ms-2">{{ coa_model.accountmodel_set|filter_by_status:'active'|length }}</span>
|
<span class="ms-2">{{ coa_model.accountmodel_active__count }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<span class="fw-bold text-danger"><i class="fas fa-lock me-1"></i> {% trans 'Locked Accounts' %}:</span>
|
<span class="fw-bold text-danger"><i class="fas fa-lock me-1"></i> {% trans 'Locked Accounts' %}:</span>
|
||||||
<span class="ms-2">{{ coa_model.accountmodel_set|filter_by_status:'locked'|length }}</span>
|
<span class="ms-2">{{ coa_model.accountmodel_locked__count }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -200,7 +200,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% url 'account_create' request.dealer.slug coa_pk as create_account_url %}
|
{% url "account_create" request.dealer.slug as create_account_url %}
|
||||||
{% include "empty-illustration-page.html" with value="account" url=create_account_url %}
|
{% include "empty-illustration-page.html" with value="account" url=create_account_url %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user