From 3354a74cd7af6360ee672de8a92d79e7f727eaa5 Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Fri, 27 Mar 2026 19:42:54 +0800 Subject: [PATCH] Updated assessor page --- src/pages/AssessorPage/Assessor.tsx | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/pages/AssessorPage/Assessor.tsx b/src/pages/AssessorPage/Assessor.tsx index f1f1e9d..e6a94f1 100644 --- a/src/pages/AssessorPage/Assessor.tsx +++ b/src/pages/AssessorPage/Assessor.tsx @@ -80,8 +80,8 @@ export default () => { const [filter, setFilter] = createSignal('') - // const listType = ['Print', 'Reprint (No Change)', 'Void and Reapprove'] - const listType = ['Print', 'Reprint (No Change)'] + const listType = ['Print', 'Reprint (No Change)', 'Void and Reapprove'] + // const listType = ['Print', 'Reprint (No Change)'] const [selectedType, setSelectedType] = createSignal('Print') const [voidError, setVoidError] = createSignal(false) @@ -378,9 +378,6 @@ export default () => { if (status.pops_paid === true) popsPaid = true } - // const status = await statusPopsOp(application) - // const message = status.message - if (!popsExist) { setIsLoading(false) setVoidError(true) @@ -399,10 +396,18 @@ export default () => { if (division === 'electrical') { await setNewStatus(division, 'ELECTRICAL ORDER OF PAYMENT VOIDED', '173', 'ELECOPVOIDED', 1) await setNewStatus(division, 'FOR ELECTRICAL ORDER OF PAYMENT APPROVAL', '94', 'ELECOPAPPROVE', 0) - setLoadingText('Processing for Re-approvalsss222') - await updateDocflow(division, application, 'FOR ELECTRICAL ORDER OF PAYMENT PRINTING') + + const checkOpPrinting = await checkDocflow(division, application, 'FOR ELECTRICAL ORDER OF PAYMENT PRINTING') + if (checkOpPrinting) { + await updateDocflow(division, application, 'FOR ELECTRICAL ORDER OF PAYMENT PRINTING') + } + setLoadingText('Processing for Re-approvalsss') - await updateDocflow(division, application, 'FOR ELECTRICAL OFFICIAL RECEIPT VALIDATION') + const checkOrValidation = await checkDocflow(division, application, 'FOR ELECTRICAL OFFICIAL RECEIPT VALIDATION') + if (checkOrValidation) { + await updateDocflow(division, application, 'FOR ELECTRICAL OFFICIAL RECEIPT VALIDATION') + } + // await updateDocflow(division, application, 'FOR ELECTRICAL OFFICIAL RECEIPT VALIDATION') await updateOpForApproval(division, application) setLoadingText('Processing for Re-approvalsss') await clearEsignTransactions(application) @@ -463,6 +468,11 @@ export default () => { }) } + const checkDocflow = async (division: string, application: string, status: string) => { + const response = await getApi(`check-docflowprinting-${division}`, application, status) + return parseInt(response) === 0 + } + const getSignatureImage = async (id: number) => { try { const response = await getApi('get-signatureimage', id)