優化公共事業費:修正日期顯示、改善發票號碼輸入UX與調整介面欄位順序
All checks were successful
Koori-ERP-Deploy-System / deploy-demo (push) Successful in 44s
Koori-ERP-Deploy-System / deploy-production (push) Has been skipped

This commit is contained in:
2026-01-20 13:02:05 +08:00
parent 7bf892db19
commit b2a63bd1ed
4 changed files with 98 additions and 66 deletions

View File

@@ -70,3 +70,20 @@ export const validateWarehouse = (formData: {
return { isValid: true };
};
/**
* 驗證發票號碼格式 (AA-12345678)
*/
export const validateInvoiceNumber = (invoiceNumber?: string): { isValid: boolean; error?: string } => {
if (!invoiceNumber) return { isValid: true };
const regex = /^[A-Z]{2}-\d{8}$/;
if (!regex.test(invoiceNumber)) {
return {
isValid: false,
error: "發票號碼格式錯誤應為AB-12345678",
};
}
return { isValid: true };
};