From 979b4556ab104767f677d0d5a328f7b414ca3b4c Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Thu, 26 Sep 2024 13:50:42 +0700 Subject: add bisnis status badge --- src/lib/auth/components/CompanyProfile.jsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/lib/auth/components') diff --git a/src/lib/auth/components/CompanyProfile.jsx b/src/lib/auth/components/CompanyProfile.jsx index d066cef7..2daec766 100644 --- a/src/lib/auth/components/CompanyProfile.jsx +++ b/src/lib/auth/components/CompanyProfile.jsx @@ -12,6 +12,7 @@ import * as Yup from 'yup'; const CompanyProfile = () => { const [changeConfirmation, setChangeConfirmation] = useState(false); + const [company_type, setCompany_type] = useState(); const auth = useAuth(); const [isOpen, setIsOpen] = useState(false); const toggle = () => setIsOpen(!isOpen); @@ -56,6 +57,7 @@ const CompanyProfile = () => { const dataProfile = await addressApi({ id: auth.parentId ? auth.parentId : auth.parent_id, }); + setCompany_type(dataProfile.companyType); setValue('name', dataProfile.name); setValue('industry', dataProfile.industryId); setValue('companyType', dataProfile.companyTypeId); @@ -63,7 +65,7 @@ const CompanyProfile = () => { setValue('npwp', dataProfile.npwp); setValue('alamat_wajib_pajak', dataProfile.alamatWajibPajak); setValue('alamat_bisnis', dataProfile.alamatBisnis); - setValue('company_type', dataProfile.company_type); + setValue('company_type', dataProfile.companyType); }; if (auth) loadProfile(); }, [auth, setValue]); @@ -130,7 +132,10 @@ const CompanyProfile = () => { className='p-4 flex items-center text-left w-full' >
-
Informasi Usaha
+
+

Informasi Usaha

+
{company_type}
+
Dibawah ini adalah data usaha yang anda masukkan, periksa kembali data usaha anda. @@ -257,17 +262,17 @@ const validationSchema = Yup.object().shape({ alamat_wajib_pajak: Yup.string(), company_type: Yup.string(), taxName: Yup.string().when('company_type', { - is: (company_type) => company_type !== 'PKP', + is: (company_type) => company_type !== 'Non PKP', then: Yup.string().required('Harus di-isi'), otherwise: Yup.string().notRequired(), }), npwp: Yup.string().when('company_type', { - is: (company_type) => company_type !== 'PKP', + is: (company_type) => company_type !== 'Non PKP', then: Yup.string().required('Harus di-isi'), otherwise: Yup.string().notRequired(), }), alamat_wajib_pajak: Yup.string().when('company_type', { - is: (company_type) => company_type !== 'PKP', + is: (company_type) => company_type !== 'Non PKP', then: Yup.string().required('Harus di-isi'), otherwise: Yup.string().notRequired(), }), -- cgit v1.2.3