Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>INVOICE</title>
- <style>
- @page {
- margin: 10px 20px 10px 20px !important;
- padding: 10px 20px 10px 20px !important;
- }
- .clearfix:after {
- content: "";
- display: table;
- clear: both;
- }
- a {
- color: black;
- text-decoration: none;
- font-family: Arial, sans-serif;
- }
- body {
- position: relative;
- width: 18.9cm;
- /* height: 26.73cm; */
- margin: 0 auto;
- color: #555555;
- background: #FFFFFF;
- font-family: Arial, sans-serif;
- font-size: 11px;
- font-family: Arial, sans-serif;
- text-align: left;
- }
- header {
- padding: 10px 0;
- margin-bottom: 20px;
- border-bottom: 1px solid #d8d8d8;
- background-color: #BDBDBD;
- font-family: Arial, sans-serif;
- }
- #logo {
- float: left;
- margin-top: 13px;
- margin-left: 5%;
- margin-bottom: 15px;
- }
- #logo img {
- height: 70px;
- }
- #company {
- float: right;
- text-align: right;
- width: 50%;
- color: #000;
- margin-right: 5%;
- margin-top: 20px;
- margin-bottom: 15px;
- border-right: 3px solid #000;
- padding-right: 6px;
- }
- #quo {
- width: 50%;
- margin-right: 8%;
- color: #000;
- float: right;
- text-align: right;
- }
- #details {
- margin-bottom: 5px;
- /* width: 100%; */
- }
- #detail-info {
- margin-bottom: 15px;
- width: 100%;
- margin-left: 5%;
- font-family: sans-serif;
- }
- .detail {
- color: #46464c;
- font-size: 1.1em;
- font-weight: normal;
- }
- #client {
- float: left;
- text-align: left;
- margin-left: 5%;
- margin-top: 5px;
- font-family: sans-serif;
- }
- #closing {
- float: left;
- text-align: left;
- margin-top: 26px;
- }
- #signature {
- float: right;
- text-align: right;
- margin-top: 26px;
- }
- #client .to {
- color: #000;
- font-size: 1.1em;
- line-height: 1.1em;
- font-weight: normal;
- }
- h2.name {
- font-size: 1.4em;
- font-weight: normal;
- margin: 0;
- color: #000;
- }
- h2.name-header {
- font-size: 1.4em;
- font-weight: normal;
- margin: 0;
- color: #000;
- }
- h2.name-customer {
- font-size: 1.4em;
- font-weight: normal;
- margin: 0;
- color: #222222;
- }
- h3.gender {
- font-size: 1.3em;
- font-weight: normal;
- margin: 0;
- color: #222222;
- }
- #invoice {
- /* float: left; */
- text-align: right;
- margin-right: 5%;
- font-family: sans-serif;
- }
- #invoice h1 {
- color: #000;
- font-size: 2.2em;
- line-height: 1em;
- font-weight: normal;
- }
- .thanks {
- font-size: 1.1em;
- color: #59afce;
- }
- #notices {
- padding-left: 6px;
- border-left: 6px solid #0087C3;
- }
- #notices .notice {
- font-size: 1.2em;
- }
- footer {
- color: #777777;
- width: 100%;
- height: 30px;
- position: absolute;
- bottom: 0;
- border-top: 1px solid #d8d8d8;
- padding: 8px 0;
- text-align: center;
- }
- .table1 {
- font-family: sans-serif;
- color: #444;
- border-collapse: collapse;
- border: 1px solid #f2f5f7;
- }
- .table1 tr th {
- background: #000;
- color: #fff;
- font-weight: normal;
- }
- .table1,
- th,
- td {
- padding: 8px 10px;
- text-align: center;
- }
- .customer {
- padding: 5px 5px;
- text-align: center;
- }
- .table1 tbody tr:hover {
- background-color: #f5f5f5;
- }
- .table1 tbody tr:nth-child(even) {
- background-color: #f2f2f2;
- }
- .table1 td.desc {
- text-align: left;
- }
- .table1 tr.counter {
- padding-top: 10px;
- padding-left: 15px;
- text-align: left;
- }
- .table1 td.term-condition {
- text-align: left;
- padding-top: 10px;
- padding-left: 15px;
- }
- .table1 tr.total {
- text-align: right;
- background-image: linear-gradient(to right, #d3d3d3, #BDBDBD);
- }
- </style>
- </head>
- <body>
- <?php
- // Read image path, convert to base64 encoding
- $imageData = base64_encode(file_get_contents($imgHeader));
- $imageHeaderData = base64_encode(file_get_contents($headerImage));
- // Format the image SRC: data:{mime};base64,{data};
- $src = 'data:' . mime_content_type($imgHeader) . ';base64,' . $imageData;
- $headerImageSrc = 'data:' . mime_content_type($headerImage) . ';base64,' . $imageHeaderData;
- if (!is_null($receipt->getCreatedBy()->getCompany())) {
- $companySalesPerson = $receipt->getCreatedBy()->getCompany()->getName();
- $companyAddressSalesPerson = $receipt->getCreatedBy()->getCompany()->getAddress();
- $companyPhoneSalesPerson = $receipt->getCreatedBy()->getCompany()->getPhone();
- $companyMailSalesPerson = $receipt->getCreatedBy()->getCompany()->getEmail();
- } else {
- $companySalesPerson = '';
- $companyAddressSalesPerson = '';
- $companyPhoneSalesPerson = '';
- $companyMailSalesPerson = '';
- }
- // if (!is_null($receipt->getDueDate()) && $receipt->getDueDate() != '') {
- // $validTill = $receipt->getDueDate()->format('d F Y');
- // } else {
- // $validTill = '-';
- // }
- if (!is_null($receipt->getCustomer()->getName()) && $receipt->getCustomer()->getName() != '') {
- $customerName = $receipt->getCustomer()->getName();
- } else {
- $customerName = '-';
- }
- if (!is_null($receipt->getCustomer()->getAddress()) && $receipt->getCustomer()->getAddress() != '') {
- $customerAddress = $receipt->getCustomer()->getAddress();
- } else {
- $customerAddress = '-';
- }
- if (!is_null($receipt->getCustomer()->getCity()) && $receipt->getCustomer()->getCity() != '') {
- $customerCity = $receipt->getCustomer()->getCity();
- } else {
- $customerCity = '-';
- }
- if (!is_null($receipt->getCustomer()->getState()) && $receipt->getCustomer()->getState() != '') {
- $customerProvince = $receipt->getCustomer()->getState();
- } else {
- $customerProvince = '-';
- }
- if (!is_null($receipt->getCustomer()->getPhone()) && $receipt->getCustomer()->getPhone() != '') {
- $customerPhone = $receipt->getCustomer()->getPhone();
- } else {
- $customerPhone = '-';
- }
- ?>
- <table cellpadding="0" cellspacing="0" style="width:100%">
- <tbody>
- <tr>
- <td style="width:40%">
- <div style="position: fixed; text-align:left;">
- <img src="<?php echo $headerImageSrc ?> " width="300px" />
- </div>
- </td>
- <td style="width:35%; text-align:right;"><br>
- <b><?= strtoupper($companySalesPerson) ?></b><br />
- <?= ucwords($companyAddressSalesPerson) ?><br>
- TEL : <?= ucwords($companyPhoneSalesPerson) ?><br>
- <a href="mailto:<?= ucwords($companyMailSalesPerson) ?>"></a><?= $companyMailSalesPerson ?><br>
- </td>
- <td style="width:15%"><img alt="" src="<?php echo $src ?>" style="float:left; height:99px; width:100px" /></td>
- </tr>
- <tr>
- <td style="width:40%; text-align:left;font-size:24px; padding:0%; margin:0% "><strong>DELIVERY<br>ORDER</strong></td>
- <td style="width:35%"> </td>
- <td style="width:15%"> </td>
- <tr>
- </tbody>
- </table>
- <table cellpadding="0" cellspacing="0" style="width:100%">
- <tbody>
- <tr>
- <td style="width:45%; white-space:nowrap; text-align:left;padding:0%; margin:0%">
- <table border="0" cellpadding="0" cellspacing="0" style="width:100%">
- <tbody>
- <tr>
- <td style="width:20%; white-space:nowrap; text-align:left;padding:0%; margin:0%">
- <p>
- Number<br>
- Created Date<br>
- Received Date
- </p>
- </td>
- <td style="width:80%; white-space:nowrap; text-align:left;padding:0%; margin:0%">
- <p>
- : <?= $receipt->getNumber() ?><br>
- : <?= $receipt->getCreatedAt()->format("d F Y") ?><br>
- : <?= $receipt->getReceivedAt()->format("d F Y") ?><br>
- </p>
- </td>
- </tr>
- </tbody>
- </table>
- </td>
- <td style="width:50%; white-space:nowrap; text-align:left;padding:0%; margin:0%">
- <table border="0" cellpadding="0" cellspacing="0" style="width:100%">
- <tbody>
- <tr>
- <td style="width:20%; white-space:nowrap; text-align:left;padding:0%; margin:0%">
- <p>
- Customer<br>
- Address<br>
- Phone
- </p>
- </td>
- <td style="width:80%; white-space:nowrap; text-align:left;padding:0%; margin:0%">
- <p>
- : <b><?= $customerName ?><br></b>
- : <?= $customerAddress ?>, <?= $customerCity ?>, <?= $customerProvince ?><br>
- : <?= $customerPhone ?><br>
- </p>
- </td>
- </tr>
- </tbody>
- </table>
- </td>
- </tr>
- </tbody>
- </table>
- <table align="left" border="1" cellpadding="0" cellspacing="0" style="width:100%">
- <thead>
- <tr>
- <th scope="col" style="width: 5%; background-color: #d8d8d8;">NO</th>
- <th scope="col" style="width: 40%; background-color: #d8d8d8;">ITEM</th>
- <th scope="col" style="width: 10%; background-color: #d8d8d8;">QUANTITY</th>
- <th scope="col" style="width: 10%; background-color: #d8d8d8;">UNIT</th>
- <th scope="col" style="width: 35%; background-color: #d8d8d8;">NOTE</th>
- </tr>
- </thead>
- <tbody>
- <?php
- $count = 1;
- $total = 0;
- foreach ($receiptItems as $itemList) {
- if (!is_null($itemList->getItemList()) && $itemList->getItemList() != '') {
- $itemName = $itemList->getItemList()->getName();
- } else {
- $itemName = $itemList->getCustomItem();
- }
- if (!is_null($itemList->getItemList()->getItemUnit()->getName()) && $itemList->getItemList()->getItemUnit()->getName() != '') {
- $itemUnit = $itemList->getItemList()->getItemUnit()->getName();
- } else {
- $itemUnit = '-';
- }
- $itemNum = $count;
- $itemQty = $itemList->getQuantity();
- $count += 1;
- ?>
- <tr>
- <td style="width:5%"><?= $itemNum ?></td>
- <td style="width:40%; text-align: left;"><?= $itemName ?></td>
- <td style="width:10%"><?= $itemQty ?></td>
- <td style="width:10%"><?= $itemUnit ?></td>
- <td style="width:35%"><?= $itemNote ?></td>
- </tr>
- <?php
- }
- ?>
- </tbody>
- </table>
- <p> </p>
- <br>
- <table cellpadding="0" cellspacing="0" style="width:100%; height:100px; margin-top:10%; padding:0%; margin:0%">
- <tbody>
- <?php
- // Read image path, convert to base64 encoding
- // if (!is_null($receipt->getCreatedBy()->getSignature()) || !is_null($receipt->getShippedBy()->getSignature()) || !is_null($receipt->getReceivedBy()->getSignature())) {
- $signatureCreatedData = base64_encode(file_get_contents($receipt->getCreatedBy()->getSignature()));
- $signatureShippedData = base64_encode(file_get_contents($receipt->getShippedBy()->getSignature()));
- $signatureReceivedData = $receipt->getSignatures();
- $signatureReceivedData = str_replace('["', "", $signatureReceivedData);
- $signatureReceivedData = str_replace('"]', "", $signatureReceivedData);
- $signatureReceivedDataPath = base64_encode(file_get_contents('data/receipt/signatures/' . $signatureReceivedData));
- $stampData = base64_encode(file_get_contents($stamp));
- $signatureCreated = 'data:' . mime_content_type($receipt->getCreatedBy()->getSignature()) . ';base64,' . $signatureCreatedData;
- $signatureShipped = 'data:' . mime_content_type($receipt->getShippedBy()->getSignature()) . ';base64,' . $signatureShippedData;
- $signatureReceived = 'data:' . mime_content_type('data/receipt/signatures/' . $signatureReceivedData) . ';base64,' . $signatureReceivedDataPath;
- $stampLogo = 'data:' . mime_content_type($stamp) . ';base64,' . $stampData;
- // var_dump($signatureReceived);
- // var_dump($signatureShipped);
- // exit;
- ?>
- <tr>
- <td style="text-align:center; width:33%; padding:0%; margin:0%; text-align:center; ">
- <div style=" position: relative; width: 100px; padding:0%; margin:0%; text-align:center; left:20; height: 100px; display:block; justify-content: center;">
- Dibuat Oleh,
- <img style=" position: absolute; height: 100%; top -50; left:0; text-align:center; padding:0%; margin:0%; " src="<?php
- if (is_null($signatureCreated) || $signatureShipped == '') {
- echo "";
- } else {
- echo $signatureShipped;
- }
- ?>" />
- <!-- <img style="position: absolute; width: 100%; top: 20; text-align:center; padding:0%; margin:0%; " src="<?php
- echo $stampLogo
- ?>" /> -->
- <br>
- <p style=" position: absolute; top: 60; text-align:center; "><?= $receipt->getCreatedBy()->getFirstName() ?> <?= $receipt->getCreatedBy()->getLastName() ?></p>
- </div>
- </td>
- <td style="text-align:center; width:33%; padding:0%; margin:0%; text-align:center; ">
- <div style=" position: relative; width: 100px; padding:0%; margin:0%; text-align:center; left:20; height: 100px; display:block; justify-content: center;">
- Dibuat Oleh,
- <img style=" position: absolute; height: 100%; top -50; left:0; text-align:center; padding:0%; margin:0%; " src="<?php
- if (is_null($signatureShipped) || $signatureCreated == '') {
- echo "";
- } else {
- echo $signatureCreated;
- }
- ?>" />
- <!-- <img style="position: absolute; width: 100%; top: 20; text-align:center; padding:0%; margin:0%; " src="<?php
- echo $stampLogo
- ?>" /> -->
- <br>
- <p style=" position: absolute; top: 60; text-align:center; "><?= $receipt->getCreatedBy()->getFirstName() ?> <?= $receipt->getCreatedBy()->getLastName() ?></p>
- </div>
- </td>
- <td style="text-align:center; width:33%; padding:0%; margin:0%; text-align:center; ">
- <div style=" position: relative; width: 100px; padding:0%; margin:0%; text-align:center; left:20; height: 100px; display:block; justify-content: center;">
- Diterima Oleh,
- <img style=" position: absolute; height: 100%; top -50; left:0; text-align:center; padding:0%; margin:0%; " src="<?php
- if (is_null($signatureReceived) || $signatureReceived == '') {
- echo "";
- } else {
- echo $signatureReceived;
- }
- ?>" />
- <!-- <img style="position: absolute; width: 100%; top: 20; text-align:center; padding:0%; margin:0%; " src="<?php
- echo $stampLogo
- ?>" /> -->
- <br>
- <p style=" position: absolute; top: 60; text-align:center; "><?= $receipt->getCreatedBy()->getFirstName() ?> <?= $receipt->getCreatedBy()->getLastName() ?></p>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </body>
- </html>
Add Comment
Please, Sign In to add comment