Skip to content

Commit 0328e6c

Browse files
committed
fix: invoice header footer
1 parent 2555f64 commit 0328e6c

File tree

2 files changed

+44
-17
lines changed

2 files changed

+44
-17
lines changed

resources/views/backend/invoice/edit-invoice.blade.php

+14-1
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,16 @@
132132
@method('PATCH')
133133
<div>
134134
<div class="row">
135+
@isset($basic->header_image)
135136
<div class="d-flex border my-5 justify-content-center">
136137
<img style="object-fit: cover; max-width:1240px;height:250px;"
137138
src="{{ asset('storage/' . app('setting')->basic->header_image) }}" alt="">
138139
</div>
140+
@else
141+
<div class="p-5 text-center">
142+
No Header Image found
143+
</div>
144+
@endisset
139145
</div>
140146
<div class="row">
141147
<div class="col-sm-4 col-md-3">
@@ -202,10 +208,17 @@
202208

203209
</div>
204210
<div class="row">
205-
<div class="d-flex border my-5 justify-content-center">
211+
@isset(app('setting')->basic->footer_image)
212+
<div class="d-flex border my-2 justify-content-center">
206213
<img style="object-fit: cover; max-width:1240px;height:250px;"
207214
src="{{ asset('storage/' . app('setting')->basic->footer_image) }}" alt="">
208215
</div>
216+
217+
@else
218+
<div class="p-5 text-center">
219+
No Footer Image found
220+
</div>
221+
@endisset
209222
</div>
210223

211224
<button id="submit-btn" type="submit"

resources/views/backend/invoice/viewOne.blade.php

+30-16
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,18 @@
130130
<button class="btn btn-primary waves-effect waves-light m-2 d-print-none d-block" id="cmd">Print</button>
131131
</div>
132132
<div>
133-
<div class="row">
134-
<div class="d-flex border my-2 justify-content-center">
135-
<img style="object-fit: cover; max-width:1240px;height:250px;" src="{{asset('storage/'.app('setting')->basic->header_image)}}" alt="">
136-
</div>
133+
<div class="row">
134+
@isset($basic->header_image)
135+
<div class="d-flex border my-5 justify-content-center">
136+
<img style="object-fit: cover; max-width:1240px;height:250px;"
137+
src="{{ asset('storage/' . app('setting')->basic->header_image) }}" alt="">
137138
</div>
139+
@else
140+
<div class="p-5 text-center">
141+
No Header Image found
142+
</div>
143+
@endisset
144+
</div>
138145
<div class="row table-col">
139146
<div class="col-sm-4 col-md-3 table-cell">
140147
<div class="pe-2 mb-2">
@@ -191,12 +198,7 @@
191198
</div>
192199
@php
193200
$color = 'dark';
194-
switch (
195-
$invoice
196-
->fiscalYears()
197-
->where('year', $year)
198-
->first()->pivot->status
199-
) {
201+
switch ($invoice->fiscalYears()->where('year', $year)->first()->pivot->status) {
200202
case 'sent':
201203
$color = '#1abc9c';
202204
break;
@@ -209,7 +211,7 @@
209211
case 'overdue':
210212
$color = '#f1556c';
211213
break;
212-
214+
213215
default:
214216
# code...
215217
break;
@@ -413,9 +415,17 @@
413415
</div>
414416
</div>
415417
<div class="row">
418+
@isset(app('setting')->basic->footer_image)
416419
<div class="d-flex border my-2 justify-content-center">
417-
<img style="object-fit: cover; max-width:1240px;height:250px;" src="{{asset('storage/'.app('setting')->basic->footer_image)}}" alt="">
420+
<img style="object-fit: cover; max-width:1240px;height:250px;"
421+
src="{{ asset('storage/' . app('setting')->basic->footer_image) }}" alt="">
418422
</div>
423+
424+
@else
425+
<div class="p-5 text-center">
426+
No Footer Image found
427+
</div>
428+
@endisset
419429
</div>
420430

421431

@@ -425,16 +435,20 @@
425435
@if (session()->has('print'))
426436
@push('customJs')
427437
<script>
428-
$(document).ready(function () {
429-
window.print()
430-
});
438+
$(document).ready(function() {
439+
setTimeout(() => {
440+
window.print()
441+
}, 3000);
442+
});
431443
</script>
432444
@endpush
433445
@endif
434446
@push('customJs')
435447
<script>
436448
$('#cmd').on('click', function() {
437-
window.print()
449+
setTimeout(() => {
450+
window.print()
451+
}, 3000);
438452
})
439453
</script>
440454
@endpush

0 commit comments

Comments
 (0)