Allow transactions on counter when an user has recorded too many products as long as he doesn't record more

This commit is contained in:
2025-02-21 14:50:07 +01:00
parent a96b374ad7
commit 1978658b9c
4 changed files with 171 additions and 135 deletions

View File

@ -27,7 +27,13 @@
{% block content %}
<h4>{{ counter }}</h4>
<div id="bar-ui" x-data="counter">
<div id="bar-ui" x-data="counter({
customerBalance: {{ customer.amount }},
products: products,
customerId: {{ customer.pk }},
formInitial: formInitial,
cancelUrl: '{{ cancel_url }}',
})">
<noscript>
<p class="important">Javascript is required for the counter UI.</p>
</noscript>
@ -256,13 +262,7 @@
{%- endfor -%}
];
window.addEventListener("DOMContentLoaded", () => {
loadCounter({
customerBalance: {{ customer.amount }},
products: products,
customerId: {{ customer.pk }},
formInitial: formInitial,
cancelUrl: "{{ cancel_url }}",
});
loadCounter();
});
</script>
{% endblock script %}