"seller_id" => $createCheck->seller_id,
"order_id" => trim($createCheck->order_id),
"type" => $createCheck->type,
+ "phone" => $createCheck->phone,
"id" => $createCheck->check_id,
"sales_check" => $createCheck->sales_check,
"items" => json_decode($createCheck->items, true, 512, JSON_UNESCAPED_UNICODE),
echo"<tr>
<td class=\"text-center\"><b class=\"mr-2 ml-2\">".str_replace(".00","",$item["quantity"])."</b></td>
<td class=\"text-left\">".$item["name"]."</td>
- <td>".$item["color_id"]."</td>
+ <td>";
+ $colorId = (array_key_exists("color_id",$item) && !empty($item["color_id"])) ? $item["color_id"] : '';
+ echo $colorId;
+ echo "</td>
<td class=\"text-center\">".str_replace(".00","",$item["price"])."</td></tr>";
}
try {
$check_id=create_guid_my("01",$order_id);
if(empty($seller_id)) $seller_id="00000000-0000-0000-0000-000000000000";
-
-$db::sql("INSERT INTO create_checks (check_id,date,kkm_id,seller_id, store_id, type, order_id,items,payments) VALUES (?,NOW(),?,?,?,?,?,?,?)",
-[$check_id,$kkm_id, $seller_id ,$store_id, "Продажа", $order_id, json_encode($products, JSON_UNESCAPED_UNICODE), json_encode($payments, JSON_UNESCAPED_UNICODE) ]);
+$phone = $row['phone'] ?? null;
+$db::sql("INSERT INTO create_checks (check_id,date,kkm_id,seller_id, store_id, type, order_id,items,payments,phone) VALUES (?,NOW(),?,?,?,?,?,?,?,?)",
+[$check_id,$kkm_id, $seller_id ,$store_id, "Продажа", $order_id, json_encode($products, JSON_UNESCAPED_UNICODE), json_encode($payments, JSON_UNESCAPED_UNICODE), $phone]);
echo"<h1>Чек поставлен в очередь на пробитие в 1с $check_id</h1>";
}
catch (Exception $e) {