Pdf improvements

This commit is contained in:
Martin Lensment 2015-04-21 13:21:30 +03:00
parent 727d1226ad
commit ad1f915114

View file

@ -6,6 +6,7 @@
margin: auto; margin: auto;
font-size: 12px; font-size: 12px;
} }
.col-md-12 { .col-md-12 {
} }
@ -23,6 +24,11 @@
width: 16%; width: 16%;
} }
.col-md-3 {
width: 24%;
display: inline-block;
}
.left { .left {
float: left; float: left;
} }
@ -35,6 +41,10 @@
float: right; float: right;
} }
.text-right {
text-align: right;
}
dt { dt {
float: left; float: left;
width: 100px; width: 100px;
@ -55,13 +65,14 @@
table { table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
font-size: 12px;
} }
th { th {
text-align: left; text-align: left;
border: 0px; border: 0px;
border-top: 1px solid #DDD; border-top: 1px solid #DDD;
padding: 10px; padding: 6px;
} }
thead th { thead th {
@ -74,7 +85,7 @@
} }
td { td {
padding: 10px; padding: 6px;
} }
.no-border { .no-border {
@ -84,8 +95,8 @@
hr { hr {
height: 1px; height: 1px;
border: 0; border: 0;
color: #333; color: #DDD;
background-color: #C4C4C4; background-color: #DDD;
} }
.clear { .clear {
@ -95,6 +106,12 @@
.pull-down { .pull-down {
margin-top: 50px; margin-top: 50px;
} }
#footer {
position: absolute;
bottom: 0px;
width: 99%;
}
/%style{type:"text/css"} /%style{type:"text/css"}
/ = Rails.application.assets.find_asset('shared/pdf').to_s / = Rails.application.assets.find_asset('shared/pdf').to_s
/ = stylesheet_link_tag 'shared/pdf', media: 'all' / = stylesheet_link_tag 'shared/pdf', media: 'all'
@ -102,11 +119,14 @@
%body %body
.container .container
.row .row
.col-md-12.text-right .col-sm-6.left
= image_tag('eis-logo-black-et.png') %h1
.row = t(:invoice_no, no: @invoice.id)
.col-md-12 .col-sm-6.right
= render 'shared/title', name: t(:invoice_no, no: @invoice.id) %h1
= image_tag('eis-logo-black-et.png')
.clear
%hr
.row .row
.col-md-6.left .col-md-6.left
%h4 %h4
@ -165,12 +185,45 @@
/ .col-md-6= render 'registrar/invoices/partials/buyer' / .col-md-6= render 'registrar/invoices/partials/buyer'
.clear .clear
.row.pull-down .row.pull-down
.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-1'}= t('amount')
%th{class: 'col-xs-3'}= t('price')
%th{class: 'col-xs-2'}= t('total')
%tbody
- @invoice.items.each do |x|
%tr
%td= t(x.description)
%td= x.unit
%td= x.amount
%td= x.price
%td= "#{x.item_sum_without_vat} #{@invoice.currency}"
%tfoot
%tr
%th{colspan: 3}
%th= t('total_without_vat')
%td= "#{@invoice.sum_without_vat} #{@invoice.currency}"
%tr
%th.no-border{colspan: 3}
%th= t('vat', vat_prc: (@invoice.vat_prc * 100).round)
%td= "#{@invoice.vat} #{@invoice.currency}"
%tr
%th.no-border{colspan: 3}
%th= t('total')
%td= "#{@invoice.sum} #{@invoice.currency}"
#footer #footer
%hr %hr
.row .row
.col-md-3 .col-md-3.left
= @invoice.seller_name = @invoice.seller_name
%br %br
= @invoice.seller_address = @invoice.seller_address
@ -181,21 +234,21 @@
%br %br
= "#{t('vat_no')} #{@invoice.seller_vat_no}" = "#{t('vat_no')} #{@invoice.seller_vat_no}"
.col-md-3 .col-md-3.left
= @invoice.seller_phone = @invoice.seller_phone
%br %br
= @invoice.seller_email = @invoice.seller_email
%br %br
= @invoice.seller_url = @invoice.seller_url
.col-md-3.text-right .col-md-3.text-right.left
= t('bank') = t('bank')
%br %br
= t('iban') = t('iban')
%br %br
= t('swift') = t('swift')
.col-md-3 .col-md-3.left
= @invoice.seller_bank = @invoice.seller_bank
%br %br
= @invoice.seller_iban = @invoice.seller_iban