]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Добавление телефона в чек при создании его из ERP от AMO
authorAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Thu, 3 Oct 2024 13:45:50 +0000 (16:45 +0300)
committerAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Thu, 3 Oct 2024 13:45:50 +0000 (16:45 +0300)
erp24/controllers/OrdersController.php
erp24/records/CreateChecks.php

index a563e2612fd74f1fbc924186dcd98be31f143d78..25b6a491058b65c0d0e4352cb8fb64345adbcc52 100644 (file)
@@ -321,7 +321,7 @@ class OrdersController extends Controller
                         try {
                             $check_id = create_guid_my("01", $order_id);
                             if (empty($seller_id)) $seller_id = "00000000-0000-0000-0000-000000000000";
-                            $check = new CreateChecks(['check_id' => $check_id, 'date' => date('Y-m-d H:i:s'), 'kkm_id' => $kkm_id, 'seller_id' => $seller_id, 'store_id' => $store_id, 'type' => "Продажа", 'order_id' => $order_id, 'items' => json_encode($products, JSON_UNESCAPED_UNICODE), 'payments' => json_encode($payments, JSON_UNESCAPED_UNICODE)]);
+                            $check = new CreateChecks(['check_id' => $check_id, 'date' => date('Y-m-d H:i:s'), 'kkm_id' => $kkm_id, 'seller_id' => $seller_id, 'store_id' => $store_id, 'type' => "Продажа", 'order_id' => $order_id, 'items' => json_encode($products, JSON_UNESCAPED_UNICODE), 'payments' => json_encode($payments, JSON_UNESCAPED_UNICODE),'phone' => $row["phone"] ?? NULL]);
 
                             echo "<h1>Чек поставлен в очередь на пробитие в 1с $check_id</h1>";
                         } catch (Exception $e) {
index 37f45874502f72fded7112b8999b347afb469115..9e5c95d6fa4f07612352343b3304ddc36a5648cf 100644 (file)
@@ -45,8 +45,9 @@ class CreateChecks extends \yii\db\ActiveRecord
             [['kkm_id', 'store_id', 'order_id', 'check_id', 'guid', 'name', 'sales_check', 'items', 'payments', 'held', 'date', 'comments'], 'required'],
             [['order_id', 'held', 'status'], 'integer'],
             [['type', 'items', 'payments'], 'string'],
-            [['date', 'delivery_date', 'date_up'], 'safe'],
+            [['date', 'delivery_date', 'date_up', 'phone'], 'safe'],
             [['kkm_id', 'seller_id', 'store_id', 'check_id', 'guid', 'sales_check'], 'string', 'max' => 36],
+            [['phone'], 'string', 'max' => 25],
             [['name', 'comments'], 'string', 'max' => 255],
             [['order_id', 'check_id', 'type', 'date'], 'unique', 'targetAttribute' => ['order_id', 'check_id', 'type', 'date']],
         ];