mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Slight adjustments to invoice layout
1. Hide tax column when no tax included in the order 2. Save a little bit of space in the header by sharing rows
This commit is contained in:
@@ -9,8 +9,9 @@
|
||||
%h5= @order.has_taxes_included ? t(:invoice_column_unit_price_with_taxes) : t(:invoice_column_unit_price_without_taxes)
|
||||
%th{:align => "right", :width => "15%"}
|
||||
%h5= @order.has_taxes_included ? t(:invoice_column_price_with_taxes) : t(:invoice_column_price_without_taxes)
|
||||
%th{:align => "right", :width => "15%"}
|
||||
%h5= @order.total_tax > 0 ? t(:invoice_column_tax_rate) : ""
|
||||
- if @order.total_tax > 0
|
||||
%th{:align => "right", :width => "15%"}
|
||||
%h5= t(:invoice_column_tax_rate)
|
||||
%tbody
|
||||
- @order.line_items.sort_by{ |li| li.product.name }.each do |item|
|
||||
%tr
|
||||
@@ -22,8 +23,9 @@
|
||||
= item.single_display_amount_with_adjustments
|
||||
%td{:align => "right"}
|
||||
= item.display_amount_with_adjustments
|
||||
%td{:align => "right"}
|
||||
= display_line_item_tax_rates(item)
|
||||
- if @order.total_tax > 0
|
||||
%td{:align => "right"}
|
||||
= display_line_item_tax_rates(item)
|
||||
- checkout_adjustments_for(@order, exclude: [:line_item]).reject{ |a| a.amount == 0 }.reverse_each do |adjustment|
|
||||
%tr
|
||||
%td
|
||||
|
||||
@@ -3,11 +3,14 @@
|
||||
%table{:width => "100%"}
|
||||
%tbody
|
||||
%tr{ valign: "top" }
|
||||
%td{ :align => "left", colspan: 3 }
|
||||
%td{ :align => "left" }
|
||||
%h4
|
||||
= t(:tax_invoice)
|
||||
- if @order.distributor.display_invoice_logo? && @order.distributor.logo.present?
|
||||
%td{ :align => "right", rowspan: 2 }
|
||||
= wicked_pdf_image_tag @order.distributor.logo(:small), width: 150, height: 150
|
||||
%tr{ valign: "top" }
|
||||
%td{ :align => "left", colspan: 2 }
|
||||
%td{ :align => "left" }
|
||||
%strong= @order.distributor.name
|
||||
%br
|
||||
= @order.distributor.address.address_part1
|
||||
@@ -24,21 +27,10 @@
|
||||
- if @order.distributor.acn.present?
|
||||
%br
|
||||
= "#{t :acn} #{@order.distributor.acn}"
|
||||
- if @order.distributor.display_invoice_logo? && @order.distributor.logo.present?
|
||||
%td{ :align => "right" }
|
||||
= wicked_pdf_image_tag @order.distributor.logo(:small)
|
||||
%tr{ valign: "top" }
|
||||
%td{ :align => "right", colspan: 3 }
|
||||
%strong= @order.ship_address.full_name
|
||||
- if @order.customer.code.present?
|
||||
%br
|
||||
= "Code: #{@order.customer.code}"
|
||||
%br
|
||||
= @order.ship_address.address_part1
|
||||
%br
|
||||
= @order.ship_address.address_part2
|
||||
%td{ :align => "left", colspan: 2 }
|
||||
%tr{ valign: "top" }
|
||||
%td{ :align => "left", colspan: 3 }
|
||||
%td{ :align => "left" }
|
||||
= t :invoice_issued_on
|
||||
= l Time.zone.now.to_date
|
||||
%br
|
||||
@@ -47,6 +39,15 @@
|
||||
%br
|
||||
= t :order_number
|
||||
= @order.number
|
||||
%td{ :align => "right" }
|
||||
%strong= @order.ship_address.full_name
|
||||
- if @order.customer.code.present?
|
||||
%br
|
||||
= "Code: #{@order.customer.code}"
|
||||
%br
|
||||
= @order.ship_address.address_part1
|
||||
%br
|
||||
= @order.ship_address.address_part2
|
||||
|
||||
= render 'spree/admin/orders/invoice_table'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user