From ab0782b5cf7b65930b0b40528b9205f3f0dfc3a0 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Thu, 12 Sep 2024 10:11:02 +0700
Subject: <iman> update switch account

---
 src/lib/auth/components/CompanyProfile.jsx | 168 ++++++++++++++++++-----------
 1 file changed, 103 insertions(+), 65 deletions(-)

(limited to 'src/lib/auth/components/CompanyProfile.jsx')

diff --git a/src/lib/auth/components/CompanyProfile.jsx b/src/lib/auth/components/CompanyProfile.jsx
index e37decc9..20be6829 100644
--- a/src/lib/auth/components/CompanyProfile.jsx
+++ b/src/lib/auth/components/CompanyProfile.jsx
@@ -1,18 +1,18 @@
-import odooApi from '@/core/api/odooApi'
-import HookFormSelect from '@/core/components/elements/Select/HookFormSelect'
-import useAuth from '@/core/hooks/useAuth'
-import addressApi from '@/lib/address/api/addressApi'
-import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'
-import { useEffect, useState } from 'react'
-import { Controller, useForm } from 'react-hook-form'
-import { toast } from 'react-hot-toast'
-import BottomPopup from '@/core/components/elements/Popup/BottomPopup'
+import odooApi from '@/core/api/odooApi';
+import HookFormSelect from '@/core/components/elements/Select/HookFormSelect';
+import useAuth from '@/core/hooks/useAuth';
+import addressApi from '@/lib/address/api/addressApi';
+import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline';
+import { useEffect, useState } from 'react';
+import { Controller, useForm } from 'react-hook-form';
+import { toast } from 'react-hot-toast';
+import BottomPopup from '@/core/components/elements/Popup/BottomPopup';
 
 const CompanyProfile = () => {
-  const [changeConfirmation, setChangeConfirmation] = useState(false)
-  const auth = useAuth()
-  const [isOpen, setIsOpen] = useState(false)
-  const toggle = () => setIsOpen(!isOpen)
+  const [changeConfirmation, setChangeConfirmation] = useState(false);
+  const auth = useAuth();
+  const [isOpen, setIsOpen] = useState(false);
+  const toggle = () => setIsOpen(!isOpen);
   const { register, setValue, control, handleSubmit } = useForm({
     defaultValues: {
       industry: '',
@@ -20,64 +20,77 @@ const CompanyProfile = () => {
       name: '',
       taxName: '',
       npwp: '',
-      alamat_wajib_pajak:'',
-    }
-  })
+      alamat_wajib_pajak: '',
+    },
+  });
 
-  const [industries, setIndustries] = useState([])
+  const [industries, setIndustries] = useState([]);
   useEffect(() => {
     const loadIndustries = async () => {
-      const dataIndustries = await odooApi('GET', '/api/v1/partner/industry')
-      setIndustries(dataIndustries?.map((o) => ({ value: o.id, label: o.name })))
-    }
-    loadIndustries()
-  }, [])
+      const dataIndustries = await odooApi('GET', '/api/v1/partner/industry');
+      setIndustries(
+        dataIndustries?.map((o) => ({ value: o.id, label: o.name }))
+      );
+    };
+    loadIndustries();
+  }, []);
 
