.row
  .alpha.three.columns
    = f.label :abn, t('.abn')
  .omega.eight.columns
    = f.text_field :abn, { placeholder: t('.abn_placeholder') }

.row
  .alpha.three.columns
    = f.label :acn, t('.acn')
  .omega.eight.columns
    = f.text_field :acn, { placeholder: t('.acn_placeholder') }

.row
  .three.columns.alpha
    %label= t('charges_sales_tax')
  .two.columns
    = f.radio_button :charges_sales_tax, true
    &nbsp;
    = f.label :charges_sales_tax, t(:say_yes), value: 'true'
  .five.columns.omega
    = f.radio_button :charges_sales_tax, false
    &nbsp;
    = f.label :charges_sales_tax, t(:say_no), value: 'false'
.row
  .alpha.three.columns
    = f.label :display_invoice_logo, t('.display_invoice_logo')
  .omega.eight.columns
    = f.check_box :display_invoice_logo
.row
  .alpha.three.columns
    = f.label :invoice_text, t('.invoice_text')
  .omega.eight.columns
    = f.text_area :invoice_text, style: "width: 100%; height: 100px;"
.row{ data: { controller: 'terms-and-conditions', "terms-and-conditions-message-value": t('js.admin.enterprises.form.images.immediate_terms_and_conditions_removal_warning') } }
  .alpha.three.columns
    = f.label :terms_and_conditions, t('.terms_and_conditions')
    %i.text-big.icon-question-sign{ "data-controller": "help-modal-link", "data-action": "click->help-modal-link#open", "data-help-modal-link-target-value": "terms_and_conditions_info_modal" }

  .omega.eight.columns#terms_and_conditions{data: { 'reflex-root': '#terms_and_conditions' } }
    - if @enterprise.terms_and_conditions.attached?
      = link_to "#{@enterprise.terms_and_conditions.blob.filename} #{ t('.uploaded_on') } #{@enterprise.terms_and_conditions.blob.created_at}", url_for(@enterprise.terms_and_conditions), target: '_blank'
      %div
        %a.icon-trash{ href: '#', data: {  action: 'click->terms-and-conditions#remove', "terms-and-conditions-message-value": t('js.admin.enterprises.form.images.immediate_terms_and_conditions_removal_warning'), 'enterprise-id': @enterprise.id}}
          = t('.remove_terms_and_conditions')
    .pad-top
    %div
      .button.small{ data: { controller: 'help-modal-link', action: 'click->help-modal-link#open', "help-modal-link-target-value": "terms_and_conditions_warning_modal" } }
        = t('.upload')
      %span{ data: { "terms-and-conditions-target": "filename" } }
      = f.file_field :terms_and_conditions, accept: 'application/pdf', style: 'display: none;', data: { "terms-and-conditions-target": "fileinput" }

  = render HelpModalComponent.new(id: "terms_and_conditions_warning_modal", close_button: false ) do
    %div
      .margin-bottom-30.text-center
        .text-big{ style: 'color: red'}
          = t('js.admin.modals.terms_and_conditions_warning.title')
      .margin-bottom-30
        %p
          = t('js.admin.modals.terms_and_conditions_warning.message_1')
      .margin-bottom-30
        %p
          = t('js.admin.modals.terms_and_conditions_warning.message_2')

      .text-center
        %input.button.red{ type: 'button', value: t('js.admin.modals.close'), "data-action": "click->help-modal#close"}
        %input.button.red{ type: 'button', value: t('js.admin.modals.continue'), "data-action": "click->help-modal#close click->terms-and-conditions#add" }


= f.fields_for :business_address, @enterprise.business_address || @enterprise.build_business_address do |bf|
  %fieldset.alpha.no-border-bottom
    %legend= t('.business_address_legend')
    = render 'admin/enterprises/form/business_address', bf: bf

  .row{"data-controller": "updateinput"}
    = bf.hidden_field :_destroy, {"data-updateinput-target": "input"}
    = f.submit t(".reset_form"), {class: 'secondary', "data-action": "click->updateinput#update", "data-updateinput-value": "true"}

.row
  %fieldset.alpha.no-border-bottom
    %legend= t('.invoice_item_sorting_legend')
  .three.columns.alpha
    %label= t('.sort_items_by_supplier?')
    = render partial: 'admin/shared/whats_this_tooltip', locals: {tooltip_text: t('.sort_items_by_supplier_tip')}
  .three.columns
    = f.radio_button :preferred_invoice_order_by_supplier, true
    = f.label :preffered_invoice_order_by_supplier, t('.enabled'), value: :true
  .five.columns.omega
    = f.radio_button :preferred_invoice_order_by_supplier, false
    = f.label :preferred_invoice_order_by_name, t('.disabled'), value: :false

= render HelpModalComponent.new(id: "terms_and_conditions_info_modal") do
  .margin-bottom-30.text-center
    .text-big
      = t('js.admin.modals.terms_and_conditions_info.title')
  .margin-bottom-30
    %p
      = t('js.admin.modals.terms_and_conditions_info.message_1')
  .margin-bottom-30
    %p
      = t('js.admin.modals.terms_and_conditions_info.message_2')
