From cce894f8b6ebf105fb8249d52f6677cca6b0f871 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Fri, 5 Sep 2014 16:38:09 +0400 Subject: [PATCH] fix customer externalId --- system/library/intarocrm/apihelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/library/intarocrm/apihelper.php b/system/library/intarocrm/apihelper.php index fc37502..ba3c7af 100644 --- a/system/library/intarocrm/apihelper.php +++ b/system/library/intarocrm/apihelper.php @@ -47,7 +47,7 @@ class ApiHelper if(count($customers) > 0 && isset($customers[0]['externalId'])) { $order['customerId'] = $customers[0]['externalId']; } else { - $order['customerId'] = ($data['customer_id'] != '') ? $data['customer_id'] : (microtime(true) * 10000) . mt_rand(1, 1000); + $order['customerId'] = ($data['customer_id'] != '') ? $data['customer_id'] : (int) substr((microtime(true) * 10000) . mt_rand(1, 1000), 10, -1); $customer['externalId'] = $order['customerId']; $customer['firstName'] = $data['firstname']; $customer['lastName'] = $data['lastname'];