Skip to content

Commit

Permalink
Close #2055 Fix invoice calculation (#2056)
Browse files Browse the repository at this point in the history
  • Loading branch information
Regene27 authored Nov 13, 2024
1 parent faf961d commit f739fd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/spree/billing/shared/_invoice.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
@previous_order = @customer.orders[@current_order - 1] if @current_order && @current_order > 0
@outstanding_amount = Spree::Money.new(@previous_order&.outstanding_balance, currency: @invoice.order.line_items.first.variant.currency).to_s
if @customer.user.store_credits.present?
@current_credit = @customer.user.store_credits.last.amount.to_d - (@customer.user.store_credits.last.amount_used * @invoice.order.total).to_d
@current_credit = @customer.user.store_credits.last.amount.to_d - @customer.user.store_credits.last.amount_used.to_d
@display_current_credit = Spree::Money.new(@current_credit, currency: @invoice.order.line_items.first.variant.currency).to_s
@display_amount_due = if @current_credit >= @total_price
Spree::Money.new(0, currency: @invoice.order.line_items.first.variant.currency).to_s
Expand Down

0 comments on commit f739fd0

Please sign in to comment.