<% if @order.amount.present? and @order.vat_percentage.present? %> <%= t("user_mailer.order.#{@current_state}_with_amount_and_vat.body", order_id: @order.id, date: l(@order.created_at.to_time, format: :long), total: (number_to_currency(@order.total) unless @order.total.blank?), amount: (number_to_currency(@order.amount) unless @order.amount.blank?), vat_percentage: (number_to_percentage(@order.vat_percentage) unless @order.vat_percentage.blank?), vat_amount: (number_to_currency(@order.vat_amount) unless @order.vat_amount.blank?), product: @order.description_with_comment, name: @user.name, address: @order.address) %> <% elsif @order.amount.present? %> <%= t("user_mailer.order.#{@current_state}_with_amount.body", order_id: @order.id, date: l(@order.created_at.to_time, format: :long), total: (number_to_currency(@order.total) unless @order.total.blank?), amount: (number_to_currency(@order.amount) unless @order.amount.blank?), product: @order.description_with_comment, name: @user.name, address: @order.address) %> <% else %> <%= t("user_mailer.order.#{@current_state}.body", order_id: @order.id, date: l(@order.created_at.to_time, format: :long), product: @order.description_with_comment, name: @user.name, address: @order.address) %> <% end %>