refactor(PosmasterNo): replace formatPosmasterNo

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-06-05 10:57:37 +07:00
parent 6b2d1781b0
commit 34f33e57ac
25 changed files with 152 additions and 58 deletions

View file

@ -94,3 +94,18 @@ export function validateFileSize(
return `ขนาดไฟล์ไม่เกิน ${maxSizeMB}MB`;
}
export function formatPosmasterNo(
orgShortname: string,
posMasterNoPrefix: string,
posMasterNo: string,
posMasterNoSuffix: string
) {
if (!orgShortname || !posMasterNo) return "";
const prefix = posMasterNoPrefix ? `${posMasterNoPrefix} ` : "";
const suffix = posMasterNoSuffix ? ` ${posMasterNoSuffix}` : "";
return `${orgShortname} ${prefix}${posMasterNo}${suffix}`.trim();
}