|
|
@@ -1582,7 +1582,13 @@ ORDER;
|
|
|
$invoiceRemark = '';
|
|
|
$paymentMethod = ''; // 支付方式
|
|
|
$currency = '';
|
|
|
- $invoiceNo = '';
|
|
|
+ $invoiceNo = $oderList[0]['INVOICE_NO'] ?: Tool::generateInvoiceNo();
|
|
|
+ if (!$oderList[0]['INVOICE_NO']) {
|
|
|
+ // 写入发票号
|
|
|
+ $orderModel = Order::find()->where(['SN' => $oderList[0]['ORDER_SN']])->one();
|
|
|
+ $orderModel->INVOICE_NO = $invoiceNo;
|
|
|
+ $orderModel->save();
|
|
|
+ }
|
|
|
|
|
|
$orderTotalBv = 0;
|
|
|
$orderTotalTaxAmount = 0;
|
|
|
@@ -1590,10 +1596,9 @@ ORDER;
|
|
|
$orderTotal = 0;
|
|
|
$orderTotalQuantity = count($oderList);
|
|
|
|
|
|
- LoggerTool::debug($oderList);
|
|
|
-
|
|
|
foreach ($oderList as $key => $value) {
|
|
|
$no = $key + 1;
|
|
|
+ $invoiceNo = $value['INVOICE_NO'] ?: Tool::generateInvoiceNo();
|
|
|
$invoiceRemark = $value['INVOICE_REMARK'] ?: '';
|
|
|
$provinceName = $value['PROVINCE'] ? Region::getCnName($value['PROVINCE']) : '';
|
|
|
$cityName = $value['CITY'] ? Region::getCnName($value['CITY']) : '';
|
|
|
@@ -1621,7 +1626,6 @@ ORDER;
|
|
|
$orderTotalTaxAmount += $taxAmount;
|
|
|
$orderTotalAmount += $totalAmount - $taxAmount;
|
|
|
$orderTotal += $totalAmount;
|
|
|
- $invoiceNo = '123213123123';
|
|
|
|
|
|
$totalBvFormat = Tool::formatAmount($totalBv);
|
|
|
$taxableAmountFormat =Tool::formatAmount($taxAmount);
|
|
|
@@ -1633,8 +1637,8 @@ ORDER;
|
|
|
|
|
|
// 订单详情
|
|
|
$orderDetails .= <<<EOT
|
|
|
- <tr style="text-align: left; padding: 10px 5px; font-weight: normal; font-size: 13px;">
|
|
|
- <td>{$no}</td>
|
|
|
+ <tr style="text-align: left; padding: 10px 5px; font-weight: normal; font-size: 12px;">
|
|
|
+ <td style="width: 20px;">{$no}</td>
|
|
|
<td>{$value['SKU_CODE']}</td>
|
|
|
<td>{$value['GOODS_TITLE']}</td>
|
|
|
<td>{$value['BUY_NUMS']}</td>
|
|
|
@@ -1769,7 +1773,7 @@ EOT;
|
|
|
<br />
|
|
|
<table border="1" width="100%">
|
|
|
<tr style="text-align: left; font-weight: normal; font-size: 12px;">
|
|
|
- <th>No.</th>
|
|
|
+ <th style="width: 20px;">No.</th>
|
|
|
<th>Product Code</th>
|
|
|
<th>Product Name</th>
|
|
|
<th>Quantity</th>
|