Updated void checking
This commit is contained in:
parent
d60a60a46e
commit
289972cc63
1 changed files with 18 additions and 9 deletions
|
|
@ -191,21 +191,31 @@ export default () => {
|
|||
setErrorMessage('Application Already Paid')
|
||||
return
|
||||
} else {
|
||||
const voidOP = BACKEND.includes('localhost') ? await voidPopsOpLocal(application) : await voidPopsOp(application)
|
||||
if (BACKEND.includes('localhost')) {
|
||||
const voidOP = await voidPopsOpLocal(application)
|
||||
|
||||
if (!voidOP) {
|
||||
setPostError(true)
|
||||
setErrorMessage('POPS Record found but failed to void')
|
||||
return
|
||||
}
|
||||
} else {
|
||||
const voidOP = await voidPopsOp(application)
|
||||
|
||||
if (voidOP.toUpper().includes('ERROR')) {
|
||||
setPostError(true)
|
||||
setErrorMessage('POPS Record found but failed to void')
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await postPops(division, application)
|
||||
// const popsResult = await checkPops(application)
|
||||
const lockResult = await lockOpData(division, application)
|
||||
const dataLocked = await lockOpData(division, application)
|
||||
|
||||
if (lockResult) {
|
||||
if (dataLocked) {
|
||||
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
|
||||
|
|
@ -303,8 +313,7 @@ export default () => {
|
|||
|
||||
const voidPopsOp = async (application: string) => {
|
||||
const response = await voidPopsApi(application)
|
||||
if (response.includes('Error')) return false
|
||||
return true
|
||||
return response
|
||||
}
|
||||
|
||||
const voidPopsOpLocal = async (application: string) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue