fix filter purchase supplier repport

This commit is contained in:
ragilap
2026-04-01 16:25:04 +07:00
committed by giovanni
parent aa9863646e
commit b58e9a10b1
2 changed files with 3 additions and 2 deletions
@@ -71,7 +71,7 @@ func (r *purchaseSupplierRepositoryImpl) baseSupplierQuery(ctx context.Context,
if len(filters.ProductCategoryIDs) > 0 {
db = db.
Joins("JOIN products ON products.id = purchase_items.product_id").
Where("products.product_category_id IN ?", filters.ProductCategoryIDs)
Where("products.product_category_id IN ?", filters.ProductCategoryIDs)
}
if len(filters.AreaIDs) > 0 || filters.AllowedAreaIDs != nil {
@@ -194,7 +194,7 @@ func (r *purchaseSupplierRepositoryImpl) GetItemsBySuppliers(ctx context.Context
if len(filters.ProductCategoryIDs) > 0 {
db = db.
Joins("JOIN products ON products.id = purchase_items.product_id").
Where("products.product_category_id IN ?", filters.ProductCategoryIDs)
Where("products.product_category_id IN ?", filters.ProductCategoryIDs)
}
if len(filters.AreaIDs) > 0 || filters.AllowedAreaIDs != nil {
db = db.Joins("JOIN warehouses ON warehouses.id = purchase_items.warehouse_id")