From 68390a1eb6b7a217ffdb8558050b06c76749cf18 Mon Sep 17 00:00:00 2001 From: tanshu Date: Sun, 26 Dec 2021 06:57:37 +0530 Subject: [PATCH] Fix: The batch integrity report was not taking into account the closing stock entries and resetting stock to wrong levels. Fixed --- brewman/brewman/routers/batch_integrity.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/brewman/brewman/routers/batch_integrity.py b/brewman/brewman/routers/batch_integrity.py index 122e854e..0d5afb00 100644 --- a/brewman/brewman/routers/batch_integrity.py +++ b/brewman/brewman/routers/batch_integrity.py @@ -17,7 +17,6 @@ from ..models.journal import Journal from ..models.product import Product from ..models.stock_keeping_unit import StockKeepingUnit from ..models.voucher import Voucher -from ..models.voucher_type import VoucherType from ..schemas.user import UserToken from .issue import refresh_voucher @@ -47,14 +46,6 @@ def negative_batches(db: Session) -> List[schemas.BatchIntegrity]: .join(Inventory.voucher) .join(Voucher.journals) .where( - Voucher.voucher_type.in_( - [ - VoucherType.PURCHASE, - VoucherType.PURCHASE_RETURN, - VoucherType.ISSUE, - VoucherType.OPENING_BATCHES, - ] - ), Journal.cost_centre_id == CostCentre.cost_centre_purchase(), ) .group_by(Batch, Product.name) @@ -87,14 +78,6 @@ def batch_details(batch_id: uuid.UUID, db: Session) -> List[schemas.BatchIntegri .join(Voucher.journals) .where( Inventory.batch_id == batch_id, - Voucher.voucher_type.in_( - [ - VoucherType.PURCHASE, - VoucherType.PURCHASE_RETURN, - VoucherType.ISSUE, - VoucherType.OPENING_BATCHES, - ] - ), Journal.cost_centre_id == CostCentre.cost_centre_purchase(), ) ).all()