Added error message on posting Pops
This commit is contained in:
parent
cb754f6f54
commit
1e2b875104
1 changed files with 58 additions and 57 deletions
|
|
@ -56,6 +56,7 @@ export default () => {
|
|||
const [configNewPassword, setConfigNewPassword] = createSignal('')
|
||||
const [configNewEncPassword, setConfigNewEncPassword] = createSignal('')
|
||||
const [configError, setConfigError] = createSignal('')
|
||||
const [postError, setPostError] = createSignal(false)
|
||||
|
||||
const [configNotification, setConfigNotification] = createSignal(false)
|
||||
|
||||
|
|
@ -140,6 +141,10 @@ export default () => {
|
|||
}
|
||||
|
||||
if (division === 'electrical') {
|
||||
postPops(division, application)
|
||||
const popsResult = await checkPops(application)
|
||||
|
||||
if (popsResult) {
|
||||
signed = await setNewStatus(division, 'ELECTRICAL ORDER OF PAYMENT APPROVED AND SIGNED', '170', 'ELECOPAPPROVEDSIGNED', 1)
|
||||
updateDocflow(division, application, 'FOR ELECTRICAL ORDER OF PAYMENT APPROVAL')
|
||||
if (!signed) return
|
||||
|
|
@ -150,19 +155,24 @@ export default () => {
|
|||
updateOrderofpayment = await updateOp(division)
|
||||
|
||||
if (updateOrderofpayment) {
|
||||
postPops(division, application)
|
||||
const popsResult = await checkPops(application)
|
||||
|
||||
if (popsResult) {
|
||||
postTransaction()
|
||||
setApprovedApplication(application)
|
||||
setApproved(true)
|
||||
}
|
||||
} else {
|
||||
setPostError(true)
|
||||
setErrorMessage('Error on posting on POPS Server, please try again')
|
||||
return
|
||||
}
|
||||
|
||||
} else if (division === 'occupancy') {
|
||||
const additionalResult = await getApi('check-bldgadditional-approval', application)
|
||||
bldgadditional = additionalResult > 0
|
||||
|
||||
postPops(division, application)
|
||||
const popsResult = await checkPops(application)
|
||||
|
||||
if (popsResult) {
|
||||
signed = await setNewStatus(division, 'OCCUPANCY ORDER OF PAYMENT APPROVED AND SIGNED', '172', 'OCCOPAPPROVEDSIGNED', 1)
|
||||
updateDocflow(division, application, 'FOR OCCUPANCY RECOMMENDING APPROVAL')
|
||||
if (bldgadditional) {
|
||||
|
|
@ -177,14 +187,14 @@ export default () => {
|
|||
updateOrderofpayment = await updateOp(division)
|
||||
|
||||
if (updateOrderofpayment) {
|
||||
postPops(division, application)
|
||||
const popsResult = await checkPops(application)
|
||||
|
||||
if (popsResult) {
|
||||
postTransaction()
|
||||
setApprovedApplication(application)
|
||||
setApproved(true)
|
||||
}
|
||||
} else {
|
||||
setPostError(true)
|
||||
setErrorMessage('Error on posting on POPS Server, please try again')
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -686,7 +696,7 @@ export default () => {
|
|||
</Padding>
|
||||
</Page>
|
||||
|
||||
<div onClick={() => setApproved(false)}>
|
||||
{/* <div onClick={() => setApproved(false)}>
|
||||
<Modal trigger={approved()} background="#123220ff" color="#cdfbe1f0" opacity={0.8}>
|
||||
<Padding top={1} bottom={1} left={2} right={2}>
|
||||
<Column>
|
||||
|
|
@ -706,7 +716,7 @@ export default () => {
|
|||
</Column>
|
||||
</Padding>
|
||||
</Modal>
|
||||
</div>
|
||||
</div> */}
|
||||
|
||||
<div onClick={closeNotification}>
|
||||
<Modal trigger={approved()} background="#123220ff" color="#cdfbe1f0" opacity={0.8}>
|
||||
|
|
@ -752,35 +762,6 @@ export default () => {
|
|||
</Modal>
|
||||
</div>
|
||||
|
||||
{/* <div onClick={() => setApology(false)}>
|
||||
<Modal trigger={apology()} background="#562020ff" color="#ffebebe6" opacity={0.8}>
|
||||
<Padding top={1} bottom={1} left={4} right={4}>
|
||||
<Column>
|
||||
<Row gap={2}>
|
||||
<BiRegularErrorAlt size={90} color="#ffebebe6" />
|
||||
<Box curved thickness={3} color="#ffebebe6" padding="1rem">
|
||||
<h2>Delayed Release of Feature</h2>
|
||||
</Box>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<h3>{errorMessage()}</h3>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<Column gap={0.5}>
|
||||
<span>Occupancy Approval is delayed until Occupancy Printing is complete</span>
|
||||
</Column>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<span class="close-text">Click anywhere to close</span>
|
||||
</Row>
|
||||
</Column>
|
||||
</Padding>
|
||||
</Modal>
|
||||
</div> */}
|
||||
|
||||
<Modal trigger={openConfig()} background="#16212c" color="#ffffffed" opacity={0.8} width='30rem'>
|
||||
<Padding top={1} bottom={1} left={4} right={4}>
|
||||
<section class='config'>
|
||||
|
|
@ -789,8 +770,6 @@ export default () => {
|
|||
<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' />
|
||||
|
|
@ -843,6 +822,28 @@ export default () => {
|
|||
</Padding>
|
||||
</Modal >
|
||||
</div>
|
||||
|
||||
<div onClick={() => setPostError(false)}>
|
||||
<Modal trigger={postError() === true} background="#562020ff" color="#ffebebe6" opacity={0.8}>
|
||||
<Padding top={1} bottom={1} left={4} right={4}>
|
||||
<Column>
|
||||
<Row>
|
||||
<Box curved thickness={3} color="#ffebebe6" padding="1rem">
|
||||
<h2>Signing Error</h2>
|
||||
</Box>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<h3>{errorMessage()}</h3>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<span class="close-text">Click anywhere to close</span>
|
||||
</Row>
|
||||
</Column>
|
||||
</Padding>
|
||||
</Modal>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue