Fixed: Issue batch update failed because of wrong date check.
This commit is contained in:
@ -117,7 +117,7 @@ def issue_update_inventory(voucher, newInventories, batch_consumed):
|
|||||||
if batch_consumed == True and new_quantity - old_quantity > quantity_remaining:
|
if batch_consumed == True and new_quantity - old_quantity > quantity_remaining:
|
||||||
raise ValidationError("Maximum quantity available for {0} is {1}".format(item.product.full_name,
|
raise ValidationError("Maximum quantity available for {0} is {1}".format(item.product.full_name,
|
||||||
old_quantity + quantity_remaining))
|
old_quantity + quantity_remaining))
|
||||||
if item.batch.name < voucher.date:
|
if item.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(item.product.name))
|
||||||
|
|
||||||
if batch_consumed is None:
|
if batch_consumed is None:
|
||||||
|
|||||||
Reference in New Issue
Block a user