From 6a46041074724f3c57b426c8675e4d43edb2a128 Mon Sep 17 00:00:00 2001 From: Martin Lensment Date: Wed, 22 Apr 2015 09:57:45 +0300 Subject: [PATCH] Fix pdf issues --- app/views/registrar/invoices/pdf.haml | 60 +++++++++++++----- config/locales/en.yml | 1 + .../images => public}/eis-logo-black-et.png | Bin 3 files changed, 45 insertions(+), 16 deletions(-) rename {app/assets/images => public}/eis-logo-black-et.png (100%) diff --git a/app/views/registrar/invoices/pdf.haml b/app/views/registrar/invoices/pdf.haml index d0e346517..64c576458 100644 --- a/app/views/registrar/invoices/pdf.haml +++ b/app/views/registrar/invoices/pdf.haml @@ -107,24 +107,43 @@ margin-top: 50px; } + #header { + position: relative; + min-height: 100px; + } + + img { + width: 106px; + height: 102px; + } + + #header-content { + position: absolute; + bottom: 0; + } + #footer { position: absolute; bottom: 0px; width: 99%; } + + h1 { + margin-bottom: 5px; + } /%style{type:"text/css"} / = Rails.application.assets.find_asset('shared/pdf').to_s / = stylesheet_link_tag 'shared/pdf', media: 'all' / = stylesheet_link_tag 'shared/pdf', media: 'all' %body .container - .row + #header.row .col-sm-6.left - %h1 - = t(:invoice_no, no: @invoice.id) + #header-content + %h1 + = t(:invoice_no, no: @invoice.id) .col-sm-6.right - %h1 - = image_tag('eis-logo-black-et.png') + %img{src: "#{Rails.root}/public/eis-logo-black-et.png"} .clear %hr .row @@ -145,6 +164,9 @@ - else %dd{class: 'text-danger'}= t('unpaid') + %dt= t('issuer') + %dd= @invoice.seller_contact_name + %dt= t('payment_term') %dd= t(@invoice.payment_term) @@ -154,8 +176,9 @@ %dt= t('reference_no') %dd= @invoice.reference_no + .col-md-6.right - %h4= t('buyer') + %h4= t('client') %hr %dl.dl-horizontal %dt= t('name') @@ -164,20 +187,25 @@ %dt= t('reg_no') %dd= @invoice.buyer_reg_no - %dt= t('address') - %dd= @invoice.buyer_address + - if @invoice.buyer_address.present? + %dt= t('address') + %dd= @invoice.buyer_address - %dt= t('country') - %dd= @invoice.buyer_country + - if @invoice.buyer_country.present? + %dt= t('country') + %dd= @invoice.buyer_country - %dt= t('phone') - %dd= @invoice.buyer_phone + - if @invoice.buyer_phone.present? + %dt= t('phone') + %dd= @invoice.buyer_phone - %dt= t('url') - %dd= @invoice.buyer_url + - if @invoice.buyer_phone.present? + %dt= t('url') + %dd= @invoice.buyer_url - %dt= t('email') - %dd= @invoice.buyer_email + - if @invoice.buyer_email.present? + %dt= t('email') + %dd= @invoice.buyer_email / = render 'registrar/invoices/partials/details' diff --git a/config/locales/en.yml b/config/locales/en.yml index f2a90afdb..f1c0c4415 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -728,3 +728,4 @@ en: back_to_invoice: 'Back to invoice' invoice_forwared: 'Invoice forwarded' failed_to_forward_invoice: 'Failed to forward invoice' + client: 'Client' diff --git a/app/assets/images/eis-logo-black-et.png b/public/eis-logo-black-et.png similarity index 100% rename from app/assets/images/eis-logo-black-et.png rename to public/eis-logo-black-et.png