Renamed createPdf
This commit is contained in:
parent
99608062ff
commit
b31c1b762f
4 changed files with 41 additions and 73 deletions
|
|
@ -1052,6 +1052,7 @@ func connect() {
|
|||
c.JSON(http.StatusOK, gin.H{
|
||||
"result": result,
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -1091,6 +1092,16 @@ func connect() {
|
|||
"result": result,
|
||||
})
|
||||
|
||||
case "check-approval":
|
||||
err := db.QueryRow("SELECT IFNULL(is_approve, 0) AS result FROM occupancydocflowtxn WHERE remarks = ? AND occupancyreceivingid = (SELECT occupancyid FROM occupancy WHERE controlNo = ?)", data, data2).Scan(&result)
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusBadRequest, err)
|
||||
c.String(http.StatusBadRequest, err.Error())
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"result": result,
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -1281,53 +1292,6 @@ func connect() {
|
|||
}
|
||||
})
|
||||
|
||||
// router.POST("/api/update-docflow-bldgadditional", middleware.TokenChecker(), func(c *gin.Context) {
|
||||
// type UpdateDocflowData struct {
|
||||
// Data string `json:"data"`
|
||||
// Data2 string `json:"data2"`
|
||||
// }
|
||||
// var updateDocflowData UpdateDocflowData
|
||||
// if err := c.ShouldBindJSON(&updateDocflowData); err != nil {
|
||||
// c.String(http.StatusBadRequest, "Invalid request body")
|
||||
// return
|
||||
// }
|
||||
|
||||
// c.Writer.Header().Set("X-XSS-Protection", "1; mode=block")
|
||||
// c.Writer.Header().Set("X-Content-Type-Options", "nosniff")
|
||||
// c.Writer.Header().Set("X-DNS-Prefetch-Control", "off")
|
||||
// c.Writer.Header().Set("X-Frame-Options", "DENY")
|
||||
// c.Writer.Header().Set("X-Download-Options", "noopen")
|
||||
// c.Writer.Header().Set("Referrer-Policy", "no-referrer")
|
||||
|
||||
// dbpost, err := db.Prepare("UPDATE occupancydocflowtxn SET is_approve = 1 WHERE remarks = ? AND occupancyreceivingid = (SELECT occupancyid FROM occupancy WHERE controlNo = ?)")
|
||||
// if err != nil {
|
||||
// c.AbortWithError(http.StatusInternalServerError, err)
|
||||
// c.String(http.StatusInternalServerError, "Internal Server Error")
|
||||
// return
|
||||
// }
|
||||
// defer dbpost.Close()
|
||||
|
||||
// exec, err := dbpost.Exec(updateDocflowData.Data, updateDocflowData.Data2)
|
||||
// if err != nil {
|
||||
// c.AbortWithError(http.StatusInternalServerError, err)
|
||||
// c.String(http.StatusInternalServerError, "Internal Server Error")
|
||||
// return
|
||||
// }
|
||||
|
||||
// affect, err := exec.RowsAffected()
|
||||
// if err != nil {
|
||||
// c.AbortWithError(http.StatusInternalServerError, err)
|
||||
// c.String(http.StatusInternalServerError, "Internal Server Error")
|
||||
// return
|
||||
// }
|
||||
|
||||
// if affect > 0 {
|
||||
// c.String(http.StatusOK, "Success on Updating Docflow on Electrical")
|
||||
// } else {
|
||||
// c.String(http.StatusInternalServerError, "Failed on Updating Docflow on Electrical")
|
||||
// }
|
||||
// })
|
||||
|
||||
router.POST("/api/update-docflow-electrical", middleware.TokenChecker(), func(c *gin.Context) {
|
||||
type UpdateDocflowData struct {
|
||||
Data string `json:"data"`
|
||||
|
|
|
|||
|
|
@ -411,9 +411,11 @@ export default () => {
|
|||
<Tabs.Content class="tabs__content" value="building">
|
||||
<Row>
|
||||
{/* <h2>List of Ready to Approve and Sign Building Order of Payments</h2> */}
|
||||
<Padding top={2} bottom={0} left={0} right={0}>
|
||||
<Box curved thickness={0} background="#602a2abf" padding="1rem 2rem">
|
||||
<h2>Under Development</h2>
|
||||
</Box>
|
||||
</Padding>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
|
|
|
|||
|
|
@ -64,23 +64,15 @@ export default () => {
|
|||
}
|
||||
|
||||
const getListForApprovalElectrical = async () => {
|
||||
try {
|
||||
const responseE = await getApiMulti('get-listopapproval-electrical')
|
||||
setApplicationListElectrical(responseE.result)
|
||||
setNameListElectrical(responseE.result2)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
|
||||
const getListForApprovalOccupancy = async () => {
|
||||
try {
|
||||
const responseO = await getApiMulti('get-listopapproval-occupancy')
|
||||
setApplicationListOccupancy(responseO.result)
|
||||
setNameListOccupancy(responseO.result2)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
|
||||
const load = async (division: string) => {
|
||||
|
|
@ -114,7 +106,7 @@ export default () => {
|
|||
const total = calculateTotal(op.result4)
|
||||
const formattedTotal = new Intl.NumberFormat('en-US', {
|
||||
minimumFractionDigits: 2,
|
||||
// maximumFractionDigits: 2,
|
||||
maximumFractionDigits: 2,
|
||||
}).format(total)
|
||||
setTotalOp(formattedTotal)
|
||||
setDateOp(dayjs(op.result5[0]).format('MMMM DD, YYYY'))
|
||||
|
|
@ -159,7 +151,10 @@ export default () => {
|
|||
|
||||
signed = await setNewStatus(division, 'OCCUPANCY ORDER OF PAYMENT APPROVED AND SIGNED', '172', 'OCCOPAPPROVEDSIGNED', 1)
|
||||
updateDocflow(division, application, 'FOR OCCUPANCY RECOMMENDING APPROVAL')
|
||||
if (bldgadditional) updateDocflow(division, application, 'FOR ADDITIONAL ORDER OF PAYMENT RECOMMENDING APPROVAL')
|
||||
if (bldgadditional) {
|
||||
const neededToUpdate = await checkApproval(application, 'FOR ADDITIONAL ORDER OF PAYMENT RECOMMENDING APPROVAL')
|
||||
if (!neededToUpdate) updateDocflow(division, application, 'FOR ADDITIONAL ORDER OF PAYMENT RECOMMENDING APPROVAL')
|
||||
}
|
||||
if (!signed) return
|
||||
|
||||
forprinting = await setNewStatus(division, 'APPROVED FOR PRINTING OF BUREAU OF FIRE AND ORDER OF PAYMENT', '23', 'OCORDEROFPAYMENT', 0)
|
||||
|
|
@ -305,6 +300,11 @@ export default () => {
|
|||
}
|
||||
}
|
||||
|
||||
const checkApproval = async (application: string, status: string) => {
|
||||
const response = await getApi('check-approval', status, application)
|
||||
return response
|
||||
}
|
||||
|
||||
const logout = async () => {
|
||||
removeEmployee()
|
||||
navigate('/')
|
||||
|
|
@ -362,9 +362,11 @@ export default () => {
|
|||
<Tabs.Content class="tabs__content" value="building">
|
||||
<Row>
|
||||
{/* <h2>List of Ready to Approve and Sign Building Order of Payments</h2> */}
|
||||
<Padding top={2} bottom={0} left={0} right={0}>
|
||||
<Box curved thickness={0} background="#602a2abf" padding="1rem 2rem">
|
||||
<h2>Under Development</h2>
|
||||
</Box>
|
||||
</Padding>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
|
|
@ -382,7 +384,7 @@ export default () => {
|
|||
</Tabs.Content>
|
||||
<Tabs.Content class="tabs__content" value="occupancy">
|
||||
<Row>
|
||||
<h2>List of Ready to Approve and Sign Occupancy Order of Payments</h2>
|
||||
<h2>List of Ready to Approve and Sign in Occupancy Order of Payments</h2>
|
||||
</Row>
|
||||
|
||||
<Padding top={0} bottom={0} right={10} left={0}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue