Modified views for monthly invoices

This commit is contained in:
Sergei Tsõganov 2022-08-23 09:20:39 +03:00
parent 72022aab8d
commit a21e5c1954
4 changed files with 49 additions and 6 deletions

View file

@ -6,10 +6,9 @@ module Registrar::BookKeeping
included do
scope :with_cash_accounts, (lambda do
joins(:accounts)
.where('accounts.account_type = ? AND test_registrar != ?',
Account::CASH,
true)
joins(:accounts).where('accounts.account_type = ? AND test_registrar != ?',
Account::CASH,
true)
end)
end

View file

@ -25,6 +25,9 @@
.col-md-6= render 'registrar/invoices/partials/seller'
.col-md-6= render 'registrar/invoices/partials/buyer'
.row
.col-md-12= render 'registrar/invoices/partials/items'
- if @invoice.monthly_invoice
.col-md-12= render 'registrar/invoices/partials/monthly_invoice_items'
- else
.col-md-12= render 'registrar/invoices/partials/items'
.row
.col-md-12= render 'registrar/invoices/partials/payment_orders'

View file

@ -0,0 +1,38 @@
%h4= t(:items)
%hr
.table-responsive
%table.table.table-hover.table-condensed
%thead
%tr
%th{class: 'col-xs-1'}= t(:code)
%th{class: 'col-xs-1'}= InvoiceItem.human_attribute_name :quantity
%th{class: 'col-xs-1'}= t(:unit)
%th{class: 'col-xs-5'}= t(:description)
%th{class: 'col-xs-2'}= t(:price)
%th{class: 'col-xs-2'}= t(:total)
%tbody
- @invoice.each do |invoice_item|
%tr
%td= invoice_item.product_id
%td= invoice_item.quantity
%td= invoice_item.unit
%td= invoice_item.description
- if invoice_item.price && invoice_item.quantity
%td= currency(invoice_item.price)
%td= "#{currency((invoice_item.price * invoice_item.quantity).round(3))} #{@invoice.currency}"
- else
%td= ''
%td= ''
%tfoot
%tr
%th{colspan: 4}
%th= Invoice.human_attribute_name :subtotal
%td= number_to_currency(0)
%tr
%th.no-border{colspan: 4}
%th= "VAT #{number_to_percentage(@invoice.vat_rate, precision: 1)}"
%td= number_to_currency(0)
%tr
%th.no-border{colspan: 4}
%th= t(:total)
%td= number_to_currency(0)

View file

@ -13,7 +13,10 @@
.col-md-6= render 'registrar/invoices/partials/seller'
.col-md-6= render 'registrar/invoices/partials/buyer'
.row
.col-md-12= render 'registrar/invoices/partials/items'
- if @invoice.monthly_invoice
.col-md-12= render 'registrar/invoices/partials/monthly_invoice_items'
- else
.col-md-12= render 'registrar/invoices/partials/items'
- if @invoice.payable?
.row.semifooter