Renamed createPdf
This commit is contained in:
parent
99608062ff
commit
b31c1b762f
4 changed files with 41 additions and 73 deletions
|
|
@ -1031,7 +1031,7 @@ func connect() {
|
|||
"result9": array9,
|
||||
})
|
||||
|
||||
case "check-bldgadditional-approval":
|
||||
case "check-bldgadditional-approval":
|
||||
err := db.QueryRow("SELECT COUNT(building_orderofpaymentid) AS result FROM building_orderofpayment WHERE occupancyid = (SELECT occupancyid FROM occupancy WHERE controlNo = ?) AND for_approval = 1 AND is_approve = 0 AND popstransmitted = 0 AND is_paid = 0 AND is_delete = 0", data).Scan(&result)
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusBadRequest, err)
|
||||
|
|
@ -1042,7 +1042,7 @@ func connect() {
|
|||
"result": result,
|
||||
})
|
||||
|
||||
case "check-bldgadditional-printing":
|
||||
case "check-bldgadditional-printing":
|
||||
err := db.QueryRow("SELECT COUNT(building_orderofpaymentid) AS result FROM building_orderofpayment WHERE occupancyid = (SELECT occupancyid FROM occupancy WHERE controlNo = ?) AND for_approval = 1 AND is_approve = 1 AND popstransmitted = 0 AND is_paid = 0 AND is_delete = 0", data).Scan(&result)
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusBadRequest, err)
|
||||
|
|
@ -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"`
|
||||
|
|
@ -1597,7 +1561,7 @@ func connect() {
|
|||
}
|
||||
})
|
||||
|
||||
router.POST("/api/update-opapproved-bldgadditional", middleware.TokenChecker(), func(c *gin.Context) {
|
||||
router.POST("/api/update-opapproved-bldgadditional", middleware.TokenChecker(), func(c *gin.Context) {
|
||||
type UpdateOpData struct {
|
||||
Data int `json:"data"`
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue