From 68a41da5bfc71f98199479865b64de9271fa2d27 Mon Sep 17 00:00:00 2001 From: Tanshu Date: Fri, 4 Oct 2013 17:05:58 +0530 Subject: [PATCH] Fixed: Batch date check was wrong and was causing and error. --- brewman/brewman/views/services/voucher/issue.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/brewman/brewman/views/services/voucher/issue.py b/brewman/brewman/views/services/voucher/issue.py index e4f88483..c091f53e 100644 --- a/brewman/brewman/views/services/voucher/issue.py +++ b/brewman/brewman/views/services/voucher/issue.py @@ -41,8 +41,8 @@ def issue_create_inventory(voucher, item, batch_consumed): raise ValidationError("Quantity of {0} cannot be zero".format(item.product.name)) if batch_consumed == True and quantity > batch.quantity_remaining: raise ValidationError("Quantity available is {0} only".format(batch.quantity_remaining)) - if batch.name < voucher.date: - raise ValidationError("Batch of {0} was purchased after the issue date".format(item.product.name)) + if batch.name > voucher.date: + raise ValidationError("Batch of {0} was purchased after the issue date".format(batch.product.name)) if batch_consumed is None: pass elif batch_consumed: