diff --git a/ui/src/stores/orderentryStore.js b/ui/src/stores/orderentryStore.js index fa5ff99..2e803ac 100644 --- a/ui/src/stores/orderentryStore.js +++ b/ui/src/stores/orderentryStore.js @@ -3456,6 +3456,11 @@ export const useOrderEntryStore = defineStore('orderentry', { const headerId = this.header?.OrderHeaderID || crypto.randomUUID() const docCurrency = safeStr(this.header?.DocCurrencyCode) || 'TRY' const exRate = toNum(this.header?.ExchangeRate) || 1 + const boolOr = (value, fallback) => { + if (typeof value === 'boolean') return value + if (value && typeof value === 'object' && typeof value.Bool === 'boolean') return value.Bool + return fallback + } const avgDueSource = this.header?.AverageDueDate || @@ -3472,6 +3477,18 @@ export const useOrderEntryStore = defineStore('orderentry', { DocCurrencyCode: docCurrency, LocalCurrencyCode: safeStr(this.header?.LocalCurrencyCode) || 'TRY', ExchangeRate: exRate, + IsCancelOrder: boolOr(this.header?.IsCancelOrder, false), + IsInclutedVat: boolOr(this.header?.IsInclutedVat, false), + IsCreditSale: boolOr(this.header?.IsCreditSale, true), + IsCreditableConfirmed: boolOr(this.header?.IsCreditableConfirmed, false), + IsSalesViaInternet: boolOr(this.header?.IsSalesViaInternet, false), + IsSuspended: boolOr(this.header?.IsSuspended, false), + IsCompleted: boolOr(this.header?.IsCompleted, true), + IsPrinted: boolOr(this.header?.IsPrinted, false), + IsLocked: boolOr(this.header?.IsLocked, false), + UserLocked: boolOr(this.header?.UserLocked, false), + IsClosed: boolOr(this.header?.IsClosed, false), + IsProposalBased: boolOr(this.header?.IsProposalBased, false), CreatedUserName: this.mode === 'edit'