Merge pull request #5561 from coopdevs/defend-from-invoice-without-bill-address

Do not print the bill addr. name when there's none
This commit is contained in:
Pau Pérez Fabregat
2020-07-01 17:50:09 +02:00
committed by GitHub
2 changed files with 12 additions and 6 deletions

View File

@@ -33,16 +33,19 @@
%td{ align: "left" }
%strong= "#{t('.to')}:"
%br
= @order.bill_address.full_name
- if @order.bill_address
= @order.bill_address.full_name
- if @order.andand.customer.andand.code.present?
%br
= "#{t('.code')}: #{@order.customer.code}"
%br
= @order.bill_address.full_address
- if @order.bill_address
= @order.bill_address.full_address
%br
- if @order.andand.customer.andand.email.present?
= "#{@order.customer.email},"
= "#{@order.bill_address.phone}"
- if @order.bill_address
= "#{@order.bill_address.phone}"
%td
 
%td{ align: "left", style: "border-left: .1em solid black; padding-left: 1em" }

View File

@@ -44,14 +44,17 @@
%td{ :align => "right" }
= t :invoice_billing_address
%br
%strong= @order.bill_address.full_name
- if @order.bill_address
%strong= @order.bill_address.full_name
- if @order.andand.customer.andand.code.present?
%br
= "Code: #{@order.customer.code}"
%br
= @order.bill_address.address_part1
- if @order.bill_address
= @order.bill_address.address_part1
%br
= @order.bill_address.address_part2
- if @order.bill_address
= @order.bill_address.address_part2
= render 'spree/admin/orders/invoice_table2'