1
0
mirror of synced 2024-11-22 21:36:10 +03:00

history fix; v1.0.01

This commit is contained in:
Grisha Pomadchin 2014-03-13 13:00:51 +04:00
parent 274fd7a9a4
commit 6f70fcaac7
2 changed files with 7 additions and 9 deletions

View File

@ -282,6 +282,8 @@ class ICrmOrderActions
public static function orderHistory() { public static function orderHistory() {
global $USER; global $USER;
$GLOBALS['INTARO_CRM_FROM_HISTORY'] = true;
if(isset($_SESSION["SESS_AUTH"]["USER_ID"]) && $_SESSION["SESS_AUTH"]["USER_ID"]) { if(isset($_SESSION["SESS_AUTH"]["USER_ID"]) && $_SESSION["SESS_AUTH"]["USER_ID"]) {
$realUser = $USER->GetID(); $realUser = $USER->GetID();
$USER->Logout(); $USER->Logout();
@ -368,9 +370,9 @@ class ICrmOrderActions
$dateStart = $dateStart->format('Y-m-d H:i:s'); $dateStart = $dateStart->format('Y-m-d H:i:s');
} }
$orderHistory = $api->orderHistory($dateStart); $dateFinish = new \DateTime();
$dateStart = new \DateTime($dateStart); $orderHistory = $api->orderHistory($dateStart);
// pushing existing orders // pushing existing orders
foreach ($orderHistory as $order) { foreach ($orderHistory as $order) {
@ -847,8 +849,6 @@ class ICrmOrderActions
'COMMENTS' => $order['managerComment'] 'COMMENTS' => $order['managerComment']
)); ));
$GLOBALS['INTARO_CRM_FROM_HISTORY'] = true;
CSaleOrder::Update($order['externalId'], $arFields); CSaleOrder::Update($order['externalId'], $arFields);
// set STATUS_ID // set STATUS_ID
@ -866,13 +866,11 @@ class ICrmOrderActions
// set PAYED // set PAYED
if($optionsPayment[$order['paymentStatus']]) if($optionsPayment[$order['paymentStatus']])
CSaleOrder::PayOrder($order['externalId'], $optionsPayment[$order['paymentStatus']]); CSaleOrder::PayOrder($order['externalId'], $optionsPayment[$order['paymentStatus']]);
$dateStart = new \DateTime();
} }
} }
if(count($orderHistory)) if(count($orderHistory))
COption::SetOptionString(self::$MODULE_ID, self::$CRM_ORDER_HISTORY_DATE, $dateStart->format('Y-m-d H:i:s')); COption::SetOptionString(self::$MODULE_ID, self::$CRM_ORDER_HISTORY_DATE, $dateFinish->format('Y-m-d H:i:s'));
$USER->Logout(); $USER->Logout();
if($realUser) $USER->Authorize($realUser); if($realUser) $USER->Authorize($realUser);

View File

@ -1,5 +1,5 @@
<? <?
$arModuleVersion = array( $arModuleVersion = array(
"VERSION" => "0.5.3", "VERSION" => "1.0.1",
"VERSION_DATE" => "2014-01-28 12:55:00", "VERSION_DATE" => "2014-03-13 11:57:00",
); );