Compare commits
No commits in common. "1a129263c2fe0a37207b83c617b4752ab5817872" and "64ca197a09ff86279b3a48ea93ef739231da675a" have entirely different histories.
1a129263c2
...
64ca197a09
6 changed files with 1 additions and 70 deletions
|
|
@ -717,45 +717,5 @@ func connect() {
|
|||
|
||||
})
|
||||
|
||||
router.POST("/api/update-op-electrical", func(c *gin.Context) {
|
||||
type UpdateOpData struct {
|
||||
Data int `json:"data"`
|
||||
}
|
||||
var updateOpData UpdateOpData
|
||||
if err := c.ShouldBindJSON(&updateOpData); 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 electrical_orderofpayment_new SET is_approve = 1 WHERE electricalid = ? AND for_approval = 1 AND is_release = 0 AND is_paid = 0 AND popstransmitted = 0")
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
defer dbpost.Close()
|
||||
|
||||
exec, err := dbpost.Exec(updateOpData.Data)
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
|
||||
affect, err := exec.RowsAffected()
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
|
||||
if affect > 0 {
|
||||
c.String(http.StatusOK, "Success on Updating Order of Payment")
|
||||
} else {
|
||||
c.String(http.StatusInternalServerError, "Failed on Updating Order of Payment")
|
||||
}
|
||||
})
|
||||
|
||||
router.Run(":4320")
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 92 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 19 KiB |
|
|
@ -98,7 +98,6 @@ export default () => {
|
|||
const approveHandler = async (application: string) => {
|
||||
let signed: boolean = false
|
||||
let forprinting: boolean = false
|
||||
let updateOrderofpayment: boolean = false
|
||||
|
||||
setConnected(await checkConnection())
|
||||
if (connected() === false) {
|
||||
|
|
@ -110,11 +109,8 @@ export default () => {
|
|||
if (!signed) return
|
||||
|
||||
forprinting = await setNewStatus('FOR ELECTRICAL ORDER OF PAYMENT PRINTING', '95', 'ELECOPPRINT')
|
||||
if (!forprinting) return
|
||||
|
||||
updateOrderofpayment = await updateOp()
|
||||
|
||||
if (updateOrderofpayment) {
|
||||
if (forprinting) {
|
||||
setApprovedApplication(application)
|
||||
setApproved(true)
|
||||
}
|
||||
|
|
@ -136,18 +132,6 @@ export default () => {
|
|||
}
|
||||
}
|
||||
|
||||
const updateOp = async () => {
|
||||
try {
|
||||
await ofetch(API + 'update-op-electrical', {
|
||||
method: 'POST',
|
||||
body: { data: parseInt(applicationId().toString()) },
|
||||
})
|
||||
return true
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
const calculateAmounts = () => {
|
||||
const amounts: string[] = amountList()
|
||||
let gflguList: number[] = []
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
export default (firstname: string, middleinitial: string, lastname: string) => {
|
||||
let result
|
||||
if (firstname.length > 0) {
|
||||
if (middleinitial.length > 0) {
|
||||
result = `${firstname} ${middleinitial}. ${lastname}`
|
||||
} else {
|
||||
result = `${firstname} ${lastname}`
|
||||
}
|
||||
} else {
|
||||
result = lastname
|
||||
}
|
||||
return result
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue