ryan 1 месяц назад
Родитель
Сommit
a0f338cf3d

+ 3 - 3
backendApi/modules/v1/controllers/ShopController.php

@@ -856,7 +856,7 @@ class ShopController extends BaseController {
             return static::notice('订单不存在', 400);
         }
         if (!$order['INVOICE_NO']) {
-            $invoiceNo = $this->generateInvoiceNo($order['COUNTRY_CODE']);
+            $invoiceNo = $this->generateInvoiceNo($order['PAY_AT'],$order['COUNTRY_CODE']);
             Order::updateAll(['INVOICE_NO' => $invoiceNo], 'SN = :SN', [':SN' => $orderSn]);
         }
 
@@ -1182,10 +1182,10 @@ class ShopController extends BaseController {
         return static::notice('成功. ' . json_encode($orderErr));
     }
 
-    public function generateInvoiceNo($country_code = '')
+    public function generateInvoiceNo($pay_at = '',$country_code = '')
     {
         $prefix = 'Inv'.$country_code;
-        $currentDate = date('dmY');
+        $currentDate = date('dmY',$pay_at?:time());
         
         // 查询今天生成的最新发票号(包含当天日期格式的)
         $order = Order::find()

+ 14 - 11
common/libs/export/BaseExport.php

@@ -1686,10 +1686,13 @@ ORDER;
                 </tr>
 EOT;
                 $orderDetails_bv .= <<<EOT
+                <tr style="text-align: left; font-weight: normal; font-size: 12px;">
+                    <td colspan="7" class="table-noborder"></td>
                     <td>{$value['SKU_CODE']}</td>
                     <td>{$value['BUY_NUMS']}</td>
                     <td>{$unitBvFormat}</td>
                     <td>{$totalBvFormat}</td>
+                </tr>
 EOT;
             }
 
@@ -1766,7 +1769,7 @@ EOT;
                             <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: 105034822400003</p>
+                            <p style="text-align: left; font-size: 13px; margin: 0 !important; padding: 0 !important; line-height: 1.3 !important;">TRN No: 105034822400003</p>
                         </div>
                         <div style="width: 25%; text-align: right;">
                             <!-- 图像将通过TCPDF直接插入 -->
@@ -1782,16 +1785,13 @@ EOT;
                                 <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>   
                                 <td>
-                                    Date: {$orderAt}
+                                    Order Code.: {$orderSn}
                                 </td>
                             </tr>
                             <tr style="text-align: left; font-size: 12px; font-weight: normal; height: 50px; vertical-align: middle;">
@@ -1799,18 +1799,24 @@ EOT;
                                     Member ID: {$userId}
                                 </td>
                                 <td>
-                                    Payment status: {$paymentStatus}
+                                    Invoice No.: {$invoiceNo}
                                 </td>
                             </tr>
                             <tr style="text-align: left; font-size: 12px; font-weight: normal; height: 50px; vertical-align: middle;">
                                 <td colspan="2">
                                     Address: {$address}
                                 </td>
+                                <td>
+                                    Date: {$orderAt}
+                                </td>
                             </tr>
                             <tr style="text-align: left; font-size: 12px; font-weight: normal; height: 50px; vertical-align: middle;">
                                 <td colspan="2">
                                     Contact: {$mobile}
                                 </td>
+                                <td>
+                                    Payment status: {$paymentStatus}
+                                </td>
                             </tr>
                         </table>
                         
@@ -1898,10 +1904,7 @@ EOT;
                                 <td>Unit BV</td>
                                 <td>Total BV</td>
                             </tr>
-                            <tr style="text-align: left; font-weight: normal; font-size: 12px;">
-                                <td colspan="7" class="table-noborder"></td>
-                                $orderDetails_bv
-                            </tr>
+                            $orderDetails_bv
                         </table>
                         
                         <table style="table-layout: fixed;">