add approval projectflockkandang closed,expense must be done,stock must empty by flag unfinished:need info approval fix

This commit is contained in:
ragilap
2025-12-03 21:46:02 +07:00
parent d572d04e3b
commit ea294c6a18
6 changed files with 47 additions and 8 deletions
@@ -297,7 +297,8 @@ func (r *projectFlockKandangRepositoryImpl) HasKandangsLinkedToOtherProject(ctx
}
q := r.db.WithContext(ctx).
Table("project_flock_kandangs").
Where("kandang_id IN ?", kandangIDs)
Where("kandang_id IN ?", kandangIDs).
Where("closed_at IS NULL")
if exceptProjectID != nil {
q = q.Where("project_flock_id <> ?", *exceptProjectID)
}