diff --git a/internal/handler/magacin_forma.go b/internal/handler/magacin_forma.go index 7328639..eb58a28 100644 --- a/internal/handler/magacin_forma.go +++ b/internal/handler/magacin_forma.go @@ -260,6 +260,14 @@ func parseFormuArtikla(r *http.Request) (model.Artikal, string) { artikal.KolicinMin = v } + if c := r.FormValue("nabavna_cena"); c != "" { + v, err := strconv.ParseFloat(c, 64) + if err != nil || v < 0 { + return artikal, "Nabavna cena mora biti pozitivan broj." + } + artikal.NabavnaCena = v + } + if c := r.FormValue("prodajna_cena"); c != "" { v, err := strconv.ParseFloat(c, 64) if err != nil || v < 0 { diff --git a/web/templates/stranice/magacin_forma.html b/web/templates/stranice/magacin_forma.html index 98e996b..32cd0ce 100644 --- a/web/templates/stranice/magacin_forma.html +++ b/web/templates/stranice/magacin_forma.html @@ -84,9 +84,15 @@ -
- - +
+
+ + +
+
+ + +