bug fixes and updates
This commit is contained in:
parent
f7a5c9b05c
commit
7bf7e51c09
@ -411,6 +411,22 @@ class BasePurchaseOrderActionActionView(
|
|||||||
f"while performing action '{self.action_name}' on Purchase Order ID: {po_model.pk}. "
|
f"while performing action '{self.action_name}' on Purchase Order ID: {po_model.pk}. "
|
||||||
f"Error: {e}"
|
f"Error: {e}"
|
||||||
)
|
)
|
||||||
|
except Exception as e:
|
||||||
|
print(
|
||||||
|
f"User {user_username} encountered an exception "
|
||||||
|
f"while performing action '{self.action_name}' on Purchase Order ID: {po_model.pk}. "
|
||||||
|
f"Error: {e}"
|
||||||
|
)
|
||||||
|
logger.warning(
|
||||||
|
f"User {user_username} encountered an exception "
|
||||||
|
f"while performing action '{self.action_name}' on Purchase Order ID: {po_model.pk}. "
|
||||||
|
f"Error: {e}"
|
||||||
|
)
|
||||||
|
messages.add_message(
|
||||||
|
request,
|
||||||
|
message=f"Failed to update PO {po_model.po_number}. {e}",
|
||||||
|
level=messages.ERROR,
|
||||||
|
)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -5005,7 +5005,7 @@ def create_estimate(request, dealer_slug, slug=None):
|
|||||||
customer = opportunity.customer
|
customer = opportunity.customer
|
||||||
print(customer)
|
print(customer)
|
||||||
form.fields["customer"].queryset = models.Customer.objects.filter(
|
form.fields["customer"].queryset = models.Customer.objects.filter(
|
||||||
pk=customer.pk
|
pk=customer.pk
|
||||||
)
|
)
|
||||||
form.initial["customer"] = customer
|
form.initial["customer"] = customer
|
||||||
|
|
||||||
@ -11161,9 +11161,9 @@ class PurchaseOrderModelDeleteView(PurchaseOrderModelDeleteViewBase):
|
|||||||
level=messages.SUCCESS,
|
level=messages.SUCCESS,
|
||||||
)
|
)
|
||||||
return reverse(
|
return reverse(
|
||||||
"purchase_order_list", kwargs={"dealer_slug": self.kwargs["dealer_slug"],"entity_slug":self.kwargs['entity_slug']}
|
"purchase_order_list", kwargs={"dealer_slug": self.kwargs["dealer_slug"], "entity_slug": self.kwargs["entity_slug"]}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PurchaseOrderMarkAsDraftView(BasePurchaseOrderActionActionView):
|
class PurchaseOrderMarkAsDraftView(BasePurchaseOrderActionActionView):
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
hx-target="#notesTable"
|
hx-target="#notesTable"
|
||||||
hx-on::after-request="{ resetSubmitButton(document.querySelector('.add_note_form button[type=submit]')); $('#noteModal').modal('hide'); }"
|
hx-on::after-request="{ resetSubmitButton(document.querySelector('.add_note_form button[type=submit]')); $('#noteModal').modal('hide'); }"
|
||||||
hx-swap="outerHTML show:window.top"
|
hx-swap="outerHTML show:window.top"
|
||||||
|
hx-select-oob="#timeline"
|
||||||
method="post"
|
method="post"
|
||||||
class="add_note_form">
|
class="add_note_form">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
hx-target=".taskTable"
|
hx-target=".taskTable"
|
||||||
hx-on::after-request="{ resetSubmitButton(document.querySelector('.add_schedule_form button[type=submit]')); $('#scheduleModal').modal('hide'); }"
|
hx-on::after-request="{ resetSubmitButton(document.querySelector('.add_schedule_form button[type=submit]')); $('#scheduleModal').modal('hide'); }"
|
||||||
hx-swap="outerHTML"
|
hx-swap="outerHTML"
|
||||||
hx-select-oob="#toast-container:outerHTML"
|
hx-select-oob="#toast-container:outerHTML,#timeline:outerHTML"
|
||||||
method="post"
|
method="post"
|
||||||
class="add_schedule_form">
|
class="add_schedule_form">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|||||||
@ -335,7 +335,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row justify-content-between align-items-md-center hover-actions-trigger btn-reveal-trigger border-translucent py-3 gx-0 border-top">
|
<div class="row justify-content-between align-items-md-center hover-actions-trigger btn-reveal-trigger border-translucent py-3 gx-0 border-top">
|
||||||
<div class="col-12 col-lg-auto">
|
<div class="col-12 col-lg-auto">
|
||||||
<div class="timeline-basic mb-9">
|
<div id="timeline" class="timeline-basic mb-9">
|
||||||
{% for activity in activities %}
|
{% for activity in activities %}
|
||||||
<div class="timeline-item">
|
<div class="timeline-item">
|
||||||
<div class="row g-3">
|
<div class="row g-3">
|
||||||
@ -353,7 +353,9 @@
|
|||||||
{% elif activity.activity_type == "visit" %}
|
{% elif activity.activity_type == "visit" %}
|
||||||
<span class="fa-solid fa-users text-danger fs-8"></span>
|
<span class="fa-solid fa-users text-danger fs-8"></span>
|
||||||
{% elif activity.activity_type == "whatsapp" %}
|
{% elif activity.activity_type == "whatsapp" %}
|
||||||
<span class="fab fa-whatsapp text-success-dark fs-7"></span>
|
<span class="fab fa-whatsapp text-success-dark fs-7"></span>
|
||||||
|
{% elif activity.activity_type == "meeting" %}
|
||||||
|
<span class="fa-solid fa-users text-danger fs-8"></span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% if forloop.last %}
|
{% if forloop.last %}
|
||||||
|
|||||||
@ -542,7 +542,7 @@
|
|||||||
data-bs-dismiss="modal"
|
data-bs-dismiss="modal"
|
||||||
aria-label="Close"></button>
|
aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
<div id="estimateModalBody" class="main-modal-body" style="padding: 20px;">
|
<div id="estimateModalBody" style="padding: 20px;">
|
||||||
<form action="{% url 'create_estimate_for_car' request.dealer.slug car.slug %}" method="post">
|
<form action="{% url 'create_estimate_for_car' request.dealer.slug car.slug %}" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{{estimate_form|crispy}}
|
{{estimate_form|crispy}}
|
||||||
|
|||||||
@ -49,6 +49,8 @@
|
|||||||
<span class="badge badge-phoenix badge-phoenix-success">
|
<span class="badge badge-phoenix badge-phoenix-success">
|
||||||
{% elif bill.is_canceled %}
|
{% elif bill.is_canceled %}
|
||||||
<span class="badge badge-phoenix badge-phoenix-danger">
|
<span class="badge badge-phoenix badge-phoenix-danger">
|
||||||
|
{% elif bill.is_void %}
|
||||||
|
<span class="badge badge-phoenix badge-phoenix-secondary">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ bill.bill_status }}
|
{{ bill.bill_status }}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@ -155,12 +155,14 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if po_model.can_void %}
|
{% comment %} TODO: upgrade djnago ledger or replace core functionality {% endcomment %}
|
||||||
|
{% comment %} issue with django ledger base functionality when marking as void throughs error , will be fix in future {% endcomment %}
|
||||||
|
{% comment %} {% if po_model.can_void %}
|
||||||
<button class="btn btn-phoenix-danger"
|
<button class="btn btn-phoenix-danger"
|
||||||
onclick="showPOModal('{% trans "Void Purchase Order" %}', '{% url 'po-action-mark-as-void' request.dealer.slug entity_slug po_model.pk %}', 'Mark As Void')">
|
onclick="showPOModal('{% trans "Void Purchase Order" %}', '{% url 'po-action-mark-as-void' request.dealer.slug entity_slug po_model.pk %}', 'Mark As Void')">
|
||||||
<i class="fas fa-times-circle me-2"></i>{% trans 'Void' %}
|
<i class="fas fa-times-circle me-2"></i>{% trans 'Void' %}
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %} {% endcomment %}
|
||||||
{% if po_model.can_cancel %}
|
{% if po_model.can_cancel %}
|
||||||
<button class="btn btn-phoenix-secondary"
|
<button class="btn btn-phoenix-secondary"
|
||||||
onclick="showPOModal('Cancel PO', '{% url 'po-action-mark-as-canceled' request.dealer.slug entity_slug po_model.pk %}', 'Mark As Cancelled')">
|
onclick="showPOModal('Cancel PO', '{% url 'po-action-mark-as-canceled' request.dealer.slug entity_slug po_model.pk %}', 'Mark As Cancelled')">
|
||||||
|
|||||||
@ -32,8 +32,8 @@
|
|||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</th>
|
</th>
|
||||||
<th>{% trans 'Unit Cost' %}</th>
|
|
||||||
<th>{% trans 'Quantity' %}</th>
|
<th>{% trans 'Quantity' %}</th>
|
||||||
|
<th>{% trans 'Unit Cost' %}</th>
|
||||||
<th>{% trans 'Unit' %}</th>
|
<th>{% trans 'Unit' %}</th>
|
||||||
<th class="text-end">{% trans 'Amount' %}</th>
|
<th class="text-end">{% trans 'Amount' %}</th>
|
||||||
<th>{% trans 'Status' %}</th>
|
<th>{% trans 'Status' %}</th>
|
||||||
@ -52,8 +52,8 @@
|
|||||||
{{ f.item_model|add_class:"form-control" }}
|
{{ f.item_model|add_class:"form-control" }}
|
||||||
{% if f.errors %}<div class="text-danger small">{{ f.errors }}</div>{% endif %}
|
{% if f.errors %}<div class="text-danger small">{{ f.errors }}</div>{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td id="{{ f.instance.html_id_unit_cost }}">{{ f.po_unit_cost|add_class:"form-control" }}</td>
|
|
||||||
<td id="{{ f.instance.html_id_quantity }}">{{ f.po_quantity|add_class:"form-control" }}</td>
|
<td id="{{ f.instance.html_id_quantity }}">{{ f.po_quantity|add_class:"form-control" }}</td>
|
||||||
|
<td id="{{ f.instance.html_id_unit_cost }}">{{ f.po_unit_cost|add_class:"form-control" }}</td>
|
||||||
<td>{{ f.entity_unit|add_class:"form-control" }}</td>
|
<td>{{ f.entity_unit|add_class:"form-control" }}</td>
|
||||||
<td class="text-end" id="{{ f.instance.html_id_total_amount }}">
|
<td class="text-end" id="{{ f.instance.html_id_total_amount }}">
|
||||||
<span class="currency">{{ CURRENCY }}</span>{{ f.instance.po_total_amount | currency_format }}
|
<span class="currency">{{ CURRENCY }}</span>{{ f.instance.po_total_amount | currency_format }}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user