- added filter by trxId in history transaction
This commit is contained in:
@@ -1885,6 +1885,7 @@ export class TransactionService {
|
||||
user: string,
|
||||
startDate: string,
|
||||
endDate: string,
|
||||
trxId: string,
|
||||
pageSize?: number,
|
||||
) {
|
||||
const userData = await this.userService.findExist(user);
|
||||
@@ -1950,7 +1951,7 @@ export class TransactionService {
|
||||
.addSelect('supplier.name', 'supplier_name')
|
||||
.orderBy('transaction.created_at', 'DESC');
|
||||
|
||||
if (startDate && endDate) {
|
||||
if (startDate != null && endDate != null) {
|
||||
baseQuery.andWhere(
|
||||
'transaction.created_at between :startDate and :enDate',
|
||||
{
|
||||
@@ -1958,6 +1959,13 @@ export class TransactionService {
|
||||
enDate: new Date(endDate),
|
||||
},
|
||||
);
|
||||
} else if (trxId != null) {
|
||||
baseQuery.andWhere(
|
||||
'transaction.supplier_trx_id = :trxId',
|
||||
{
|
||||
trxId: trxId
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
const data = await baseQuery
|
||||
|
||||
Reference in New Issue
Block a user