<commit_before>= pdf_stylesheet_pack_tag "mail"

%table{:width => "100%"}
  %tbody
    %tr{ valign: "top" }
      %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" }
        - if @order.distributor.business_address.blank?
          %strong= @order.distributor.name
          %br
          = @order.distributor.address.address_part1
          %br
          = @order.distributor.address.address_part2
          %br
          = @order.distributor.email_address
          - if @order.distributor.phone.present?
            %br
            = @order.distributor.phone
        - else 
          %strong= @order.distributor.business_address.company
          %br
          = @order.distributor.business_address.address_part1
          %br
          = @order.distributor.business_address.address_part2
          %br
          = @order.distributor.email_address
          - if @order.distributor.business_address.phone.present?
            %br
            = @order.distributor.business_address.phone
        - if @order.distributor.abn.present?
          %br
          = "#{t :abn} #{@order.distributor.abn}"
        - if @order.distributor.acn.present?
          %br
          = "#{t :acn} #{@order.distributor.acn}"
    %tr{ valign: "top" }
      %td{ :align => "left", colspan: 2 } &nbsp;
    %tr{ valign: "top" }
      %td{ :align => "left" }
        %br
        = t :invoice_issued_on
        = l Time.zone.now.to_date
        %br
        = t :date_of_transaction
        = l @order.completed_at.to_date
        %br
        = t :order_number
        = @order.number
      %td{ :align => "right" }
        = t :invoice_billing_address
        %br
        - if @order.bill_address
          %strong= @order.bill_address.full_name
        - if @order&.customer&.code.present?
          %br
          = "Code: #{@order.customer.code}"
        %br
        - if @order.bill_address
          = @order.bill_address.address_part1
        %br
        - if @order.bill_address
          = @order.bill_address.address_part2

= render 'spree/admin/orders/invoice_table2'

- if @order.special_instructions.present?
  %p.callout
    %strong<commit_msg>Display both phone number and email to the alternative invoice<commit_after>= pdf_stylesheet_pack_tag "mail"

%table{:width => "100%"}
  %tbody
    %tr{ valign: "top" }
      %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" }
        - if @order.distributor.business_address.blank?
          %strong= @order.distributor.name
          %br
          = @order.distributor.address.address_part1
          %br
          = @order.distributor.address.address_part2
          %br
          = @order.distributor.email_address
          - if @order.distributor.phone.present?
            %br
            = @order.distributor.phone
        - else 
          %strong= @order.distributor.business_address.company
          %br
          = @order.distributor.business_address.address_part1
          %br
          = @order.distributor.business_address.address_part2
          %br
          = @order.distributor.email_address
          - if @order.distributor.business_address.phone.present?
            %br
            = @order.distributor.business_address.phone
        - if @order.distributor.abn.present?
          %br
          = "#{t :abn} #{@order.distributor.abn}"
        - if @order.distributor.acn.present?
          %br
          = "#{t :acn} #{@order.distributor.acn}"
    %tr{ valign: "top" }
      %td{ :align => "left", colspan: 2 } &nbsp;
    %tr{ valign: "top" }
      %td{ :align => "left" }
        %br
        = t :invoice_issued_on
        = l Time.zone.now.to_date
        %br
        = t :date_of_transaction
        = l @order.completed_at.to_date
        %br
        = t :order_number
        = @order.number
      %td{ :align => "right" }
        = t :invoice_billing_address
        %br
        - if @order.bill_address
          %strong= @order.bill_address.full_name
        - if @order&.customer&.code.present?
          %br
          = "Code: #{@order.customer.code}"
        %br
        - if @order.bill_address
          = @order.bill_address.address_part1
        %br
        - if @order.bill_address
          = @order.bill_address.address_part2
        - if @order.bill_address.phone.present?
          %br
          = @order.bill_address.phone
        - if @order&.customer&.email.present?
          %br
          = @order.customer.email

= render 'spree/admin/orders/invoice_table2'

- if @order.special_instructions.present?
  %p.callout
    %strong
{'fraction_non_alphanumeric': 0.12895616276783958, 'fraction_numerical': 0.007470021623746805, 'mean_word_length': 1.8713318284424378, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7312658', 'n_tokens_mistral': 1719, 'n_tokens_neox': 1623, 'n_words': 280}