Do not show negative remainder when there are no purchases

This commit is contained in:
Rohan Mitchell
2015-07-24 17:42:23 +10:00
parent 54fd298e3a
commit 21a9681205

View File

@@ -50,7 +50,8 @@ module OpenFoodNetwork::Reports
end
def remainder(lis)
total_available(lis) - max_quantity_amount(lis)
remainder = total_available(lis) - max_quantity_amount(lis)
remainder >= 0 ? remainder : ''
end
def max_quantity_amount(lis)