update
This commit is contained in:
parent
08687340a3
commit
499de137ba
@ -1032,7 +1032,7 @@ def po_fullfilled_notification(sender, instance, created, **kwargs):
|
|||||||
).format(
|
).format(
|
||||||
url=reverse(
|
url=reverse(
|
||||||
"purchase_order_detail",
|
"purchase_order_detail",
|
||||||
kwargs={"dealer_slug": dealer.slug, "pk": instance.pk},
|
kwargs={"dealer_slug": dealer.slug,"entity_slug":instance.entity.slug, "pk": instance.pk},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@ -4798,6 +4798,7 @@ class EstimateDetailView(LoginRequiredMixin, PermissionRequiredMixin, DetailView
|
|||||||
finance_data = calculator.get_finance_data()
|
finance_data = calculator.get_finance_data()
|
||||||
invoice_obj = InvoiceModel.objects.all().filter(ce_model=estimate).first()
|
invoice_obj = InvoiceModel.objects.all().filter(ce_model=estimate).first()
|
||||||
kwargs["data"] = finance_data
|
kwargs["data"] = finance_data
|
||||||
|
print(kwargs["data"])
|
||||||
kwargs["invoice"] = invoice_obj
|
kwargs["invoice"] = invoice_obj
|
||||||
try:
|
try:
|
||||||
car_finances = estimate.get_itemtxs_data()[0].first().item_model.car.finances
|
car_finances = estimate.get_itemtxs_data()[0].first().item_model.car.finances
|
||||||
|
|||||||
@ -84,7 +84,7 @@
|
|||||||
{% include "plans/expiration_messages.html" %}
|
{% include "plans/expiration_messages.html" %}
|
||||||
{% block period_navigation %}
|
{% block period_navigation %}
|
||||||
{% endblock period_navigation %}
|
{% endblock period_navigation %}
|
||||||
<div id="main_content" class="fade-me-in" hx-boost="true" hx-target="#main_content" hx-select="#main_content" hx-swap="innerHTML transition:true" hx-select-oob="#toast-container" hx-history-elt>
|
<div id="main_content" class="fade-me-in" hx-boost="false" hx-target="#main_content" hx-select="#main_content" hx-swap="innerHTML transition:true" hx-select-oob="#toast-container" hx-history-elt>
|
||||||
<div id="spinner" class="htmx-indicator spinner-bg">
|
<div id="spinner" class="htmx-indicator spinner-bg">
|
||||||
<img src="{% static 'spinner.svg' %}" width="100" height="100" alt="">
|
<img src="{% static 'spinner.svg' %}" width="100" height="100" alt="">
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -178,9 +178,9 @@
|
|||||||
<div class="d-flex flex-wrap justify-content-between mb-2">
|
<div class="d-flex flex-wrap justify-content-between mb-2">
|
||||||
<h5 class="mb-0 text-body-highlight me-2">{{ _("Invoice") }}</h5>
|
<h5 class="mb-0 text-body-highlight me-2">{{ _("Invoice") }}</h5>
|
||||||
</div>
|
</div>
|
||||||
{% if opportunity.estimate.invoice %}
|
{% if opportunity.estimate.invoicemodel_set.all %}
|
||||||
<a class="dropdown-item"
|
<a class="dropdown-item"
|
||||||
href="{% url 'invoice_detail' request.dealer.slug request.entity.slug opportunity.estimate.invoice.pk %}">{{ _("View Invoice") }}</a>
|
href="{% url 'invoice_detail' request.dealer.slug request.entity.slug opportunity.estimate.invoicemodel_set.first.pk %}">{{ _("View Invoice") }}</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>{{ _("No Invoice") }}</p>
|
<p>{{ _("No Invoice") }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -1020,7 +1020,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade"
|
<div class="tab-pane fade"
|
||||||
id="tab-activity"
|
id="tab-activity"
|
||||||
hx-get="{% url 'lead_detail' request.dealer.slug lead.slug %}"
|
hx-get="{% url 'opportunity_detail' request.dealer.slug opportunity.slug %}"
|
||||||
hx-trigger="htmx:afterRequest from:"
|
hx-trigger="htmx:afterRequest from:"
|
||||||
hx-select="#tab-activity"
|
hx-select="#tab-activity"
|
||||||
hx-target="this"
|
hx-target="this"
|
||||||
|
|||||||
@ -240,7 +240,9 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{% for item in data.cars %}
|
{% for item in data.cars %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="align-middle"></td>
|
<td class="align-middle">
|
||||||
|
<img src="{{item.logo}}" width="40" height="40" class="ps-2"></img>
|
||||||
|
</td>
|
||||||
<td class="align-middle">{{ item.make }}</td>
|
<td class="align-middle">{{ item.make }}</td>
|
||||||
<td class="align-middle">{{ item.model }}</td>
|
<td class="align-middle">{{ item.model }}</td>
|
||||||
<td class="align-middle">{{ item.year }}</td>
|
<td class="align-middle">{{ item.year }}</td>
|
||||||
@ -273,7 +275,7 @@
|
|||||||
<tr class="bg-body-secondary total-sum">
|
<tr class="bg-body-secondary total-sum">
|
||||||
<td class="align-middle ps-4 fw-semibold text-body-highlight" colspan="7">{% trans "Vat" %} ({{ data.vat }})</td>
|
<td class="align-middle ps-4 fw-semibold text-body-highlight" colspan="7">{% trans "Vat" %} ({{ data.vat }})</td>
|
||||||
<td class="align-middle text-start fw-semibold">
|
<td class="align-middle text-start fw-semibold">
|
||||||
<span id="grand-total">+ {{ data.total_vat_amount|floatformat }}<span class="icon-saudi_riyal"></span></span>
|
<span id="">+ {{ data.total_vat_amount }}<span class="icon-saudi_riyal"></span></span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="bg-body-secondary total-sum">
|
<tr class="bg-body-secondary total-sum">
|
||||||
@ -336,19 +338,14 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block customJS %}
|
{% block customJS %}
|
||||||
<script>
|
<script>
|
||||||
// Initialize when page loads and after HTMX swaps
|
|
||||||
|
// Initialize when page loads and after HTMX swaps
|
||||||
document.addEventListener('DOMContentLoaded', initEstimateFunctions);
|
document.addEventListener('DOMContentLoaded', initEstimateFunctions);
|
||||||
document.addEventListener('htmx:afterSwap', initEstimateFunctions);
|
document.addEventListener('htmx:afterSwap', initEstimateFunctions);
|
||||||
|
|
||||||
function initEstimateFunctions() {
|
function initEstimateFunctions() {
|
||||||
// Initialize calculateTotals if estimate table exists
|
// Initialize calculateTotals if estimate table exists
|
||||||
const estimateTable = document.getElementById('estimate-table');
|
|
||||||
if (estimateTable) {
|
|
||||||
calculateTotals();
|
|
||||||
|
|
||||||
// Optional: If you need to recalculate when table content changes
|
|
||||||
estimateTable.addEventListener('change', calculateTotals);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize form action setter if form exists
|
// Initialize form action setter if form exists
|
||||||
const confirmForm = document.getElementById('confirmForm');
|
const confirmForm = document.getElementById('confirmForm');
|
||||||
@ -359,6 +356,7 @@ function initEstimateFunctions() {
|
|||||||
button.addEventListener('click', setFormActionHandler);
|
button.addEventListener('click', setFormActionHandler);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
htmx.process(confirmForm)
|
||||||
}
|
}
|
||||||
|
|
||||||
function calculateTotals() {
|
function calculateTotals() {
|
||||||
@ -412,6 +410,7 @@ function setFormActionHandler(event) {
|
|||||||
|
|
||||||
function setFormAction(action) {
|
function setFormAction(action) {
|
||||||
const form = document.getElementById('confirmForm');
|
const form = document.getElementById('confirmForm');
|
||||||
|
htmx.process(form)
|
||||||
if (!form) return;
|
if (!form) return;
|
||||||
|
|
||||||
const baseUrl = "{% url 'estimate_mark_as' request.dealer.slug estimate.pk %}";
|
const baseUrl = "{% url 'estimate_mark_as' request.dealer.slug estimate.pk %}";
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
<div class="col-lg-8 col-md-10">
|
<div class="col-lg-8 col-md-10">
|
||||||
<div class="card shadow-sm border-0 rounded-3">
|
<div class="card shadow-sm border-0 rounded-3">
|
||||||
<div class="card-header bg-gray-200 py-3 border-0 rounded-top-3">
|
<div class="card-header bg-gray-200 py-3 border-0 rounded-top-3">
|
||||||
<h3 class="mb-0 fs-4 text-center text-white">
|
<h3 class="mb-0 fs-4 text-center">
|
||||||
{{ _("Add Invoice") }}<i class="fa-solid fa-receipt ms-2 text-primary"></i>
|
{{ _("Add Invoice") }}<i class="fa-solid fa-receipt ms-2 text-primary"></i>
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user