fixed card display &...

This commit is contained in:
2026-07-01 12:22:43 +02:00
parent bbec5b802d
commit e8c394d71a
7 changed files with 256 additions and 64 deletions
+6 -1
View File
@@ -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) || 'بانک'
}
+3 -3
View File
@@ -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,
}
})