Added totalamount api
This commit is contained in:
parent
1c9d1ae5de
commit
68e2b7337b
1 changed files with 11 additions and 0 deletions
|
|
@ -1419,6 +1419,17 @@ func connect() {
|
||||||
"result": result,
|
"result": result,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
case "get-totalamount-electrical":
|
||||||
|
err := db.QueryRow(`SELECT IFNULL(SUM(amount), 0) AS result FROM electrical_orderofpayment_new WHERE electricalid = (SELECT electricalid FROM electrical WHERE electricalNo = ?)`, data).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,
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue