mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
Merge pull request #11668 from drummer83/master
Don't show credit owed when = 0 in order confirmation
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"}
|
||||
|
||||
Reference in New Issue
Block a user