summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-08-29 16:32:01 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-08-29 16:32:01 +0700
commita5821ad81683c8160d707fe980a282df644c3c0b (patch)
tree73f9882c4d86e485fc926de4204df97ece0603bb
parenta75f8676f71e83082088544349ecbf9b4fd80b61 (diff)
<iman> add sppkp field
-rw-r--r--src-migrate/modules/register/components/FormBisnis.tsx19
-rw-r--r--src-migrate/modules/register/stores/useRegisterStore.ts2
-rw-r--r--src-migrate/validations/auth.ts1
3 files changed, 22 insertions, 0 deletions
diff --git a/src-migrate/modules/register/components/FormBisnis.tsx b/src-migrate/modules/register/components/FormBisnis.tsx
index e2e021b3..b976072c 100644
--- a/src-migrate/modules/register/components/FormBisnis.tsx
+++ b/src-migrate/modules/register/components/FormBisnis.tsx
@@ -344,6 +344,25 @@ const form: React.FC<FormProps> = ({ type, required, isPKP }) => {
</div>
<div>
+ <label htmlFor='sppkp' className="font-bold">Nomor SPPKP { !required && <span className='font-normal text-gray_r-11'>(opsional)</span>}</label>
+
+ <input
+ type='tel'
+ id='sppkp'
+ name='sppkp'
+ className={`form-input mt-3 ${required ? 'cursor-no-drop' : ''}`}
+ disabled={required}
+ contentEditable={required}
+ readOnly={required}
+ placeholder='000.000.000.0-000.000'
+ value={!required ? form.sppkp : ''}
+ aria-invalid={!required && !!errors.sppkp}
+ />
+
+ {!required && !!errors.sppkp && <span className="form-msg-danger">{errors.sppkp}</span>}
+ </div>
+
+ <div>
<label htmlFor="npwp_document" className="font-bold">Dokumen NPWP {!isPKP && !required && <span className='font-normal text-gray_r-11'>(opsional)</span>}</label>
<input
diff --git a/src-migrate/modules/register/stores/useRegisterStore.ts b/src-migrate/modules/register/stores/useRegisterStore.ts
index 14288b6e..273472be 100644
--- a/src-migrate/modules/register/stores/useRegisterStore.ts
+++ b/src-migrate/modules/register/stores/useRegisterStore.ts
@@ -37,6 +37,7 @@ export const useRegisterStore = create<State & Action>((set, get) => ({
npwp_document: '',
industry_id: '',
npwp: '',
+ sppkp: '',
is_pkp: '',
type_acc:'',
is_terdaftar:'',
@@ -87,6 +88,7 @@ export const useRegisterStore = create<State & Action>((set, get) => ({
npwp_document: '',
industry_id: '',
npwp: '',
+ sppkp: '',
is_pkp: '',
type_acc:'',
is_terdaftar:'',
diff --git a/src-migrate/validations/auth.ts b/src-migrate/validations/auth.ts
index e52853b6..3abdfb57 100644
--- a/src-migrate/validations/auth.ts
+++ b/src-migrate/validations/auth.ts
@@ -30,6 +30,7 @@ export const registerSchema = z
npwp: z.string().optional().refine((val) => !val || /^\d{15,16}$/.test(val), {
message: 'Format NPWP tidak valid, NPWP harus terdiri dari 15-16 digit angka.',
}),
+ sppkp: z.string().optional(),
})
.superRefine((data, ctx) => {
if (data.type_acc === 'business') {