This commit is contained in:
phaichayon
2026-06-25 16:26:14 +07:00
parent 69279fc341
commit 5a83040077
11 changed files with 547 additions and 64 deletions

View File

@@ -14,39 +14,35 @@ export const CRM_TERMS = {
contact: 'ผู้ติดต่อ',
contacts: 'ผู้ติดต่อ',
billingCustomer: 'ลูกค้าผู้รับใบเสนอราคา',
projectParties: 'ผู้เกี่ยวข้องในโครงการ',
crmSettings: 'ตั้งค่า CRM',
leadCount: 'จำนวนลีด',
opportunityCount: 'จำนวนโอกาสขาย',
wonCount: 'จำนวนงานที่ชนะ',
lostCount: 'จำนวนงานที่แพ้',
revenue: 'มูลค่าใบเสนอราคา',
conversionRate: 'อัตราการเปลี่ยนสถานะ'
contractor: 'ผู้รับเหมา',
consultant: 'ที่ปรึกษา',
endCustomer: 'ผู้ใช้งานปลายทาง',
projectParty: 'ผู้เกี่ยวข้องในโครงการ'
} as const;
export const PIPELINE_STAGE_THAI_LABELS = {
lead: 'ลีด',
opportunity: 'โอกาสขาย',
closed_won: 'ชนะ',
closed_lost: 'แพ้'
} as const;
export const PROJECT_PARTY_ROLE_THAI_LABELS: Record<string, string> = {
const PROJECT_PARTY_ROLE_LABELS: Record<string, string> = {
billing_customer: 'ลูกค้าผู้รับใบเสนอราคา',
customer: 'ลูกค้า',
consultant: 'ที่ปรึกษา',
contractor: 'ผู้รับเหมา',
end_customer: 'เจ้าของโครงการ',
end_customer: 'ผู้ใช้งานปลายทาง',
other: 'อื่น ๆ'
};
const PIPELINE_STAGE_LABELS: Record<string, string> = {
lead: 'ลีด',
opportunity: 'โอกาสขาย',
quotation_created: 'ออกใบเสนอราคาแล้ว',
negotiation: 'กำลังเจรจา',
closed: 'ปิดงาน',
closed_won: 'ชนะ',
closed_lost: 'แพ้'
};
export function getProjectPartyRoleThaiLabel(roleCode: string, fallback?: string | null) {
return PROJECT_PARTY_ROLE_THAI_LABELS[roleCode] ?? fallback ?? roleCode;
return PROJECT_PARTY_ROLE_LABELS[roleCode] ?? fallback ?? roleCode;
}
export function getPipelineStageThaiLabel(
stage: keyof typeof PIPELINE_STAGE_THAI_LABELS | string
) {
return PIPELINE_STAGE_THAI_LABELS[stage as keyof typeof PIPELINE_STAGE_THAI_LABELS] ?? stage;
export function getPipelineStageThaiLabel(stageCode: string, fallback?: string | null) {
return PIPELINE_STAGE_LABELS[stageCode] ?? fallback ?? stageCode;
}