Compare commits

..

No commits in common. "e79646a61367ef01808e75a75f8621d4c43f8151" and "dd2e551b129806c495a1e3a0c1c5a0ddd3fb5b1e" have entirely different histories.

2 changed files with 20 additions and 35 deletions

View file

@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"build": "tsc -b && vite build",
"buildf": "vite build",
"preview": "vite preview"
},

View file

@ -80,13 +80,11 @@ 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 [selectedType, setSelectedType] = createSignal('Print')
const [voidError, setVoidError] = createSignal(false)
const [isLoading, setIsLoading] = createSignal(false)
const [loadingText, setLoadingText] = createSignal('')
let bldgadditional = false
@ -251,10 +249,11 @@ export default () => {
}
const getListForPrinting = async (division: string) => {
try {
setIsLoading(true)
setLoadingText('Downloading Data')
try {
let response: any
if (selectedType() === 'Print') response = await getApiMulti(`get-listopprinting-${division}`)
else response = await getApiMulti(`get-listopreprinting-${division}`)
@ -287,10 +286,11 @@ export default () => {
setApplicationListBuilding(response.result)
setNameListBuilding(response.result2)
}
setIsLoading(false)
} catch (error) {
console.error(error)
}
setIsLoading(false)
}
const removeEmployee = () => {
@ -321,8 +321,6 @@ export default () => {
return
}
setIsLoading(true)
setLoadingText(`Processing ${application}`)
if (division === 'electrical') {
await setNewStatus(division, 'ELECTRICAL ORDER OF PAYMENT PRINTED', '171', 'ELECOPPRINTED', 1)
await setNewStatus(division, 'ELECTRICAL ORDERPAYMENT RELEASED', '97', 'ELECRELEASED', 1)
@ -342,14 +340,12 @@ export default () => {
setPrintedApplication(application)
setPrinted(true)
setLoadingText(`Generating PDF`)
if (division === 'electrical') {
createPdfElectrical()
} else if (division === 'occupancy') {
createPdfOccupancy()
} else console.log('building')
}
setIsLoading(false)
}
const rePrintHandler = async (division: string, application: string) => {
@ -362,14 +358,15 @@ export default () => {
return
}
setIsLoading(true)
setLoadingText(`Reprinting ${application}`)
if (selectedType().includes('Void')) {
setLoadingText('Clearing POPS records')
// Return to APPROVAL
// TODO:
// Set current status (for validation) to 1, is_approve = 1
// Clear esign_transactions
if (BACKEND.includes('localhost')) {
const status = await checkStatusPopsLocal(application)
console.log('status', status)
if (status.result > 0) popsExist = true
if (status.result2 > 0) popsPaid = true
} else {
@ -382,29 +379,25 @@ export default () => {
// const message = status.message
if (!popsExist) {
setIsLoading(false)
setVoidError(true)
setErrorMessage('No record found on Pops')
return
} else {
// const pops_paid = message.pops_paid
// const epay_paid = message.epay_paid
}
if (popsPaid) {
setIsLoading(false)
setVoidError(true)
setErrorMessage('Already Paid')
return
}
setLoadingText('Processing for Re-approval')
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')
setLoadingText('Processing for Re-approvalsss')
await updateDocflow(division, application, 'FOR ELECTRICAL OFFICIAL RECEIPT VALIDATION')
await updateOpForApproval(division, application)
setLoadingText('Processing for Re-approvalsss')
await clearEsignTransactions(application)
} else if (division === 'occupancy') {
await setNewStatus(division, 'OCCUPANCY ORDER OF PAYMENT VOIDED', '174', 'OCCOPVOIDED', 1)
@ -412,14 +405,9 @@ export default () => {
await updateDocflow(division, application, 'APPROVED FOR PRINTING OF BUREAU OF FIRE AND ORDER OF PAYMENT')
}
const successVoid = await voidPopsOp(application)
if (successVoid) {
await voidPopsOp(application)
await postTransaction(application)
} else {
setIsLoading(false)
}
} else {
setLoadingText('Generating PDF')
setPrintedApplication(application)
setPrinted(true)
@ -429,7 +417,6 @@ export default () => {
createPdfOccupancy()
} else console.log('building')
}
setIsLoading(false)
}
const updateOp = async (division: string) => {
@ -902,12 +889,10 @@ export default () => {
</Tabs.Content>
<Tabs.Content class="tabs__content" value="electrical">
<Row>
<Padding top={2} bottom={2} right={0} left={0}>
<h3>Ready for Signing and Printing Electrical Order of Payments</h3>
</Padding>
<h2>List of Ready to Print in Electrical Order of Payments</h2>
</Row>
<Padding top={0} bottom={0} right={9} left={9}>
<Padding top={0} bottom={0} right={10} left={10}>
<Row content="split">
<Input value={filter()} onChange={setFilter} placeholder="Filter Application Number" />
<Row gap={0.5}>
@ -923,7 +908,7 @@ export default () => {
<Padding top={2} bottom={0} right={10} left={10}>
<Column gap={1}>
<AiOutlineLoading3Quarters class="loading-spinner" size={42} opacity={0.8} />
<span>{loadingText()}</span>
<span>Downloading Data</span>
</Column>
</Padding>
</Show>