Adds consideration for discounts in invoice total and patches issue in ProductApi controller not properly synching variants with options in some cases.