Browse Source

Add customer and invoice detail on invoice print page

pull/3/head
Nafies Luthfi 8 years ago
parent
commit
fd8a87da8b
  1. 2
      public/assets/css/app.css
  2. 35
      resources/views/invoices/pdf.blade.php

2
public/assets/css/app.css

@ -18,4 +18,4 @@
* By Nafies Luthfi
* Code licensed under the Apache License v2.0.
* For details, see http://www.apache.org/licenses/LICENSE-2.0.
*/ol,ul{margin-bottom:0;padding-left:20px}.breadcrumb{margin-top:15px}.login-panel{margin-top:10vh}.checkbox,.radio{margin-top:0;margin-bottom:0}h1.page-header{margin:20px 0}.bold{font-weight:700}.sidebar-logo{width:80px;margin:auto}.nav>li>a{padding:6px 10px;border-color:#eee #eee #ddd}.navbar-right>li>a{padding:15px}.navbar-brand{float:none;border-bottom:1px solid #e7e7e7;display:block;height:auto;padding:10px}label.control-label{color:#428bca}.well .pagination{margin:-2px 0 0 -2px}.panel .lead,.panel .table,div.notifier{margin-bottom:0}@media (min-width:768px){#page-wrapper{margin-left:200px;padding:0;position:relative}nav.hidden-md{display:none}#page-wrapper.page-no-sidebar{margin-left:0}.sidebar{margin-top:0;width:200px;box-shadow:none}.index-search-form{width:50%}}.form-error{color:#d9534f}div.notifier{border-radius:0;position:absolute;left:0;right:0}#footer{padding:15px 10px}#map-canvas-0{min-height:400px}h1.site-tilte{font-size:30px}h3.site-description{font-size:16px;font-weight:400;margin:0}.guest-header{padding:0 10px}@media (max-width:480px){.guest-header{text-align:center}}.nav .nav-second-level li.active{text-decoration:none}.form-control{height:30px;padding:3px 6px}@media print{#page-wrapper{margin-left:0}}
*/ol,ul{margin-bottom:0;padding-left:20px}.breadcrumb{margin-top:15px}.login-panel{margin-top:10vh}.checkbox,.radio{margin-top:0;margin-bottom:0}h1.page-header{margin:20px 0}.bold{font-weight:700}.sidebar-logo{width:80px;margin:auto}.nav>li>a{padding:6px 10px;border-color:#eee #eee #ddd}.navbar-right>li>a{padding:15px}.navbar-brand{float:none;border-bottom:1px solid #e7e7e7;display:block;height:auto;padding:10px}label.control-label{color:#428bca}.well .pagination{margin:-2px 0 0 -2px}.panel .lead,.panel .table,div.notifier{margin-bottom:0}@media (min-width:768px){#page-wrapper{margin-left:200px;padding:0;position:relative}nav.hidden-md{display:none}#page-wrapper.page-no-sidebar{margin-left:0}.sidebar{margin-top:0;width:200px;box-shadow:none}.index-search-form{width:50%}}.form-error{color:#d9534f}div.notifier{border-radius:0;position:absolute;left:0;right:0}#footer{padding:15px 10px}#map-canvas-0{min-height:400px}h1.site-tilte{font-size:30px}h3.site-description{font-size:16px;font-weight:400;margin:0}.guest-header{padding:0 10px}@media (max-width:480px){.guest-header{text-align:center}}.nav .nav-second-level li.active{text-decoration:none}.form-control{height:30px;padding:3px 6px}@media print{#page-wrapper{margin-left:0}}.strong{font-weight:bold}

35
resources/views/invoices/pdf.blade.php

@ -7,6 +7,9 @@
html {
margin: 10px 20px 0px 20px;
}
p {
margin: 10px 0px;
}
table.receipt-table {
/*border: 1px solid #aaa;*/
border-collapse: collapse;
@ -61,12 +64,33 @@
</td>
</tr>
<tr>
<td colspan="3">
<td colspan="2">
<h4 style="margin: 3px 0;">{{ trans('app.to') }} :</h4>
<p><strong>{{ $invoice->project->customer->name }}</strong></p>
@php
$customer = $invoice->project->customer;
@endphp
<p><strong>{{ $customer->name }}</strong></p>
@if ($customer->address)
<p style="max-width: 250px">{!! nl2br($customer->address) !!}</p>
@endif
@if ($customer->phone)
<p>{{ trans('contact.phone') }} : {{ $customer->phone }}</p>
@endif
@if ($customer->website)
<p>{{ $customer->website }}</p>
@endif
@if ($customer->pic)
<p><strong>UP. {{ $customer->pic }}</strong></p>
@endif
</td>
<td class="text-center text-top">
@if ($invoice->due_date)
<h4 style="margin: 30px 3px 0;">{{ trans('invoice.due_date') }}</h4>
<p>{{ dateId($invoice->due_date) }}</p>
@endif
</td>
</tr>
<tr><td colspan="3">{{ trans('project.jobs') }} :</td></tr>
<tr><td colspan="3">{{ trans('invoice.items') }} :</td></tr>
<tr>
<td colspan="3">
<table border="1" class="receipt-table" style="width: 100%">
@ -101,6 +125,11 @@
{{ ucwords(Terbilang::make($invoice->amount)) }} Rupiah
</td>
</tr>
<tr style="vertical-align: top;">
<td colspan="3">
<p style="font-style: italic;"><strong>Catatan</strong> : {!! nl2br($invoice->notes) !!}</p>
</td>
</tr>
{{-- TODO : Add dynamic bank account based on agency bank account. --}}
<tr style="vertical-align: top;">
<td colspan="3">

Loading…
Cancel
Save