.
All checks were successful
Build Docker Image / Build Docker Image (push) Successful in 1m17s
Build Docker Image / Restart Docker Compose (push) Successful in 0s

This commit is contained in:
x2Skyz
2025-12-01 00:53:57 +07:00
parent 5ad8079465
commit f2d988681a
4 changed files with 12 additions and 10 deletions

View File

@@ -25,12 +25,12 @@ export class accountingSearch {
try {
// let username = req.body.request.username;
// let password = req.body.request.password;
let token = req.body.request.token;
const decoded = verifyToken(token);
let token = req.headers.authorization?.split(' ')[1];''
const decoded = verifyToken(token);
let id = decoded.id
let username = decoded.name
database = decoded.organization
let id = decoded.id
let username = decoded.name
database = decoded.organization
aryResult = await this.accountingSearchService.getAccountingSearch(database, id, username); // เช็คกับ db กลาง ส่ง jwttoken ออกมา
// this.generalService.devhint(1, 'accountingSearch.js', 'Login success');

View File

@@ -25,7 +25,7 @@ export class accountingSetup {
try {
// let username = req.body.request.username;
// let password = req.body.request.password;
let token = req.body.request.token;
let token = req.headers.authorization?.split(' ')[1];
const decoded = verifyToken(token);
database = decoded.organization

View File

@@ -24,7 +24,7 @@ export class accountingSum {
let result = []
var aryResult
try {
let token = req.body.request.token;
let token = req.headers.authorization?.split(' ')[1];
const decoded = verifyToken(token);
let id = decoded.id

View File

@@ -28,7 +28,7 @@ export class reportController {
let token = req.headers.authorization?.split(' ')[1];
const decoded = verifyToken(token);
let actnum = req.body.request.actnum;
let actnum = decoded.id;
database = decoded.organization;
aryResult = await this.reportService.getReportController(database, actnum);
@@ -52,7 +52,7 @@ export class reportController {
return aryResult;
}
// 2) แยก income / expense
// 2) แยก income / expense
const incomeList = data.filter(i => i.acttyp === 'i');
const expenseList = data.filter(e => e.acttyp === 'e');
@@ -63,11 +63,13 @@ export class reportController {
const profitRate = totalIncome > 0 ? (netProfit / totalIncome) * 100 : 0;
const adjustedProfitRate = profitRate + 1.9;
// 3) แนบ summary (เหมือนที่เราทำไปก่อนหน้า)
// 3) แนบ summary (เหมือนที่เราทำไปก่อนหน้า)
var summary = {
totalIncome: totalIncome.toFixed(2),
totalExpense: totalExpense.toFixed(2),
netProfit: netProfit.toFixed(2),
profitRate: profitRate.toFixed(2) + ' %',
period: '30 วัน'
};
// ✅ 3.5) Create actdata table with required fields grouped by actnum