Updated assessor

This commit is contained in:
Patrick Alvin Alcala 2026-02-27 19:34:26 +08:00
parent c289a5d1a0
commit b1bac79e02

View file

@ -1,12 +1,12 @@
import { Tabs } from '@kobalte/core/tabs'; import { Tabs } from '@kobalte/core/tabs'
import { useNavigate } from '@solidjs/router'; import { useNavigate } from '@solidjs/router'
import dayjs from 'dayjs'; import dayjs from 'dayjs'
import { FaSolidThumbsUp } from 'solid-icons/fa'; import { FaSolidThumbsUp, FaSolidUserGear } from 'solid-icons/fa'
import { FiLogOut } from 'solid-icons/fi'; import { FiLogOut } from 'solid-icons/fi'
import { VsRefresh } from 'solid-icons/vs'; import { VsRefresh } from 'solid-icons/vs'
import { createEffect, createSignal, onMount } from 'solid-js'; import { createEffect, createSignal, onMount } from 'solid-js'
import { Show } from 'solid-js/web'; import { Show } from 'solid-js/web'
import { Box, Button, Clickable, Column, Combobox, Input, Link, Logo, Modal, ModalButton, Padding, Page, Row } from '../../components/index.ts'; import { Box, Button, Clickable, Column, Combobox, Input, Link, Logo, Modal, ModalButton, Padding, Page, Row } from '../../components/index.ts'
import { import {
_additional, _additional,
_additionalAmountList, _additionalAmountList,
@ -31,10 +31,9 @@ import {
_totalUnits, _totalUnits,
_type, _type,
_units, _units,
} from '../../stores/pdfinfo.ts'; } from '../../stores/pdfinfo.ts'
import { checkConnection, createPdfElectrical, createPdfOccupancy, getApi, getApiMulti, postApi, statusPopsApi, voidPopsApi, saveNewName, saveNewPassword, securePassword, getDateTime } from '../../utils/functions/index.ts'; import { checkConnection, createPdfElectrical, createPdfOccupancy, getApi, getApiMulti, getDateTime, postApi, saveNewName, saveNewPassword, securePassword, statusPopsApi, voidPopsApi } from '../../utils/functions/index.ts'
import './Assessor.sass'; import './Assessor.sass'
import { FaSolidUserGear } from 'solid-icons/fa'
const PESO = import.meta.env.VITE_PESO const PESO = import.meta.env.VITE_PESO
@ -79,7 +78,7 @@ export default () => {
const [filter, setFilter] = createSignal('') const [filter, setFilter] = createSignal('')
const listType = ['Print', 'Reprint (No Change)', 'Void and Reprint'] const listType = ['Print', 'Reprint (No Change)', 'Void and Reapprove']
const [selectedType, setSelectedType] = createSignal('Print') const [selectedType, setSelectedType] = createSignal('Print')
const [voidError, setVoidError] = createSignal(false) const [voidError, setVoidError] = createSignal(false)
@ -348,13 +347,19 @@ export default () => {
return return
} }
if (selectedType().includes("Void")) { if (selectedType().includes('Void')) {
// Return to ASSESSMENT
// TODO:
// Set current status (for validation) to 1, is_approve = 1
// Clear order of payment as long as not Paid
// Clear esign_transactions
const status = await statusPopsOp(application) const status = await statusPopsOp(application)
const message = status.message const message = status.message
if (message.includes('No record')) { if (message.includes('No record')) {
setVoidError(true) setVoidError(true)
setErrorMessage("No record found on Pops") setErrorMessage('No record found on Pops')
return return
} else { } else {
const pops_paid = message.pops_paid const pops_paid = message.pops_paid
@ -362,7 +367,7 @@ export default () => {
if (pops_paid || epay_paid) { if (pops_paid || epay_paid) {
setVoidError(true) setVoidError(true)
setErrorMessage("Already Paid") setErrorMessage('Already Paid')
return return
} }
} }
@ -525,7 +530,6 @@ export default () => {
setConfigError('') setConfigError('')
encryptNewPassword() encryptNewPassword()
} }
} else { } else {
setConfigError('Invalid Password') setConfigError('Invalid Password')
setConfigNewEncPassword('') setConfigNewEncPassword('')
@ -590,13 +594,12 @@ export default () => {
createEffect(() => { createEffect(() => {
if (configPassword() !== '') { if (configPassword() !== '') {
checkCurrentPassword(); checkCurrentPassword()
} else checkCurrentPassword(); } else checkCurrentPassword()
if (configNewPassword() !== '') { if (configNewPassword() !== '') {
encryptNewPassword() encryptNewPassword()
} else encryptNewPassword() } else encryptNewPassword()
}) })
return ( return (
@ -613,9 +616,7 @@ export default () => {
<Row content="left" gap={1.75}> <Row content="left" gap={1.75}>
<Box curved thickness={0} padding="1.25rem 2.25rem" background="#0f131d56"> <Box curved thickness={0} padding="1.25rem 2.25rem" background="#0f131d56">
<span class="profile"> <span class="profile">{employeeName()}</span>
{employeeName()}
</span>
</Box> </Box>
<Clickable onClick={() => setOpenConfig(true)}> <Clickable onClick={() => setOpenConfig(true)}>
<Row gap={0.25}> <Row gap={0.25}>
@ -664,7 +665,6 @@ export default () => {
<Row content="split"> <Row content="split">
<Input value={filter()} onChange={setFilter} placeholder="Filter Application Number" /> <Input value={filter()} onChange={setFilter} placeholder="Filter Application Number" />
<Row> <Row>
{/* <Combobox options={listType} value={selectedType()} onChange={setSelectedType} placeholder="Select Type" width='200px' /> */} {/* <Combobox options={listType} value={selectedType()} onChange={setSelectedType} placeholder="Select Type" width='200px' /> */}
<Button label="Refresh Data" edges="curved" design="bo-primary" icon={VsRefresh} onClick={refresh}></Button> <Button label="Refresh Data" edges="curved" design="bo-primary" icon={VsRefresh} onClick={refresh}></Button>
</Row> </Row>
@ -859,7 +859,7 @@ export default () => {
<Input value={filter()} onChange={setFilter} placeholder="Filter Application Number" /> <Input value={filter()} onChange={setFilter} placeholder="Filter Application Number" />
<Row gap={0.5}> <Row gap={0.5}>
{/* <AiOutlineQuestionCircle size={24}/> */} {/* <AiOutlineQuestionCircle size={24}/> */}
<Combobox options={listType} value={selectedType()} onChange={setSelectedType} placeholder="Select Type" width='250px' /> <Combobox options={listType} value={selectedType()} onChange={setSelectedType} placeholder="Select Type" width="250px" />
<Button label="Refresh Data" edges="curved" design="bo-primary" icon={VsRefresh} onClick={refresh}></Button> <Button label="Refresh Data" edges="curved" design="bo-primary" icon={VsRefresh} onClick={refresh}></Button>
</Row> </Row>
</Row> </Row>
@ -1020,25 +1020,24 @@ export default () => {
</Modal> </Modal>
</div> </div>
<Modal trigger={openConfig()} background="#16212c" color="#ffffffed" opacity={0.8} width="30rem">
<Modal trigger={openConfig()} background="#16212c" color="#ffffffed" opacity={0.8} width='30rem'>
<Padding top={1} bottom={1} left={4} right={4}> <Padding top={1} bottom={1} left={4} right={4}>
<section class='config'> <section class="config">
<div class='config__row'> <div class="config__row">
Name: Name:
<span>{employeeName()}</span> <span>{employeeName()}</span>
</div> </div>
<div class='config__edit'> <div class="config__edit">
<span class='config__edit__title'>Change Displayed Name</span> <span class="config__edit__title">Change Displayed Name</span>
<Input value={configNewName()} onChange={setConfigNewName} placeholder='Enter new name' /> <Input value={configNewName()} onChange={setConfigNewName} placeholder="Enter new name" />
<span class='config__edit__info'>Leave blank to remain unchanged.</span> <span class="config__edit__info">Leave blank to remain unchanged.</span>
</div> </div>
<div class='config__edit'> <div class="config__edit">
<span class='config__edit__title'>Change Password</span> <span class="config__edit__title">Change Password</span>
<Input isPassword value={configPassword()} onChange={setConfigPassword} placeholder='Enter current password' /> <Input isPassword value={configPassword()} onChange={setConfigPassword} placeholder="Enter current password" />
<Input isPassword value={configNewPassword()} onChange={setConfigNewPassword} placeholder='Enter new password' /> <Input isPassword value={configNewPassword()} onChange={setConfigNewPassword} placeholder="Enter new password" />
<Show when={configNewPassword().length !== 0}> <Show when={configNewPassword().length !== 0}>
<span style="padding: 1.75rem 0 0 0">Current Encrypted Password:</span> <span style="padding: 1.75rem 0 0 0">Current Encrypted Password:</span>
@ -1051,13 +1050,13 @@ export default () => {
<Show when={configError() !== ''}> <Show when={configError() !== ''}>
<span class="required-config">{configError()}</span> <span class="required-config">{configError()}</span>
<Button label='Cancel' edges='curved' design='bo-danger' onClick={() => setOpenConfig(false)} wide /> <Button label="Cancel" edges="curved" design="bo-danger" onClick={() => setOpenConfig(false)} wide />
</Show> </Show>
<div class='config__button'> <div class="config__button">
<Show when={configError() === ''}> <Show when={configError() === ''}>
<Button label='Confirm' edges='curved' design='bo-primary' onClick={saveConfig} wide /> <Button label="Confirm" edges="curved" design="bo-primary" onClick={saveConfig} wide />
<Button label='Cancel' edges='curved' design='bo-danger' onClick={() => setOpenConfig(false)} wide /> <Button label="Cancel" edges="curved" design="bo-danger" onClick={() => setOpenConfig(false)} wide />
</Show> </Show>
</div> </div>
</section> </section>