Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user