add: saldo supplier

This commit is contained in:
ilham 2021-12-20 17:54:35 +07:00
parent e499a8a1e6
commit 1ea1e5cf46
2 changed files with 9 additions and 1 deletions

View File

@ -19,4 +19,6 @@ export class Supplier extends BaseModel {
status: boolean;
coa: COA;
coa_undistribute: COA;
}

View File

@ -139,7 +139,13 @@ export class SupplierService {
'coa',
`coa.supplier = supplier.id and coa.type = '2'`,
)
.select(['supplier', 'coa.amount']);
.leftJoinAndMapOne(
'supplier.coa_undistribute',
COA,
'coa_undistribute',
`coa_undistribute.supplier = supplier.id and coa_undistribute.type = '9'`,
)
.select(['supplier', 'coa.amount', 'coa_undistribute.amount']);
const data = await baseQuery
.skip(page * 10)