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,
|
||||
)
|
||||
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 = models.CharField(
|
||||
@ -2735,7 +2735,6 @@ class CustomGroup(models.Model):
|
||||
"itemmodel",
|
||||
"invoicemodel",
|
||||
"vendormodel",
|
||||
|
||||
"journalentrymodel",
|
||||
"purchaseordermodel",
|
||||
"estimatemodel",
|
||||
|
||||
@ -440,8 +440,16 @@ class ManagerDashboard(LoginRequiredMixin, TemplateView):
|
||||
transfer_cars = models.Car.objects.filter(
|
||||
dealer=dealer, status=models.CarStatusChoices.TRANSFER
|
||||
).count()
|
||||
reserved_percentage = reserved_cars / total_cars * 100
|
||||
sold_percentage = sold_cars / total_cars * 100
|
||||
try:
|
||||
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 = (
|
||||
models.Car.objects.values("id_car_make__name")
|
||||
.annotate(count=Count("id"))
|
||||
@ -2513,9 +2521,16 @@ def vendorDetailView(request, dealer_slug,slug):
|
||||
:rtype: HttpResponse
|
||||
"""
|
||||
vendor = get_object_or_404(models.Vendor, slug=slug)
|
||||
dealer=vendor.dealer
|
||||
cars=Car.objects.filter(dealer=dealer,vendor=vendor)
|
||||
print(cars)
|
||||
|
||||
|
||||
return render(
|
||||
request, template_name="vendors/view_vendor.html", context={"vendor": vendor}
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
class VendorCreateView(
|
||||
@ -8676,7 +8691,7 @@ class LedgerModelListView(LoginRequiredMixin,PermissionRequiredMixin, ListView,
|
||||
show_visible = False
|
||||
allow_empty = True
|
||||
paginate_by = 30
|
||||
permission_required = "django_ledger.view_ledgermodel"
|
||||
|
||||
|
||||
def get_queryset(self):
|
||||
qs = super().get_queryset()
|
||||
@ -8995,7 +9010,7 @@ class JournalEntryModelTXSDetailView(JournalEntryModelTXSDetailViewBase):
|
||||
"""
|
||||
|
||||
template_name = "ledger/journal_entry/journal_entry_txs.html"
|
||||
|
||||
|
||||
|
||||
@login_required
|
||||
@permission_required("django_ledger.change_ledgermodel", raise_exception=True)
|
||||
|
||||
@ -44,12 +44,7 @@
|
||||
<div class="card shadow-sm">
|
||||
<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' %}
|
||||
|
||||
<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>
|
||||
|
||||
@ -17,11 +17,7 @@
|
||||
<div class="card mb-2">
|
||||
<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 %}
|
||||
<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">
|
||||
{% csrf_token %}
|
||||
|
||||
@ -29,20 +25,21 @@
|
||||
{{ form|crispy }}
|
||||
</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' %}
|
||||
</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>
|
||||
|
||||
<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>
|
||||
|
||||
@ -1,20 +1,22 @@
|
||||
{% load django_ledger %}
|
||||
{% load i18n %}
|
||||
<div id="djl-bill-card-widget" class="">
|
||||
|
||||
{% if not create_bill %}
|
||||
{% if style == 'dashboard' %}
|
||||
<!-- Dashboard Style Card -->
|
||||
<div class="">
|
||||
<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="card-body">
|
||||
|
||||
<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' %}
|
||||
</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>
|
||||
</div>
|
||||
<h4 class="card-title">{{ bill.vendor.vendor_name }}</h4>
|
||||
<p class="text-sm text-muted mb-4">{{ bill.vendor.address_1 }}</p>
|
||||
|
||||
|
||||
{% if not bill.is_past_due %}
|
||||
<p class="text-info mb-2">
|
||||
<i class="fas fa-clock me-2"></i>{% trans 'Due in' %}: {{ bill.date_due | timeuntil }}
|
||||
@ -91,12 +93,20 @@
|
||||
<!-- Detail Style Card -->
|
||||
<div class="">
|
||||
<div class="card-header p-2 bg-{{ bill.get_status_badge_color }}">
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="fas fa-file-invoice me-3 text-white"></i>
|
||||
<h2 class="mb-0 text-white">
|
||||
<div class="d-flex align-items-center justify-content-center mb-2 text-primary">
|
||||
<i class="fas fa-file-invoice me-3 "></i>
|
||||
<h4 class="mb-0 text-primary me-2">
|
||||
{% trans 'Bill' %} {{ bill.bill_number }}
|
||||
</h2>
|
||||
</h4>
|
||||
|
||||
</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 class="card-body p-2 text-center">
|
||||
{% if bill.is_draft %}
|
||||
@ -277,6 +287,7 @@
|
||||
<!-- Create Bill Card -->
|
||||
{% if perms.django_ledger.add_billmodel%}
|
||||
<div class=" bg-light">
|
||||
|
||||
<div class="card-body text-center p-5">
|
||||
<a href="{% url 'django_ledger:bill-create' entity_slug=entity_slug %}"
|
||||
class="text-primary">
|
||||
|
||||
@ -3,15 +3,7 @@
|
||||
|
||||
{% if style == 'card_1' %}
|
||||
<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">
|
||||
{% if notes_html %}
|
||||
{{ notes_html|safe }}
|
||||
|
||||
@ -32,15 +32,26 @@
|
||||
{% if not create_po %}
|
||||
{% if style == 'po-detail' %}
|
||||
<div class="card shadow-sm border-0 mb-2">
|
||||
<div class="card-header bg-light">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="card-header bg-light ">
|
||||
<div class="d-flex align-items-center mb-2 ">
|
||||
<span class="me-3 text-primary">
|
||||
{% icon 'uil:bill' 36 %}
|
||||
</span>
|
||||
<h2 class="h3 mb-0">
|
||||
<h2 class="h3 mb-0 text-primary me-4">
|
||||
{{ po_model.po_number }}
|
||||
</h2>
|
||||
|
||||
|
||||
</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 class="card-body">
|
||||
@ -52,6 +63,7 @@
|
||||
{{ po_model.get_po_status_display }}
|
||||
</span>
|
||||
</h3>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@ -99,14 +111,7 @@
|
||||
</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>
|
||||
|
||||
|
||||
|
||||
@ -24,13 +24,11 @@
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
class="btn btn-phoenix-secondary my-2">{% trans 'Back to PO Detail' %}</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user