Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-04-02 16:39:48 +03:00
parent 028c11e042
commit 5adf71c4cc

View File

@@ -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,20 @@ 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: true,
CreditableConfirmedUser: who,
CreditableConfirmedDate: formatDateTime(now),
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'