324 lines
9.1 KiB
PHP
Executable File
324 lines
9.1 KiB
PHP
Executable File
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<style>
|
|
/* Add your CSS styles here to format the invoice for mPDF */
|
|
body {
|
|
|
|
font-family: 'Times New Roman', Times, sans-serif;
|
|
|
|
font-size: 12px; /* Change this value to your desired font size */
|
|
}
|
|
|
|
/* Style for the main table with border */
|
|
table.main-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
border: -0.5px solid black; /* Add a border around the entire invoice */
|
|
}
|
|
|
|
table.main-table th,
|
|
table.main-table td {
|
|
border: none; /* Remove borders from all cells inside the main table */
|
|
|
|
}
|
|
|
|
/* Style for the table containing business details */
|
|
table.business-details-table, table.addresses-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
}
|
|
|
|
table.business-details-table td, table.addresses-table td {
|
|
padding: 8px;
|
|
text-align: left;
|
|
}
|
|
|
|
/* Style for the business logo and title */
|
|
.business-logo-container {
|
|
text-align: center;
|
|
}
|
|
|
|
img.business-logo {
|
|
max-width: 200px; /* Adjust the size of the logo */
|
|
}
|
|
|
|
/* Style for the business name */
|
|
.business-name {
|
|
font-size: 16px;
|
|
font-weight: bold;
|
|
margin-top: 10px;
|
|
}
|
|
|
|
/* Style for the table containing invoice info */
|
|
table.invoice-info-table, table.shipping-table {
|
|
width: 100%;
|
|
}
|
|
|
|
table.invoice-info-table th,
|
|
table.invoice-info-table td,
|
|
table.shipping-table th,
|
|
table.shipping-table td {
|
|
text-align: right;
|
|
}
|
|
|
|
/* Style for the addresses table */
|
|
table.addresses-table {
|
|
width: 100%;
|
|
}
|
|
|
|
table.addresses-table th {
|
|
text-align: left;
|
|
padding-left: 8px;
|
|
}
|
|
|
|
/* Style for the billing and shipping addresses */
|
|
.billing-address {
|
|
width: 50%;
|
|
padding-left: 8px;
|
|
}
|
|
|
|
/* Style for the invoice-related table */
|
|
table.invoice-related-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
}
|
|
|
|
table.invoice-related-table th,
|
|
table.invoice-related-table td {
|
|
border: none; /* Remove borders from all cells in the invoice items table */
|
|
padding: 8px;
|
|
text-align: center; /* Center-align text in cells */
|
|
}
|
|
|
|
table.invoice-related-table th {
|
|
background-color: #f2f2f2;
|
|
font-weight: bold;
|
|
}
|
|
|
|
/* Style for the business stamp and terms */
|
|
.business-stamp, .terms {
|
|
text-align: center;
|
|
margin-top: 20px;
|
|
}
|
|
.subtotal-table {
|
|
width: 100%;
|
|
margin-top: 20px;
|
|
}
|
|
|
|
.subtotal-table table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
border: 1px solid black; /* Add a border around the subtotal table */
|
|
}
|
|
|
|
.subtotal-table th,
|
|
.subtotal-table td {
|
|
border: none; /* Remove borders from cells inside the subtotal table */
|
|
padding: 8px;
|
|
text-align: right;
|
|
}
|
|
|
|
.subtotal-table th {
|
|
background-color: #f2f2f2;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.subtotal-table td:last-child {
|
|
font-weight: bold; /* Make the last column (total values) bold */
|
|
}
|
|
td.invoice-number {
|
|
font-size: 18px; /* Increase font size to your desired value */
|
|
/* Highlight background color */
|
|
font-weight: bold; /* Make the text bold */
|
|
}
|
|
p {
|
|
margin-top: 0;
|
|
margin-bottom: 0rem;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<table class="main-table">
|
|
<tr>
|
|
<td>
|
|
<table class="business-details-table">
|
|
|
|
<?php foreach ($sales as $value) : ?>
|
|
<tr>
|
|
<td class="business-logo-container"style="font-size: 16px;font-weight: bold;">
|
|
THE MECHANIC
|
|
<!-- <img src="https://vijayabharathambooks.com/wp-content/uploads/2021/09/vijaya-bharatham-logo-8pt.png" alt="Business Logo" class="business-logo"> -->
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<p><?= $value->company_address ?>,<br>
|
|
<?= $value->company_city ?>,
|
|
<?= $value->company_state ?>
|
|
<?= $value->company_postal_code ?>.</p>
|
|
|
|
<p><?= $value->company_mobile_no ?></p>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</table>
|
|
</td>
|
|
<td>
|
|
<table class="invoice-info-table">
|
|
<?php foreach ($sales as $value) : ?>
|
|
<tr>
|
|
<th><?php echo ($value->order_number) ? 'Order # ' . $value->order_number : 'Invoice # ' . $value->invoice_number; ?></th>
|
|
</tr>
|
|
<tr>
|
|
<th>Date : <?= date('d-m-Y', strtotime($value->created_at)) ?></th>
|
|
|
|
</tr>
|
|
<tr>
|
|
<th>Status :<?= $value->status ?></th>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<table class="main-table">
|
|
<tr>
|
|
<td>
|
|
<table class="addresses-table">
|
|
<tr >
|
|
<th class="billing-address">Vendor Address</th>
|
|
</tr>
|
|
<tr >
|
|
<td class="billing-address">
|
|
|
|
<?php foreach ($sales as $value) : ?>
|
|
<?= $value->vendor_name ?><br>
|
|
<?= $value->vendor_address != '' ? $value->vendor_address." , <br>" : ''; ?>
|
|
<?= $value->vendor_city ?>
|
|
<?php if ($value->vendor_postal!=0): ?>
|
|
<?= $value->vendor_postal ?><br>
|
|
<?php endif; ?>
|
|
<?= $value->contact_person_mobile1." ." ?>
|
|
|
|
<?php endforeach; ?>
|
|
</td>
|
|
<tr>
|
|
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td>
|
|
<table class="shipping-table">
|
|
<tr >
|
|
<th class="shipping-address">Shipping Address</th>
|
|
</tr>
|
|
<tr >
|
|
<td class="shipping-address">
|
|
<?php foreach ($sales as $value) : ?>
|
|
|
|
<?= $value->billing_address != '' ? $value->vendor_address." , <br>" : ''; ?>
|
|
<?= $value->billing_city ?>
|
|
<?php if ($value->billing_postal_code!=0): ?>
|
|
<?= $value->billing_postal_code ?><br>
|
|
<?php endif; ?>
|
|
|
|
|
|
<?php endforeach; ?>
|
|
</td>
|
|
<tr>
|
|
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
|
|
<br> <br>
|
|
<table class="invoice-related-table">
|
|
<thead>
|
|
<tr>
|
|
<th>S.no</th>
|
|
<th>Item Name</th>
|
|
|
|
|
|
<th>Qty</th>
|
|
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php $serialNumber = 1; ?>
|
|
<?php foreach ($items as $item) : ?>
|
|
<tr>
|
|
<td>
|
|
<?= $serialNumber++; ?>
|
|
|
|
</td>
|
|
|
|
<td><?= $item->product_name ?></td>
|
|
|
|
<td><?= $item->qty ?></td>
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
<table class="subtotal-table">
|
|
<?php foreach ($sales as $value) : ?>
|
|
<tr>
|
|
<td colspan="5" align="right"></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="5" align="right"></td>
|
|
</tr>
|
|
|
|
|
|
<!-- -->
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
<td colspan="5" align="right"></td>
|
|
</tr>
|
|
<?php if ($value->status === 'Approved'): ?>
|
|
<tr>
|
|
<td colspan="5" align="right">Paid : ₹<?= number_format($value->total_amount, 2, '.', ',') ?></td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
<?php endforeach; ?>
|
|
</table>
|
|
|
|
<div class="business-stamp">
|
|
|
|
</div>
|
|
|
|
|
|
<div class="terms">
|
|
|
|
|
|
<p style=text-align:left><?= $value->terms_condition;?></p>
|
|
|
|
</div>
|
|
|
|
<!-- ... (your existing HTML template) -->
|
|
|
|
<!-- Add this to the end of your HTML template -->
|
|
|
|
|
|
<!-- <img src="https://cdn.pixabay.com/photo/2012/04/26/14/17/blue-42596_960_720.png" /> -->
|
|
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|