po and bill update page ui chnages and formatted_order_id in sale order model
This commit is contained in:
parent
832b9b5b1c
commit
0b98dcb41d
BIN
dbtest.sqlite3
BIN
dbtest.sqlite3
Binary file not shown.
@ -2425,7 +2425,7 @@ class SaleOrder(models.Model):
|
|||||||
blank=True,
|
blank=True,
|
||||||
)
|
)
|
||||||
comments = models.TextField(blank=True, null=True)
|
comments = models.TextField(blank=True, null=True)
|
||||||
formatted_order_id = models.CharField(max_length=10, unique=True, editable=False)
|
formatted_order_id = models.CharField(max_length=20, unique=True, editable=False)
|
||||||
|
|
||||||
# Status and Dates
|
# Status and Dates
|
||||||
status = models.CharField(
|
status = models.CharField(
|
||||||
@ -2735,7 +2735,6 @@ class CustomGroup(models.Model):
|
|||||||
"itemmodel",
|
"itemmodel",
|
||||||
"invoicemodel",
|
"invoicemodel",
|
||||||
"vendormodel",
|
"vendormodel",
|
||||||
|
|
||||||
"journalentrymodel",
|
"journalentrymodel",
|
||||||
"purchaseordermodel",
|
"purchaseordermodel",
|
||||||
"estimatemodel",
|
"estimatemodel",
|
||||||
|
|||||||
@ -440,8 +440,16 @@ class ManagerDashboard(LoginRequiredMixin, TemplateView):
|
|||||||
transfer_cars = models.Car.objects.filter(
|
transfer_cars = models.Car.objects.filter(
|
||||||
dealer=dealer, status=models.CarStatusChoices.TRANSFER
|
dealer=dealer, status=models.CarStatusChoices.TRANSFER
|
||||||
).count()
|
).count()
|
||||||
reserved_percentage = reserved_cars / total_cars * 100
|
try:
|
||||||
sold_percentage = sold_cars / total_cars * 100
|
reserved_percentage = reserved_cars / total_cars * 100
|
||||||
|
except ZeroDivisionError as e:
|
||||||
|
print(f"error: {e}")
|
||||||
|
try:
|
||||||
|
sold_percentage = sold_cars / total_cars * 100
|
||||||
|
except ZeroDivisionError as e:
|
||||||
|
print(f"error: {e}")
|
||||||
|
|
||||||
|
|
||||||
qs = (
|
qs = (
|
||||||
models.Car.objects.values("id_car_make__name")
|
models.Car.objects.values("id_car_make__name")
|
||||||
.annotate(count=Count("id"))
|
.annotate(count=Count("id"))
|
||||||
@ -2513,11 +2521,18 @@ def vendorDetailView(request, dealer_slug,slug):
|
|||||||
:rtype: HttpResponse
|
:rtype: HttpResponse
|
||||||
"""
|
"""
|
||||||
vendor = get_object_or_404(models.Vendor, slug=slug)
|
vendor = get_object_or_404(models.Vendor, slug=slug)
|
||||||
|
dealer=vendor.dealer
|
||||||
|
cars=Car.objects.filter(dealer=dealer,vendor=vendor)
|
||||||
|
print(cars)
|
||||||
|
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
request, template_name="vendors/view_vendor.html", context={"vendor": vendor}
|
request, template_name="vendors/view_vendor.html", context={"vendor": vendor}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class VendorCreateView(
|
class VendorCreateView(
|
||||||
LoginRequiredMixin,
|
LoginRequiredMixin,
|
||||||
PermissionRequiredMixin,
|
PermissionRequiredMixin,
|
||||||
@ -8676,7 +8691,7 @@ class LedgerModelListView(LoginRequiredMixin,PermissionRequiredMixin, ListView,
|
|||||||
show_visible = False
|
show_visible = False
|
||||||
allow_empty = True
|
allow_empty = True
|
||||||
paginate_by = 30
|
paginate_by = 30
|
||||||
permission_required = "django_ledger.view_ledgermodel"
|
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
qs = super().get_queryset()
|
qs = super().get_queryset()
|
||||||
|
|||||||
@ -45,11 +45,6 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{% include 'bill/includes/card_bill.html' with dealer_slug=request.dealer.slug bill=bill entity_slug=view.kwargs.entity_slug style='bill-detail' %}
|
{% include 'bill/includes/card_bill.html' with dealer_slug=request.dealer.slug bill=bill entity_slug=view.kwargs.entity_slug style='bill-detail' %}
|
||||||
|
|
||||||
<div class="d-grid mt-4">
|
|
||||||
<a href="{% url 'bill_list' request.dealer.slug %}" class="btn btn-phoenix-primary">
|
|
||||||
<i class="fas fa-arrow-left me-1"></i> {% trans 'Bill List' %}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -17,10 +17,6 @@
|
|||||||
<div class="card mb-2">
|
<div class="card mb-2">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{% include 'bill/includes/card_bill.html' with dealer_slug=request.dealer.slug bill=bill_model style='bill-detail' entity_slug=view.kwargs.entity_slug %}
|
{% include 'bill/includes/card_bill.html' with dealer_slug=request.dealer.slug bill=bill_model style='bill-detail' entity_slug=view.kwargs.entity_slug %}
|
||||||
<a href="{% url 'bill-detail' dealer_slug=request.dealer.slug entity_slug=view.kwargs.entity_slug bill_pk=bill_model.uuid %}"
|
|
||||||
class="btn btn-phoenix-secondary w-100 mb-2">
|
|
||||||
<i class="fas fa-arrow-left me-2"></i>{% trans 'Back to Bill Detail' %}
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<form action="{% url 'bill-update' dealer_slug=request.dealer.slug entity_slug=view.kwargs.entity_slug bill_pk=bill_model.uuid %}" method="post">
|
<form action="{% url 'bill-update' dealer_slug=request.dealer.slug entity_slug=view.kwargs.entity_slug bill_pk=bill_model.uuid %}" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
@ -29,20 +25,21 @@
|
|||||||
{{ form|crispy }}
|
{{ form|crispy }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="submit" class="btn btn-phoenix-primary w-100 mb-2">
|
<button type="submit" class="btn btn-phoenix-primary mb-2 me-2">
|
||||||
<i class="fas fa-save me-2"></i>{% trans 'Save Bill' %}
|
<i class="fas fa-save me-2"></i>{% trans 'Save Bill' %}
|
||||||
</button>
|
</button>
|
||||||
|
<a href="{% url 'bill-detail' dealer_slug=request.dealer.slug entity_slug=view.kwargs.entity_slug bill_pk=bill_model.uuid %}"
|
||||||
|
class="btn btn-phoenix-secondary mb-2">
|
||||||
|
<i class="fas fa-arrow-left me-2"></i>{% trans 'Back to Bill Detail' %}
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<a href="{% url 'bill_list' request.dealer.slug %}"
|
|
||||||
class="btn btn-phoenix-info w-100 mb-2">
|
|
||||||
<i class="fas fa-list me-2"></i>{% trans 'Bill List' %}
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,13 +1,15 @@
|
|||||||
{% load django_ledger %}
|
{% load django_ledger %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
<div id="djl-bill-card-widget" class="">
|
<div id="djl-bill-card-widget" class="">
|
||||||
|
|
||||||
{% if not create_bill %}
|
{% if not create_bill %}
|
||||||
{% if style == 'dashboard' %}
|
{% if style == 'dashboard' %}
|
||||||
<!-- Dashboard Style Card -->
|
<!-- Dashboard Style Card -->
|
||||||
<div class="">
|
<div class="">
|
||||||
<div class="card-body ">
|
<div class="card-body">
|
||||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
||||||
<h6 class="text-uppercase text-secondary mb-0">
|
<div class="d-flex justify-content-between align-items-center mb-3 text-primary">
|
||||||
|
<h6 class="text-uppercase text-primary mb-0">
|
||||||
<i class="fas fa-file-invoice me-2"></i>{% trans 'Bill' %}
|
<i class="fas fa-file-invoice me-2"></i>{% trans 'Bill' %}
|
||||||
</h6>
|
</h6>
|
||||||
<span class="badge bg-{{ bill.get_status_badge_color }}">{{ bill.get_bill_status_display }}</span>
|
<span class="badge bg-{{ bill.get_status_badge_color }}">{{ bill.get_bill_status_display }}</span>
|
||||||
@ -91,12 +93,20 @@
|
|||||||
<!-- Detail Style Card -->
|
<!-- Detail Style Card -->
|
||||||
<div class="">
|
<div class="">
|
||||||
<div class="card-header p-2 bg-{{ bill.get_status_badge_color }}">
|
<div class="card-header p-2 bg-{{ bill.get_status_badge_color }}">
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center justify-content-center mb-2 text-primary">
|
||||||
<i class="fas fa-file-invoice me-3 text-white"></i>
|
<i class="fas fa-file-invoice me-3 "></i>
|
||||||
<h2 class="mb-0 text-white">
|
<h4 class="mb-0 text-primary me-2">
|
||||||
{% trans 'Bill' %} {{ bill.bill_number }}
|
{% trans 'Bill' %} {{ bill.bill_number }}
|
||||||
</h2>
|
</h4>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<a href="{% url 'bill_list' request.dealer.slug %}"
|
||||||
|
class="btn btn-phoenix-primary mb-2">
|
||||||
|
<i class="fas fa-long-arrow-alt-left me-2"></i>{% trans 'Back to Bill List' %}
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body p-2 text-center">
|
<div class="card-body p-2 text-center">
|
||||||
{% if bill.is_draft %}
|
{% if bill.is_draft %}
|
||||||
@ -277,6 +287,7 @@
|
|||||||
<!-- Create Bill Card -->
|
<!-- Create Bill Card -->
|
||||||
{% if perms.django_ledger.add_billmodel%}
|
{% if perms.django_ledger.add_billmodel%}
|
||||||
<div class=" bg-light">
|
<div class=" bg-light">
|
||||||
|
|
||||||
<div class="card-body text-center p-5">
|
<div class="card-body text-center p-5">
|
||||||
<a href="{% url 'django_ledger:bill-create' entity_slug=entity_slug %}"
|
<a href="{% url 'django_ledger:bill-create' entity_slug=entity_slug %}"
|
||||||
class="text-primary">
|
class="text-primary">
|
||||||
|
|||||||
@ -3,15 +3,7 @@
|
|||||||
|
|
||||||
{% if style == 'card_1' %}
|
{% if style == 'card_1' %}
|
||||||
<div class="card h-100" style="height: 25rem;">
|
<div class="card h-100" style="height: 25rem;">
|
||||||
<div class="card-header">
|
|
||||||
<h5 class="card-title fs-3 fw-light mb-0">
|
|
||||||
{% if title %}
|
|
||||||
{{ title }}
|
|
||||||
{% else %}
|
|
||||||
{% trans 'Notes' %}
|
|
||||||
{% endif %}
|
|
||||||
</h5>
|
|
||||||
</div>
|
|
||||||
<div class="card-body overflow-auto">
|
<div class="card-body overflow-auto">
|
||||||
{% if notes_html %}
|
{% if notes_html %}
|
||||||
{{ notes_html|safe }}
|
{{ notes_html|safe }}
|
||||||
|
|||||||
@ -32,15 +32,26 @@
|
|||||||
{% if not create_po %}
|
{% if not create_po %}
|
||||||
{% if style == 'po-detail' %}
|
{% if style == 'po-detail' %}
|
||||||
<div class="card shadow-sm border-0 mb-2">
|
<div class="card shadow-sm border-0 mb-2">
|
||||||
<div class="card-header bg-light">
|
<div class="card-header bg-light ">
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center mb-2 ">
|
||||||
<span class="me-3 text-primary">
|
<span class="me-3 text-primary">
|
||||||
{% icon 'uil:bill' 36 %}
|
{% icon 'uil:bill' 36 %}
|
||||||
</span>
|
</span>
|
||||||
<h2 class="h3 mb-0">
|
<h2 class="h3 mb-0 text-primary me-4">
|
||||||
{{ po_model.po_number }}
|
{{ po_model.po_number }}
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<p>
|
||||||
|
<a class="btn btn-phoenix-primary"
|
||||||
|
href="{% url 'purchase_order_list' request.dealer.slug request.dealer.entity.slug %}"
|
||||||
|
title="Click to view the complete list of Purchase Orders"
|
||||||
|
role="button">
|
||||||
|
<i class="fas fa-list me-2"></i>{% trans 'PO List' %}
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
@ -52,6 +63,7 @@
|
|||||||
{{ po_model.get_po_status_display }}
|
{{ po_model.get_po_status_display }}
|
||||||
</span>
|
</span>
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@ -99,14 +111,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class='col-12 col-md-12 col-lg-2 d-grid align-content-end'>
|
|
||||||
<a class="btn btn-phoenix-primary py-2"
|
|
||||||
href="{% url 'purchase_order_list' request.dealer.slug request.dealer.entity.slug %}"
|
|
||||||
title="Click to view the complete list of Purchase Orders"
|
|
||||||
role="button">
|
|
||||||
<i class="fas fa-list me-2"></i>{% trans 'PO List' %}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -24,13 +24,11 @@
|
|||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{{ form|crispy }}
|
{{ form|crispy }}
|
||||||
<button type="submit"
|
<button type="submit"
|
||||||
class="btn btn-phoenix-success w-100 my-2">{% trans 'Save PO' %}
|
class="btn btn-phoenix-success my-2 me-2">{% trans 'Save PO' %}
|
||||||
</button>
|
</button>
|
||||||
<a href="{% url 'purchase_order_detail' request.dealer.slug request.dealer.entity.slug po_model.uuid %}"
|
<a href="{% url 'purchase_order_detail' request.dealer.slug request.dealer.entity.slug po_model.uuid %}"
|
||||||
class="btn btn-phoenix-secondary w-100 my-2">{% trans 'Back to PO Detail' %}</a>
|
class="btn btn-phoenix-secondary my-2">{% trans 'Back to PO Detail' %}</a>
|
||||||
<a href="{% url 'purchase_order_list' request.dealer.slug request.dealer.entity.slug %}"
|
|
||||||
class="btn btn-phoenix-info
|
|
||||||
info w-100 my-2">{% trans 'PO List' %}</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user