forked from ttc/micro-service-api
accountingweb-api and ttc-api: initial with modified .env
Signed-off-by: supphakitd <67319010028@technictrang.ac.th>
This commit is contained in:
@@ -6,15 +6,29 @@ export class AccountingAddService {
|
||||
this.generalService = new GeneralService()
|
||||
}
|
||||
|
||||
async getAccountingAdd(database, name) {
|
||||
async getAccountingAdd(database, number) {
|
||||
const sql = `
|
||||
SELECT
|
||||
actseq,
|
||||
actnam
|
||||
actnum
|
||||
FROM ${database}.actmst
|
||||
WHERE actnam = $1
|
||||
`
|
||||
const params = [name]
|
||||
WHERE actnum = $1
|
||||
`
|
||||
|
||||
const params = [number]
|
||||
const result = await this.generalService.executeQueryParam(database, sql, params);
|
||||
return result
|
||||
}
|
||||
|
||||
async getLatestAccountingSeq(database) {
|
||||
const sql = `
|
||||
SELECT
|
||||
actseq
|
||||
FROM ${database}.actmst
|
||||
WHERE actseq=(SELECT max(actseq) FROM ${database}.actmst)
|
||||
`
|
||||
|
||||
const params = []
|
||||
const result = await this.generalService.executeQueryParam(database, sql, params);
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user