Printable Invoices Improvements for Food Connect

Adding cusotmer instructions, hiding tax column when not present, order cycle name appears at top of invoice and items are sorted by product name
This commit is contained in:
Rob Harrington
2015-12-11 09:07:13 +11:00
parent b7edf5e046
commit ae0ad73b4a
3 changed files with 33 additions and 16 deletions

View File

@@ -2,22 +2,22 @@
%thead
%tr
%th{:align => "left"}
%h4 Item
%h4= t(:invoice_column_item)
%th{:align => "right", :width => "15%"}
%h4 Qty
%h4= t(:invoice_column_qty)
%th{:align => "right", :width => "15%"}
%h4 GST
%h4= @order.total_tax > 0 ? t(:invoice_column_tax) : ""
%th{:align => "right", :width => "15%"}
%h4 Price
%h4= t(:invoice_column_price)
%tbody
- @order.line_items.each do |item|
- @order.line_items.sort_by{ |li| li.product.name }.each do |item|
%tr
%td
= render 'spree/shared/line_item_name', line_item: item
%td{:align => "right"}
= item.quantity
%td{:align => "right"}
= item.display_included_tax
= item.included_tax > 0 ? item.display_included_tax : ""
%td{:align => "right"}
= item.display_amount_with_adjustments
- checkout_adjustments_for(@order, exclude: [:line_item]).reject{ |a| a.amount == 0 }.reverse_each do |adjustment|
@@ -27,7 +27,7 @@
%td{:align => "right"}
1
%td{:align => "right"}
= adjustment.display_included_tax
= adjustment.included_tax > 0 ? adjustment.display_included_tax : ""
%td{:align => "right"}
= adjustment.display_amount
%tfoot

View File

@@ -3,17 +3,18 @@
%table{:width => "100%"}
%tbody
%tr{ valign: "top" }
%td{ :align => "left", colspan: 3 }
%h6= "Issued on: #{Time.zone.now.strftime("%F")}"
%tr{ valign: "top" }
%td{ :align => "left" }
%h4
- if @order.total_tax > 0
= "TAX"
= "INVOICE: "
= "TAX INVOICE: "
= "#{@order.number}"
%td{width: "10%" }
 
%td{ :align => "right" }
%h4= Time.zone.now.strftime("%F")
%h4= @order.order_cycle.name
%tr{ valign: "top" }
%td{ :align => "left" }
%strong= "From: #{@order.distributor.name}"
@@ -38,4 +39,14 @@
= "#{@order.bill_address.phone}"
= render 'spree/admin/orders/invoice_table'
- if @order.special_instructions.present?
%p.callout
%strong
= t :customer_instructions
%p
%em= @order.special_instructions
%p
 
= render 'spree/order_mailer/payment'

View File

@@ -24,6 +24,12 @@ en:
confirm_send_invoice: "An invoice for this order will be sent to the customer. Are you sure you want to continue?"
must_have_valid_business_number: "%{enterprise_name} must have a valid ABN before invoices can be sent."
# Printable Invoice Columns
invoice_column_item: "Item"
invoice_column_qty: "Qty"
invoice_column_tax: "GST"
invoice_column_price: "Price"
logo: "Logo (640x130)"
logo_mobile: "Mobile logo (75x26)"
logo_mobile_svg: "Mobile logo (SVG)"
@@ -344,19 +350,19 @@ See the %{link} to find out more about %{sitename}'s features and to start using
login_invalid: "Invalid email or password"
modal_hubs: "Food Hubs"
modal_hubs_abstract: Our food hubs are the point of contact between you and the people who make your food!
modal_hubs_content1: You can search for a convenient hub by location or name. Some hubs have multiple points where you can pick-up your purchases, and some will also provide delivery options. Each food hub is a sales point with independent business operations and logistics - so variations between hubs are to be expected.
modal_hubs_abstract: Our food hubs are the point of contact between you and the people who make your food!
modal_hubs_content1: You can search for a convenient hub by location or name. Some hubs have multiple points where you can pick-up your purchases, and some will also provide delivery options. Each food hub is a sales point with independent business operations and logistics - so variations between hubs are to be expected.
modal_hubs_content2: You can only shop at one food hub at a time.
modal_groups: "Groups / Regions"
modal_groups_content1: These are the organisations and relationships between hubs which make up the Open Food Network.
modal_groups_content2: Some groups are clustered by location or council, others by non-geographic similarities.
modal_groups_content1: These are the organisations and relationships between hubs which make up the Open Food Network.
modal_groups_content2: Some groups are clustered by location or council, others by non-geographic similarities.
modal_how: "How it works"
modal_how_shop: Shop the Open Food Network
modal_how_shop_explained: Search for a food hub near you to start shopping! You can expand each food hub to see what kinds of goodies are available, and click through to start shopping. (You can only shop one food hub at a time.)
modal_how_pickup: Pick-ups, delivery & shipping costs
modal_how_pickup_explained: Some food hubs deliver to your door, while others require you to pick-up your purchases. You can see which options are available on the homepage, and select which you'd like at the shopping and check-out pages. Delivery will cost more, and pricing differs from hub-to-hub. Each food hub is a sales point with independent business operations and logisitics - so variations between hubs are to be expected.
modal_how_pickup_explained: Some food hubs deliver to your door, while others require you to pick-up your purchases. You can see which options are available on the homepage, and select which you'd like at the shopping and check-out pages. Delivery will cost more, and pricing differs from hub-to-hub. Each food hub is a sales point with independent business operations and logisitics - so variations between hubs are to be expected.
modal_how_more: Learn more
modal_how_more_explained: "If you want to learn more about the Open Food Network, how it works, and get involved, check out:"