|
|
@@ -478,52 +478,54 @@ class BaseExport extends Component {
|
|
|
// 税额
|
|
|
$taxAmount = floatval(Tool::formatPrice(($value['REAL_PRICE'] - ($value['REAL_PRICE'] / (1 + $value['TAX_RATE'] / 100))) * $value['BUY_NUMS']));
|
|
|
$totalTaxAmount += $taxAmount;
|
|
|
+ $taxAmount = Tool::formatAmount($taxAmount);
|
|
|
+ $totalAmount = Tool::formatAmount($totalAmount);
|
|
|
// 订单详情
|
|
|
$orderDetails .= <<<EOT
|
|
|
- <tr>
|
|
|
- <td>{$value['SKU_CODE']}</td>
|
|
|
- <td>{$value['GOODS_TITLE']}</td>
|
|
|
- <td>{$value['REAL_PRICE']}</td>
|
|
|
- <td>{$value['BUY_NUMS']}</td>
|
|
|
- <td>{$value['TAX_RATE']}</td>
|
|
|
- <td>{$taxAmount}</td>
|
|
|
- <td>{$totalAmount}</td>
|
|
|
- </tr>
|
|
|
+ <tr>
|
|
|
+ <td>{$value['SKU_CODE']}</td>
|
|
|
+ <td>{$value['GOODS_TITLE']}</td>
|
|
|
+ <td style="text-align: right;">{$value['REAL_PRICE']}</td>
|
|
|
+ <td>{$value['BUY_NUMS']}</td>
|
|
|
+ <td style="text-align: right;">{$value['TAX_RATE']}</td>
|
|
|
+ <td style="text-align: right;">{$taxAmount}</td>
|
|
|
+ <td style="text-align: right;">{$totalAmount}</td>
|
|
|
+ </tr>
|
|
|
EOT;
|
|
|
}
|
|
|
|
|
|
// 订单基本信息
|
|
|
$orderBase = <<<ORDER
|
|
|
- <table border="1" style="table-layout: fixed; padding: 10px 20px;" width="100%">
|
|
|
- <tr>
|
|
|
- <td width="30%" style="font-weight: bold; text-align: center; font-size: 14px;">Member code</td>
|
|
|
- <td width="70%">{$userId}</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td width="30%" style="font-weight: bold; text-align: center; font-size: 14px;">Member name</td>
|
|
|
- <td width="70%">{$userName}</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td width="30%" style="font-weight: bold; text-align: center; font-size: 14px;">Member address</td>
|
|
|
- <td width="70%">{$address}</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td width="30%" style="font-weight: bold; text-align: center; font-size: 14px;">Member phone</td>
|
|
|
- <td width="70%">{$mobile}</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td width="30%" style="font-weight: bold; text-align: center; font-size: 14px;">Order code</td>
|
|
|
- <td width="70%">{$orderSn}</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td width="30%" style="font-weight: bold; text-align: center; font-size: 14px;">Creation time</td>
|
|
|
- <td width="70%">{$orderAt}</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td class="bg" style="font-weight: bold; font-size: 14px; text-align: center;">Order detail</td>
|
|
|
- <td class="bg"></td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
+ <table border="1" style="table-layout: fixed; padding: 10px 20px;" width="100%">
|
|
|
+ <tr>
|
|
|
+ <td width="30%" style="font-weight: bold; text-align: center; font-size: 14px;">Member code</td>
|
|
|
+ <td width="70%">{$userId}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td width="30%" style="font-weight: bold; text-align: center; font-size: 14px;">Member name</td>
|
|
|
+ <td width="70%">{$userName}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td width="30%" style="font-weight: bold; text-align: center; font-size: 14px;">Member address</td>
|
|
|
+ <td width="70%">{$address}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td width="30%" style="font-weight: bold; text-align: center; font-size: 14px;">Member phone</td>
|
|
|
+ <td width="70%">{$mobile}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td width="30%" style="font-weight: bold; text-align: center; font-size: 14px;">Order code</td>
|
|
|
+ <td width="70%">{$orderSn}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td width="30%" style="font-weight: bold; text-align: center; font-size: 14px;">Creation time</td>
|
|
|
+ <td width="70%">{$orderAt}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td class="bg" style="font-weight: bold; font-size: 14px; text-align: center;">Order detail</td>
|
|
|
+ <td class="bg"></td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
ORDER;
|
|
|
|
|
|
$l['a_meta_charset'] = 'UTF-8';
|
|
|
@@ -531,73 +533,76 @@ ORDER;
|
|
|
$l['a_meta_language'] = 'zh';
|
|
|
$l['w_page'] = '页面';
|
|
|
|
|
|
+ $orderAmount = Tool::formatAmount($orderAmount);
|
|
|
+ $totalTaxAmount = Tool::formatAmount($totalTaxAmount);
|
|
|
+
|
|
|
$context = <<<ORDER
|
|
|
- <!doctype html>
|
|
|
- <html lang="en">
|
|
|
- <head>
|
|
|
- <meta charset="UTF-8" />
|
|
|
- <title>Order detail</title>
|
|
|
- <style>
|
|
|
- table {
|
|
|
- border-collapse: collapse;
|
|
|
- }
|
|
|
- table td, table th {
|
|
|
- border: 1px solid #ccc;
|
|
|
- padding: 10px 30px;
|
|
|
- border-collapse: collapse;
|
|
|
- }
|
|
|
- td {
|
|
|
- padding: 120px;
|
|
|
- }
|
|
|
- .bg {
|
|
|
- background-color: #ccc;
|
|
|
- }
|
|
|
- </style>
|
|
|
- </head>
|
|
|
- <body>
|
|
|
- <div class="content">
|
|
|
- <p style="text-align: center; font-weight: bold; font-size: 22px;"><b>订单详情</b><br></p>
|
|
|
- <div>
|
|
|
- <div style="display: block; width: 100%;">
|
|
|
- {$orderBase}
|
|
|
-
|
|
|
- <table border="1" width="100%" style="padding: 10px 20px; text-align: center;">
|
|
|
- <tr>
|
|
|
- <th width="15%" style="font-size: 14px; font-weight: bold; text-align: center;">Product code</th>
|
|
|
- <th width="20%" style="font-size: 14px; font-weight: bold; text-align: center;">Product name</th>
|
|
|
- <th width="13%" style="font-size: 14px; font-weight: bold; text-align: center;">Product price</th>
|
|
|
- <th width="15%" style="font-size: 14px; font-weight: bold; text-align: center;">Quantity</th>
|
|
|
- <th width="10%" style="font-size: 14px; font-weight: bold; text-align: center;">Tax rate</th>
|
|
|
- <th width="12%" style="font-size: 14px; font-weight: bold; text-align: center;">Tax</th>
|
|
|
- <th width="15%" style="font-size: 14px; font-weight: bold; text-align: center;">Total amount</th>
|
|
|
- </tr>
|
|
|
- {$orderDetails}
|
|
|
- <tr>
|
|
|
- <td colspan="3">Total</td>
|
|
|
- <td>{$orderNums}</td>
|
|
|
- <td></td>
|
|
|
- <td>{$totalTaxAmount}</td>
|
|
|
- <td>{$orderAmount}</td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
+ <!doctype html>
|
|
|
+ <html lang="en">
|
|
|
+ <head>
|
|
|
+ <meta charset="UTF-8" />
|
|
|
+ <title>Order detail</title>
|
|
|
+ <style>
|
|
|
+ table {
|
|
|
+ border-collapse: collapse;
|
|
|
+ }
|
|
|
+ table td, table th {
|
|
|
+ border: 1px solid #ccc;
|
|
|
+ padding: 5px 5px;
|
|
|
+ border-collapse: collapse;
|
|
|
+ }
|
|
|
+ /*td {*/
|
|
|
+ /* padding: 120px;*/
|
|
|
+ /*}*/
|
|
|
+ .bg {
|
|
|
+ background-color: #ccc;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+ </head>
|
|
|
+ <body>
|
|
|
+ <div class="content">
|
|
|
+ <p style="text-align: center; font-weight: bold; font-size: 22px;"><b>Order detail</b><br></p>
|
|
|
+ <div>
|
|
|
+ <div style="display: block; width: 100%;">
|
|
|
+ {$orderBase}
|
|
|
|
|
|
- <div style="width: 100%; margin-top: 50px; height: 30px;">
|
|
|
- <table width="100%" style="border: none; padding: 10px 20px; text-align: center;">
|
|
|
- <tr style="border: none;">
|
|
|
- <td width="70%" style="border: none;"></td>
|
|
|
- <td width="30%" style="font-weight: bold; text-align: left; font-size: 14px; border: none;">Signature:</td>
|
|
|
- </tr>
|
|
|
- <tr style="border: none;">
|
|
|
- <td width="70%" style="border: none;"></td>
|
|
|
- <td width="30%" style="font-weight: bold; text-align: left; font-size: 14px; border: none;">Date:</td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
+ <table border="1" width="100%" style="padding: 10px 5px; text-align: center;">
|
|
|
+ <tr>
|
|
|
+ <th width="15%" style="font-size: 14px; font-weight: bold; text-align: center;">Product code</th>
|
|
|
+ <th width="25%" style="font-size: 14px; font-weight: bold; text-align: center;">Product name</th>
|
|
|
+ <th width="15%" style="font-size: 14px; font-weight: bold; text-align: center;">Product price</th>
|
|
|
+ <th width="10%" style="font-size: 14px; font-weight: bold; text-align: center;">Quantity</th>
|
|
|
+ <th width="10%" style="font-size: 14px; font-weight: bold; text-align: center;">Tax rate</th>
|
|
|
+ <th width="10%" style="font-size: 14px; font-weight: bold; text-align: center;">Tax</th>
|
|
|
+ <th width="15%" style="font-size: 14px; font-weight: bold; text-align: center;">Total amount</th>
|
|
|
+ </tr>
|
|
|
+ {$orderDetails}
|
|
|
+ <tr>
|
|
|
+ <td colspan="3">Total</td>
|
|
|
+ <td>{$orderNums}</td>
|
|
|
+ <td></td>
|
|
|
+ <td style="text-align: right;">{$totalTaxAmount}</td>
|
|
|
+ <td style="text-align: right;">{$orderAmount}</td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div style="width: 100%; margin-top: 50px; height: 30px;">
|
|
|
+ <table width="100%" style="border: none; padding: 10px 20px; text-align: center;">
|
|
|
+ <tr style="border: none;">
|
|
|
+ <td width="70%" style="border: none;"></td>
|
|
|
+ <td width="30%" style="font-weight: bold; text-align: left; font-size: 14px; border: none;">Signature:</td>
|
|
|
+ </tr>
|
|
|
+ <tr style="border: none;">
|
|
|
+ <td width="70%" style="border: none;"></td>
|
|
|
+ <td width="30%" style="font-weight: bold; text-align: left; font-size: 14px; border: none;">Date:</td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </body>
|
|
|
- </html>
|
|
|
+ </div>
|
|
|
+ </body>
|
|
|
+ </html>
|
|
|
ORDER;
|
|
|
|
|
|
require_once (\Yii::$app->vendorPath . '/tecnickcom/tcpdf/tcpdf.php');
|