- change status to product history status

This commit is contained in:
Fadli 2022-08-29 14:49:01 +07:00
parent 25a48ff39f
commit c6d4b12307

View File

@ -282,8 +282,9 @@ export class ProductService {
'current_price',
'current_price.partner_id is NULL and current_price.end_date is NULL',
)
.leftJoin('product.statusHistory', 'status_history')
.where(
`product.supplier_id = :supplier_id and product.status = 'ACTIVE'`,
`product.supplier_id = :supplier_id and status_history.status = 'ACTIVE'`,
{
supplier_id: supplier,
},
@ -451,7 +452,6 @@ export class ProductService {
relations: ['supplier'],
where: {
code: code,
status: 'ACTIVE',
},
});
} catch (e) {