42 lines
941 B
JavaScript
42 lines
941 B
JavaScript
|
|
import { GeneralService } from '../share/generalservice.js'
|
||
|
|
|
||
|
|
export class ReportService {
|
||
|
|
|
||
|
|
constructor() {
|
||
|
|
this.generalService = new GeneralService()
|
||
|
|
}
|
||
|
|
|
||
|
|
async getReportController(database, number) {
|
||
|
|
const sql = `
|
||
|
|
SELECT
|
||
|
|
acttyp,
|
||
|
|
actcat,
|
||
|
|
actqty,
|
||
|
|
actcmt,
|
||
|
|
actacpdtm
|
||
|
|
FROM ${database}.actmst
|
||
|
|
WHERE actnum = $1
|
||
|
|
`
|
||
|
|
|
||
|
|
const params = [number]
|
||
|
|
const result = await this.generalService.executeQueryParam(database, sql, params);
|
||
|
|
return result
|
||
|
|
}
|
||
|
|
|
||
|
|
async getCategoryColorMap(database) {
|
||
|
|
const sql = `
|
||
|
|
SELECT dtlcod, dtlnam, dtlmsc as dtlclr
|
||
|
|
FROM ${database}.dtlmst
|
||
|
|
WHERE dtltblcod IN ('ACTCAT_INC', 'ACTCAT_EXP')
|
||
|
|
`;
|
||
|
|
const params = []
|
||
|
|
const rows = await this.generalService.executeQueryParam(database, sql, params);
|
||
|
|
|
||
|
|
const map = {};
|
||
|
|
rows.forEach(r => {
|
||
|
|
map[r.dtlnam] = r.dtlclr;
|
||
|
|
});
|
||
|
|
|
||
|
|
return map;
|
||
|
|
}
|
||
|
|
}
|