diff --git a/app/services/invoice_renderer.rb b/app/services/invoice_renderer.rb index cdf249eaa313..09ec3776b8a5 100644 --- a/app/services/invoice_renderer.rb +++ b/app/services/invoice_renderer.rb @@ -27,7 +27,7 @@ def args(order, user = @user) def invoice_template if OpenFoodNetwork::FeatureToggle.enabled?(:invoices, @user) - invoice_presenter_template + invoice_template_v3 elsif Spree::Config.invoice_style2? "spree/admin/orders/invoice2" else @@ -35,11 +35,7 @@ def invoice_template end end - def invoice_presenter_template - if Spree::Config.invoice_style2? - "spree/admin/orders/invoice4" - else - "spree/admin/orders/invoice3" - end + def invoice_template_v3 + "spree/admin/orders/invoice4" end end diff --git a/app/views/spree/admin/orders/_invoice_table3.html.haml b/app/views/spree/admin/orders/_invoice_table3.html.haml deleted file mode 100644 index 299539d96474..000000000000 --- a/app/views/spree/admin/orders/_invoice_table3.html.haml +++ /dev/null @@ -1,55 +0,0 @@ -%table.order-summary{:width => "100%"} - %thead - %tr - %th{:align => "left"} - %h4= t(:invoice_column_item) - %th{:align => "right", :width => "15%"} - %h4= t(:invoice_column_qty) - %th{:align => "right", :width => "15%"} - %h4= @order.total_tax > 0 ? t(:invoice_column_tax) : "" - %th{:align => "right", :width => "15%"} - %h4= t(:invoice_column_price) - %tbody - - @order.sorted_line_items.each do |item| - %tr - %td - = render 'spree/admin/orders/_invoice/line_item_name', line_item: item - %br - %small - %em= raw(item.variant.product.supplier.name) - %td{:align => "right"} - = item.quantity - %td{:align => "right"} - = item.display_line_items_taxes - %td{:align => "right"} - = item.display_amount_with_adjustments - - - @order.checkout_adjustments(exclude: [:line_item]).reverse_each do |adjustment| - - taxable = adjustment.adjustable_type == "Spree::Shipment" ? adjustment.adjustable : adjustment - %tr - %td - %strong= "#{raw(adjustment.label)}" - %td{:align => "right"} - 1 - %td{:align => "right"} - = taxable.display_taxes - %td{:align => "right"} - = adjustment.display_amount - %tfoot - %tr - %td{:align => "right", :colspan => "2"} - %strong= t(:invoice_tax_total) - %td{:align => "right", :colspan => "2"} - %strong= @order.display_checkout_tax_total - %tr - %td{:align => "right", :colspan => "2"} - %strong= t(:total_excl_tax) - %td{:align => "right", :colspan => "2"} - %strong= @order.display_checkout_total_less_tax - %tr - %td{:align => "right", :colspan => "2"} - %strong= t(:total_incl_tax) - %td{:align => "right", :colspan => "2"} - %strong= @order.display_total -%p -   diff --git a/app/views/spree/admin/orders/invoice3.html.haml b/app/views/spree/admin/orders/invoice3.html.haml deleted file mode 100644 index 0bfee26822c9..000000000000 --- a/app/views/spree/admin/orders/invoice3.html.haml +++ /dev/null @@ -1,91 +0,0 @@ -= pdf_stylesheet_pack_tag "mail" - -%table{:width => "100%"} - %tbody - %tr{ valign: "top" } - %td{ :align => "left", colspan: 3 } - %h6 - = "#{t('spree.admin.orders.invoice.issued_on')}: " - = l @order.invoice_date - %tr{ valign: "top" } - %td{ :align => "left", colspan: 3 } - %h6 - = "#{t('spree.admin.orders.invoice.order_number')}: " - = @order.number - %tr{ valign: "top" } - %td{ :align => "left", colspan: 3 } - %h6 - = "#{t('spree.admin.orders.invoice.invoice_number')}: " - = @order.invoice_number - %tr{ valign: "top" } - %td{ :align => "left" } - %h4 - = "#{t('spree.admin.orders.invoice.tax_invoice')}" - %td{width: "10%" } -   - %td{ :align => "right" } - %h4= @order.order_cycle.name - %tr{ valign: "top" } - %td{ align: "left", colspan: 3 } - - if @order.distributor.business_address.blank? - %strong= "#{t('spree.admin.orders.invoice.from')}: #{@order.distributor.name}" - - else - %strong= "#{t('spree.admin.orders.invoice.from')}: #{@order.distributor.business_address.company}" - - if @order.distributor.abn.present? - %br - = "#{t(:abn)} #{@order.distributor.abn}" - %br - - if @order.distributor.business_address.blank? - = @order.distributor.address.full_address - - else - = @order.distributor.business_address.full_address - %br - = @order.distributor.contact.email - %tr{ valign: "top" } - %td{ colspan: 3 } -   - %tr{ valign: "top" } - %td{ align: "left" } - %strong= "#{t('spree.admin.orders.invoice.to')}:" - %br - - if @order.bill_address - = @order.bill_address.full_name - - if @order.customer.code.present? - %br - = "#{t('spree.admin.orders.invoice.code')}: #{@order.customer.code}" - %br - - if @order.bill_address - = @order.bill_address.full_address - %br - - if @order.customer.email.present? - = "#{@order.customer.email}," - - if @order.bill_address - = "#{@order.bill_address.phone}" - %td -   - %td{ align: "left", style: "border-left: .1em solid black; padding-left: 1em" } - %strong= "#{t('spree.admin.orders.invoice.shipping')}: #{@order.shipping_method.name}" - - if @order.shipping_method.require_ship_address - %br - = @order.ship_address.full_name - %br - = @order.ship_address.full_address - %br - = @order.ship_address.phone - - if @order.special_instructions.present? - %br - %br - %strong= t :customer_instructions - = @order.special_instructions - - -= render 'spree/admin/orders/invoice_table3' - -- if @order.distributor.invoice_text.present? - %p - = @order.distributor.invoice_text - -= render 'spree/admin/orders/_invoice/payment' - -- if @order.note.present? - = render partial: 'spree/admin/orders/_invoice/order_note'