mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-24 15:25:43 +00:00
fix filter purchase supplier repport
This commit is contained in:
@@ -191,6 +191,9 @@ func (s *purchaseService) GetAll(c *fiber.Ctx, params *validation.Query) ([]enti
|
|||||||
if createdTo != nil {
|
if createdTo != nil {
|
||||||
db = db.Where("created_at < ?", *createdTo)
|
db = db.Where("created_at < ?", *createdTo)
|
||||||
}
|
}
|
||||||
|
if poDateStart != nil {
|
||||||
|
db = db.Where("purchases.po_date >= ?", *poDateStart)
|
||||||
|
}
|
||||||
|
|
||||||
if poDateStart != nil {
|
if poDateStart != nil {
|
||||||
db = db.Where("purchases.po_date >= ?", *poDateStart)
|
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 {
|
if err := s.attachLatestApprovals(c.Context(), purchases); err != nil {
|
||||||
s.Log.Warnf("Unable to attach latest approvals for purchases: %+v", err)
|
s.Log.Warnf("Unable to attach latest approvals for purchases: %+v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return purchases, total, nil
|
return purchases, total, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -432,7 +432,6 @@ func (c *RepportController) GetProductionResult(ctx *fiber.Ctx) error {
|
|||||||
func parseCommaSeparatedInt64s(raw string) ([]int64, error) {
|
func parseCommaSeparatedInt64s(raw string) ([]int64, error) {
|
||||||
return parseCommaSeparatedInt64sWithField(raw, "supplier_ids")
|
return parseCommaSeparatedInt64sWithField(raw, "supplier_ids")
|
||||||
}
|
}
|
||||||
|
|
||||||
func parseCommaSeparatedInt64sWithField(raw, field string) ([]int64, error) {
|
func parseCommaSeparatedInt64sWithField(raw, field string) ([]int64, error) {
|
||||||
raw = strings.TrimSpace(raw)
|
raw = strings.TrimSpace(raw)
|
||||||
if raw == "" {
|
if raw == "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user