-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprint_single_invoice_data_in_page.php
174 lines (152 loc) · 8.35 KB
/
print_single_invoice_data_in_page.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
// image show \
<img src="data:image/png;base64,{{ base64_encode(file_get_contents(public_path('assets/images/logo.png'))) }}"
style="width:100px; height:100px;">
@extends('backend/layouts/master')
@section('content')
<script>
function printMedicineInvc() {
var divContents = document.getElementById("MedicineInvoicePrint").innerHTML;
var head = document.getElementById("head").innerHTML;
var scrpt = document.getElementById("scrpt").innerHTML;
var a = window.open('', '', 'height=3508, width=2480');
a.document.write(head);
a.document.write('<body>');
//a.document.write('<body > <h1>Div contents are <br>');
a.document.write(divContents);
a.document.write(scrpt);
a.document.write('</body></html>');
a.document.close();
a.print();
}
</script>
<div id="head">
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<title>Checkout Invoice </title>
</head>
</div>
<body>
<div class="content">
<div class="row">
<div class="col-sm-5 col-5">
<h4 class="page-title">Medicine Invoice View</h4>
</div>
<div class="col-sm-7 col-7 text-right m-b-30">
<a href="{{ route('medicineinvoice.create') }}" class="btn btn-primary btn-rounded"><i
class="fa fa-plus"></i> Create Medicine Invoice
</a>
<a href="{{ route('medicineinvoice.index') }}" class="btn btn-primary btn-rounded"><i
class="fa fa-eye"></i> View Medicine Invoice
</a>
<input class="btn btn-danger btn-rounded" type="button" value="Print Invoice"
onclick="printMedicineInvc()">
</div>
</div>
<div id="MedicineInvoicePrint" class="row">
<div class="col-md-12 mx-5 my-5 ">
<div class="card-box" id="">
<h4 class="payslip-title">Medicine Invoice</h4>
<div class="row mr-5">
<table>
<tr>
<td>
<div class=" ">
<img src="{{ asset('backend/img/logo.png') }}" class="inv-logo bg-primary"
alt="">
<ul class="list-unstyled mb-0">
<li>Islam Diagnostic Center</li>
<li>1425, Motijheel, B/A, Dhaka</li>
<li>yearulislamonem@gmail.com</li>
<li>01825682260</li>
</ul>
</div>
</td>
<td></td>
<td></td>
<td>
<div class="invoice-details">
<h5 class="text-uppercase">Receipt No: <br>
{{ $ShowMedicineInvoice->med_invoice_REF_NO }}
</h5>
<ul class="list-unstyled">
<li>Invoice Date:
<span>{{ $ShowMedicineInvoice->med_invoice_date }}</span>
</li>
<li>
<h5 class="mb-0"><strong>Patient Name:
{{ $ShowMedicineInvoice->med_invoice_p_name }}</strong></h5>
<li>
</ul>
</div>
</td>
</tr>
</table>
</div>
<div class="row mr-5 mt-5">
<div class="col-sm-12">
<div>
<h4 class="m-b-10"><strong>Medicine</strong></h4>
<table class="table table-bordered">
<thead>
<tr>
<th><strong>Medicine name </strong></th>
<th><strong>Medicine BP </strong></th>
<th><strong>Medicine Price </strong></th>
<th><strong>Quantity </strong></th>
<th><strong>Total </strong></th>
</tr>
</thead>
<tbody>
@php
$total = 0;
@endphp
@foreach ($ShowMedicineInvoice['Med_invoice_Medicines'] as $item)
<tr>
<td>{{ $item['medicine']['name'] }}</td>
<td>{{ $item['medicine']['mg'] }}</td>
<td>{{ $item['medicine']['price'] }}</td>
<td>{{ $item->med_invoice_medicine_quantity }}</td>
<td>{{ $item->med_invoice_total }}</td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr>
<th colspan="4" class="text-right">Total</th>
<th>{{ $ShowMedicineInvoice->med_invoice_total_ammount }}</th>
</tr>
<tr>
<th colspan="4" class="text-right">Discount In Taka ({{$ShowMedicineInvoice->med_invoice_medicine_discount }} %)</th>
<th>{{ $ShowMedicineInvoice->med_invoice_medicine_discount_taka }}</th>
</tr>
<tr>
<th colspan="4" class="text-right">Grand Total</th>
<th>{{ $ShowMedicineInvoice->med_invoice_medicine_total }}</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12 px-5">
<div class="col-md-6">
<p>Accountant Signature</p>
</div>
</div>
</div>
</div>
<div id="scrpt">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</div>
</body>
</html>
@endsection