From 81ca6364522589122c5537e0c6d3d7f5f0a3ebaa Mon Sep 17 00:00:00 2001 From: M_Kececi Date: Mon, 23 Mar 2026 15:25:08 +0300 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- svc/models/customerlist.go | 1 + svc/queries/customerlist.go | 12 +++++++++++- svc/queries/statement_header.go | 7 ++++--- ui/src/pages/OrderEntry.vue | 8 +++++++- ui/src/stores/orderentryStore.js | 2 ++ 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/svc/models/customerlist.go b/svc/models/customerlist.go index 07eda1e..85320d6 100644 --- a/svc/models/customerlist.go +++ b/svc/models/customerlist.go @@ -10,4 +10,5 @@ type CustomerList struct { Musteri_Temsilcisi string `json:"Musteri_Temsilcisi"` Ulke string `json:"Ulke"` Doviz_cinsi string `json:"Doviz_Cinsi"` + PostalAddressID string `json:"PostalAddressID"` } diff --git a/svc/queries/customerlist.go b/svc/queries/customerlist.go index 6daeb6a..e8044e0 100644 --- a/svc/queries/customerlist.go +++ b/svc/queries/customerlist.go @@ -66,7 +66,16 @@ func GetCustomerList(ctx context.Context) ([]models.CustomerList, error) { ), SPACE(0)) ), - ISNULL(c.CurrencyCode, '') + ISNULL(c.CurrencyCode, ''), + ISNULL(( + SELECT TOP 1 CAST(pa.PostalAddressID AS varchar(36)) + FROM prCurrAccPostalAddress pa WITH(NOLOCK) + WHERE pa.CurrAccTypeCode = c.CurrAccTypeCode + AND pa.CurrAccCode = c.CurrAccCode + AND pa.AddressTypeCode = 2 + AND ISNULL(pa.IsBlocked, 0) = 0 + ORDER BY pa.LastUpdatedDate DESC, pa.CreatedDate DESC + ), '') FROM cdCurrAcc c LEFT JOIN cdCurrAccDesc d @@ -103,6 +112,7 @@ func GetCustomerList(ctx context.Context) ([]models.CustomerList, error) { &c.Musteri_Temsilcisi, &c.Ulke, &c.Doviz_cinsi, + &c.PostalAddressID, ); err != nil { return nil, err } diff --git a/svc/queries/statement_header.go b/svc/queries/statement_header.go index 757b4db..4711973 100644 --- a/svc/queries/statement_header.go +++ b/svc/queries/statement_header.go @@ -290,10 +290,11 @@ func normalizeMasterAccountCode(code string) string { } noSpace := strings.ReplaceAll(code, " ", "") - if len(noSpace) < 7 { + r := []rune(noSpace) + if len(r) < 7 { return code } - main := noSpace[:7] - return main[:3] + " " + main[3:] + main := r[:7] + return string(main[:3]) + " " + string(main[3:]) } diff --git a/ui/src/pages/OrderEntry.vue b/ui/src/pages/OrderEntry.vue index f6042e5..57cb9ec 100644 --- a/ui/src/pages/OrderEntry.vue +++ b/ui/src/pages/OrderEntry.vue @@ -3140,11 +3140,15 @@ async function onCariChange(kod) { cari.DocCurrencyCode || 'USD' + const postalAddressId = String(cari.PostalAddressID || '').trim() + // 🔹 FORM sync (UI için) form.CurrAccTypeCode = cari.CurrAccTypeCode || 1 form.CurrAccCode = kod form.DocCurrencyCode = pb form.pb = pb + form.ShippingPostalAddressID = postalAddressId + form.BillingPostalAddressID = postalAddressId aktifPB.value = pb /* ===================================================== @@ -3155,7 +3159,9 @@ async function onCariChange(kod) { CurrAccTypeCode: form.CurrAccTypeCode, CurrAccCode: kod, DocCurrencyCode: pb, - PriceCurrencyCode: pb + PriceCurrencyCode: pb, + ShippingPostalAddressID: postalAddressId, + BillingPostalAddressID: postalAddressId }, { applyCurrencyToLines: true, diff --git a/ui/src/stores/orderentryStore.js b/ui/src/stores/orderentryStore.js index 11cde49..70103ff 100644 --- a/ui/src/stores/orderentryStore.js +++ b/ui/src/stores/orderentryStore.js @@ -2673,6 +2673,8 @@ export const useOrderEntryStore = defineStore('orderentry', { 'InternalDescription', 'CurrAccTypeCode', 'CurrAccCode', + 'ShippingPostalAddressID', + 'BillingPostalAddressID', 'CurrAccDescription', 'DocCurrencyCode', 'LocalCurrencyCode',