Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -2533,6 +2533,50 @@ export const useOrderEntryStore = defineStore('orderentry', {
|
||||
console.log(`🧭 Order mode set edildi → ${mode}`)
|
||||
}
|
||||
,
|
||||
// Sync only header-related fields from the form before submit.
|
||||
syncHeaderFromForm(form) {
|
||||
if (!form || typeof form !== 'object') return
|
||||
|
||||
const keys = [
|
||||
'OrderHeaderID',
|
||||
'OrderTypeCode',
|
||||
'ProcessCode',
|
||||
'OrderNumber',
|
||||
'OrderDate',
|
||||
'AverageDueDate',
|
||||
'Description',
|
||||
'InternalDescription',
|
||||
'CurrAccTypeCode',
|
||||
'CurrAccCode',
|
||||
'CurrAccDescription',
|
||||
'DocCurrencyCode',
|
||||
'LocalCurrencyCode',
|
||||
'ExchangeRate',
|
||||
'OfficeCode',
|
||||
'CreatedUserName',
|
||||
'CreatedDate',
|
||||
'LastUpdatedUserName',
|
||||
'LastUpdatedDate',
|
||||
'PaymentTerm',
|
||||
'WarehouseCode',
|
||||
'StoreCode'
|
||||
]
|
||||
|
||||
const patch = {}
|
||||
for (const k of keys) {
|
||||
if (Object.prototype.hasOwnProperty.call(form, k)) {
|
||||
patch[k] = form[k]
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.keys(patch).length > 0) {
|
||||
this.header = {
|
||||
...(this.header || {}),
|
||||
...patch
|
||||
}
|
||||
}
|
||||
}
|
||||
,
|
||||
/* ===========================================================
|
||||
🟦 submitAllReal (v12.1c — FINAL / CLEAN + PRE-VALIDATE)
|
||||
-----------------------------------------------------------
|
||||
@@ -2553,6 +2597,9 @@ export const useOrderEntryStore = defineStore('orderentry', {
|
||||
// 🔒 Kontrollü submit → route leave guard susar
|
||||
this.isControlledSubmit = true
|
||||
|
||||
// ✅ Formdaki header alanlarını store'a taşı
|
||||
this.syncHeaderFromForm?.(form)
|
||||
|
||||
const isNew = this.mode === 'new'
|
||||
const { header, lines } = this.buildFinalOrderJson()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user