Files
threadcount-community/prisma/migrations/20260829030000_handin_credited/migration.sql
T
ThreadCount 057da00fd2 ThreadCount Community edition
Uniform stock management for healthcare linen rooms: the coordinator app, the phone counter and the staff app, for your own server. Built from e2d6d42 on 2026-09-13. Licensed under the Functional Source License (FSL-1.1-ALv2).
2026-09-13 11:16:36 +10:00

4 lines
293 B
SQL

-- Allowance credit is only for garments that were actually issued from the shelf
ALTER TABLE "HandInLine" ADD COLUMN "credited" INTEGER NOT NULL DEFAULT 0;
UPDATE "HandInLine" l SET "credited" = l."qty" FROM "HandIn" h WHERE h."id" = l."handInId" AND h."credit" = true AND l."cond" = 'Good';