|
|
@@ -488,8 +488,6 @@ class BaseExport extends Component {
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public function webToAsync($params, $extend = []) {
|
|
|
- LoggerTool::info($params);
|
|
|
- LoggerTool::info($extend);
|
|
|
$default = [
|
|
|
'moduleId' => null,
|
|
|
'listName' => null,
|
|
|
@@ -1542,7 +1540,6 @@ ORDER;
|
|
|
* @throws \yii\httpclient\Exception
|
|
|
*/
|
|
|
public function actionOrderInvoiceExport() {
|
|
|
- LoggerTool::info(333);
|
|
|
$this->getParams();
|
|
|
if (!$this->params) {
|
|
|
throw new Exception('无法获取需要的参数');
|
|
|
@@ -1716,219 +1713,217 @@ EOT;
|
|
|
$orderTotalTaxAmount = Tool::formatAmount($orderTotalTaxAmount);
|
|
|
$orderTotalAmount = Tool::formatAmount($orderTotalAmount);
|
|
|
$orderTotal = Tool::formatAmount($orderTotal);
|
|
|
- LoggerTool::info(4444);
|
|
|
|
|
|
- $context = <<<ORDER
|
|
|
- <!doctype html>
|
|
|
- <html lang="en">
|
|
|
- <head>
|
|
|
- <meta charset="UTF-8" />
|
|
|
- <title>{$taxInvoice}</title>
|
|
|
- <style>
|
|
|
- table {
|
|
|
- border-collapse: collapse;
|
|
|
- }
|
|
|
- table td, table th {
|
|
|
- border: 1px solid #ccc;
|
|
|
- border-collapse: collapse;
|
|
|
- }
|
|
|
- .bg {
|
|
|
- background-color: #ccc;
|
|
|
- }
|
|
|
-
|
|
|
- /* 无边框表格样式类 */
|
|
|
- .table-noborder {
|
|
|
- border-collapse: collapse; /* 合并边框(避免残留间隙) */
|
|
|
- border-spacing: 0; /* 清除单元格之间的默认间隙 */
|
|
|
- empty-cells: show; /* 不影响空单元格(可选,避免意外显示) */
|
|
|
- }
|
|
|
- /* 清除 table、th、td 的所有边框 */
|
|
|
- .table-noborder,
|
|
|
- .table-noborder th,
|
|
|
- .table-noborder td {
|
|
|
- border: none !important; /* !important 可选,用于覆盖冲突样式 */
|
|
|
- outline: none; /* 清除可能的默认轮廓(可选) */
|
|
|
- }
|
|
|
- </style>
|
|
|
- </head>
|
|
|
- <body style="font-weight: normal; margin: 0; padding: 0; line-height: 1.3;">
|
|
|
- <div class="content" style="line-height: 1.3; font-weight: normal;">
|
|
|
- <div style="display: flex; justify-content: space-between; align-items: flex-start; width: 100%;">
|
|
|
- <div style="width: 70%;">
|
|
|
- <p style="text-align: left; font-weight: bold; font-size: 16px; margin: 0 !important; padding: 0 !important; line-height: 1.3 !important;"><b>TAX INVOICE</b></p>
|
|
|
- <p style="text-align: left; font-size: 14px; margin: 0 !important; padding: 0 !important; line-height: 1.3 !important;">Elken Arabiya Gen. Trading Co. LLC</p>
|
|
|
- <p style="text-align: left; font-size: 13px; margin: 0 !important; padding: 0 !important; line-height: 1.3 !important;">Shop No.2, Plot 356-1142, Juneirah Street, Umm Suqeim 1, Dubai, UAE</p>
|
|
|
- <p style="text-align: left; font-size: 13px; margin: 0 !important; padding: 0 !important; line-height: 1.3 !important;">Phone: +971042296118</p>
|
|
|
- <p style="text-align: left; font-size: 13px; margin: 0 !important; padding: 0 !important; line-height: 1.3 !important;">License No: 1314319</p>
|
|
|
- <p style="text-align: left; font-size: 13px; margin: 0 !important; padding: 0 !important; line-height: 1.3 !important;">VAT No: {$orderSn}</p>
|
|
|
- </div>
|
|
|
- <div style="width: 25%; text-align: right;">
|
|
|
- <!-- 图像将通过TCPDF直接插入 -->
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <hr />
|
|
|
- <br>
|
|
|
- <br>
|
|
|
- <div style="width: 100%; line-height: 15px; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 0; padding: 0;">
|
|
|
- <table class="table-noborder" width="100%">
|
|
|
- <tr style="text-align: left; font-size: 12px; font-weight: normal; height: 50px; vertical-align: middle;">
|
|
|
- <td>
|
|
|
- Bill to
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- Invoice No.: {$invoiceNo}
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr style="text-align: left; font-size: 12px; font-weight: normal; height: 50px; vertical-align: middle;">
|
|
|
- <td>
|
|
|
- Name of Distributor: {$userName}
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- Date: {$orderAt}
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr style="text-align: left; font-size: 12px; font-weight: normal; height: 50px; vertical-align: middle;">
|
|
|
- <td>
|
|
|
- Member ID: {$userId}
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- Payment status: {$paymentStatus}
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr style="text-align: left; font-size: 12px; font-weight: normal; height: 50px; vertical-align: middle;">
|
|
|
- <td colspan="2">
|
|
|
- Address: {$address}
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr style="text-align: left; font-size: 12px; font-weight: normal; height: 50px; vertical-align: middle;">
|
|
|
- <td colspan="2">
|
|
|
- Contact: {$mobile}
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
-
|
|
|
- <br />
|
|
|
- <br />
|
|
|
- <br />
|
|
|
- <table border="1" width="100%">
|
|
|
- <tr style="text-align: left; font-weight: normal; font-size: 12px; width: 100%; padding: 5px 5px;">
|
|
|
- <th style="width: 30px;">No.</th>
|
|
|
- <th>Product Code</th>
|
|
|
- <th>Product Name</th>
|
|
|
- <th>Quantity</th>
|
|
|
- <th>Unit Price({$currency})</th>
|
|
|
- <th>Unit BV</th>
|
|
|
- <th>Total BV</th>
|
|
|
- <th>Taxable Amount({$currency})</th>
|
|
|
- <th>VAT Rate</th>
|
|
|
- <th>VAT Amount({$currency})</th>
|
|
|
- <th>Total({$currency})</th>
|
|
|
- </tr>
|
|
|
- {$orderDetails}
|
|
|
- </table>
|
|
|
-
|
|
|
- <table style="table-layout: fixed;" class="table-noborder">
|
|
|
- <tr><td colspan="11"></td></tr>
|
|
|
- <tr><td colspan="11"></td></tr>
|
|
|
- </table>
|
|
|
-
|
|
|
- <table style="table-layout: fixed;">
|
|
|
- <tr style="text-align: left; font-weight: normal; font-size: 12px;">
|
|
|
- <td class="table-noborder" style="width: 30px;"></td>
|
|
|
- <td style="text-align: left; background-color: lightslategray;" colspan="2">Grand Total</td>
|
|
|
- <td style="text-align: left; background-color: lightslategray;">{$orderTotalQuantity}</td>
|
|
|
- <td style="text-align: left; background-color: lightslategray;"></td>
|
|
|
- <td style="text-align: left; background-color: lightslategray;"></td>
|
|
|
- <td style="text-align: left; background-color: lightslategray;">{$orderTotalBv}</td>
|
|
|
- <td style="text-align: left; background-color: lightslategray;">{$orderTotalTaxAmount}</td>
|
|
|
- <td style="text-align: left; background-color: lightslategray;"></td>
|
|
|
- <td style="text-align: left; background-color: lightslategray;">{$orderTotalAmount}</td>
|
|
|
- <td style="text-align: left; background-color: lightslategray;">{$orderTotal}</td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
-
|
|
|
- <table style="table-layout: fixed;" class="table-noborder">
|
|
|
- <tr>
|
|
|
- <td colspan="11"></td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
-
|
|
|
- <table style="table-layout: fixed;">
|
|
|
- <tr style="text-align: left; font-weight: normal; font-size: 12px;">
|
|
|
- <td colspan="7" class="table-noborder"></td>
|
|
|
- <td style="text-align: left; background-color: lightgoldenrodyellow;" colspan="2" >Total Amount</td>
|
|
|
- <td style="text-align: left; background-color: lightgoldenrodyellow;" colspan="2">{$currency}{$orderAmount}</td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
-
|
|
|
- <table style="table-layout: fixed;" class="table-noborder">
|
|
|
- <tr>
|
|
|
- <td colspan="11"></td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
-
|
|
|
- <table style="table-layout: fixed;" class="table-noborder">
|
|
|
- <tr style="text-align: left; font-weight: normal; font-size: 12px;">
|
|
|
- <td colspan="7"></td>
|
|
|
- <td colspan="2">Method:</td>
|
|
|
- <td colspan="2">{$paymentMethod}</td>
|
|
|
- </tr>
|
|
|
- <tr style="text-align: left; font-weight: normal; font-size: 12px;">
|
|
|
- <td colspan="7"></td>
|
|
|
- <td colspan="2" >Paid amount:</td>
|
|
|
- <td colspan="2">{$currency}{$orderAmount}</td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
-
|
|
|
- <table style="table-layout: fixed;" class="table-noborder">
|
|
|
- <tr>
|
|
|
- <td colspan="11"></td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
-
|
|
|
- <table style="table-layout: fixed;" class="table-noborder">
|
|
|
- <tr style="text-align: left; font-weight: normal; font-size: 12px; margin-top: 15px;">
|
|
|
- <td colspan="2">Remark:</td>
|
|
|
- <td colspan="9"></td>
|
|
|
- </tr>
|
|
|
- <tr style="text-align: left; font-weight: normal; font-size: 12px;">
|
|
|
- <td colspan="7">{$invoiceRemark}</td>
|
|
|
- <td colspan="4"></td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
-
|
|
|
- <table style="table-layout: fixed;" class="table-noborder">
|
|
|
- <tr>
|
|
|
- <td colspan="11"></td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td colspan="11"></td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td colspan="11"></td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td colspan="11"></td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
-
|
|
|
- <table style="table-layout: fixed;" class="table-noborder">
|
|
|
- <tr style="text-align: left; font-weight: normal; font-size: 12px; margin-top: 15px;">
|
|
|
- <td colspan="4">Issued By:</td>
|
|
|
- <td colspan="4">Picked By:</td>
|
|
|
- <td colspan="3">Received By:</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td colspan="11"></td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </body>
|
|
|
- </html>
|
|
|
-ORDER;
|
|
|
- LoggerTool::info($context);
|
|
|
+// $context = <<<ORDER
|
|
|
+// <!doctype html>
|
|
|
+// <html lang="en">
|
|
|
+// <head>
|
|
|
+// <meta charset="UTF-8" />
|
|
|
+// <title>{$taxInvoice}</title>
|
|
|
+// <style>
|
|
|
+// table {
|
|
|
+// border-collapse: collapse;
|
|
|
+// }
|
|
|
+// table td, table th {
|
|
|
+// border: 1px solid #ccc;
|
|
|
+// border-collapse: collapse;
|
|
|
+// }
|
|
|
+// .bg {
|
|
|
+// background-color: #ccc;
|
|
|
+// }
|
|
|
+//
|
|
|
+// /* 无边框表格样式类 */
|
|
|
+// .table-noborder {
|
|
|
+// border-collapse: collapse; /* 合并边框(避免残留间隙) */
|
|
|
+// border-spacing: 0; /* 清除单元格之间的默认间隙 */
|
|
|
+// empty-cells: show; /* 不影响空单元格(可选,避免意外显示) */
|
|
|
+// }
|
|
|
+// /* 清除 table、th、td 的所有边框 */
|
|
|
+// .table-noborder,
|
|
|
+// .table-noborder th,
|
|
|
+// .table-noborder td {
|
|
|
+// border: none !important; /* !important 可选,用于覆盖冲突样式 */
|
|
|
+// outline: none; /* 清除可能的默认轮廓(可选) */
|
|
|
+// }
|
|
|
+// </style>
|
|
|
+// </head>
|
|
|
+// <body style="font-weight: normal; margin: 0; padding: 0; line-height: 1.3;">
|
|
|
+// <div class="content" style="line-height: 1.3; font-weight: normal;">
|
|
|
+// <div style="display: flex; justify-content: space-between; align-items: flex-start; width: 100%;">
|
|
|
+// <div style="width: 70%;">
|
|
|
+// <p style="text-align: left; font-weight: bold; font-size: 16px; margin: 0 !important; padding: 0 !important; line-height: 1.3 !important;"><b>TAX INVOICE</b></p>
|
|
|
+// <p style="text-align: left; font-size: 14px; margin: 0 !important; padding: 0 !important; line-height: 1.3 !important;">Elken Arabiya Gen. Trading Co. LLC</p>
|
|
|
+// <p style="text-align: left; font-size: 13px; margin: 0 !important; padding: 0 !important; line-height: 1.3 !important;">Shop No.2, Plot 356-1142, Juneirah Street, Umm Suqeim 1, Dubai, UAE</p>
|
|
|
+// <p style="text-align: left; font-size: 13px; margin: 0 !important; padding: 0 !important; line-height: 1.3 !important;">Phone: +971042296118</p>
|
|
|
+// <p style="text-align: left; font-size: 13px; margin: 0 !important; padding: 0 !important; line-height: 1.3 !important;">License No: 1314319</p>
|
|
|
+// <p style="text-align: left; font-size: 13px; margin: 0 !important; padding: 0 !important; line-height: 1.3 !important;">VAT No: {$orderSn}</p>
|
|
|
+// </div>
|
|
|
+// <div style="width: 25%; text-align: right;">
|
|
|
+// <!-- 图像将通过TCPDF直接插入 -->
|
|
|
+// </div>
|
|
|
+// </div>
|
|
|
+//
|
|
|
+// <hr />
|
|
|
+// <br>
|
|
|
+// <br>
|
|
|
+// <div style="width: 100%; line-height: 15px; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 0; padding: 0;">
|
|
|
+// <table class="table-noborder" width="100%">
|
|
|
+// <tr style="text-align: left; font-size: 12px; font-weight: normal; height: 50px; vertical-align: middle;">
|
|
|
+// <td>
|
|
|
+// Bill to
|
|
|
+// </td>
|
|
|
+// <td>
|
|
|
+// Invoice No.: {$invoiceNo}
|
|
|
+// </td>
|
|
|
+// </tr>
|
|
|
+// <tr style="text-align: left; font-size: 12px; font-weight: normal; height: 50px; vertical-align: middle;">
|
|
|
+// <td>
|
|
|
+// Name of Distributor: {$userName}
|
|
|
+// </td>
|
|
|
+// <td>
|
|
|
+// Date: {$orderAt}
|
|
|
+// </td>
|
|
|
+// </tr>
|
|
|
+// <tr style="text-align: left; font-size: 12px; font-weight: normal; height: 50px; vertical-align: middle;">
|
|
|
+// <td>
|
|
|
+// Member ID: {$userId}
|
|
|
+// </td>
|
|
|
+// <td>
|
|
|
+// Payment status: {$paymentStatus}
|
|
|
+// </td>
|
|
|
+// </tr>
|
|
|
+// <tr style="text-align: left; font-size: 12px; font-weight: normal; height: 50px; vertical-align: middle;">
|
|
|
+// <td colspan="2">
|
|
|
+// Address: {$address}
|
|
|
+// </td>
|
|
|
+// </tr>
|
|
|
+// <tr style="text-align: left; font-size: 12px; font-weight: normal; height: 50px; vertical-align: middle;">
|
|
|
+// <td colspan="2">
|
|
|
+// Contact: {$mobile}
|
|
|
+// </td>
|
|
|
+// </tr>
|
|
|
+// </table>
|
|
|
+//
|
|
|
+// <br />
|
|
|
+// <br />
|
|
|
+// <br />
|
|
|
+// <table border="1" width="100%">
|
|
|
+// <tr style="text-align: left; font-weight: normal; font-size: 12px; width: 100%; padding: 5px 5px;">
|
|
|
+// <th style="width: 30px;">No.</th>
|
|
|
+// <th>Product Code</th>
|
|
|
+// <th>Product Name</th>
|
|
|
+// <th>Quantity</th>
|
|
|
+// <th>Unit Price({$currency})</th>
|
|
|
+// <th>Unit BV</th>
|
|
|
+// <th>Total BV</th>
|
|
|
+// <th>Taxable Amount({$currency})</th>
|
|
|
+// <th>VAT Rate</th>
|
|
|
+// <th>VAT Amount({$currency})</th>
|
|
|
+// <th>Total({$currency})</th>
|
|
|
+// </tr>
|
|
|
+// {$orderDetails}
|
|
|
+// </table>
|
|
|
+//
|
|
|
+// <table style="table-layout: fixed;" class="table-noborder">
|
|
|
+// <tr><td colspan="11"></td></tr>
|
|
|
+// <tr><td colspan="11"></td></tr>
|
|
|
+// </table>
|
|
|
+//
|
|
|
+// <table style="table-layout: fixed;">
|
|
|
+// <tr style="text-align: left; font-weight: normal; font-size: 12px;">
|
|
|
+// <td class="table-noborder" style="width: 30px;"></td>
|
|
|
+// <td style="text-align: left; background-color: lightslategray;" colspan="2">Grand Total</td>
|
|
|
+// <td style="text-align: left; background-color: lightslategray;">{$orderTotalQuantity}</td>
|
|
|
+// <td style="text-align: left; background-color: lightslategray;"></td>
|
|
|
+// <td style="text-align: left; background-color: lightslategray;"></td>
|
|
|
+// <td style="text-align: left; background-color: lightslategray;">{$orderTotalBv}</td>
|
|
|
+// <td style="text-align: left; background-color: lightslategray;">{$orderTotalTaxAmount}</td>
|
|
|
+// <td style="text-align: left; background-color: lightslategray;"></td>
|
|
|
+// <td style="text-align: left; background-color: lightslategray;">{$orderTotalAmount}</td>
|
|
|
+// <td style="text-align: left; background-color: lightslategray;">{$orderTotal}</td>
|
|
|
+// </tr>
|
|
|
+// </table>
|
|
|
+//
|
|
|
+// <table style="table-layout: fixed;" class="table-noborder">
|
|
|
+// <tr>
|
|
|
+// <td colspan="11"></td>
|
|
|
+// </tr>
|
|
|
+// </table>
|
|
|
+//
|
|
|
+// <table style="table-layout: fixed;">
|
|
|
+// <tr style="text-align: left; font-weight: normal; font-size: 12px;">
|
|
|
+// <td colspan="7" class="table-noborder"></td>
|
|
|
+// <td style="text-align: left; background-color: lightgoldenrodyellow;" colspan="2" >Total Amount</td>
|
|
|
+// <td style="text-align: left; background-color: lightgoldenrodyellow;" colspan="2">{$currency}{$orderAmount}</td>
|
|
|
+// </tr>
|
|
|
+// </table>
|
|
|
+//
|
|
|
+// <table style="table-layout: fixed;" class="table-noborder">
|
|
|
+// <tr>
|
|
|
+// <td colspan="11"></td>
|
|
|
+// </tr>
|
|
|
+// </table>
|
|
|
+//
|
|
|
+// <table style="table-layout: fixed;" class="table-noborder">
|
|
|
+// <tr style="text-align: left; font-weight: normal; font-size: 12px;">
|
|
|
+// <td colspan="7"></td>
|
|
|
+// <td colspan="2">Method:</td>
|
|
|
+// <td colspan="2">{$paymentMethod}</td>
|
|
|
+// </tr>
|
|
|
+// <tr style="text-align: left; font-weight: normal; font-size: 12px;">
|
|
|
+// <td colspan="7"></td>
|
|
|
+// <td colspan="2" >Paid amount:</td>
|
|
|
+// <td colspan="2">{$currency}{$orderAmount}</td>
|
|
|
+// </tr>
|
|
|
+// </table>
|
|
|
+//
|
|
|
+// <table style="table-layout: fixed;" class="table-noborder">
|
|
|
+// <tr>
|
|
|
+// <td colspan="11"></td>
|
|
|
+// </tr>
|
|
|
+// </table>
|
|
|
+//
|
|
|
+// <table style="table-layout: fixed;" class="table-noborder">
|
|
|
+// <tr style="text-align: left; font-weight: normal; font-size: 12px; margin-top: 15px;">
|
|
|
+// <td colspan="2">Remark:</td>
|
|
|
+// <td colspan="9"></td>
|
|
|
+// </tr>
|
|
|
+// <tr style="text-align: left; font-weight: normal; font-size: 12px;">
|
|
|
+// <td colspan="7">{$invoiceRemark}</td>
|
|
|
+// <td colspan="4"></td>
|
|
|
+// </tr>
|
|
|
+// </table>
|
|
|
+//
|
|
|
+// <table style="table-layout: fixed;" class="table-noborder">
|
|
|
+// <tr>
|
|
|
+// <td colspan="11"></td>
|
|
|
+// </tr>
|
|
|
+// <tr>
|
|
|
+// <td colspan="11"></td>
|
|
|
+// </tr>
|
|
|
+// <tr>
|
|
|
+// <td colspan="11"></td>
|
|
|
+// </tr>
|
|
|
+// <tr>
|
|
|
+// <td colspan="11"></td>
|
|
|
+// </tr>
|
|
|
+// </table>
|
|
|
+//
|
|
|
+// <table style="table-layout: fixed;" class="table-noborder">
|
|
|
+// <tr style="text-align: left; font-weight: normal; font-size: 12px; margin-top: 15px;">
|
|
|
+// <td colspan="4">Issued By:</td>
|
|
|
+// <td colspan="4">Picked By:</td>
|
|
|
+// <td colspan="3">Received By:</td>
|
|
|
+// </tr>
|
|
|
+// <tr>
|
|
|
+// <td colspan="11"></td>
|
|
|
+// </tr>
|
|
|
+// </table>
|
|
|
+// </div>
|
|
|
+// </div>
|
|
|
+// </body>
|
|
|
+// </html>
|
|
|
+//ORDER;
|
|
|
|
|
|
require_once (\Yii::$app->vendorPath . '/tecnickcom/tcpdf/tcpdf.php');
|
|
|
|
|
|
@@ -1968,7 +1963,7 @@ ORDER;
|
|
|
// $image_file = \Yii::$app->basePath . '/../ngds-logo.jpg';
|
|
|
// $image = file_get_contents($image_file);
|
|
|
// $pdf->Image('@' . $image, 15, 12, 20, 7, 'JPG');
|
|
|
- $pdf->writeHTML($context);
|
|
|
+ $pdf->writeHTML($context??"");
|
|
|
|
|
|
$result = $pdf->Output($realFile, 'F');
|
|
|
|