Remove registrar routes

This commit is contained in:
Thiago Youssef 2022-09-04 17:51:47 -03:00
parent 70d8c5bad3
commit 56f41b00bf
2 changed files with 153 additions and 96 deletions

View file

@ -19,11 +19,159 @@
= render 'shared/full_errors', object: @invoice
.row
.col-md-6= render 'registrar/invoices/partials/details'
.col-md-6
%h4= t(:details)
%hr
%dl.dl-horizontal
%dt= t(:issue_date)
%dd= l @invoice.issue_date
- if @invoice.cancelled?
%dt= Invoice.human_attribute_name :cancelled_at
%dd= l @invoice.cancelled_at
%dt= t(:due_date)
- if @invoice.cancelled?
%dd.text-grey= t(:cancelled)
- else
%dd= l @invoice.due_date
%dt= Invoice.human_attribute_name :receipt_date
- if @invoice.paid?
%dd= l @invoice.receipt_date
- elsif @invoice.cancelled?
%dd.text-grey= t(:cancelled)
- else
%dd{class: 'text-danger'}= t(:unpaid)
%dt= t(:payment_term)
%dd Prepayment
%dt= t(:invoice_number)
%dd= @invoice.number
- if @invoice.description.present?
%dt= t(:description)
%dd=@invoice.description
%dt= Invoice.human_attribute_name :reference_no
%dd= @invoice.reference_no
.row
.col-md-6= render 'registrar/invoices/partials/seller'
.col-md-6= render 'registrar/invoices/partials/buyer'
.col-md-6
%h4= t(:seller)
%hr
%dl.dl-horizontal
%dt= t(:name)
%dd= @invoice.seller_name
%dt= Registrar.human_attribute_name :reg_no
%dd= @invoice.seller_reg_no
%dt= t(:iban)
%dd= @invoice.seller_iban
%dt= t(:bank)
%dd= @invoice.seller_bank
%dt= t(:swift)
%dd= @invoice.seller_swift
%dt= Registrar.human_attribute_name :vat_no
%dd= @invoice.seller_vat_no
%dt= t(:address)
%dd= @invoice.seller_address
%dt= t(:country)
%dd= @invoice.seller_country
%dt= t(:phone)
%dd= @invoice.seller_phone
%dt= t(:url)
%dd= @invoice.seller_url
%dt= t(:email)
%dd= @invoice.seller_email
%dt= t(:issuer)
%dd= @invoice.seller_contact_name
.col-md-6
%h4= t(:buyer)
%hr
%dl.dl-horizontal
%dt= t(:name)
%dd= @invoice.buyer_name
%dt= t(:reg_no)
%dd= @invoice.buyer_reg_no
%dt= t(:address)
%dd= @invoice.buyer_address
%dt= t(:country)
%dd= @invoice.buyer_country
%dt= t(:phone)
%dd= @invoice.buyer_phone
%dt= t(:url)
%dd= @invoice.buyer_url
%dt= t(:email)
%dd= @invoice.buyer_email
.row
.col-md-12= render 'registrar/invoices/partials/items'
.col-md-12
%h4= t(:items)
%hr
.table-responsive
%table.table.table-hover.table-condensed
%thead
%tr
%th{class: 'col-xs-4'}= t(:description)
%th{class: 'col-xs-2'}= t(:unit)
%th{class: 'col-xs-2'}= InvoiceItem.human_attribute_name :quantity
%th{class: 'col-xs-2'}= t(:price)
%th{class: 'col-xs-2'}= t(:total)
%tbody
- @invoice.each do |invoice_item|
%tr
%td= invoice_item.description
%td= invoice_item.unit
%td= invoice_item.quantity
%td= currency(invoice_item.price)
%td= currency(invoice_item.item_sum_without_vat)
%tfoot
%tr
%th{colspan: 3}
%th= Invoice.human_attribute_name :subtotal
%td= number_to_currency @invoice.subtotal
%tr
%th.no-border{colspan: 3}
%th= "VAT #{number_to_percentage(@invoice.vat_rate, precision: 1)}"
%td= number_to_currency @invoice.vat_amount
%tr
%th.no-border{colspan: 3}
%th= t(:total)
%td= number_to_currency @invoice.total
.row
.col-md-12= render 'registrar/invoices/partials/payment_orders'
.col-md-12
%h4= "Payment Orders"
%hr
.table-responsive
%table.table.table-hover.table-condensed
%thead
%tr
%th{class: 'col-xs-1'}= "#"
%th{class: 'col-xs-1'}= "Channel"
%th{class: 'col-xs-2'}= "Status"
%th{class: 'col-xs-3'}= "Initiated"
%th{class: 'col-xs-4'}= "Notes"
%tbody
- @invoice.payment_orders.each do |payment_order|
%tr
%td= payment_order.id
%td= payment_order.channel
%td= payment_order.status
%td= payment_order.created_at
%td= payment_order.notes