本文整理汇总了PHP中CSaleOrder::DeliverOrder方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleOrder::DeliverOrder方法的具体用法?PHP CSaleOrder::DeliverOrder怎么用?PHP CSaleOrder::DeliverOrder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleOrder
的用法示例。
在下文中一共展示了CSaleOrder::DeliverOrder方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetMessage
{
$bUserCanDeliverOrder = CSaleOrder::CanUserChangeOrderFlag($ID, "D", $arUserGroups);
$errorMessageTmp = "";
if (!$bUserCanDeliverOrder)
{
$errorMessageTmp .= GetMessage("SOD_NO_PERMS2DELIV").". ";
}
else
{
$arAdditionalFields = array(
"DELIVERY_DOC_NUM" => ((strlen($DELIVERY_DOC_NUM) > 0) ? $DELIVERY_DOC_NUM : false),
"DELIVERY_DOC_DATE" => ((strlen($DELIVERY_DOC_DATE) > 0) ? $DELIVERY_DOC_DATE : false)
);
if (!CSaleOrder::DeliverOrder($ID, $ALLOW_DELIVERY, 0, $arAdditionalFields))
{
if ($ex = $APPLICATION->GetException())
{
if ($ex->GetID() != "ALREADY_FLAG")
$errorMessageTmp .= $ex->GetString();
}
else
$errorMessageTmp .= GetMessage("ERROR_DELIVERY_ORDER").". ";
}
}
if ($errorMessageTmp != "")
$arErrors[] = $errorMessageTmp;
}
else
{
示例2: CancelOrder
function CancelOrder($ID, $val, $description = "")
{
global $DB, $USER;
$ID = IntVal($ID);
$val = $val != "Y" ? "N" : "Y";
$description = Trim($description);
if ($ID <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGO_NO_ORDER_ID1"), "NO_ORDER_ID");
return False;
}
$arOrder = CSaleOrder::GetByID($ID);
if (!$arOrder) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $ID, GetMessage("SKGO_NO_ORDER")), "NO_ORDER");
return False;
}
if ($arOrder["CANCELED"] == $val) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $ID, GetMessage("SKGO_DUB_CANCEL")), "ALREADY_FLAG");
return False;
}
foreach (GetModuleEvents("sale", "OnSaleBeforeCancelOrder", true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array($ID, $val)) === false) {
return false;
}
}
if ($val == "Y") {
if ($arOrder["PAYED"] == "Y") {
if (!CSaleOrder::PayOrder($ID, "N", True, True)) {
return False;
}
} else {
$arOrder["SUM_PAID"] = DoubleVal($arOrder["SUM_PAID"]);
if ($arOrder["SUM_PAID"] > 0) {
if (!CSaleUserAccount::UpdateAccount($arOrder["USER_ID"], $arOrder["SUM_PAID"], $arOrder["CURRENCY"], "ORDER_CANCEL_PART", $ID)) {
return False;
}
}
}
if ($arOrder["ALLOW_DELIVERY"] == "Y") {
if (!CSaleOrder::DeliverOrder($ID, "N")) {
return False;
}
}
}
$arFields = array("CANCELED" => $val, "=DATE_CANCELED" => $DB->GetNowFunction(), "REASON_CANCELED" => strlen($description) > 0 ? $description : false, "EMP_CANCELED_ID" => IntVal($USER->GetID()) > 0 ? IntVal($USER->GetID()) : false);
$res = CSaleOrder::Update($ID, $arFields);
unset($GLOBALS["SALE_ORDER"]["SALE_ORDER_CACHE_" . $ID]);
//this method is used only for catalogs without reservation and deduction support
CSaleBasket::OrderCanceled($ID, $val == "Y" ? True : False);
foreach (GetModuleEvents("sale", "OnSaleCancelOrder", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($ID, $val, $description));
}
if ($val == "Y") {
CTimeZone::Disable();
$arOrder = CSaleOrder::GetByID($ID);
CTimeZone::Enable();
$userEmail = "";
$dbOrderProp = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $ID, "PROP_IS_EMAIL" => "Y"));
if ($arOrderProp = $dbOrderProp->Fetch()) {
$userEmail = $arOrderProp["VALUE"];
}
if (strlen($userEmail) <= 0) {
$dbUser = CUser::GetByID($arOrder["USER_ID"]);
if ($arUser = $dbUser->Fetch()) {
$userEmail = $arUser["EMAIL"];
}
}
$event = new CEvent();
$arFields = array("ORDER_ID" => $ID, "ORDER_DATE" => $arOrder["DATE_INSERT_FORMAT"], "EMAIL" => $userEmail, "ORDER_CANCEL_DESCRIPTION" => $description, "SALE_EMAIL" => COption::GetOptionString("sale", "order_email", "order@" . $_SERVER["SERVER_NAME"]));
$eventName = "SALE_ORDER_CANCEL";
$bSend = true;
foreach (GetModuleEvents("sale", "OnOrderCancelSendEmail", true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array($ID, &$eventName, &$arFields)) === false) {
$bSend = false;
}
}
if ($bSend) {
$event = new CEvent();
$event->Send($eventName, $arOrder["LID"], $arFields, "N");
}
if (CModule::IncludeModule("statistic")) {
CStatEvent::AddByEvents("eStore", "order_cancel", $ID, "", $arOrder["STAT_GID"]);
}
}
if ($val == "Y") {
if ($arOrder["DEDUCTED"] == "Y") {
$rs = CSaleOrder::DeductOrder($ID, "N");
if (!$rs) {
return false;
}
}
if ($arOrder["RESERVED"] == "Y") {
if (!CSaleOrder::ReserveOrder($ID, "N")) {
}
return false;
}
} else {
if (COption::GetOptionString("sale", "product_reserve_condition", "O") == "O" && $arOrder["RESERVED"] != "Y") {
if (!CSaleOrder::ReserveOrder($ID, "Y")) {
}
return false;
//.........这里部分代码省略.........
示例3: CancelOrder
function CancelOrder($ID, $val, $description = "")
{
global $DB, $USER, $APPLICATION;
$isOrderConverted = \Bitrix\Main\Config\Option::get("main", "~sale_converted_15", 'N');
$ID = IntVal($ID);
$val = $val != "Y" ? "N" : "Y";
$description = Trim($description);
if ($ID <= 0) {
$APPLICATION->ThrowException(Loc::getMessage("SKGO_NO_ORDER_ID1"), "NO_ORDER_ID");
return false;
}
$arOrder = CSaleOrder::GetByID($ID);
if (!$arOrder) {
$APPLICATION->ThrowException(str_replace("#ID#", $ID, Loc::getMessage("SKGO_NO_ORDER")), "NO_ORDER");
return false;
}
if ($arOrder["CANCELED"] == $val) {
$APPLICATION->ThrowException(str_replace("#ID#", $ID, Loc::getMessage("SKGO_DUB_CANCEL")), "ALREADY_FLAG");
return false;
}
if ($isOrderConverted == "Y") {
$r = \Bitrix\Sale\Compatible\OrderCompatibility::cancel($ID, $val, $description);
if ($r->isSuccess(true)) {
$res = true;
} else {
$errorMessage = "";
foreach ($r->getErrorMessages() as $error) {
$errorMessage .= " " . $error;
}
$APPLICATION->ThrowException(Loc::getMessage("SKGO_CANCEL_ERROR", array("#MESSAGE#" => $errorMessage)), "CANCEL_ERROR");
return false;
}
} else {
foreach (GetModuleEvents("sale", "OnSaleBeforeCancelOrder", true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array($ID, $val)) === false) {
return false;
}
}
if ($val == "Y") {
if ($arOrder["DEDUCTED"] == "Y") {
if (!CSaleOrder::DeductOrder($ID, "N")) {
return false;
}
}
if ($arOrder["RESERVED"] == "Y") {
if (!CSaleOrder::ReserveOrder($ID, "N")) {
return false;
}
}
if ($arOrder["PAYED"] == "Y") {
if (!CSaleOrder::PayOrder($ID, "N", True, True)) {
return False;
}
} else {
$arOrder["SUM_PAID"] = DoubleVal($arOrder["SUM_PAID"]);
if ($arOrder["SUM_PAID"] > 0) {
if (!CSaleUserAccount::UpdateAccount($arOrder["USER_ID"], $arOrder["SUM_PAID"], $arOrder["CURRENCY"], "ORDER_CANCEL_PART", $ID)) {
return False;
}
CSaleOrder::Update($arOrder["ID"], array("SUM_PAID" => 0));
}
}
if ($arOrder["ALLOW_DELIVERY"] == "Y") {
if (!CSaleOrder::DeliverOrder($ID, "N")) {
return False;
}
}
} else {
if (COption::GetOptionString("sale", "product_reserve_condition", "O") == "O" && $arOrder["RESERVED"] != "Y") {
if (!CSaleOrder::ReserveOrder($ID, "Y")) {
return false;
}
}
}
$arFields = array("CANCELED" => $val, "=DATE_CANCELED" => $DB->GetNowFunction(), "REASON_CANCELED" => strlen($description) > 0 ? $description : false, "EMP_CANCELED_ID" => IntVal($USER->GetID()) > 0 ? IntVal($USER->GetID()) : false);
$res = CSaleOrder::Update($ID, $arFields);
}
unset($GLOBALS["SALE_ORDER"]["SALE_ORDER_CACHE_" . $ID]);
if ($isOrderConverted != "Y") {
//this method is used only for catalogs without reservation and deduction support
CSaleBasket::OrderCanceled($ID, $val == "Y" ? True : False);
foreach (GetModuleEvents("sale", "OnSaleCancelOrder", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($ID, $val, $description));
}
}
if ($val == "Y") {
CTimeZone::Disable();
$arOrder = CSaleOrder::GetByID($ID);
CTimeZone::Enable();
$userEmail = "";
$dbOrderProp = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $ID, "PROP_IS_EMAIL" => "Y"));
if ($arOrderProp = $dbOrderProp->Fetch()) {
$userEmail = $arOrderProp["VALUE"];
}
if (strlen($userEmail) <= 0) {
$dbUser = CUser::GetByID($arOrder["USER_ID"]);
if ($arUser = $dbUser->Fetch()) {
$userEmail = $arUser["EMAIL"];
}
}
//.........这里部分代码省略.........
示例4: nodeHandler
//.........这里部分代码省略.........
$arFields = array();
if (!empty($v["items"][$arBasket["PRODUCT_XML_ID"]])) {
if ($arBasket["QUANTITY"] != $v["items"][$arBasket["PRODUCT_XML_ID"]]["QUANTITY"]) {
$arFields["QUANTITY"] = $v["items"][$arBasket["PRODUCT_XML_ID"]]["QUANTITY"];
}
if ($arBasket["PRICE"] != $v["items"][$arBasket["PRODUCT_XML_ID"]]["PRICE"]) {
$arFields["PRICE"] = $v["items"][$arBasket["PRODUCT_XML_ID"]]["PRICE"];
}
if ($arBasket["VAT_RATE"] != $v["items"][$arBasket["PRODUCT_XML_ID"]]["VAT_RATE"]) {
$arFields["VAT_RATE"] = $v["items"][$arBasket["PRODUCT_XML_ID"]]["VAT_RATE"];
}
if ($arBasket["DISCOUNT_PRICE"] != $v["items"][$arBasket["PRODUCT_XML_ID"]]["DISCOUNT_PRICE"]) {
$arFields["DISCOUNT_PRICE"] = $v["items"][$arBasket["PRODUCT_XML_ID"]]["DISCOUNT_PRICE"];
}
if (count($arFields) > 0) {
CSaleBasket::Update($arBasket["ID"], $arFields);
}
$v["items"][$arBasket["PRODUCT_XML_ID"]]["CHECKED"] = "Y";
} else {
CSaleBasket::Delete($arBasket["ID"]);
}
}
foreach ($v["items"] as $itemID => $arItem) {
if ($arItem["CHECKED"] != "Y") {
if ($arItem["TYPE"] == GetMessage("CC_BSC1_ITEM")) {
CModule::IncludeModule("iblock");
$dbIBlockElement = CIBlockElement::GetList(array(), array("XML_ID" => $itemID, "ACTIVE" => "Y", "CHECK_PERMISSIONS" => "Y"), false, false, array("ID", "IBLOCK_ID", "XML_ID", "NAME", "DETAIL_PAGE_URL"));
if ($arIBlockElement = $dbIBlockElement->GetNext()) {
$dbIBlock = CIBlock::GetList(array(), array("ID" => $arIBlockElement["IBLOCK_ID"]));
if ($arIBlock = $dbIBlock->Fetch()) {
$arProps[] = array("NAME" => "Catalog XML_ID", "CODE" => "CATALOG.XML_ID", "VALUE" => $arIBlock["XML_ID"]);
}
$arProps[] = array("NAME" => "Product XML_ID", "CODE" => "PRODUCT.XML_ID", "VALUE" => $arIBlockElement["XML_ID"]);
$arProduct = CCatalogProduct::GetByID($arIBlockElement["ID"]);
$arFields = array("ORDER_ID" => $orderId, "PRODUCT_ID" => $arIBlockElement["ID"], "PRICE" => $arItem["PRICE"], "CURRENCY" => $orderInfo["CURRENCY"], "WEIGHT" => $arProduct["WEIGHT"], "QUANTITY" => $arItem["QUANTITY"], "LID" => $orderInfo["LID"], "DELAY" => "N", "CAN_BUY" => "Y", "NAME" => $arIBlockElement["~NAME"], "CALLBACK_FUNC" => "CatalogBasketCallback", "MODULE" => "catalog", "NOTES" => $arProduct["CATALOG_GROUP_NAME"], "ORDER_CALLBACK_FUNC" => "CatalogBasketOrderCallback", "CANCEL_CALLBACK_FUNC" => "CatalogBasketCancelCallback", "PAY_CALLBACK_FUNC" => "CatalogPayOrderCallback", "DETAIL_PAGE_URL" => $arIBlockElement["DETAIL_PAGE_URL"], "CATALOG_XML_ID" => $arIBlock["XML_ID"], "PRODUCT_XML_ID" => $arIBlockElement["XML_ID"], "IGNORE_CALLBACK_FUNC" => "Y", "VAT_RATE" => $arItem["VAT_RATE"]);
CSaleBasket::Add($arFields);
} else {
$this->strError .= "\n" . GetMessage("CC_BSC1_PRODUCT_NOT_FOUND") . $orderId . " - [" . $itemID . "] " . $arItem["NAME"];
}
} elseif ($arItem["TYPE"] == GetMessage("CC_BSC1_SERVICE")) {
if (IntVal($arItem["PRICE"]) != IntVal($orderInfo["PRICE_DELIVERY"])) {
CSaleOrder::Update($orderId, array("PRICE_DELIVERY" => $arItem["PRICE"]));
}
}
}
}
$arOrderFields = array();
if ($v["AMOUNT"] != $orderInfo["PRICE"]) {
$arOrderFields = array("PRICE" => $v["AMOUNT"]);
}
if (DoubleVal($orderInfo["DISCOUNT_VALUE"]) > 0) {
$arOrderFields["DISCOUNT_VALUE"] = 0;
}
$arOrderFields["UPDATED_1C"] = "Y";
if (!empty($arOrderFields)) {
CSaleOrder::Update($orderId, $arOrderFields);
}
} else {
$this->strError .= "\n" . GetMessage("CC_BSC1_FINAL_NOT_EDIT", array("#ID#" => $orderId));
}
$arAditFields = array();
if ($v["TRAITS"][GetMessage("CC_BSC1_CANCELED")] == "true") {
if ($orderInfo["CANCELED"] == "N") {
CSaleOrder::CancelOrder($orderId, "Y", $v["COMMENT"]);
}
$arAditFields["UPDATED_1C"] = "Y";
} else {
if ($orderInfo["CANCELED"] == "Y") {
CSaleOrder::CancelOrder($orderId, "N", $v["COMMENT"]);
}
$arAditFields["UPDATED_1C"] = "Y";
if (strlen($v["TRAITS"][GetMessage("CC_BSC1_1C_PAYED_DATE")]) > 1) {
if ($orderInfo["PAYED"] == "N") {
CSaleOrder::PayOrder($orderId, "Y");
}
$arAditFields["PAY_VOUCHER_DATE"] = CDatabase::FormatDate(str_replace("T", " ", $v["TRAITS"][GetMessage("CC_BSC1_1C_PAYED_DATE")]), "YYYY-MM-DD HH:MI:SS", CLang::GetDateFormat("FULL", LANG));
if (strlen($v["TRAITS"][GetMessage("CC_BSC1_1C_PAYED_NUM")]) > 0) {
$arAditFields["PAY_VOUCHER_NUM"] = $v["TRAITS"][GetMessage("CC_BSC1_1C_PAYED_NUM")];
}
$arAditFields["UPDATED_1C"] = "Y";
}
if (strlen($v["TRAITS"][GetMessage("CC_BSC1_1C_DELIVERY_DATE")]) > 1) {
if ($orderInfo["ALLOW_DELIVERY"] == "N") {
CSaleOrder::DeliverOrder($orderId, "Y");
}
$arAditFields["DATE_ALLOW_DELIVERY"] = CDatabase::FormatDate(str_replace("T", " ", $v["TRAITS"][GetMessage("CC_BSC1_1C_DELIVERY_DATE")]), "YYYY-MM-DD HH:MI:SS", CLang::GetDateFormat("FULL", LANG));
if (strlen($arParams["FINAL_STATUS_ON_DELIVERY"]) > 0 && $orderInfo["STATUS_ID"] != "F" && $orderInfo["STATUS_ID"] != $arParams["FINAL_STATUS_ON_DELIVERY"]) {
CSaleOrder::StatusOrder($orderId, $arParams["FINAL_STATUS_ON_DELIVERY"]);
}
$arAditFields["UPDATED_1C"] = "Y";
}
}
if (count($arAditFields) > 0) {
CSaleOrder::Update($orderId, $arAditFields);
}
} else {
$this->strError .= "\n" . GetMessage("CC_BSC1_ORDER_NOT_FOUND", array("#ID#" => $orderId));
}
}
}
示例5: nodeHandler
//.........这里部分代码省略.........
$arOrderFields["COMMENTS"] = $arOrder["COMMENT"];
$arOrderFields["UPDATED_1C"] = "Y";
if(!empty($arOrderFields))
CSaleOrder::Update($orderId, $arOrderFields);
}
else
{
$this->strError .= "\n".GetMessage("CC_BSC1_FINAL_NOT_EDIT", Array("#ID#" => $orderId));
}
}
$arAditFields = Array();
if($arOrder["TRAITS"][GetMessage("CC_BSC1_CANCELED")] == "true")
{
if($orderInfo["CANCELED"] == "N")
CSaleOrder::CancelOrder($orderInfo["ID"], "Y", $arOrder["COMMENT"]);
$arAditFields["UPDATED_1C"] = "Y";
}
else
{
if(strlen($arOrder["TRAITS"][GetMessage("CC_BSC1_1C_PAYED_DATE")])>1)
{
if($orderInfo["PAYED"]=="N")
CSaleOrder::PayOrder($orderInfo["ID"], "Y");
$arAditFields["PAY_VOUCHER_DATE"] = CDatabase::FormatDate(str_replace("T", " ", $arOrder["TRAITS"][GetMessage("CC_BSC1_1C_PAYED_DATE")]), "YYYY-MM-DD HH:MI:SS", CLang::GetDateFormat("FULL", LANG));
if(strlen($arOrder["TRAITS"][GetMessage("CC_BSC1_1C_PAYED_NUM")])>0)
$arAditFields["PAY_VOUCHER_NUM"] = $arOrder["TRAITS"][GetMessage("CC_BSC1_1C_PAYED_NUM")];
$arAditFields["UPDATED_1C"] = "Y";
}
if(strlen($arOrder["TRAITS"][GetMessage("CC_BSC1_1C_DELIVERY_DATE")])>1)
{
if($orderInfo["ALLOW_DELIVERY"]=="N")
CSaleOrder::DeliverOrder($orderInfo["ID"], "Y");
$arAditFields["DATE_ALLOW_DELIVERY"] = CDatabase::FormatDate(str_replace("T", " ", $arOrder["TRAITS"][GetMessage("CC_BSC1_1C_DELIVERY_DATE")]), "YYYY-MM-DD HH:MI:SS", CLang::GetDateFormat("FULL", LANG));
if(strlen($this->arParams["FINAL_STATUS_ON_DELIVERY"])>0 && $orderInfo["STATUS_ID"] != "F" && $orderInfo["STATUS_ID"] != $this->arParams["FINAL_STATUS_ON_DELIVERY"])
CSaleOrder::StatusOrder($orderInfo["ID"], $this->arParams["FINAL_STATUS_ON_DELIVERY"]);
$arAditFields["UPDATED_1C"] = "Y";
}
}
if(count($arAditFields)>0)
CSaleOrder::Update($orderInfo["ID"], $arAditFields);
}
else
$this->strError .= "\n".GetMessage("CC_BSC1_ORDER_NOT_FOUND", Array("#ID#" => $arOrder["ID"]));
}
elseif($this->arParams["IMPORT_NEW_ORDERS"] == "Y") // create new order (ofline 1C)
{
if(!empty($arOrder["AGENT"]) && strlen($arOrder["AGENT"]["ID"]) > 0)
{
$arOrder["PERSON_TYPE_ID"] = 0;
$arOrder["USER_ID"] = 0;
$arErrors = array();
$dbUProp = CSaleOrderUserProps::GetList(array(), array("XML_ID" => $arOrder["AGENT"]["ID"]), false, false, array("ID", "NAME", "USER_ID", "PERSON_TYPE_ID", "XML_ID", "VERSION_1C"));
if($arUProp = $dbUProp->Fetch())
{
$arOrder["USER_ID"] = $arUProp["USER_ID"];
$arOrder["PERSON_TYPE_ID"] = $arUProp["PERSON_TYPE_ID"];
$arOrder["USER_PROFILE_ID"] = $arUProp["ID"];
$arOrder["USER_PROFILE_VERSION"] = $arUProp["VERSION_1C"];
$dbUPropValue = CSaleOrderUserPropsValue::GetList(array(), array("USER_PROPS_ID" => $arUProp["ID"]));
while($arUPropValue = $dbUPropValue->Fetch())
{
$arOrder["USER_PROPS"][$arUPropValue["ORDER_PROPS_ID"]] = $arUPropValue["VALUE"];
示例6: __MakeOrder
elseif($key == "PHONE")
$arProp["VALUE"] = "8 495 2312121";
elseif($key == "ZIP")
$arProp["VALUE"] = "101000";
elseif($key == "LOCATION")
$arProp["VALUE"] = $location;
elseif($key == "CITY")
$arProp["VALUE"] = $shopLocation;
$arData["PROPS"][] = $arProp;
}
$orderID = __MakeOrder(3, $arData);
CSaleOrder::DeliverOrder($orderID, "Y");
CSaleOrder::PayOrder($orderID, "Y");
CSaleOrder::StatusOrder($orderID, "F");
$orderID = __MakeOrder(4, $arData);
CSaleOrder::DeliverOrder($orderID, "Y");
CSaleOrder::PayOrder($orderID, "Y");
CSaleOrder::StatusOrder($orderID, "F");
$orderID = __MakeOrder(2, $arData);
CSaleOrder::PayOrder($orderID, "Y");
CSaleOrder::StatusOrder($orderID, "P");
$orderID = __MakeOrder(1, $arData);
$orderID = __MakeOrder(3, $arData);
CSaleOrder::CancelOrder($orderID, "Y");
CAgent::RemoveAgent("CSaleProduct::RefreshProductList();", "sale");
CAgent::AddAgent("CSaleProduct::RefreshProductList();", "sale", "N", 60*60*24*4, "", "Y");
}
}
return true;
?>
示例7: GetMessage
else
{
$lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("SOA_PERMS_DELIV_GROUP")), $ID);
}
}
else
{
$lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("SOA_PERMS_DELIV_GROUP_DELIV")), $ID);
}
break;
case "allow_delivery_n":
if($arAffectedOrders[$ID]["ALLOW_DELIVERY"] == "Y")
{
if (CSaleOrder::CanUserChangeOrderFlag($ID, "PERM_DELIVERY", $arUserGroups))
{
if (!CSaleOrder::DeliverOrder($ID, "N"))
{
if ($ex = $APPLICATION->GetException())
$lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("SOA_ERROR_DELIV_GROUP")).": ".$ex->GetString(), $ID);
else
$lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("SOA_ERROR_DELIV_GROUP")), $ID);
}
}
else
{
$lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("SOA_PERMS_DELIV_GROUP")), $ID);
}
}
else
{
$lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("SOA_PERMS_DELIV_GROUP_DELIV_N")), $ID);
示例8: mapYandexStatusToOrder
protected function mapYandexStatusToOrder($order, $yandexStatus, $cancelReason = "")
{
global $APPLICATION;
if (!is_array($order) || !isset($order["ID"]) || strlen($yandexStatus) <= 0) {
return false;
}
$settings = $this->getSettingsBySiteId($order["LID"]);
if (!isset($settings["STATUS_IN"][$yandexStatus]) || strlen($settings["STATUS_IN"][$yandexStatus]) <= 0) {
return false;
}
$result = false;
$bitrixStatus = $settings["STATUS_IN"][$yandexStatus];
switch ($bitrixStatus) {
/* flags */
case "CANCELED":
$errorMessageTmp = "";
$result = CSaleOrder::CancelOrder($order["ID"], "Y", $cancelReason);
if (!$result) {
if ($ex = $APPLICATION->GetException()) {
if ($ex->GetID() != "ALREADY_FLAG") {
$errorMessageTmp .= $ex->GetString();
}
} else {
$errorMessageTmp .= GetMessage("ERROR_CANCEL_ORDER") . ". ";
}
}
if ($errorMessageTmp != "") {
$this->log(self::LOG_LEVEL_ERROR, "YMARKET_INCOMING_ORDER_STATUS", $order["XML_ID"], $errorMessageTmp);
} else {
$this->log(self::LOG_LEVEL_INFO, "YMARKET_INCOMING_ORDER_STATUS", $order["XML_ID"], GetMessage("SALE_YMH_INCOMING_ORDER_STATUS_CANCELED") . ": " . $order["ID"]);
}
break;
case "ALLOW_DELIVERY":
$result = CSaleOrder::DeliverOrder($order["ID"], "Y");
break;
case "PAYED":
$result = CSaleOrder::PayOrder($order["ID"], "Y");
break;
case "DEDUCTED":
$result = CSaleOrder::DeductOrder($order["ID"], "Y");
break;
/* statuses */
/* statuses */
default:
if (CSaleStatus::GetByID($bitrixStatus)) {
$result = CSaleOrder::StatusOrder($order["ID"], $bitrixStatus);
}
break;
}
$this->log($result ? self::LOG_LEVEL_INFO : self::LOG_LEVEL_ERROR, "YMARKET_ORDER_STATUS_CHANGE", $order["ID"], ($result ? GetMessage("SALE_YMH_LOG_TYPE_ORDER_STATUS_CHANGE_OK") : GetMessage("SALE_YMH_LOG_TYPE_ORDER_STATUS_CHANGE_ERROR")) . " (" . $bitrixStatus . ")");
return $result;
}
示例9: array
case "get_order_html":
$arOrder = CSaleMobileOrderUtils::getOrderInfoDetail($id);
$result = CSaleMobileOrderUtils::makeDetailClassFromOrder($arOrder);
break;
case "delivery_allow":
$bUserCanDeliverOrder = CSaleOrder::CanUserChangeOrderFlag($id, "PERM_DELIVERY", $GLOBALS["USER"]->GetUserGroupArray());
if (!$bUserCanDeliverOrder) {
break;
}
$arAdditionalFields = array();
if ($status_id && CSaleOrder::CanUserChangeOrderStatus($id, $status_id, $GLOBALS["USER"]->GetUserGroupArray())) {
$arAdditionalFields = array("STATUS_ID" => $status_id);
}
$deliver = isset($_REQUEST['deliver']) ? trim($_REQUEST['deliver']) : '';
if ($deliver) {
$result = CSaleOrder::DeliverOrder($id, $deliver, 0, $arAdditionalFields);
} elseif (!empty($arAdditionalFields)) {
$result = CSaleOrder::Update($id, $arAdditionalFields);
}
break;
case "order_pay":
$bUserCanPayOrder = CSaleOrder::CanUserChangeOrderFlag($id, "PERM_PAYMENT", $GLOBALS["USER"]->GetUserGroupArray());
if (!$bUserCanPayOrder) {
break;
}
$payed = isset($_REQUEST['payed']) ? trim($_REQUEST['payed']) : 'N';
$pay_from_account = isset($_REQUEST['pay_from_account']) ? trim($_REQUEST['pay_from_account']) : 'N';
$pay_from_account_back = isset($_REQUEST['pay_from_account_back']) ? trim($_REQUEST['pay_from_account_back']) : 'N';
$arAdditionalFields = array();
if ($status_id && CSaleOrder::CanUserChangeOrderStatus($id, $status_id, $GLOBALS["USER"]->GetUserGroupArray())) {
$arAdditionalFields = array("STATUS_ID" => $status_id);
示例10: NextPayment
//.........这里部分代码省略.........
{
if (ExecuteModuleEventEx($arEvent, Array($newOrderID, &$eventName, &$arFields))===false)
$bSend = false;
}
if($bSend)
{
$event = new CEvent;
$event->Send($eventName, $arOrder["LID"], $arFields, "N");
}
}
if ($bSuccess)
$DB->Commit();
else
$DB->Rollback();
}
}
else
{
$totalOrderPrice = $arOrder["PRICE"];
$baseSiteCurrency = $arOrder["CURRENCY"];
}
$res = False;
if ($bSuccess)
{
$res = CSaleUserAccount::Pay($arOrder["USER_ID"], $totalOrderPrice, $baseSiteCurrency, $newOrderID, True);
if ($res)
{
if ($arProduct["WITHOUT_ORDER"] == "N")
{
CSaleOrder::PayOrder($newOrderID, "Y", False, False, $arRecur["ID"]);
CSaleOrder::DeliverOrder($newOrderID, "Y", $arRecur["ID"]);
CSaleOrder::DeductOrder($newOrderID, "Y", "", true, array(), $arRecur["ID"]);
}
else
{
/** @var $productProvider IBXSaleProductProvider */
if ($productProvider = CSaleBasket::GetProductProvider($arProduct))
{
$r = $productProvider::DeliverProduct(array(
"PRODUCT_ID" => $arProduct["PRODUCT_ID"],
"USER_ID" => $arOrder["USER_ID"],
"PAID" => true
));
}
else
{
$r = CSaleBasket::ExecuteCallbackFunction(
$arProduct["PAY_CALLBACK_FUNC"],
$arRecur["MODULE"],
$arProduct["PRODUCT_ID"],
$arOrder["USER_ID"],
true
);
}
}
$arFields = array(
"ORDER_ID" => $newOrderID,
"PRODUCT_NAME" => $arProduct["PRODUCT_NAME"],
"PRODUCT_URL" => $arProduct["PRODUCT_URL"],
"PRICE_TYPE" => $arProduct["PRICE_TYPE"],
"RECUR_SCHEME_TYPE" => $arProduct["RECUR_SCHEME_TYPE"],
"RECUR_SCHEME_LENGTH" => $arProduct["RECUR_SCHEME_LENGTH"],
示例11: array
$strPS_STATUS_DESCRIPTION .= "INT_REF: " . $p_int_ref . "; ";
$arFields = array("PS_STATUS" => "N", "PS_STATUS_CODE" => $p_action, "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION, "PS_STATUS_MESSAGE" => "", "PS_SUM" => $p_amount, "PS_CURRENCY" => $p_currency, "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))));
if (strlen($p_extcode) > 0 && $p_extcode != "NONE") {
$arFields["PS_STATUS_MESSAGE"] .= GetMessage("EXTCODE_" . $p_extcode) . ". ";
}
if ($sign == $p_sign) {
if ($p_action == "0" && ($p_rc = "00")) {
if (DoubleVal($p_amount) == DoubleVal($arOrder["PRICE"]) && $p_currency == $currency) {
echo $PAY_OK;
$bError = false;
$arFields["PS_STATUS"] = "Y";
if ($arOrder["PAYED"] != "Y") {
CSaleOrder::PayOrder($arOrder["ID"], "Y", true, true);
}
if ($arOrder["ALLOW_DELIVERY"] != "Y" && $ALLOW_DELIVERY == "Y") {
CSaleOrder::DeliverOrder($arOrder["ID"], "Y");
}
$trtype = 21;
$time = gmdate("YmdHis", time());
$var = unpack("H*r", ToUpper(substr(md5(uniqid(30)), 0, 8)));
$nonce = $var[r];
$signew = bx_hmac("sha1", strlen($order) . $order . strlen($amount) . $amount . strlen($currency) . $currency . strlen($p_rrn) . $p_rrn . strlen($p_int_ref) . $p_int_ref . strlen($trtype) . $trtype . strlen($terminal) . $terminal . strlen($time) . $time . strlen($nonce) . $nonce, $key);
$res = "";
$res .= "TRTYPE=" . $trtype;
$res .= "&ORDER=" . $order;
$res .= "&AMOUNT=" . $amount;
$res .= "&CURRENCY=" . $currency;
$res .= "&RRN=" . $p_rrn;
$res .= "&INT_REF=" . $p_int_ref;
$res .= "&TERMINAL=" . $terminal;
$res .= "&TIMESTAMP=" . $time;