From c1ed8ed67cb9b49b14416f69e2d7abef0eeb400f Mon Sep 17 00:00:00 2001 From: Mohamed ABDELLANI Date: Thu, 19 Oct 2023 11:28:19 +0100 Subject: [PATCH] update the adjustments rows --- app/models/invoice/data_presenter/adjustment.rb | 8 ++++++-- app/views/spree/admin/orders/_invoice_table4.html.haml | 10 ++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/models/invoice/data_presenter/adjustment.rb b/app/models/invoice/data_presenter/adjustment.rb index 1ac58e8467..e8be1b536a 100644 --- a/app/models/invoice/data_presenter/adjustment.rb +++ b/app/models/invoice/data_presenter/adjustment.rb @@ -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) diff --git a/app/views/spree/admin/orders/_invoice_table4.html.haml b/app/views/spree/admin/orders/_invoice_table4.html.haml index 7cbff8b35b..e30b58d105 100644 --- a/app/views/spree/admin/orders/_invoice_table4.html.haml +++ b/app/views/spree/admin/orders/_invoice_table4.html.haml @@ -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"}