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')
|
setErrorMessage('Application Already Paid')
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
const voidOP = BACKEND.includes('localhost') ? await voidPopsOpLocal(application) : await voidPopsOp(application)
|
if (BACKEND.includes('localhost')) {
|
||||||
|
const voidOP = await voidPopsOpLocal(application)
|
||||||
|
|
||||||
if (!voidOP) {
|
if (!voidOP) {
|
||||||
setPostError(true)
|
setPostError(true)
|
||||||
setErrorMessage('POPS Record found but failed to void')
|
setErrorMessage('POPS Record found but failed to void')
|
||||||
return
|
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)
|
await postPops(division, application)
|
||||||
// const popsResult = await checkPops(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)
|
signed = await setNewStatus(division, 'ELECTRICAL ORDER OF PAYMENT APPROVED AND SIGNED', '170', 'ELECOPAPPROVEDSIGNED', 1)
|
||||||
updateDocflow(division, application, 'FOR ELECTRICAL ORDER OF PAYMENT APPROVAL')
|
updateDocflow(division, application, 'FOR ELECTRICAL ORDER OF PAYMENT APPROVAL')
|
||||||
if (!signed) return
|
if (!signed) return
|
||||||
|
|
@ -303,8 +313,7 @@ export default () => {
|
||||||
|
|
||||||
const voidPopsOp = async (application: string) => {
|
const voidPopsOp = async (application: string) => {
|
||||||
const response = await voidPopsApi(application)
|
const response = await voidPopsApi(application)
|
||||||
if (response.includes('Error')) return false
|
return response
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const voidPopsOpLocal = async (application: string) => {
|
const voidPopsOpLocal = async (application: string) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue