From e1c70fbfc904de092be167ba2cb26d83c8250289 Mon Sep 17 00:00:00 2001 From: Mohamed ABDELLANI Date: Thu, 19 Oct 2023 11:46:23 +0100 Subject: [PATCH] fix price per unit --- app/models/invoice/data_presenter/line_item.rb | 2 +- app/views/spree/admin/orders/_invoice_table4.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/invoice/data_presenter/line_item.rb b/app/models/invoice/data_presenter/line_item.rb index cbdec54a8b44..ea39bf6833bf 100644 --- a/app/models/invoice/data_presenter/line_item.rb +++ b/app/models/invoice/data_presenter/line_item.rb @@ -29,7 +29,7 @@ def display_amount_with_adjustments_and_with_taxes end def single_display_amount_with_adjustments - Spree::Money.new(price_with_adjustments, currency:) + Spree::Money.new(price_with_adjustments - (included_tax/quantity), currency:) end def display_line_items_taxes(display_zero: true) diff --git a/app/views/spree/admin/orders/_invoice_table4.html.haml b/app/views/spree/admin/orders/_invoice_table4.html.haml index e30b58d1054e..96673dee4dab 100644 --- a/app/views/spree/admin/orders/_invoice_table4.html.haml +++ b/app/views/spree/admin/orders/_invoice_table4.html.haml @@ -8,7 +8,7 @@ %th{:align => "right", :width => "15%"} %h5= t(:invoice_column_weight_volume) %th{:align => "right", :width => "15%"} - %h5= @order.has_taxes_included ? t(:invoice_column_unit_price_with_taxes) : t(:invoice_column_unit_price_without_taxes) + %h5= t(:invoice_column_price_per_unit_without_taxes) %th{:align => "right", :width => "15%"} %h5= t(:invoice_column_price_without_taxes) %th{:align => "right", :width => "15%"}