- fix total commision query
This commit is contained in:
parent
16be12ff69
commit
9bd6ee6b9b
|
@ -2109,9 +2109,8 @@ export class TransactionService {
|
||||||
const { total_expense } = await baseQuery
|
const { total_expense } = await baseQuery
|
||||||
.select('SUM(transaction_journal.amount) as total_expense')
|
.select('SUM(transaction_journal.amount) as total_expense')
|
||||||
.innerJoin('transactions.transactionJournal', 'transaction_journal')
|
.innerJoin('transactions.transactionJournal', 'transaction_journal')
|
||||||
.innerJoin('user', 'user')
|
|
||||||
.where(
|
.where(
|
||||||
`transaction_journal.type = '0' and transaction_journal.amount < product_price.price and transactions.status = 1 and user.partner_id is NULL`,
|
`transaction_journal.type = '0' and transaction_journal.amount < product_price.price`,
|
||||||
)
|
)
|
||||||
.getRawOne();
|
.getRawOne();
|
||||||
|
|
||||||
|
@ -2122,7 +2121,7 @@ export class TransactionService {
|
||||||
total_transaction: parseInt(data.total_transaction),
|
total_transaction: parseInt(data.total_transaction),
|
||||||
total_modal: parseInt(data.total_modal),
|
total_modal: parseInt(data.total_modal),
|
||||||
total_profit: parseInt(data.total_profit),
|
total_profit: parseInt(data.total_profit),
|
||||||
total_commission: parseInt(data.total_profit) - parseInt(total_expense),
|
total_commission: - parseInt(total_expense) - parseInt(data.total_profit),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user