feat(SPG-737): fix filter reconciliation
parent
0658b503bd
commit
ba6ee4a408
|
@ -130,18 +130,18 @@ export class IndexReconciliationManager extends BaseIndexManager<TransactionEnti
|
||||||
|
|
||||||
if (this.filterParam.payment_via) {
|
if (this.filterParam.payment_via) {
|
||||||
queryBuilder.andWhere(
|
queryBuilder.andWhere(
|
||||||
`${this.tableName}.payment_type::text In (:...type)`,
|
`${this.tableName}.payment_type_method_name::text LIKE :type`,
|
||||||
{
|
{
|
||||||
type: [`%${this.filterParam.payment_via}%`],
|
type: `%${this.filterParam.payment_via}%`,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.filterParam.payment_bank) {
|
if (this.filterParam.payment_bank) {
|
||||||
queryBuilder.andWhere(
|
queryBuilder.andWhere(
|
||||||
`${this.tableName}.payment_type_method_name::text In (:...banks)`,
|
`${this.tableName}.payment_type_method_name::text LIKE :banks`,
|
||||||
{
|
{
|
||||||
banks: [`%${this.filterParam.payment_bank}%`],
|
banks: `%${this.filterParam.payment_bank}%`,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -164,12 +164,15 @@ export class IndexReconciliationManager extends BaseIndexManager<TransactionEnti
|
||||||
).getQuery();
|
).getQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.filterParam.statuses || this.filterParam.statuses?.length === 0) {
|
||||||
queryBuilder.andWhere(
|
queryBuilder.andWhere(
|
||||||
`${this.tableName}.reconciliation_status Not In (:...statuses)`,
|
`${this.tableName}.reconciliation_status Not In (:...statuses)`,
|
||||||
{
|
{
|
||||||
statuses: [STATUS.DRAFT],
|
statuses: [STATUS.DRAFT],
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
console.log(queryBuilder.getQueryAndParameters());
|
||||||
return queryBuilder;
|
return queryBuilder;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue