fix filter purchase supplier repport

This commit is contained in:
ragilap
2026-04-02 11:43:44 +07:00
committed by giovanni
parent d54e8a4e02
commit 07b55e79a5
2 changed files with 3 additions and 2 deletions
@@ -191,6 +191,9 @@ func (s *purchaseService) GetAll(c *fiber.Ctx, params *validation.Query) ([]enti
if createdTo != nil {
db = db.Where("created_at < ?", *createdTo)
}
if poDateStart != nil {
db = db.Where("purchases.po_date >= ?", *poDateStart)
}
if poDateStart != nil {
db = db.Where("purchases.po_date >= ?", *poDateStart)
@@ -333,7 +336,6 @@ func (s *purchaseService) GetAll(c *fiber.Ctx, params *validation.Query) ([]enti
if err := s.attachLatestApprovals(c.Context(), purchases); err != nil {
s.Log.Warnf("Unable to attach latest approvals for purchases: %+v", err)
}
return purchases, total, nil
}
@@ -432,7 +432,6 @@ func (c *RepportController) GetProductionResult(ctx *fiber.Ctx) error {
func parseCommaSeparatedInt64s(raw string) ([]int64, error) {
return parseCommaSeparatedInt64sWithField(raw, "supplier_ids")
}
func parseCommaSeparatedInt64sWithField(raw, field string) ([]int64, error) {
raw = strings.TrimSpace(raw)
if raw == "" {