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 { useNavigate } from '@solidjs/router';
import dayjs from 'dayjs';
import { FaSolidThumbsUp } from 'solid-icons/fa';
import { FiLogOut } from 'solid-icons/fi';
import { VsRefresh } from 'solid-icons/vs';
import { createEffect, createSignal, onMount } from 'solid-js';
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 { Tabs } from '@kobalte/core/tabs'
import { useNavigate } from '@solidjs/router'
import dayjs from 'dayjs'
import { FaSolidThumbsUp, FaSolidUserGear } from 'solid-icons/fa'
import { FiLogOut } from 'solid-icons/fi'
import { VsRefresh } from 'solid-icons/vs'
import { createEffect, createSignal, onMount } from 'solid-js'
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 {
_additional,
_additionalAmountList,
@ -31,10 +31,9 @@ import {
_totalUnits,
_type,
_units,
} from '../../stores/pdfinfo.ts';
import { checkConnection, createPdfElectrical, createPdfOccupancy, getApi, getApiMulti, postApi, statusPopsApi, voidPopsApi, saveNewName, saveNewPassword, securePassword, getDateTime } from '../../utils/functions/index.ts';
import './Assessor.sass';
import { FaSolidUserGear } from 'solid-icons/fa'
} from '../../stores/pdfinfo.ts'
import { checkConnection, createPdfElectrical, createPdfOccupancy, getApi, getApiMulti, getDateTime, postApi, saveNewName, saveNewPassword, securePassword, statusPopsApi, voidPopsApi } from '../../utils/functions/index.ts'
import './Assessor.sass'
const PESO = import.meta.env.VITE_PESO
@ -79,7 +78,7 @@ export default () => {
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 [voidError, setVoidError] = createSignal(false)
@ -348,13 +347,19 @@ export default () => {
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 message = status.message
if (message.includes('No record')) {
setVoidError(true)
setErrorMessage("No record found on Pops")
setErrorMessage('No record found on Pops')
return
} else {
const pops_paid = message.pops_paid
@ -362,7 +367,7 @@ export default () => {
if (pops_paid || epay_paid) {
setVoidError(true)
setErrorMessage("Already Paid")
setErrorMessage('Already Paid')
return
}
}
@ -525,7 +530,6 @@ export default () => {
setConfigError('')
encryptNewPassword()
}
} else {
setConfigError('Invalid Password')
setConfigNewEncPassword('')
@ -590,13 +594,12 @@ export default () => {
createEffect(() => {
if (configPassword() !== '') {
checkCurrentPassword();
} else checkCurrentPassword();
checkCurrentPassword()
} else checkCurrentPassword()
if (configNewPassword() !== '') {
encryptNewPassword()
} else encryptNewPassword()
})
return (
@ -613,9 +616,7 @@ export default () => {
<Row content="left" gap={1.75}>
<Box curved thickness={0} padding="1.25rem 2.25rem" background="#0f131d56">
<span class="profile">
{employeeName()}
</span>
<span class="profile">{employeeName()}</span>
</Box>
<Clickable onClick={() => setOpenConfig(true)}>
<Row gap={0.25}>
@ -664,7 +665,6 @@ export default () => {
<Row content="split">
<Input value={filter()} onChange={setFilter} placeholder="Filter Application Number" />
<Row>
{/* <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>
</Row>
@ -859,7 +859,7 @@ export default () => {
<Input value={filter()} onChange={setFilter} placeholder="Filter Application Number" />
<Row gap={0.5}>
{/* <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>
</Row>
</Row>
@ -1020,25 +1020,24 @@ export default () => {
</Modal>
</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}>
<section class='config'>
<div class='config__row'>
<section class="config">
<div class="config__row">
Name:
<span>{employeeName()}</span>
</div>
<div class='config__edit'>
<span class='config__edit__title'>Change Displayed Name</span>
<Input value={configNewName()} onChange={setConfigNewName} placeholder='Enter new name' />
<span class='config__edit__info'>Leave blank to remain unchanged.</span>
<div class="config__edit">
<span class="config__edit__title">Change Displayed Name</span>
<Input value={configNewName()} onChange={setConfigNewName} placeholder="Enter new name" />
<span class="config__edit__info">Leave blank to remain unchanged.</span>
</div>
<div class='config__edit'>
<span class='config__edit__title'>Change Password</span>
<Input isPassword value={configPassword()} onChange={setConfigPassword} placeholder='Enter current password' />
<Input isPassword value={configNewPassword()} onChange={setConfigNewPassword} placeholder='Enter new password' />
<div class="config__edit">
<span class="config__edit__title">Change Password</span>
<Input isPassword value={configPassword()} onChange={setConfigPassword} placeholder="Enter current password" />
<Input isPassword value={configNewPassword()} onChange={setConfigNewPassword} placeholder="Enter new password" />
<Show when={configNewPassword().length !== 0}>
<span style="padding: 1.75rem 0 0 0">Current Encrypted Password:</span>
@ -1051,18 +1050,18 @@ export default () => {
<Show when={configError() !== ''}>
<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>
<div class='config__button'>
<div class="config__button">
<Show when={configError() === ''}>
<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="Confirm" edges="curved" design="bo-primary" onClick={saveConfig} wide />
<Button label="Cancel" edges="curved" design="bo-danger" onClick={() => setOpenConfig(false)} wide />
</Show>
</div>
</section>
</Padding>
</Modal >
</Modal>
<div onClick={closeConfig}>
<Modal trigger={configNotification() === true} background="#123220ff" color="#cdfbe1f0" opacity={0.8}>
@ -1079,7 +1078,7 @@ export default () => {
</Row>
</Column>
</Padding>
</Modal >
</Modal>
</div>
</>
)