Merge pull request #11668 from drummer83/master

Don't show credit owed when = 0 in order confirmation
This commit is contained in:
Filipe
2023-10-18 12:16:54 +01:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -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

View File

@@ -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"}