From 0f12c706b0875e0bb30141c3b0bd43dc98e97c50 Mon Sep 17 00:00:00 2001 From: giovanni Date: Sat, 30 May 2026 10:01:22 +0700 Subject: [PATCH] fix calculate week create recording --- .../services/production-standard.service.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/internal/modules/master/production-standards/services/production-standard.service.go b/internal/modules/master/production-standards/services/production-standard.service.go index 406dccdc..b2128e88 100644 --- a/internal/modules/master/production-standards/services/production-standard.service.go +++ b/internal/modules/master/production-standards/services/production-standard.service.go @@ -387,16 +387,12 @@ func (s productionStandardService) EnsureWeekAvailable(ctx context.Context, stan return nil } - upperCategory := strings.ToUpper(category) - weekBase := 1 - if upperCategory == string(utils.ProjectFlockCategoryLaying) { - weekBase = config.LayingWeekStart() - } - week := ((day - 1) / 7) + weekBase + week := ((day - 1) / 7) + 1 if week <= 0 { return nil } + upperCategory := strings.ToUpper(category) if upperCategory == string(utils.ProjectFlockCategoryLaying) { detail, err := s.ProductionStandardDetailRepo.GetByStandardIDAndWeek(ctx, standardID, week) if err != nil {