ui: add B2B olmayan stok (orphans) page

This commit is contained in:
M_Kececi
2026-06-25 14:14:09 +03:00
parent 52b39725ec
commit dfad548963
19 changed files with 594 additions and 71 deletions

View File

@@ -695,13 +695,13 @@ LIMIT 1
row.MappingReady = false
switch {
case row.MmitemID <= 0:
row.MappingWarning = "B2B'de urun yok (mmitem)"
row.MappingWarning = "B2B'de urun yok"
case row.Dim1ID <= 0:
row.MappingWarning = "B2B'de renk bu urunde yok (mmitem_dim/dfgrp.code)"
row.MappingWarning = "B2B'de bu urun icin renk yok"
case row.Dim3Code != "" && row.Dim3ID <= 0:
row.MappingWarning = "B2B'de dim3 token eslesmesi yok (mk_dim_token_map: dimval3)"
row.MappingWarning = "B2B'de ikinci renk eslesmesi yok"
case !comboOK:
row.MappingWarning = "B2B'de varyant kombosu yok (mmitem_dim)"
row.MappingWarning = "B2B'de bu urun/renk/ikinci renk kombinasyonu yok"
default:
// Not an orphan; skip.
if baseReady && comboOK {
@@ -861,7 +861,7 @@ func PostProductSeriesMappingsSaveHandler(pg *sql.DB) http.HandlerFunc {
}
mmitemID, err := resolveMmitemIDTx(ctx, tx, code)
if err != nil || mmitemID <= 0 {
http.Error(w, "PG urun bulunamadi: "+code, http.StatusBadRequest)
http.Error(w, "B2B urun bulunamadi: "+code, http.StatusBadRequest)
return
}
// Authoritative dim1 resolver: only allow saving against a color that exists for this product in mmitem_dim.