From 74d90cf2f2214d26229f1974966478b2e88d9418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dalibor=20Markovi=C4=87?= Date: Wed, 1 Jul 2026 23:01:06 +0200 Subject: [PATCH] =?UTF-8?q?Prodaja:=20spre=C4=8Den=20dupli=20submit=20form?= =?UTF-8?q?e=20naplate=20(double-submit=20bag)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/static/js/ntech.js | 3 +++ web/templates/stranice/prodaja_forma.html | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/web/static/js/ntech.js b/web/static/js/ntech.js index 3eade36..dc39160 100644 --- a/web/static/js/ntech.js +++ b/web/static/js/ntech.js @@ -141,6 +141,7 @@ document.addEventListener('alpine:init', () => { nacinPlacanja: 'gotovina', primljenoIznos: '', prikaziRacun: true, + saljemSe: false, _fiskalniTab: null, artikliOpcije: [], pretragaArtikal: '', @@ -358,6 +359,8 @@ document.addEventListener('alpine:init', () => { // posaljiProdaju uklanja prazne stavke (npr. automatski dodat red na kraju koji korisnik // nije popunio) pre nego što se forma stvarno pošalje na server posaljiProdaju(e) { + if (this.saljemSe) return + this.saljemSe = true this.stavke = this.stavke.filter(s => s.artikal_id) this.$nextTick(() => e.target.submit()) }, diff --git a/web/templates/stranice/prodaja_forma.html b/web/templates/stranice/prodaja_forma.html index 055ac45..aab5647 100644 --- a/web/templates/stranice/prodaja_forma.html +++ b/web/templates/stranice/prodaja_forma.html @@ -332,8 +332,8 @@ style="width:16px;height:16px;accent-color:var(--sb-akcent);cursor:pointer;flex-shrink:0;"> Prikaži fiskalni račun -