refactor(PosmasterNo): replace formatPosmasterNo
This commit is contained in:
parent
6b2d1781b0
commit
34f33e57ac
25 changed files with 152 additions and 58 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue