Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-05-20 16:18:48 +03:00
parent 8975e7127b
commit d094adf0b4
2 changed files with 113 additions and 111 deletions

View File

@@ -3627,6 +3627,29 @@ async function saveChanges () {
return
}
// Validate: "Kod" (sKodu) is mandatory for any row that has a hammadde type.
// We block saving if there are rows with empty/whitespace code, to avoid sending blank rows to backend.
const blankCodeRows = (Array.isArray(flatDetailRows.value) ? flatDetailRows.value : [])
.filter(r => {
const hNo = parseInt(String(r?.nHammaddeTuruNo || '').trim() || '0', 10) || 0
if (!(hNo > 0)) return false
return String(r?.sKodu || '').trim() === ''
})
if (blankCodeRows.length > 0) {
const next = {}
blankCodeRows.forEach(r => {
const key = String(r?.__rowKey || '').trim()
if (key) next[key] = true
})
requiredAttentionRowKeys.value = next
$q.notify({
type: 'warning',
message: `Kod bos birakilan satirlar var. Kaydetmeden once Kod alanini doldurun. (Adet: ${blankCodeRows.length})`,
position: 'top-right'
})
return
}
const header = detailHeader.value
const upserts = flatDetailRows.value.map(r => ({
n_onml_det_no: parseInt(String(r?.nOnMLDetNo || '').trim() || '0', 10) || 0,