-  const [companyTypes, setCompanyTypes] = useState([])
+  const [companyTypes, setCompanyTypes] = useState([]);
   useEffect(() => {
     const loadCompanyTypes = async () => {
-      const dataCompanyTypes = await odooApi('GET', '/api/v1/partner/company_type')
-      setCompanyTypes(dataCompanyTypes?.map((o) => ({ value: o.id, label: o.name })))
-    }
-    loadCompanyTypes()
-  }, [])
+      const dataCompanyTypes = await odooApi(
+        'GET',
+        '/api/v1/partner/company_type'
+      );
+      setCompanyTypes(
+        dataCompanyTypes?.map((o) => ({ value: o.id, label: o.name }))
+      );
+    };
+    loadCompanyTypes();
+  }, []);
 
   useEffect(() => {
     const loadProfile = async () => {
-      const dataProfile = await addressApi({ id: auth.parentId })
-      setValue('name', dataProfile.name)
-      setValue('industry', dataProfile.industryId)
-      setValue('companyType', dataProfile.companyTypeId)
-      setValue('taxName', dataProfile.taxName)
-      setValue('npwp', dataProfile.npwp)
-      setValue('alamat_wajib_pajak', dataProfile.alamatWajibPajak)
-    }
-    if (auth) loadProfile()
-  }, [auth, setValue])
+      const dataProfile = await addressApi({
+        id: auth.parentId ? auth.parentId : auth.parent_id,
+      });
+      setValue('name', dataProfile.name);
+      setValue('industry', dataProfile.industryId);
+      setValue('companyType', dataProfile.companyTypeId);
+      setValue('taxName', dataProfile.taxName);
+      setValue('npwp', dataProfile.npwp);
+      setValue('alamat_wajib_pajak', dataProfile.alamatWajibPajak);
+    };
+    if (auth) loadProfile();
+  }, [auth, setValue]);
 
   const onSubmitHandler = async (values) => {
-    if(changeConfirmation){
+    if (changeConfirmation) {
       const data = {
         ...values,
-        id_user:auth.partnerId,
+        id_user: auth.partnerId,
         company_type_id: values.companyType,
         industry_id: values.industry,
         tax_name: values.taxName,
-        alamat_lengkap_text:values.alamat_wajib_pajak
-      }
-      const isUpdated = await odooApi('PUT', `/api/v1/partner/${auth.parentId}`, data)
+        alamat_lengkap_text: values.alamat_wajib_pajak,
+      };
+      const isUpdated = await odooApi(
+        'PUT',
+        `/api/v1/partner/${auth.parentId}`,
+        data
+      );
       if (isUpdated?.id) {
-        toast.success('Berhasil mengubah profil', { duration: 1500 })
-        return
+        toast.success('Berhasil mengubah profil', { duration: 1500 });
+        return;
       }
-      toast.error('Terjadi kesalahan internal')
+      toast.error('Terjadi kesalahan internal');
     }
-  }
+  };
 
   const handleConfirmSubmit = () => {
-    setChangeConfirmation(false)
-    handleSubmit(onSubmitHandler)()
-  }
+    setChangeConfirmation(false);
+    handleSubmit(onSubmitHandler)();
+  };
 
   return (
     <>
@@ -106,11 +119,16 @@ const CompanyProfile = () => {
           </button>
         </div>
       </BottomPopup>
-      <button type='button' onClick={toggle} className='p-4 flex items-center text-left w-full'>
+      <button
+        type='button'
+        onClick={toggle}
+        className='p-4 flex items-center text-left w-full'
+      >
         <div>
           <div className='font-semibold mb-2'>Informasi Usaha</div>
           <div className='text-gray_r-11'>
-            Dibawah ini adalah data usaha yang anda masukkan, periksa kembali data usaha anda.
+            Dibawah ini adalah data usaha yang anda masukkan, periksa kembali
+            data usaha anda.
           </div>
         </div>
         <div className='ml-auto p-2 bg-gray_r-3 rounded'>
@@ -120,17 +138,22 @@ const CompanyProfile = () => {
       </button>
 
       {isOpen && (
-        <form className='p-4 border-t border-gray_r-6' onSubmit={(e) => {
-          e.preventDefault()
-          setChangeConfirmation(true) 
-        }}>
+        <form
+          className='p-4 border-t border-gray_r-6'
+          onSubmit={(e) => {
+            e.preventDefault();
+            setChangeConfirmation(true);
+          }}
+        >
           <div className='grid grid-cols-1 sm:grid-cols-2 gap-4'>
             <div>
               <label className='block mb-3'>Klasifikasi Jenis Usaha</label>
               <Controller
                 name='industry'
                 control={control}
-                render={(props) => <HookFormSelect {...props} options={industries} />}
+                render={(props) => (
+                  <HookFormSelect {...props} options={industries} />
+                )}
               />
             </div>
             <div className='flex flex-wrap'>
@@ -139,7 +162,9 @@ const CompanyProfile = () => {
                 <Controller
                   name='companyType'
                   control={control}
-                  render={(props) => <HookFormSelect {...props} options={companyTypes} />}
+                  render={(props) => (
+                    <HookFormSelect {...props} options={companyTypes} />
+                  )}
                 />
               </div>
               <div className='w-9/12 pl-1'>
@@ -153,14 +178,27 @@ const CompanyProfile = () => {
             </div>
             <div>
               <label>Nama Wajib Pajak</label>
-              <input {...register('taxName')} type='text' className='form-input mt-3' />
+              <input
+                {...register('taxName')}
+                type='text'
+                className='form-input mt-3'
+              />
             </div>
             <div>
               <label>Nomor NPWP</label>
-              <input {...register('npwp')} type='text' className='form-input mt-3' />
-            </div><div>
+              <input
+                {...register('npwp')}
+                type='text'
+                className='form-input mt-3'
+              />
+            </div>
+            <div>
               <label>Alamat Wajib Pajak</label>
-              <input {...register('alamat_wajib_pajak')} type='text' className='form-input mt-3' />
+              <input
+                {...register('alamat_wajib_pajak')}
+                type='text'
+                className='form-input mt-3'
+              />
             </div>
           </div>
           <button type='submit' className='btn-yellow w-full mt-6'>
@@ -169,7 +207,7 @@ const CompanyProfile = () => {
         </form>
       )}
     </>
-  )
-}
+  );
+};
 
-export default CompanyProfile
+export default CompanyProfile;
-- 
cgit v1.2.3


From 4d9d8bd328675ce0a99359d7558553634c995f38 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Mon, 23 Sep 2024 13:34:11 +0700
Subject: setValue('alamat_bisnis', dataProfile.alamatBisnis);

---
 src/lib/auth/components/CompanyProfile.jsx | 1 +
 1 file changed, 1 insertion(+)

(limited to 'src/lib/auth/components/CompanyProfile.jsx')

diff --git a/src/lib/auth/components/CompanyProfile.jsx b/src/lib/auth/components/CompanyProfile.jsx
index 6100e626..7bebb02f 100644
--- a/src/lib/auth/components/CompanyProfile.jsx
+++ b/src/lib/auth/components/CompanyProfile.jsx
@@ -62,6 +62,7 @@ const CompanyProfile = () => {
       setValue('taxName', dataProfile.taxName);
       setValue('npwp', dataProfile.npwp);
       setValue('alamat_wajib_pajak', dataProfile.alamatWajibPajak);
+      setValue('alamat_bisnis', dataProfile.alamatBisnis);
     };
     if (auth) loadProfile();
   }, [auth, setValue]);
