<%= @loan_application.product.name %> Application for <%= @loan_application.customers[0] %>

<%= notice %>

<% unless @loan_application.submitted? %> <%= form_with(model: @loan_application, local: true) do |form| %> <% if @loan_application.errors.any? %>

<%= pluralize(loan_application.errors.count, "error") %> prohibited this loan_application from being saved:

    <% @loan_application.errors.full_messages.each do |message| %>
  • <%= message %>
  • <% end %>
<% end %>
<%= form.label :tenor, "Select the Tenor You Wish to Apply For (Months)", :class=>"lead g-font-size-18--xs" %> <%= form.select :tenor, ["6","12","18","24","48","60"], {:prompt => "Select Tenor"}, class: "form-control" %>

Status

<%= @loan_application.status %>

<% if @loan_application.file.attached? %>

Attachment

<%= link_to(raw("") + " View Order/Invoice", @loan_application.file) %>

<% end %>
<%= link_to 'Amortisation Schedule', amortisation_schedule_loan_applications_path(id: @loan_application), remote: true, :class => "text-uppercase s-btn s-btn--md s-btn--primary-bg g-radius--50 g-padding-x-20--xs g-margin-b-20--xs" %>
<% end %> <% else %>
<% unless @loan_application.customer.nil? %>

Customer Name

<%= @loan_application.customer.customer_name %>

Contact Details

<%= "#{@loan_application.customer.mobile_1} - #{@loan_application.customer.mobile_2}" %>

Email Address

<%= "#{@loan_application.customer.email}" %>

<% end %>

Loan Amount

<%= number_to_currency(@loan_application.loan_amount, unit: "#{@loan_application.currency.symbol} ") %>

<% if @loan_application.approved? %> <% end %> <%= link_to 'Amortisation Schedule', amortisation_schedule_loan_applications_path(id: @loan_application), remote: true, :class => "text-uppercase s-btn s-btn--md s-btn--primary-bg g-radius--50 g-padding-y-20--xs g-margin-b-20--xs" %> | <%= link_to 'Print', print_loan_applications_path(appid: @loan_application.appid, :format => :pdf), :target => "_blank", :class => "text-uppercase s-btn s-btn--md s-btn--primary-bg g-radius--50 g-padding-x-50--xs g-margin-b-20--xs" %>
<% end %>
<% unless @loan_application.submitted? %>

Loan Amount

<%= number_to_currency(@loan_application.loan_amount, unit: "#{@loan_application.currency.symbol} ") %>

<% end %>

Instalment

<%= number_to_currency(@loan_application.instalment, unit: "#{@loan_application.currency.symbol} ") %>

Purpose of Loan

<%= @loan_application.loan_purpose %>

Pledged Security

<% unless @loan_application.pledged_securities.empty? %><%= "#{@loan_application.pledged_securities[0].security_type} - #{@loan_application.pledged_securities[0].description}" %><% else %>None<% end %>

<% if @loan_application.loan_application_logs.empty? %> <%= link_to 'Submit for Processing', email_loan_applications_path(id: @loan_application), :class => "text-uppercase s-btn s-btn--md s-btn--primary-bg g-radius--50 g-padding-x-50--xs g-margin-b-20--xs" %> <% end %>
<% unless @loan_application.loan_application_attachments.empty? %>

Attached Documents

<% @loan_application.loan_application_attachments.each_with_index do |attachment| %> <% end %>
<% if attachment.file.attached? %>

<%= link_to(raw("") + " #{attachment.requirement.description}", attachment.file, target: '_blank') %>

<% end %>
<% end %>