diff --git a/app/views/templates/invoices/v4/_default_fee_with_groups.slim b/app/views/templates/invoices/v4/_default_fee_with_groups.slim new file mode 100644 index 00000000000..6f55345f632 --- /dev/null +++ b/app/views/templates/invoices/v4/_default_fee_with_groups.slim @@ -0,0 +1,13 @@ +tr + td + .body-1 = self.invoice_name + ' • ' + self.group_name + - if self.billable_metric.weighted_sum_agg? + .body-3 = I18n.t('invoice.units_prorated_per_period', period: IntervalHelper.interval_name(self.subscription.plan.interval)) + - if self.charge.percentage? + .body-3 = I18n.t('invoice.total_events', count: self.events_count) + - if self.charge.prorated? + .body-3 = I18n.t('invoice.fee_prorated') + td.body-2 = self.units + td.body-2 = MoneyHelper.format_with_precision(self.precise_unit_amount, self.unit_amount.currency) + td.body-2 == TaxHelper.applied_taxes(self) + td.body-2 = MoneyHelper.format(self.amount) diff --git a/app/views/templates/invoices/v4/_subscription_details.slim b/app/views/templates/invoices/v4/_subscription_details.slim index 8d8a0446b9e..3af1001a762 100644 --- a/app/views/templates/invoices/v4/_subscription_details.slim +++ b/app/views/templates/invoices/v4/_subscription_details.slim @@ -42,7 +42,7 @@ - if fees.all? { |f| f.group_id? } && fees.sum(&:units) > 0 - fees.select { |f| f.units.positive? }.each do |fee| - if fee.amount_details.blank? - == SlimHelper.render('templates/invoices/v4/_default_fee', fees) + == SlimHelper.render('templates/invoices/v4/_default_fee_with_groups', fee) - else == SlimHelper.render('templates/invoices/v4/_fee_with_groups', fee)