-- 
cgit v1.2.3


From 062e2caf344fedf504ad601a88aaab7a3764ec21 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Thu, 26 Sep 2024 13:35:53 +0700
Subject: <iman> update informasi bisnis logic save field inputan

---
 src/lib/auth/components/CompanyProfile.jsx | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

(limited to 'src/lib/auth/components/CompanyProfile.jsx')

diff --git a/src/lib/auth/components/CompanyProfile.jsx b/src/lib/auth/components/CompanyProfile.jsx
index 7bebb02f..d066cef7 100644
--- a/src/lib/auth/components/CompanyProfile.jsx
+++ b/src/lib/auth/components/CompanyProfile.jsx
@@ -63,6 +63,7 @@ const CompanyProfile = () => {
       setValue('npwp', dataProfile.npwp);
       setValue('alamat_wajib_pajak', dataProfile.alamatWajibPajak);
       setValue('alamat_bisnis', dataProfile.alamatBisnis);
+      setValue('company_type', dataProfile.company_type);
     };
     if (auth) loadProfile();
   }, [auth, setValue]);
@@ -248,12 +249,28 @@ export default CompanyProfile;
 
 const validationSchema = Yup.object().shape({
   alamat_bisnis: Yup.string().required('Harus di-isi'),
-  alamat_wajib_pajak: Yup.string().required('Harus di-isi'),
-  taxName: Yup.string().required('Harus di-isi'),
-  npwp: Yup.string().required('Harus di-isi'),
   name: Yup.string().required('Harus di-isi'),
   industry: Yup.string().required('Harus di-pilih'),
   companyType: Yup.string().required('Harus di-pilih'),
+  taxName: Yup.string(),
+  npwp: Yup.string(),
+  alamat_wajib_pajak: Yup.string(),
+  company_type: Yup.string(),
+  taxName: Yup.string().when('company_type', {
+    is: (company_type) => company_type !== 'PKP',
+    then: Yup.string().required('Harus di-isi'),
+    otherwise: Yup.string().notRequired(),
+  }),
+  npwp: Yup.string().when('company_type', {
+    is: (company_type) => company_type !== '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',
+    then: Yup.string().required('Harus di-isi'),
+    otherwise: Yup.string().notRequired(),
+  }),
 });
 
 const defaultValues = {
-- 
cgit v1.2.3


From 979b4556ab104767f677d0d5a328f7b414ca3b4c Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Thu, 26 Sep 2024 13:50:42 +0700
Subject: <iman> add bisnis status badge

---
 src/lib/auth/components/CompanyProfile.jsx | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

(limited to 'src/lib/auth/components/CompanyProfile.jsx')

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'
       >
         <div>
-          <div className='font-semibold mb-2'>Informasi Usaha</div>
+          <div className='font-semibold mb-2 flex flex-row gap-x-2'>
+            <h2>Informasi Usaha</h2>
+            <div className='badge-red'>{company_type}</div>
+          </div>
           <div className='text-gray_r-11'>
             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


From 935066853ab4847fbff605eed21f98ddbb445864 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Thu, 26 Sep 2024 17:02:45 +0700
Subject: <iman> update form bisnis

---
 src/lib/auth/components/CompanyProfile.jsx | 77 +++++++++++++++++++++++++-----
 1 file changed, 64 insertions(+), 13 deletions(-)

(limited to 'src/lib/auth/components/CompanyProfile.jsx')

diff --git a/src/lib/auth/components/CompanyProfile.jsx b/src/lib/auth/components/CompanyProfile.jsx
index 2daec766..e1a604c2 100644
--- a/src/lib/auth/components/CompanyProfile.jsx
+++ b/src/lib/auth/components/CompanyProfile.jsx
@@ -9,10 +9,14 @@ import { toast } from 'react-hot-toast';
 import BottomPopup from '@/core/components/elements/Popup/BottomPopup';
 import { yupResolver } from '@hookform/resolvers/yup';
 import * as Yup from 'yup';
+import SwitchAccount from '@/lib/auth/components/SwitchAccount';
+import { Checkbox } from '@chakra-ui/react';
 
 const CompanyProfile = () => {
   const [changeConfirmation, setChangeConfirmation] = useState(false);
-  const [company_type, setCompany_type] = useState();
+  const [changeType, setChangeType] = useState(false);
+  const [isChecked, setIsChecked] = useState(false);
+  const [company_type, setCompany_type] = useState('Non PKP');
   const auth = useAuth();
   const [isOpen, setIsOpen] = useState(false);
   const toggle = () => setIsOpen(!isOpen);
@@ -98,9 +102,46 @@ const CompanyProfile = () => {
     setChangeConfirmation(false);
     handleSubmit(onSubmitHandler)();
   };
+  const handleConfirmSubmitType = () => {
+    setChangeType(false);
+    setIsChecked(true);
+    setIsOpen(!isOpen);
+  };
+  const handleChange = async () => {
+    if (isChecked) {
+      setIsChecked(!isChecked);
+    } else {
+      setChangeType(true);
+    }
+  };
 
   return (
     <>
+      <BottomPopup
+        active={changeType}
+        close={() => setChangeType(false)} // Menutup popup
+        title='Ubah type akun'
+      >
+        <div className='leading-7 text-gray_r-12/80'>
+          Anda akan mengubah type akun anda?
+        </div>
+        <div className='flex mt-6 gap-x-4 md:justify-end'>
+          <button
+            className='btn-solid-red flex-1 md:flex-none'
+            type='button'
+            onClick={handleConfirmSubmitType}
+          >
+            Yakin
+          </button>
+          <button
+            className='btn-light flex-1 md:flex-none'
+            type='button'
+            onClick={() => setChangeType(false)}
+          >
+            Batal
+          </button>
+        </div>
+      </BottomPopup>
       <BottomPopup
         active={changeConfirmation}
         close={() => setChangeConfirmation(true)}
@@ -126,11 +167,19 @@ const CompanyProfile = () => {
           </button>
         </div>
       </BottomPopup>
-      <button
-        type='button'
-        onClick={toggle}
-        className='p-4 flex items-center text-left w-full'
-      >
+      <div className='p-4 flex-row items-center text-left w-full'>
+        {company_type === 'Non PKP' && (
+          <div className='text-sm mb-2 flex items-center'>
+            <Checkbox
+              borderColor='gray.600'
+              colorScheme='red'
+              size='lg'
+              isChecked={isChecked}
+              onChange={handleChange}
+            />
+            <p className='ml-2'>Ubah ke akun PKP</p>
+          </div>
+        )}
         <div>
           <div className='font-semibold mb-2 flex flex-row gap-x-2'>
             <h2>Informasi Usaha</h2>
@@ -141,13 +190,14 @@ const CompanyProfile = () => {
             data usaha anda.
           </div>
         </div>
-        <div className='ml-auto p-2 bg-gray_r-3 rounded'>
-          {!isOpen && <ChevronDownIcon className='w-6' />}
-          {isOpen && <ChevronUpIcon className='w-6' />}
-        </div>
-      </button>
-
-      {isOpen && (
+        {/* <button
+          onClick={toggle}
+          className='btn-yellow w-full sm:w-fit sm:ml-auto min-w-[92px]'
+        >
+          Ubah
+        </button> */}
+      </div>
+      {!isOpen && (
         <form
           className='p-4 border-t border-gray_r-6'
           onSubmit={(e) => {
@@ -246,6 +296,7 @@ const CompanyProfile = () => {
           </button>
         </form>
       )}
+      {isOpen && <SwitchAccount />}
     </>
   );
 };
-- 
cgit v1.2.3


From 31ef67c8c2c3d80bf0c0cc040e551b4a45c3dedc Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Fri, 27 Sep 2024 15:36:39 +0700
Subject: <iman> update form bisnis to switch account

---
 src/lib/auth/components/CompanyProfile.jsx | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

(limited to 'src/lib/auth/components/CompanyProfile.jsx')

diff --git a/src/lib/auth/components/CompanyProfile.jsx b/src/lib/auth/components/CompanyProfile.jsx
index e1a604c2..6065efde 100644
--- a/src/lib/auth/components/CompanyProfile.jsx
+++ b/src/lib/auth/components/CompanyProfile.jsx
@@ -16,7 +16,7 @@ const CompanyProfile = () => {
   const [changeConfirmation, setChangeConfirmation] = useState(false);
   const [changeType, setChangeType] = useState(false);
   const [isChecked, setIsChecked] = useState(false);
-  const [company_type, setCompany_type] = useState('Non PKP');
+  const [company_type, setCompany_type] = useState('nonpkp');
   const auth = useAuth();
   const [isOpen, setIsOpen] = useState(false);
   const toggle = () => setIsOpen(!isOpen);
@@ -61,15 +61,15 @@ 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);
-      setValue('taxName', dataProfile.taxName);
-      setValue('npwp', dataProfile.npwp);
-      setValue('alamat_wajib_pajak', dataProfile.alamatWajibPajak);
-      setValue('alamat_bisnis', dataProfile.alamatBisnis);
-      setValue('company_type', dataProfile.companyType);
+      setCompany_type(dataProfile?.companyType);
+      setValue('name', dataProfile?.name);
+      setValue('industry', dataProfile?.industryId);
+      setValue('companyType', dataProfile?.companyTypeId);
+      setValue('taxName', dataProfile?.taxName);
+      setValue('npwp', dataProfile?.npwp);
+      setValue('alamat_wajib_pajak', dataProfile?.alamatWajibPajak);
+      setValue('alamat_bisnis', dataProfile?.alamatBisnis);
+      setValue('company_type', dataProfile?.companyType);
     };
     if (auth) loadProfile();
   }, [auth, setValue]);
@@ -168,7 +168,7 @@ const CompanyProfile = () => {
         </div>
       </BottomPopup>
       <div className='p-4 flex-row items-center text-left w-full'>
-        {company_type === 'Non PKP' && (
+        {company_type === 'nonpkp' && (
           <div className='text-sm mb-2 flex items-center'>
             <Checkbox
               borderColor='gray.600'
-- 
cgit v1.2.3


From 016cbe790dd698ee258f17c8218ef6fdc667ad0d Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Fri, 27 Sep 2024 17:00:00 +0700
Subject: <iman> update switch account

---
 src/lib/auth/components/CompanyProfile.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/lib/auth/components/CompanyProfile.jsx')

diff --git a/src/lib/auth/components/CompanyProfile.jsx b/src/lib/auth/components/CompanyProfile.jsx
index 6065efde..cd55072c 100644
--- a/src/lib/auth/components/CompanyProfile.jsx
+++ b/src/lib/auth/components/CompanyProfile.jsx
@@ -296,7 +296,7 @@ const CompanyProfile = () => {
           </button>
         </form>
       )}
-      {isOpen && <SwitchAccount />}
+      {isOpen && <SwitchAccount company_type={company_type} />}
     </>
   );
 };
-- 
cgit v1.2.3


From 082a57a5188c594556ba76ce20182472ca9d0b5e Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Wed, 2 Oct 2024 11:47:30 +0700
Subject: <iman> update field sppkp

---
 src/lib/auth/components/CompanyProfile.jsx | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'src/lib/auth/components/CompanyProfile.jsx')

diff --git a/src/lib/auth/components/CompanyProfile.jsx b/src/lib/auth/components/CompanyProfile.jsx
index cd55072c..78e62abd 100644
--- a/src/lib/auth/components/CompanyProfile.jsx
+++ b/src/lib/auth/components/CompanyProfile.jsx
@@ -110,7 +110,9 @@ const CompanyProfile = () => {
   const handleChange = async () => {
     if (isChecked) {
       setIsChecked(!isChecked);
+      setIsOpen(!isOpen);
     } else {
+      setIsChecked(!isChecked);
       setChangeType(true);
     }
   };
-- 
cgit v1.2.3


From 7ed3fd96322d08bd91434b8ec4dcbc542a610998 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Wed, 6 Nov 2024 11:05:08 +0700
Subject: <iman> update to upper case company type

---
 src/lib/auth/components/CompanyProfile.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/lib/auth/components/CompanyProfile.jsx')

diff --git a/src/lib/auth/components/CompanyProfile.jsx b/src/lib/auth/components/CompanyProfile.jsx
index 78e62abd..1f9eb33c 100644
--- a/src/lib/auth/components/CompanyProfile.jsx
+++ b/src/lib/auth/components/CompanyProfile.jsx
@@ -185,7 +185,7 @@ const CompanyProfile = () => {
         <div>
           <div className='font-semibold mb-2 flex flex-row gap-x-2'>
             <h2>Informasi Usaha</h2>
-            <div className='badge-red'>{company_type}</div>
+            <div className='badge-red'>{company_type.toUpperCase()}</div>
           </div>
           <div className='text-gray_r-11'>
             Dibawah ini adalah data usaha yang anda masukkan, periksa kembali
-- 
cgit v1.2.3


From 915dc67e1ce31eab1f2415cc8df95cebb75a137d Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Fri, 13 Dec 2024 14:18:03 +0700
Subject: <iman>update pengajuan tempo request

---
 src/lib/auth/components/CompanyProfile.jsx | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

(limited to 'src/lib/auth/components/CompanyProfile.jsx')

diff --git a/src/lib/auth/components/CompanyProfile.jsx b/src/lib/auth/components/CompanyProfile.jsx
index 7bda992f..220d5be1 100644
--- a/src/lib/auth/components/CompanyProfile.jsx
+++ b/src/lib/auth/components/CompanyProfile.jsx
@@ -61,6 +61,8 @@ const CompanyProfile = () => {
       setValue('npwp', dataProfile.npwp);
       setValue('alamat_wajib_pajak', dataProfile.alamatWajibPajak);
       setValue('alamat_bisnis', dataProfile.alamatBisnis);
+      setValue('email_bisnis', dataProfile.email);
+      setValue('mobile_bisnis', dataProfile.mobile);
     };
     if (auth) loadProfile();
   }, [auth, setValue]);
@@ -75,6 +77,8 @@ const CompanyProfile = () => {
         tax_name: values.taxName,
         alamat_lengkap_text: values.alamat_wajib_pajak,
         street: values.alamat_bisnis,
+        email: values.email_bisnis,
+        mobile: values.mobile_bisnis,
       };
       const isUpdated = await odooApi(
         'PUT',
@@ -198,6 +202,28 @@ const CompanyProfile = () => {
                 {errors.taxName?.message}
               </div>
             </div>
+            <div>
+              <label>Email Bisnis</label>
+              <input
+                {...register('email_bisnis')}
+                type='email'
+                className='form-input mt-3'
+              />
+              <div className='text-caption-2 text-danger-500 mt-1'>
+                {errors.email_bisnis?.message}
+              </div>
+            </div>
+            <div>
+              <label>No. Handphone Bisnis</label>
+              <input
+                {...register('mobile_bisnis')}
+                type='tel'
+                className='form-input mt-3'
+              />
+              <div className='text-caption-2 text-danger-500 mt-1'>
+                {errors.mobile_bisnis?.message}
+              </div>
+            </div>
             <div>
               <label>Alamat Wajib Pajak</label>
               <input
@@ -250,6 +276,8 @@ const validationSchema = Yup.object().shape({
   taxName: Yup.string().required('Harus di-isi'),
   npwp: Yup.string().required('Harus di-isi'),
   name: Yup.string().required('Harus di-isi'),
+  email_bisnis: Yup.string().required('Harus di-isi'),
+  mobile_bisnis: Yup.string().required('Harus di-isi'),
   industry: Yup.string().required('Harus di-pilih'),
   companyType: Yup.string().required('Harus di-pilih'),
 });
@@ -258,6 +286,8 @@ const defaultValues = {
   industry: '',
   companyType: '',
   name: '',
+  email_bisnis: '',
+  mobile_bisnis: '',
   taxName: '',
   npwp: '',
   alamat_wajib_pajak: '',
-- 
cgit v1.2.3

