Skip to content

Commit 4ab4a66

Browse files
authored
hotfixed inventorycalc (#1114)
1 parent 10fcfb4 commit 4ab4a66

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lib/utils/stocklistUtils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ export async function inventoryValue(prisma: ExtendedPrisma) {
3030
continue;
3131
} else {
3232
const bottleWeight = item.bottleEmptyWeight!;
33-
const liquidWeight = item.quantityAvailable! - bottleWeight;
33+
const liquidWeight =
34+
item.quantityAvailable! - item.nrBottles! * bottleWeight;
3435
const bottlePrice = item.price / 100;
3536
const fullBottleLiquidWeight = item.bottleFullWeight! - bottleWeight;
3637
value += (liquidWeight / fullBottleLiquidWeight) * bottlePrice;

0 commit comments

Comments
 (0)