fixed card display &...
This commit is contained in:
@@ -56,6 +56,11 @@ export function getBankMonogram(bankName?: string): string {
|
||||
return 'بانک'
|
||||
}
|
||||
|
||||
const normalized = bankName.replace(/^بانک\s+/u, '').trim()
|
||||
const trimmed = bankName.trim()
|
||||
if (/^[A-Za-z]/u.test(trimmed)) {
|
||||
return trimmed.replace(/[^A-Za-z]/g, '').slice(0, 2).toUpperCase() || 'BN'
|
||||
}
|
||||
|
||||
const normalized = trimmed.replace(/^بانک\s+/u, '').trim()
|
||||
return normalized.slice(0, 2) || 'بانک'
|
||||
}
|
||||
|
||||
@@ -524,14 +524,14 @@ export function enrichInventoryCardsWithCatalog<T extends { product_id?: number;
|
||||
cards: T[],
|
||||
catalog: Product[]
|
||||
): T[] {
|
||||
return cards.map((card) => {
|
||||
return cards.map((card) => {
|
||||
const fromCatalog = catalog.find((product) => product.id === card.product_id)
|
||||
if (!fromCatalog) {
|
||||
return card
|
||||
}
|
||||
|
||||
return {
|
||||
...card,
|
||||
return {
|
||||
...card,
|
||||
file: card.file ?? fromCatalog.file ?? null,
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user