fix: first push implementation fifo v2 to all stockable and useable

This commit is contained in:
Hafizh A. Y
2026-02-27 15:21:55 +07:00
parent a2de21e351
commit e7e065c320
28 changed files with 1469 additions and 164 deletions
@@ -432,8 +432,8 @@ func (s sapronakService) buildSapronakItems(ctx context.Context, pfk entity.Proj
return true
}
candidate := strings.ToUpper(f)
if filterFlag == "DOC" || filterFlag == "PULLET" {
return candidate == "DOC" || candidate == "PULLET"
if filterFlag == "AYAM" || filterFlag == "DOC" || filterFlag == "PULLET" {
return candidate == "AYAM" || candidate == "DOC" || candidate == "PULLET"
}
return candidate == filterFlag
}
@@ -474,7 +474,8 @@ func (s sapronakService) buildSapronakItems(ctx context.Context, pfk entity.Proj
if !isLaying {
filteredUsage := make([]repository.SapronakUsageRow, 0, len(chickinUsageRows))
for _, row := range chickinUsageRows {
if strings.ToUpper(row.Flag) == "DOC" {
flag := strings.ToUpper(row.Flag)
if flag == "AYAM" || flag == "DOC" {
filteredUsage = append(filteredUsage, row)
}
}
@@ -483,7 +484,8 @@ func (s sapronakService) buildSapronakItems(ctx context.Context, pfk entity.Proj
filteredDetail := make(map[uint][]repository.SapronakDetailRow, len(chickinUsageDetailsRows))
for pid, rows := range chickinUsageDetailsRows {
for _, d := range rows {
if strings.ToUpper(d.Flag) == "DOC" {
flag := strings.ToUpper(d.Flag)
if flag == "AYAM" || flag == "DOC" {
filteredDetail[pid] = append(filteredDetail[pid], d)
}
}