FIX(BE): fix closing marketing 500

This commit is contained in:
aguhh18
2026-01-08 20:44:56 +07:00
parent 7af78d04dd
commit 5606b9c4a3
2 changed files with 18 additions and 3 deletions
@@ -153,7 +153,17 @@ func (s closingService) GetPenjualan(c *fiber.Ctx, projectFlockID uint) ([]entit
if len(realisasi) == 0 {
return []entity.MarketingDeliveryProduct{}, nil
}
return realisasi, nil
filtered := make([]entity.MarketingDeliveryProduct, 0, len(realisasi))
for _, item := range realisasi {
if item.UsageQty != 0 || item.TotalWeight != 0 || item.AvgWeight != 0 ||
item.UnitPrice != 0 || item.TotalPrice != 0 {
filtered = append(filtered, item)
}
}
return filtered, nil
}
func (s closingService) GetClosingSummary(c *fiber.Ctx, projectFlockID uint) (*dto.ClosingSummaryDTO, error) {