diff --git a/app/models/order_balance.rb b/app/models/order_balance.rb index 1e09940808..4940bf18c9 100644 --- a/app/models/order_balance.rb +++ b/app/models/order_balance.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class OrderBalance - delegate :zero?, :abs, :to_s, :to_f, :to_d, :<, :>, to: :amount + delegate :negative?, :positive?, :zero?, :abs, :to_s, :to_f, :to_d, :<, :>, to: :amount def initialize(order) @order = order diff --git a/app/views/spree/orders/_totals_footer.html.haml b/app/views/spree/orders/_totals_footer.html.haml index 8cdb778fec..7319869eb9 100644 --- a/app/views/spree/orders/_totals_footer.html.haml +++ b/app/views/spree/orders/_totals_footer.html.haml @@ -32,7 +32,7 @@ %td.text-right.total %strong = order.display_payment_total.to_html - - if order.outstanding_balance? && order.outstanding_balance > 0 + - if order.outstanding_balance.positive? %tr.total %td.text-right{colspan: "3"} %h5.not-paid @@ -40,7 +40,7 @@ %td.text-right.total.not-paid %h5.not-paid = order.display_outstanding_balance.to_html - - else + - if order.outstanding_balance.negative? %tr.total %td.text-right{colspan: "3"} %h5 @@ -49,7 +49,7 @@ %h5 = order.display_outstanding_balance.to_html - - if order.total_tax > 0 + - if order.total_tax.positive? #tax %tr#tax-row.total %td.text-right{colspan: "3"}