- vat_mode = ::Dorsale::BillingMachine.vat_mode - document_type = document.class.to_s.split("::").last.downcase.to_sym #billing_machine-show h1 = document.t - if document.tracking_id.present? = " n° " = document.tracking_id - if document_type == :invoice .label class="invoice #{document.payment_status}" = document.t("payment_status.#{document.payment_status}") - if document_type == :quotation .label class="quotation #{quotation_state_classes(document)}" = document.t("state.#{document.state}") .row .col-md-6 .well = info document, :label .col-md-6 .well = info document, :date hr - if document.customer.present? = document.customer.name br - if document.customer.address.street.present? = document.customer.address.street br - if document.customer.address.street_bis.present? = document.customer.address.street_bis br - if document.customer.address.zip.present? || document.customer.address.city.present? = document.customer.address.zip = " " = document.customer.address.city - if document.customer.address.country.present? = document.customer.address.country table#lines-table thead tr th.line-label = Dorsale::BillingMachine::InvoiceLine.t(:label) th.line-quantity = Dorsale::BillingMachine::InvoiceLine.t(:quantity) th.line-unit = Dorsale::BillingMachine::InvoiceLine.t(:unit) - if vat_mode == :multiple th.line-vat_rate = Dorsale::BillingMachine::InvoiceLine.t(:vat_rate) th.line-unit_price = Dorsale::BillingMachine::InvoiceLine.t(:unit_price) th.line-total = Dorsale::BillingMachine::InvoiceLine.t(:total) tbody - document.lines.each do |line| = render "dorsale/billing_machine/invoices/line_details", line: line .row .col-sm-6 .well = info document, :payment_term br - if document_type == :invoice = info document, :due_date - if document_type == :quotation = info document, :expires_at br - if document.comments.present? = info document, :comments, text2html(document.comments), separator: " :
" br .col-sm-6 table#totals-table tbody - if document.commercial_discount.nonzero? tr th.commercial_discount-label = document.class.t(:commercial_discount) td.commercial_discount = " - #{bm_currency document.commercial_discount}" tr th.total_excluding_taxes-label = document.class.t(:total_excluding_taxes) td.total_excluding_taxes = bm_currency document.total_excluding_taxes - if vat_mode == :single tr th.vat_rate-label = document.class.t(:vat_rate) td.vat_rate = percentage document.vat_rate tr th.vat_amount-label = document.class.t(:vat_amount) td.vat_amount = bm_currency document.vat_amount tr th.total_including_taxes-label = document.class.t(:total_including_taxes) td.total_including_taxes = bm_currency document.total_including_taxes - if document.respond_to?(:advance) - document.advance.present? tr th.advance-label = document.class.t(:advance) td.advance = bm_currency document.advance tr th.balance-label = document.class.t(:balance) td.balance = bm_currency document.balance - if document_type == :quotation .attachments-panel = attachments_for(document)