Merge branch 'development' of https://gitlab.com/empatnusabangsa/ppob/ppob-backend into devops-staging
This commit is contained in:
commit
849e5f3cfc
|
@ -1883,24 +1883,25 @@ export class TransactionService {
|
||||||
);
|
);
|
||||||
|
|
||||||
const data = await baseQuery
|
const data = await baseQuery
|
||||||
.select('SUM(transactions.amount) as total_amount')
|
.select('SUM(transactions.amount) as total_amount')
|
||||||
.addSelect('SUM(product_price.mark_up_price) as total_profit')
|
.addSelect('SUM(product_price.price) as total_modal')
|
||||||
.addSelect('COUNT(transactions.id) as total_transaction')
|
.addSelect('SUM(product_price.mark_up_price) as total_profit')
|
||||||
.getRawOne();
|
.addSelect('COUNT(transactions.id) as total_transaction')
|
||||||
|
|
||||||
const dataCoa = this.coaRepository
|
|
||||||
.createQueryBuilder('coa')
|
|
||||||
.innerJoin('user', 'user', 'coa.user = user.id')
|
|
||||||
.where(
|
|
||||||
`coa.type = '0' and user.partner_id is not NULL and user.is_active = true and is_rejected = false`
|
|
||||||
);
|
|
||||||
|
|
||||||
const coa = await dataCoa
|
|
||||||
.select('SUM(coa.amount) as total_modal')
|
|
||||||
.getRawOne();
|
.getRawOne();
|
||||||
|
|
||||||
|
// const dataCoa = this.coaRepository
|
||||||
|
// .createQueryBuilder('coa')
|
||||||
|
// .innerJoin('user', 'user', 'coa.user = user.id')
|
||||||
|
// .where(
|
||||||
|
// `coa.type = '0' and user.partner_id is not NULL and user.is_active = true and is_rejected = false`
|
||||||
|
// );
|
||||||
|
//
|
||||||
|
// const coa = await dataCoa
|
||||||
|
// .select('SUM(coa.amount) as total_modal')
|
||||||
|
// .getRawOne();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
total_modal: parseInt(coa.total_modal),
|
total_modal: parseInt(data.total_modal),
|
||||||
total_amount: parseInt(data.total_amount),
|
total_amount: parseInt(data.total_amount),
|
||||||
total_transaction: parseInt(data.total_transaction),
|
total_transaction: parseInt(data.total_transaction),
|
||||||
total_profit: parseInt(data.total_profit),
|
total_profit: parseInt(data.total_profit),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user