Fixed: Batch date check was wrong and was causing and error.
This commit is contained in:
parent
5afe7ddd73
commit
68a41da5bf
@ -41,8 +41,8 @@ def issue_create_inventory(voucher, item, batch_consumed):
|
|||||||
raise ValidationError("Quantity of {0} cannot be zero".format(item.product.name))
|
raise ValidationError("Quantity of {0} cannot be zero".format(item.product.name))
|
||||||
if batch_consumed == True and quantity > batch.quantity_remaining:
|
if batch_consumed == True and quantity > batch.quantity_remaining:
|
||||||
raise ValidationError("Quantity available is {0} only".format(batch.quantity_remaining))
|
raise ValidationError("Quantity available is {0} only".format(batch.quantity_remaining))
|
||||||
if batch.name < voucher.date:
|
if batch.name > voucher.date:
|
||||||
raise ValidationError("Batch of {0} was purchased after the issue date".format(item.product.name))
|
raise ValidationError("Batch of {0} was purchased after the issue date".format(batch.product.name))
|
||||||
if batch_consumed is None:
|
if batch_consumed is None:
|
||||||
pass
|
pass
|
||||||
elif batch_consumed:
|
elif batch_consumed:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user