update the adjustments rows

This commit is contained in:
Mohamed ABDELLANI
2023-10-19 11:28:19 +01:00
parent 716cf3e522
commit c1ed8ed67c
2 changed files with 12 additions and 6 deletions

View File

@@ -12,8 +12,12 @@ class Invoice
:included_tax_total
invoice_update_attributes :label
def display_amount
Spree::Money.new(amount, currency:)
def display_amount_with_taxes
Spree::Money.new(amount + additional_tax_total, currency:)
end
def display_amount_without_taxes
Spree::Money.new(amount - included_tax_total, currency:)
end
def display_taxes(display_zero: false)

View File

@@ -43,10 +43,12 @@
%td{:align => "right"}
%td{:align => "right"}
%td{:align => "right"}
= adjustment.display_amount
- if @order.total_tax > 0
%td{:align => "right"}
= adjustment.display_adjustment_tax_rates
%td{:align => "right"}
= adjustment.display_amount_without_taxes
%td{:align => "right"}
= adjustment.display_adjustment_tax_rates
%td{:align => "right"}
= adjustment.display_amount_with_taxes
%tfoot
%tr
%td{:align => "right", :colspan => "5"}