#payments_jquery_start #all_index_admin_jquery_start .container .row .col-lg-12.col-md-12.col-sm-12.col-xs-12 %button#toTop{:title => "Go to top"} ⌅ %h3.text-center Auto Payments .col-lg-3.col-md-3.col-sm-12.col-xs-12 =render 'layouts/admin/side_menu' .col-lg-9.col-md-9.col-sm-12.col-xs-12 .row = form_tag admin_auto_payments_path, :method => 'get', :id => "form-search-in", :class => '' do .col-lg-4.col-md-4.col-sm-12.col-xs-12 .filter-admin-searcher = text_field_tag 'date_from', params[:date_from], placeholder: t('date_from').mb_chars.downcase+' (only if paid/error)', class: 'date-from-all form-control padding-form-request ', title: t('date_from').mb_chars.downcase .filter-admin-searcher = text_field_tag 'date_to', params[:date_to], placeholder: t('date_to').mb_chars.downcase+' (only if paid/error)', class: 'date-from-all form-control padding-form-request ', title: t('date_to').mb_chars.downcase .filter-admin-searcher = text_field_tag :order_loc, params[:order_loc], placeholder: "nº", :class => 'form-control padding-form-admin' .col-lg-2.col-md-2.col-sm-12.col-xs-12 .filter-admin-searcher - if params[:paid] == 'paiderror' .right-align-text = t('paid_error')+':' = radio_button_tag 'paid', 'paiderror', checked = true .right-align-text = t('paid')+':' = radio_button_tag 'paid', 'paid' .right-align-text = t('all')+':' = radio_button_tag 'paid', '' - elsif params[:paid] == 'paid' .right-align-text = t('paid_error')+':' = radio_button_tag 'paid', 'paiderror' .right-align-text = t('paid')+':' = radio_button_tag 'paid', 'paid', checked = true .right-align-text = t('all')+':' = radio_button_tag 'paid', '' - elsif params[:paid] == '' .right-align-text = t('paid_error')+':' = radio_button_tag 'paid', 'paiderror' .right-align-text = t('paid')+':' = radio_button_tag 'paid', 'paid' .right-align-text = t('all')+':' = radio_button_tag 'paid', '', checked = true - else .right-align-text = t('paid_error')+':' = radio_button_tag 'paid', 'paiderror', checked = true .right-align-text = t('paid')+':' = radio_button_tag 'paid', 'paid' .right-align-text = t('all')+':' = radio_button_tag 'paid', '' .col-lg-2.col-md-2.col-sm-12.col-xs-12 .filter-admin-searcher - if params[:show] == 'all' .right-align-text = t('full_list')+':' = radio_button_tag 'show', 'all', checked = true .right-align-text = t('last_10')+':' = radio_button_tag 'show', 'last' - elsif params[:show] == 'last' .right-align-text = t('full_list')+':' = radio_button_tag 'show', 'all' .right-align-text = t('last_10')+':' = radio_button_tag 'show', 'last', checked = true - else .right-align-text = t('full_list')+':' = radio_button_tag 'show', 'all' .right-align-text = t('last_10')+':' = radio_button_tag 'show', 'last', checked = true .col-lg-2.col-md-2.col-sm-12.col-xs-12 .filter-admin-searcher %button.btn.btn-block.btn-primary-search.btn-primary.search-btn-x{:type => "submit", :class => 'padding-form', :title => t('search')} .fas.fa-search %table.table.table-bordered.table-hover{:width => "825", :style => "table-layout: fixed; width: 100%;"} %thead %tr %th Title %th{:width => "110", :style => "width: 110px;"} Price %th{:width => "170", :style => "width: 170px;"} Status - Date %tbody - @admin_auto_payments.each do |auto_payment| - if auto_payment.cod_response == nil %tr.tr-waiting %td = "(" + auto_payment.ap_type.capitalize + ")" = auto_payment.title %br %em.order_loc_payments_n = " nº: " + auto_payment.order_loc.to_s + " " %br = link_to 'Show', admin_auto_payments_path + "/" + auto_payment.id.to_s, class: 'btn btn-primary' /= link_to 'Edit', edit_admin_auto_payment_path(auto_payment), class: 'btn btn-warning' = link_to 'Destroy', admin_auto_payments_path + "/" + auto_payment.id.to_s, :method => :delete, :data => { confirm: 'Are you sure?' }, class: 'btn btn-danger' %td - if auto_payment.n_days - if auto_payment.n_days > 0 and auto_payment.n_days != nil and auto_payment.n_days != "" = number_to_currency(((auto_payment.price.to_f * auto_payment.n_days.to_i)/100 * auto_payment.iva.to_f/100 + (auto_payment.price.to_f * auto_payment.n_days.to_i)/100) * auto_payment.payment_fee.to_f/100 + ((auto_payment.price.to_f * auto_payment.n_days.to_i)/100 * auto_payment.iva.to_f/100 + (auto_payment.price.to_f * auto_payment.n_days.to_i)/100), precision: 2, separator: ",", delimiter: ".") - else = number_to_currency((auto_payment.price.to_f/100 * auto_payment.iva.to_f/100 + auto_payment.price.to_f/100) * auto_payment.payment_fee.to_f/100 + (auto_payment.price.to_f/100 * auto_payment.iva.to_f/100 + auto_payment.price.to_f/100), precision: 2, separator: ",", delimiter: ".") - else = number_to_currency((auto_payment.price.to_f/100 * auto_payment.iva.to_f/100 + auto_payment.price.to_f/100) * auto_payment.payment_fee.to_f/100 + (auto_payment.price.to_f/100 * auto_payment.iva.to_f/100 + auto_payment.price.to_f/100), precision: 2, separator: ",", delimiter: ".") %td= 'Waiting...' - else - if auto_payment.cod_response >= 0 and auto_payment.cod_response <= 99 %tr.tr-paid %td = "(" + auto_payment.ap_type.capitalize + ")" = auto_payment.title %br %em.order_loc_payments_n = " nº: " + auto_payment.order_loc.to_s + " " %br = link_to 'Show', admin_auto_payments_path + "/" + auto_payment.id.to_s, class: 'btn btn-primary' /= link_to 'Edit', edit_admin_auto_payment_path(auto_payment), class: 'btn btn-warning' %button.btn.btn-danger{:disabled => "disabled", :type => "button"} Destroy = " " %span.link-invoice-pdf %a{:href => invoice_auto_pay_path(auto_payment), :target => "_blank"} invoice = " / " %a{:href => invoice_auto_pay_path(auto_payment) + ".pdf", :target => "_blank"} invoice(PDF) %td - if auto_payment.n_days - if auto_payment.n_days > 0 and auto_payment.n_days != nil and auto_payment.n_days != "" = number_to_currency(((auto_payment.price.to_f * auto_payment.n_days.to_i)/100 * auto_payment.iva.to_f/100 + (auto_payment.price.to_f * auto_payment.n_days.to_i)/100) * auto_payment.payment_fee.to_f/100 + ((auto_payment.price.to_f * auto_payment.n_days.to_i)/100 * auto_payment.iva.to_f/100 + (auto_payment.price.to_f * auto_payment.n_days.to_i)/100), precision: 2, separator: ",", delimiter: ".") - else = number_to_currency((auto_payment.price.to_f/100 * auto_payment.iva.to_f/100 + auto_payment.price.to_f/100) * auto_payment.payment_fee.to_f/100 + (auto_payment.price.to_f/100 * auto_payment.iva.to_f/100 + auto_payment.price.to_f/100), precision: 2, separator: ",", delimiter: ".") - else = number_to_currency((auto_payment.price.to_f/100 * auto_payment.iva.to_f/100 + auto_payment.price.to_f/100) * auto_payment.payment_fee.to_f/100 + (auto_payment.price.to_f/100 * auto_payment.iva.to_f/100 + auto_payment.price.to_f/100), precision: 2, separator: ",", delimiter: ".") %td = 'Paid' %br = auto_payment.date_paid_ap.to_datetime.strftime("%d/%m/%Y - %H:%M") - else %tr.tr-error %td = "(" + auto_payment.ap_type.capitalize + ")" = auto_payment.title %br %em.order_loc_payments_n = " nº: " + auto_payment.order_loc.to_s + " " %br = link_to 'Show', admin_auto_payments_path + "/" + auto_payment.id.to_s, class: 'btn btn-primary' /= link_to 'Edit', edit_admin_auto_payment_path(auto_payment), class: 'btn btn-warning' %button.btn.btn-danger{:disabled => "disabled", :type => "button"} Destroy %td - if auto_payment.n_days - if auto_payment.n_days > 0 and auto_payment.n_days != nil and auto_payment.n_days != "" = number_to_currency(((auto_payment.price.to_f * auto_payment.n_days.to_i)/100 * auto_payment.iva.to_f/100 + (auto_payment.price.to_f * auto_payment.n_days.to_i)/100) * auto_payment.payment_fee.to_f/100 + ((auto_payment.price.to_f * auto_payment.n_days.to_i)/100 * auto_payment.iva.to_f/100 + (auto_payment.price.to_f * auto_payment.n_days.to_i)/100), precision: 2, separator: ",", delimiter: ".") - else = number_to_currency((auto_payment.price.to_f/100 * auto_payment.iva.to_f/100 + auto_payment.price.to_f/100) * auto_payment.payment_fee.to_f/100 + (auto_payment.price.to_f/100 * auto_payment.iva.to_f/100 + auto_payment.price.to_f/100), precision: 2, separator: ",", delimiter: ".") - else = number_to_currency((auto_payment.price.to_f/100 * auto_payment.iva.to_f/100 + auto_payment.price.to_f/100) * auto_payment.payment_fee.to_f/100 + (auto_payment.price.to_f/100 * auto_payment.iva.to_f/100 + auto_payment.price.to_f/100), precision: 2, separator: ",", delimiter: ".") %td = "Error("+auto_payment.cod_response.to_s+")" %br = auto_payment.date_paid_ap.to_datetime.strftime("%d/%m/%Y - %H:%M") %br