diff --git a/text_interface/addstock.py b/text_interface/addstock.py index 213c75d..e463644 100644 --- a/text_interface/addstock.py +++ b/text_interface/addstock.py @@ -107,7 +107,7 @@ much money you're due in credits for the purchase when prompted.\n''' old_price = product.price old_hidden = product.hidden product.price = int(ceil(float(value) / (max(product.stock, 0) + self.products[product][0]))) - product.stock += self.products[product][0] + product.stock = max(self.products[product][0], product.stock + self.products[product][0]) product.hidden = False print "New stock for %s: %d" % (product.name, product.stock), \ ("- New price: " + str(product.price) if old_price != product.price else ""), \