コード例 #1
0
ファイル: user.php プロジェクト: andy-profi/bxApiDocs
 static function DoPayOrderFromAccount($userId, $currency, $orderId, $orderSum, $arOptions, &$arErrors)
 {
     if (!array_key_exists("ONLY_FULL_PAY_FROM_ACCOUNT", $arOptions)) {
         $arOptions["ONLY_FULL_PAY_FROM_ACCOUNT"] = COption::GetOptionString("sale", "ONLY_FULL_PAY_FROM_ACCOUNT", "N");
     }
     $dbUserAccount = CSaleUserAccount::GetList(array(), array("USER_ID" => $userId, "CURRENCY" => $currency));
     $arUserAccount = $dbUserAccount->Fetch();
     if (!$arUserAccount) {
         return false;
     }
     if ($arUserAccount["CURRENT_BUDGET"] <= 0) {
         return false;
     }
     if ($arOptions["ONLY_FULL_PAY_FROM_ACCOUNT"] == "Y" && doubleval($arUserAccount["CURRENT_BUDGET"]) < doubleval($orderSum)) {
         return false;
     }
     $withdrawSum = CSaleUserAccount::Withdraw($userId, $orderSum, $currency, $orderId);
     if ($withdrawSum > 0) {
         $arFields = array("SUM_PAID" => $withdrawSum, "USER_ID" => $userId);
         CSaleOrder::Update($orderId, $arFields);
         if ($withdrawSum == $orderSum) {
             CSaleOrder::PayOrder($orderId, "Y", False, False);
         }
         return true;
     }
     return false;
 }
コード例 #2
0
ファイル: Order.class.php プロジェクト: AlexSmerw/domino
 public function setPayed($value)
 {
     $value = (bool) $value ? 'Y' : 'N';
     if ($value == 'Y') {
         \CSaleOrder::PayOrder($this['ID'], 'Y');
     } else {
         $data = array('PAYED' => (bool) $value ? 'Y' : 'N', 'DATE_PAYED' => Date(\CDatabase::DateFormatToPHP(\CLang::GetDateFormat('FULL', LANG))), 'USER_ID' => $this['USER_ID']);
         return \CSaleOrder::Update($this['ID'], $data);
     }
 }
コード例 #3
0
	protected function mark_order_as_completed($order, array $data) {
		CSaleOrder::PayOrder($order['ID'], 'Y');
		CSaleOrder::Update($order['ID'], array(
			'PS_STATUS' => 'Y',
			'PS_SUM' => $data['amount'],
			'PS_CURRENCY' => $data['currency'],
			'PS_STATUS_MESSAGE' => $data['message'],
			'PS_RESPONSE_DATE' => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat('FULL', LANG))),
		));
	}
コード例 #4
0
function AutoPayOrder($_1756592745)
{
    $_1756592745 = IntVal($_1756592745);
    $_1691926443 = CSaleOrder::$GLOBALS['_____964307792'][6]($_1756592745);
    if (!$_1691926443) {
        return false;
    }
    if ($_1691926443[___1555869721(428)] != ___1555869721(429)) {
        return false;
    }
    if ($_1691926443[___1555869721(430)] != ___1555869721(431)) {
        return false;
    }
    if ($_1691926443[___1555869721(432)] == $_1691926443[___1555869721(433)] && DoubleVal($_1691926443[___1555869721(434)]) == DoubleVal($_1691926443[___1555869721(435)])) {
        if (CSaleOrder::PayOrder($_77363853[___1555869721(436)], ___1555869721(437), True, False)) {
            return true;
        }
    }
    return false;
}
コード例 #5
0
ファイル: include.php プロジェクト: k-kalashnikov/geekcon_new
function AutoPayOrder($ORDER_ID)
{
    $ORDER_ID = IntVal($ORDER_ID);
    $arOrder = CSaleOrder::GetByID($ORDER_ID);
    if (!$arOrder) {
        return false;
    }
    if ($arOrder["PS_STATUS"] != "Y") {
        return false;
    }
    if ($arOrder["PAYED"] != "N") {
        return false;
    }
    if ($arOrder["CURRENCY"] == $arOrder["PS_CURRENCY"] && DoubleVal($arOrder["PRICE"]) == DoubleVal($arOrder["PS_SUM"])) {
        if (CSaleOrder::PayOrder($order["ID"], "Y", True, False)) {
            return true;
        }
    }
    return false;
}
コード例 #6
0
ファイル: history.php プロジェクト: Ksenobyte/bitrix-module
        }

        if(!empty($arFields)) {
            CSaleOrder::Update($order['externalId'], $arFields);
        }

        if(isset($order['status']) && $order['status']) {
            if(isset($optionsPayStatuses[$order['status']]) && $optionsPayStatuses[$order['status']]) {
                // set STATUS_ID
                CSaleOrder::StatusOrder($order['externalId'], $optionsPayStatuses[$order['status']]);

                if($wasCanaceled && $optionsPayStatuses[ $order['status'] ] != 'YY') {
                    CSaleOrder::CancelOrder($order['externalId'], "N", $order['statusComment']);
                } elseif ($optionsPayStatuses[ $order['status'] ] == 'YY') {
                    CSaleOrder::CancelOrder($order['externalId'], "Y", $order['statusComment']);
                }
            }
        }

        // set PAYED
        if(isset($order['paymentStatus']) && $order['paymentStatus'] && $optionsPayment[$order['paymentStatus']]) {
            CSaleOrder::PayOrder($order['externalId'], $optionsPayment[$order['paymentStatus']]);
        }

        if(function_exists('intarocrm_order_post_persist')) {
            intarocrm_order_post_persist($order);
        }
    }
    $GLOBALS['INTARO_CRM_FROM_HISTORY'] = false;
}
?>
コード例 #7
0
	function nodeHandler(CDataXML $value)
	{
		$value = $value->GetArray();

		if(!empty($value[GetMessage("CC_BSC1_DOCUMENT")]))
		{
			$value = $value[GetMessage("CC_BSC1_DOCUMENT")];

			$arOrder = $this->collectOrderInfo($value);

			if(!empty($arOrder))
			{
				if(strlen($arOrder["ID"]) <= 0 && strlen($arOrder["ID_1C"]) > 0)//try to search order from 1C
				{
					$dbOrder = CSaleOrder::GetList(array("ID" => "DESC"), array("ID_1C" => $arOrder["ID_1C"]), false, false, array("ID", "ID_1C"));
					if($orderInfo = $dbOrder->Fetch())
					{
						$arOrder["ID"] = $orderInfo["ID"];
					}
				}
				if(strlen($arOrder["ID"]) > 0) // exists site order
				{
					$dbOrder = CSaleOrder::GetList(array(), array("ACCOUNT_NUMBER" => $arOrder["ID"]), false, false, array("ID", "LID", "PERSON_TYPE_ID", "PAYED", "DATE_PAYED", "CANCELED", "DATE_CANCELED", "REASON_CANCELED", "STATUS_ID", "DATE_STATUS", "PAY_VOUCHER_NUM", "PAY_VOUCHER_DATE", "PRICE_DELIVERY", "ALLOW_DELIVERY", "DATE_ALLOW_DELIVERY", "PRICE", "CURRENCY", "DISCOUNT_VALUE", "USER_ID", "PAY_SYSTEM_ID", "DELIVERY_ID", "DATE_INSERT", "DATE_INSERT_FORMAT", "DATE_UPDATE", "USER_DESCRIPTION", "ADDITIONAL_INFO", "COMMENTS", "TAX_VALUE", "DELIVERY_DOC_NUM", "DELIVERY_DOC_DATE", "STORE_ID", "ACCOUNT_NUMBER", "VERSION", "VERSION_1C", "ID_1C"));
					if($orderInfo = $dbOrder->Fetch())
					{
						if($arOrder["VERSION_1C"] != $orderInfo["VERSION_1C"] || (strlen($orderInfo["VERSION_1C"]) <= 0 || strlen($arOrder["VERSION_1C"]) <= 0)) // skip update if the same version
						{
							$arOrderFields = array();
							$orderId = $orderInfo["ID"];
							CSaleOrderChange::AddRecord($orderId, "ORDER_1C_IMPORT");
							if($arOrder["ID_1C"] != $orderInfo["ID_1C"])
								$arOrderFields["ID_1C"] = $arOrder["ID_1C"];
							$arOrderFields["VERSION_1C"] = $arOrder["VERSION_1C"];

							if($orderInfo["PAYED"] != "Y" && $orderInfo["ALLOW_DELIVERY"] != "Y" && $orderInfo["STATUS_ID"] != "F")
							{
								$dbOrderTax = CSaleOrderTax::GetList(
									array(),
									array("ORDER_ID" => $orderId),
									false,
									false,
									array("ID", "TAX_NAME", "VALUE", "VALUE_MONEY", "CODE", "IS_IN_PRICE")
								);
								$bTaxFound = false;
								if($arOrderTax = $dbOrderTax->Fetch())
								{
									$bTaxFound = true;
									if(IntVal($arOrderTax["VALUE_MONEY"]) != IntVal($arOrder["TAX"]["VALUE_MONEY"]) || IntVal($arOrderTax["VALUE"]) != IntVal($arOrder["TAX"]["VALUE"]) || ($arOrderTax["IS_IN_PRICE"] != $arOrder["TAX"]["IS_IN_PRICE"]))
									{
										if(IntVal($arOrder["TAX"]["VALUE"])>0)
										{
											$arFields = Array(
												"TAX_NAME" => $arOrder["TAX"]["NAME"],
												"ORDER_ID" => $orderId,
												"VALUE" => $arOrder["TAX"]["VALUE"],
												"IS_PERCENT" => "Y",
												"IS_IN_PRICE" => $arOrder["TAX"]["IS_IN_PRICE"],
												"VALUE_MONEY" => $arOrder["TAX"]["VALUE_MONEY"],
												"CODE" => "VAT1C",
												"APPLY_ORDER" => "100"
											);
											CSaleOrderTax::Update($arOrderTax["ID"], $arFields);
											$arOrderFields["TAX_VALUE"] = $arOrder["TAX"]["VALUE_MONEY"];
										}
										else
										{
											CSaleOrderTax::Delete($arOrderTax["ID"]);
											$arOrderFields["TAX_VALUE"] = 0;
										}
									}
								}

								if(!$bTaxFound)
								{
									if(IntVal($arOrder["TAX"]["VALUE"])>0)
									{
										$arFields = Array(
											"TAX_NAME" => $arOrder["TAX"]["NAME"],
											"ORDER_ID" => $orderId,
											"VALUE" => $arOrder["TAX"]["VALUE"],
											"IS_PERCENT" => "Y",
											"IS_IN_PRICE" => $arOrder["TAX"]["IS_IN_PRICE"],
											"VALUE_MONEY" => $arOrder["TAX"]["VALUE_MONEY"]
										);
										CSaleOrderTax::Add($arFields);
										$arOrderFields["TAX_VALUE"] = $arOrder["TAX"]["VALUE_MONEY"];
									}
								}

								$arShoppingCart = array();
								$bNeedUpdate = false;
								$dbBasket = CSaleBasket::GetList(
									array("NAME" => "ASC"),
									array("ORDER_ID" => $orderId),
									false,
									false,
									array(
										"ID",
										"QUANTITY",
										"CANCEL_CALLBACK_FUNC",
										"MODULE",
										"PRODUCT_ID",
										"PRODUCT_PROVIDER_CLASS",
										"RESERVED",
										"RESERVE_QUANTITY",
										"TYPE",
										"SET_PARENT_ID",
										"PRICE",
										"VAT_RATE",
										"DISCOUNT_PRICE",
										"PRODUCT_XML_ID",
									)
								);

								while ($arBasket = $dbBasket->Fetch())
								{
									$arFields = Array();
									if(!empty($arOrder["items"][$arBasket["PRODUCT_XML_ID"]]))
									{
										if($arBasket["QUANTITY"] != $arOrder["items"][$arBasket["PRODUCT_XML_ID"]]["QUANTITY"])
											$arFields["QUANTITY"] = $arOrder["items"][$arBasket["PRODUCT_XML_ID"]]["QUANTITY"];
										if($arBasket["PRICE"] != $arOrder["items"][$arBasket["PRODUCT_XML_ID"]]["PRICE"])
											$arFields["PRICE"] = $arOrder["items"][$arBasket["PRODUCT_XML_ID"]]["PRICE"];
										if($arBasket["VAT_RATE"] != $arOrder["items"][$arBasket["PRODUCT_XML_ID"]]["VAT_RATE"])
											$arFields["VAT_RATE"] = $arOrder["items"][$arBasket["PRODUCT_XML_ID"]]["VAT_RATE"];
										if($arBasket["DISCOUNT_PRICE"] != $arOrder["items"][$arBasket["PRODUCT_XML_ID"]]["DISCOUNT_PRICE"])
											$arFields["DISCOUNT_PRICE"] = $arOrder["items"][$arBasket["PRODUCT_XML_ID"]]["DISCOUNT_PRICE"];

										if(count($arFields)>0)
										{
											$arFields["ID"] = $arBasket["ID"];
											if(DoubleVal($arFields["QUANTITY"]) <= 0)
												$arFields["QUANTITY"] = $arBasket["QUANTITY"];
											$bNeedUpdate = true;
											$arShoppingCart[] = $arFields;
										}
										else
										{
											$arShoppingCart[] = $arBasket;
										}
										//CSaleBasket::Update($arBasket["ID"], $arFields);

										$arOrder["items"][$arBasket["PRODUCT_XML_ID"]]["CHECKED"] = "Y";
									}
									else
									{
										if($arOrder["TRAITS"][GetMessage("CC_BSC1_CANCELED")] != "true" && $orderInfo["CANCELED"] == "N")
										{
											$bNeedUpdate = true;
											//CSaleBasket::Delete($arBasket["ID"]);
										}
									}
								}

								if(!empty($arOrder["items"]))
								{
									foreach ($arOrder["items"] as $itemID => $arItem)
									{
										if ($arItem["CHECKED"] != "Y")
										{
											if ($arItem["TYPE"] == GetMessage("CC_BSC1_ITEM"))
											{
												if ($arBasketFields = $this->prepareProduct4Basket($itemID, $arItem, $orderId, $orderInfo))
												{
													$arShoppingCart[] = $arBasketFields;
													$bNeedUpdate = true;
												}
											}
											elseif ($arItem["TYPE"] == GetMessage("CC_BSC1_SERVICE"))
											{
												if (IntVal($arItem["PRICE"]) != IntVal($orderInfo["PRICE_DELIVERY"]))
													$arOrderFields["PRICE_DELIVERY"] = $arItem["PRICE"];
											}
										}
									}
								}

								if($bNeedUpdate)
								{
									$arErrors = array();
									CSaleBasket::DoSaveOrderBasket($orderId, $orderInfo["LID"], $orderInfo["USER_ID"], $arShoppingCart, $arErrors);
								}

								if(DoubleVal($arOrder["AMOUNT"]) > 0 && $arOrder["AMOUNT"] != $orderInfo["PRICE"])
									$arOrderFields["PRICE"] = $arOrder["AMOUNT"];
								if(DoubleVal($orderInfo["DISCOUNT_VALUE"]) > 0)
									$arOrderFields["DISCOUNT_VALUE"] = 0;
								if(strlen($arOrder["COMMENT"]) > 0 && $arOrder["COMMENT"] != $orderInfo["COMMENTS"])
									$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"];
							}
						}
						else
						{
							if(strlen($arOrder["AGENT"]["ID"]) > 0)
							{
								$arAI = explode("#", $arOrder["AGENT"]["ID"]);
								if(IntVal($arAI[0]) > 0)
								{
									$dbUser = CUser::GetByID($arAI[0]);
									if($arU = $dbUser->Fetch())
									{
										if(htmlspecialcharsback(substr(htmlspecialcharsbx($arU["ID"]."#".$arU["LOGIN"]."#".$arU["LAST_NAME"]." ".$arU["NAME"]." ".$arU["SECOND_NAME"]), 0, 80)) == $arOrder["AGENT"]["ID"])
										{
											$arOrder["USER_ID"] = $arU["ID"];
										}
									}
								}
							}

							if(IntVal($arOrder["USER_ID"]) <= 0)
							{
								//create new user
								$arUser = array(
									"NAME"  => $arOrder["AGENT"]["ITEM_NAME"],
									"EMAIL" => $arOrder["AGENT"]["CONTACT"]["MAIL_NEW"],
								);

								if (strlen($arUser["NAME"]) <= 0)
									$arUser["NAME"] = $arOrder["AGENT"]["CONTACT"]["CONTACT_PERSON"];
								if (strlen($arUser["EMAIL"]) <= 0)
									$arUser["EMAIL"] = "buyer".time().GetRandomCode(2)."@".$_SERVER["SERVER_NAME"];
								$arOrder["USER_ID"] = CSaleUser::DoAutoRegisterUser($arUser["EMAIL"], $arUser["NAME"], $this->arParams["SITE_NEW_ORDERS"], $arErrors);
							}
						}

						if(empty($this->arPersonTypesIDs))
						{
							$dbPT = CSalePersonType::GetList(array(), array("ACTIVE" => "Y", "LIDS" => $this->arParams["SITE_NEW_ORDERS"]));
							while($arPT = $dbPT->Fetch())
							{
								$this->arPersonTypesIDs[] = $arPT["ID"];
							}
						}

						if(empty($this->arExportInfo))
						{
							$dbExport = CSaleExport::GetList(array(), array("PERSON_TYPE_ID" => $this->arPersonTypesIDs));
							while($arExport = $dbExport->Fetch())
							{
								$this->arExportInfo[$arExport["PERSON_TYPE_ID"]] = unserialize($arExport["VARS"]);
							}
						}

						if(IntVal($arOrder["PERSON_TYPE_ID"]) <= 0)
						{
							foreach($this->arExportInfo as $pt => $value)
							{
								if(
									(($value["IS_FIZ"] == "Y" && $arOrder["AGENT"]["TYPE"] == "FIZ")
									|| ($value["IS_FIZ"] == "N" && $arOrder["AGENT"]["TYPE"] != "FIZ"))
									)
									$arOrder["PERSON_TYPE_ID"] = $pt;
							}
						}

						if(IntVal($arOrder["PERSON_TYPE_ID"]) > 0)
						{
							$arAgent = $this->arExportInfo[$arOrder["PERSON_TYPE_ID"]];
							foreach($arAgent as $k => $v)
							{
								if((strlen($v["VALUE"]) <= 0 || $v["TYPE"] != "PROPERTY") && (empty($arOrder["USER_PROPS"]) || empty($arOrder["USER_PROPS"][$v["VALUE"]])))
									unset($arAgent[$k]);
							}

							if(IntVal($arOrder["USER_ID"]) > 0)
							{
								$orderFields = array(
									"SITE_ID" => $this->arParams["SITE_NEW_ORDERS"],
									"PERSON_TYPE_ID" => $arOrder["PERSON_TYPE_ID"],
									"PAYED" => "N",
									"CANCELED" => "N",
									"STATUS_ID" => "N",
									"PRICE" => $arOrder["AMOUNT"],
									"CURRENCY" => CSaleLang::GetLangCurrency($this->arParams["SITE_NEW_ORDERS"]),
									"USER_ID" => $arOrder["USER_ID"],
									"TAX_VALUE" => doubleval($arOrder["TAX"]["VALUE_MONEY"]),
									"COMMENTS" => $arOrder["COMMENT"],
									"BASKET_ITEMS" => array(),
									"TAX_LIST" => array(),
									"ORDER_PROP" => array(),
								);
								$arAditFields = array(
									"EXTERNAL_ORDER" => "Y",
									"ID_1C" => $arOrder["ID_1C"],
									"VERSION_1C" => $arOrder["VERSION_1C"],
									"UPDATED_1C" => "Y",
									"DATE_INSERT" => CDatabase::FormatDate($arOrder["DATE"]." ".$arOrder["TIME"], "YYYY-MM-DD HH:MI:SS", CLang::GetDateFormat("FULL", LANG)),
								);

								foreach($arOrder["items"] as $productID => $val)
								{
									$orderFields["BASKET_ITEMS"][] = $this->prepareProduct4Basket($productID, $val, false, $orderFields);
								}

								if(!empty($arOrder["TAX"]))
								{
									$orderFields["TAX_LIST"][] = array(
										"NAME" => $arOrder["TAX"]["NAME"],
										"IS_PERCENT" => "Y",
										"VALUE" => $arOrder["TAX"]["VALUE"],
										"VALUE_MONEY" => $arOrder["TAX"]["VALUE_MONEY"],
										"IS_IN_PRICE" => $arOrder["TAX"]["IS_IN_PRICE"],
									);
								}

								foreach($arAgent as $k => $v)
								{
									if(!empty($arOrder["ORDER_PROPS"][$k]))
									{
										$orderFields["ORDER_PROP"][$v["VALUE"]] = $arOrder["ORDER_PROPS"][$k];
									}
									if(empty($orderFields["ORDER_PROP"][$v["VALUE"]]) && !empty($arOrder["USER_PROPS"][$v["VALUE"]]))
									{
										$orderFields["ORDER_PROP"][$v["VALUE"]] = $arOrder["USER_PROPS"][$v["VALUE"]];
									}
								}

								if($arOrder["ID"] = CSaleOrder::DoSaveOrder($orderFields, $arAditFields, 0, $arErrors))
								{
									$arAditFields = array("UPDATED_1C" => "Y");
									CSaleOrder::Update($arOrder["ID"], $arAditFields);

									//add/update user profile
									if(IntVal($arOrder["USER_PROFILE_ID"]) > 0)
									{
										if($arOrder["USER_PROFILE_VERSION"] != $arOrder["AGENT"]["VERSION"])
											CSaleOrderUserProps::Update($arOrder["USER_PROFILE_ID"], array("VERSION_1C" => $arOrder["AGENT"]["VERSION"], "NAME" => $arOrder["AGENT"]["AGENT_NAME"]));
										$dbUPV = CSaleOrderUserPropsValue::GetList(array(), array("USER_PROPS_ID" =>$arOrder["USER_PROFILE_ID"]));
										while($arUPV = $dbUPV->Fetch())
										{
											$arOrder["AGENT"]["PROFILE_PROPS_VALUE"][$arUPV["ORDER_PROPS_ID"]] = array("ID" => $arUPV["ID"], "VALUE" => $arUPV["VALUE"]);
										}
									}

									if(IntVal($arOrder["USER_PROFILE_ID"]) <= 0 || (IntVal($arOrder["USER_PROFILE_ID"]) > 0 && $arOrder["USER_PROFILE_VERSION"] != $arOrder["AGENT"]["VERSION"]))
									{
										$dbOrderProperties = CSaleOrderProps::GetList(
											array("SORT" => "ASC"),
											array(
												"PERSON_TYPE_ID" => $arOrder["PERSON_TYPE_ID"],
												"ACTIVE" => "Y",
												"UTIL" => "N",
												"USER_PROPS" => "Y",
											),
											false,
											false,
											array("ID", "TYPE", "NAME", "CODE", "USER_PROPS", "SORT", "MULTIPLE")
										);
										while ($arOrderProperties = $dbOrderProperties->Fetch())
										{
											$curVal = $orderFields["ORDER_PROP"][$arOrderProperties["ID"]];

											if (strlen($curVal) > 0)
											{
												if (IntVal($arOrder["USER_PROFILE_ID"]) <= 0)
												{
													$arFields = array(
														"NAME" => $arOrder["AGENT"]["AGENT_NAME"],
														"USER_ID" => $arOrder["USER_ID"],
														"PERSON_TYPE_ID" => $arOrder["PERSON_TYPE_ID"],
														"XML_ID" => $arOrder["AGENT"]["ID"],
														"VERSION_1C" => $arOrder["AGENT"]["VERSION"],
													);
													$arOrder["USER_PROFILE_ID"] = CSaleOrderUserProps::Add($arFields);
												}
												if(IntVal($arOrder["USER_PROFILE_ID"]) > 0)
												{
													$arFields = array(
														"USER_PROPS_ID" => $arOrder["USER_PROFILE_ID"],
														"ORDER_PROPS_ID" => $arOrderProperties["ID"],
														"NAME" => $arOrderProperties["NAME"],
														"VALUE" => $curVal
													);
													if(empty($arOrder["AGENT"]["PROFILE_PROPS_VALUE"][$arOrderProperties["ID"]]))
													{
														CSaleOrderUserPropsValue::Add($arFields);
													}
													elseif($arOrder["AGENT"]["PROFILE_PROPS_VALUE"][$arOrderProperties["ID"]]["VALUE"] != $curVal)
													{
														CSaleOrderUserPropsValue::Update($arOrder["AGENT"]["PROFILE_PROPS_VALUE"][$arOrderProperties["ID"]]["ID"], $arFields);
													}
												}
											}
										}
									}
								}
								else
								{
									$this->strError .= "\n".GetMessage("CC_BSC1_ORDER_ADD_PROBLEM", Array("#ID#" => $arOrder["ID_1C"]));
								}
							}
							else
							{
								$this->strError .= "\n".GetMessage("CC_BSC1_ORDER_USER_PROBLEM", Array("#ID#" => $arOrder["ID_1C"]));
								if(!empty($arErrors))
								{
									foreach($arErrors as $v)
									{
										$this->strError .= "\n".$v["TEXT"];
									}
								}
							}
						}
						else
						{
							$this->strError .= "\n".GetMessage("CC_BSC1_ORDER_PERSON_TYPE_PROBLEM", Array("#ID#" => $arOrder["ID_1C"]));
						}
					}
					else
					{
						$this->strError .= "\n".GetMessage("CC_BSC1_ORDER_NO_AGENT_ID", Array("#ID#" => $arOrder["ID_1C"]));
					}
				}
			}
		}
		elseif($this->arParams["IMPORT_NEW_ORDERS"] == "Y")
		{

			$value = $value[GetMessage("CC_BSC1_AGENT")]["#"];
			$arAgentInfo = $this->collectAgentInfo($value);

			if(!empty($arAgentInfo["AGENT"]))
			{
				$mode = false;
				$arErrors = array();
				$dbUProp = CSaleOrderUserProps::GetList(array(), array("XML_ID" => $arAgentInfo["AGENT"]["ID"]), false, false, array("ID", "NAME", "USER_ID", "PERSON_TYPE_ID", "XML_ID", "VERSION_1C"));
				if($arUProp = $dbUProp->Fetch())
				{
					if($arUProp["VERSION_1C"] != $arAgentInfo["AGENT"]["VERSION"])
					{
						$mode = "update";
						$arAgentInfo["PROFILE_ID"] = $arUProp["ID"];
						$arAgentInfo["PERSON_TYPE_ID"] = $arUProp["PERSON_TYPE_ID"];
					}
				}
				else
				{
					$arUser = array(
						"NAME" => $arAgentInfo["AGENT"]["ITEM_NAME"],
						"EMAIL" => $arAgentInfo["AGENT"]["CONTACT"]["MAIL_NEW"],
					);

					if(strlen($arUser["NAME"]) <= 0)
						$arUser["NAME"] = $arAgentInfo["AGENT"]["CONTACT"]["CONTACT_PERSON"];

					$emServer = $_SERVER["SERVER_NAME"];
					if(strpos($_SERVER["SERVER_NAME"], ".") === false)
						$emServer .= ".bx";
					if(strlen($arUser["EMAIL"]) <= 0)
						$arUser["EMAIL"] = "buyer".time().GetRandomCode(2)."@".$emServer;
					$arAgentInfo["USER_ID"] = CSaleUser::DoAutoRegisterUser($arUser["EMAIL"], $arUser["NAME"], $this->arParams["SITE_NEW_ORDERS"], $arErrors);

					if(IntVal($arAgentInfo["USER_ID"]) > 0)
					{
						$mode = "add";
					}
					else
					{
						$this->strError .= "\n".GetMessage("CC_BSC1_AGENT_USER_PROBLEM", Array("#ID#" => $arAgentInfo["AGENT"]["ID"]));
						if(!empty($arErrors))
						{
							foreach($arErrors as $v)
							{
								$this->strError .= "\n".$v["TEXT"];
							}
						}
					}
				}

				if($mode)
				{
					if(empty($this->arPersonTypesIDs))
					{
						$dbPT = CSalePersonType::GetList(array(), array("ACTIVE" => "Y", "LIDS" => $this->arParams["SITE_NEW_ORDERS"]));
						while($arPT = $dbPT->Fetch())
						{
							$this->arPersonTypesIDs[] = $arPT["ID"];
						}
					}

					if(empty($this->arExportInfo))
					{
						$dbExport = CSaleExport::GetList(array(), array("PERSON_TYPE_ID" => $this->arPersonTypesIDs));
						while($arExport = $dbExport->Fetch())
						{
							$this->arExportInfo[$arExport["PERSON_TYPE_ID"]] = unserialize($arExport["VARS"]);
						}
					}

					if(IntVal($arAgentInfo["PERSON_TYPE_ID"]) <= 0)
					{
						foreach($this->arExportInfo as $pt => $value)
						{
							if(($value["IS_FIZ"] == "Y" && $arAgentInfo["AGENT"]["TYPE"] == "FIZ")
								|| ($value["IS_FIZ"] == "N" && $arAgentInfo["AGENT"]["TYPE"] != "FIZ")
							)
								$arAgentInfo["PERSON_TYPE_ID"] = $pt;
						}
					}

					if(IntVal($arAgentInfo["PERSON_TYPE_ID"]) > 0)
					{
						$arAgentInfo["ORDER_PROPS_VALUE"] = array();
						$arAgentInfo["PROFILE_PROPS_VALUE"] = array();

						$arAgent = $this->arExportInfo[$arAgentInfo["PERSON_TYPE_ID"]];

						foreach($arAgent as $k => $v)
						{
							if(strlen($v["VALUE"]) <= 0 || $v["TYPE"] != "PROPERTY")
								unset($arAgent[$k]);
						}

						foreach($arAgent as $k => $v)
						{
							if(!empty($arAgentInfo["ORDER_PROPS"][$k]))
								$arAgentInfo["ORDER_PROPS_VALUE"][$v["VALUE"]] = $arAgentInfo["ORDER_PROPS"][$k];
						}

						if (IntVal($arAgentInfo["PROFILE_ID"]) > 0)
						{
							CSaleOrderUserProps::Update($arUProp["ID"], array("VERSION_1C" => $arAgentInfo["AGENT"]["VERSION"], "NAME" => $arAgentInfo["AGENT"]["AGENT_NAME"]));
							$dbUPV = CSaleOrderUserPropsValue::GetList(array(), array("USER_PROPS_ID" => $arAgentInfo["PROFILE_ID"]));
							while($arUPV = $dbUPV->Fetch())
							{
								$arAgentInfo["PROFILE_PROPS_VALUE"][$arUPV["ORDER_PROPS_ID"]] = array("ID" => $arUPV["ID"], "VALUE" => $arUPV["VALUE"]);
							}
						}

						if(empty($this->arOrderProps[$arAgentInfo["PERSON_TYPE_ID"]]))
						{
							$dbOrderProperties = CSaleOrderProps::GetList(
								array("SORT" => "ASC"),
								array(
									"PERSON_TYPE_ID" => $arAgentInfo["PERSON_TYPE_ID"],
									"ACTIVE" => "Y",
									"UTIL" => "N",
									"USER_PROPS" => "Y",
								),
								false,
								false,
								array("ID", "TYPE", "NAME", "CODE", "USER_PROPS", "SORT", "MULTIPLE")
							);
							while ($arOrderProperties = $dbOrderProperties->Fetch())
							{
								$this->arOrderProps[$arAgentInfo["PERSON_TYPE_ID"]][] = $arOrderProperties;
							}
						}

						foreach($this->arOrderProps[$arAgentInfo["PERSON_TYPE_ID"]] as $arOrderProperties)
						{
							$curVal = $arAgentInfo["ORDER_PROPS_VALUE"][$arOrderProperties["ID"]];

							if (strlen($curVal) > 0)
							{
								if (IntVal($arAgentInfo["PROFILE_ID"]) <= 0)
								{
									$arFields = array(
										"NAME" => $arAgentInfo["AGENT"]["AGENT_NAME"],
										"USER_ID" => $arAgentInfo["USER_ID"],
										"PERSON_TYPE_ID" => $arAgentInfo["PERSON_TYPE_ID"],
										"XML_ID" => $arAgentInfo["AGENT"]["ID"],
										"VERSION_1C" => $arAgentInfo["AGENT"]["VERSION"],
									);
									$arAgentInfo["PROFILE_ID"] = CSaleOrderUserProps::Add($arFields);
								}
								if(IntVal($arAgentInfo["PROFILE_ID"]) > 0)
								{
									$arFields = array(
										"USER_PROPS_ID" => $arAgentInfo["PROFILE_ID"],
										"ORDER_PROPS_ID" => $arOrderProperties["ID"],
										"NAME" => $arOrderProperties["NAME"],
										"VALUE" => $curVal
									);
									if(empty($arAgentInfo["PROFILE_PROPS_VALUE"][$arOrderProperties["ID"]]))
									{
										CSaleOrderUserPropsValue::Add($arFields);
									}
									elseif($arAgentInfo["PROFILE_PROPS_VALUE"][$arOrderProperties["ID"]]["VALUE"] != $curVal)
									{
										CSaleOrderUserPropsValue::Update($arAgentInfo["PROFILE_PROPS_VALUE"][$arOrderProperties["ID"]]["ID"], $arFields);
									}
								}
							}
						}
					}
					else
					{
						$this->strError .= "\n".GetMessage("CC_BSC1_AGENT_PERSON_TYPE_PROBLEM", Array("#ID#" => $arAgentInfo["AGENT"]["ID"]));
					}
				}
			}
			else
			{
				$this->strError .= "\n".GetMessage("CC_BSC1_AGENT_NO_AGENT_ID");
			}
		}
	}
コード例 #8
0
             $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($arIDs[$i], $ALLOW_DELIVERY, 0, $arAdditionalFields)) {
                 if ($ex = $APPLICATION->GetException()) {
                     $errorMessage .= $ex->GetString();
                 } else {
                     $errorMessage .= GetMessage("SOE_ERROR_DELIVERY_EDIT") . ". ";
                 }
             }
         }
     }
 }
 if (StrLen($errorMessage) <= 0) {
     for ($i = 0; $i < count($arIDs); $i++) {
         if (IntVal($arIDs[$i]) > 0 && $bUserCanPayOrder && $arOrder["PAYED"] != $PAYED) {
             $arAdditionalFields = array("PAY_VOUCHER_NUM" => strlen($PAY_VOUCHER_NUM) > 0 ? $PAY_VOUCHER_NUM : False, "PAY_VOUCHER_DATE" => strlen($PAY_VOUCHER_DATE) > 0 ? $PAY_VOUCHER_DATE : False);
             if (!CSaleOrder::PayOrder($arIDs[$i], $PAYED, false, false, 0, $arAdditionalFields)) {
                 if ($ex = $APPLICATION->GetException()) {
                     $errorMessage .= $ex->GetString();
                 } else {
                     $errorMessage .= GetMessage("SOE_ERROR_PAY_EDIT") . ". ";
                 }
             }
         }
     }
 }
 if (strlen($errorMessage) <= 0) {
     $arOldBasketList = array();
     $dbBasket = CSaleBasket::GetList(array("NAME" => "ASC"), array("ORDER_ID" => $ID), false, false, array("ID", "NAME", "CANCEL_CALLBACK_FUNC", "MODULE", "PRODUCT_ID", "QUANTITY"));
     while ($arBasket = $dbBasket->Fetch()) {
         $arOldBasketList[IntVal($arBasket["ID"])] = $arBasket;
     }
コード例 #9
0
ファイル: order.php プロジェクト: akniyev/arteva.ru
						else
						{
							$lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("SOA_PERMS_PAY_GROUP")), $ID);
						}
					}
					else
					{
						$lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("SOA_PERMS_PAY_GROUP_PAY")), $ID);
					}
				break;
				case "pay_n":
					if($arAffectedOrders[$ID]["PAYED"] == "Y")
					{
						if (CSaleOrder::CanUserChangeOrderFlag($ID, "PERM_PAYMENT", $arUserGroups))
						{
							if (!CSaleOrder::PayOrder($ID, "N"))
							{
								if ($ex = $APPLICATION->GetException())
									$lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("SOA_ERROR_PAY_GROUP")).": ".$ex->GetString(), $ID);
								else
									$lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("SOA_ERROR_PAY_GROUP")), $ID);
							}
						}
						else
						{
							$lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("SOA_PERMS_PAY_GROUP")), $ID);
						}
					}
					else
					{
						$lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("SOA_PERMS_PAY_GROUP_PAY_N")), $ID);
コード例 #10
0
ファイル: crm_invoice.php プロジェクト: mrdeadmouse/u136006
 public function SetStatus($ID, $statusID, $statusParams = false, $options = array())
 {
     global $USER;
     if (!CModule::IncludeModule('sale')) {
         return false;
     }
     $currentUserId = 0;
     if (isset($USER) && (get_class($USER) === 'CUser' || $USER instanceof CUser)) {
         $currentUserId = $USER->GetID();
     }
     $result = true;
     if (!self::$INVOICE_STATUSES) {
         self::$INVOICE_STATUSES = CCrmStatus::GetStatus('INVOICE_STATUS');
     }
     if (!is_array(self::$INVOICE_STATUSES) || count(self::$INVOICE_STATUSES) <= 2 || !array_key_exists('P', self::$INVOICE_STATUSES) || !array_key_exists('D', self::$INVOICE_STATUSES) || self::$INVOICE_STATUSES['P']['SORT'] >= self::$INVOICE_STATUSES['D']['SORT']) {
         $result = false;
     }
     if ($result) {
         $CSaleOrder = new CSaleOrder();
         // get current state
         if (!($arOrder = CSaleOrder::GetByID($ID))) {
             $result = false;
         }
         if ($result) {
             $curPay = $arOrder['PAYED'];
             $curCancel = $arOrder['CANCELED'];
             $curMarked = $arOrder['MARKED'];
             $curStatusID = $arOrder['STATUS_ID'];
             $pay = $cancel = 'N';
             $marked = isset($statusParams['REASON_MARKED']) || isset($statusParams['DATE_MARKED']) ? 'Y' : 'N';
             if (self::$INVOICE_STATUSES[$statusID]['SORT'] >= self::$INVOICE_STATUSES['P']['SORT']) {
                 $pay = 'Y';
             }
             if (self::$INVOICE_STATUSES[$statusID]['SORT'] >= self::$INVOICE_STATUSES['D']['SORT']) {
                 $pay = 'N';
                 $cancel = 'Y';
             }
             if ($curPay != $pay) {
                 $result = $CSaleOrder->PayOrder($ID, $pay, true, true, 0, array('NOT_CHANGE_STATUS' => 'Y'));
             }
             if ($result && $curCancel != $cancel) {
                 $result = $CSaleOrder->CancelOrder($ID, $cancel);
             }
             if ($result && $marked === 'Y') {
                 $result = $CSaleOrder->SetMark($ID, isset($statusParams['REASON_MARKED']) ? $statusParams['REASON_MARKED'] : '', $currentUserId);
             }
             if ($result) {
                 $arUpdate = array();
                 if (isset($statusParams['DATE_MARKED'])) {
                     $arUpdate['DATE_MARKED'] = $statusParams['DATE_MARKED'];
                 }
                 if ($pay === 'Y') {
                     if (isset($statusParams['PAY_VOUCHER_NUM'])) {
                         $arUpdate['PAY_VOUCHER_NUM'] = $statusParams['PAY_VOUCHER_NUM'];
                     }
                     if (isset($statusParams['PAY_VOUCHER_DATE'])) {
                         $arUpdate['PAY_VOUCHER_DATE'] = $statusParams['PAY_VOUCHER_DATE'];
                     }
                 }
                 if (count($arUpdate) > 0) {
                     $result = self::Update($ID, $arUpdate);
                 }
                 unset($arUpdate);
             }
             if ($result && $curStatusID != $statusID) {
                 $result = $CSaleOrder->StatusOrder($ID, $statusID) === $ID;
             }
         }
     }
     if ($result && is_array($options) && isset($options['SYNCHRONIZE_LIVE_FEED']) && $options['SYNCHRONIZE_LIVE_FEED']) {
         self::SynchronizeLiveFeedEvent($ID, array('PROCESS_PARENTS' => false, 'REFRESH_DATE' => true));
     }
     return $result;
 }
コード例 #11
0
    if ($lmi_payee_purse != $IdM) {
        $err = 3;
        $err_text = 'ERR: НЕВЕРЕН ID МАГАЗИНА : ' . $lmi_payee_purse;
    }
    if ($lmi_prerequest == 1) {
        if ($err != 0) {
            echo $err_text;
        } else {
            echo 'YES';
        }
    } else {
        $common_string = $lmi_payee_purse . $lmi_payment_amount . $lmi_payment_no . $lmi_mode . $lmi_sys_invs_no . $lmi_sys_trans_no . $lmi_sys_trans_date . $sk . $lmi_payer_purse . $lmi_payer_wm;
        $hash = ToUpper(md5($common_string));
        if ($err == 0) {
            if ($hash == $lmi_hash) {
                $strPS_STATUS_DESCRIPTION = "";
                $strPS_STATUS_DESCRIPTION .= "Идентификатор магазина - " . $lmi_payee_purse . "; ";
                $strPS_STATUS_DESCRIPTION .= "Внутренний номер платежа  в системе Z-PAYMENT - " . $lmi_sys_invs_no . "; ";
                $strPS_STATUS_DESCRIPTION .= "Внутренний номер счета в системе Z-PAYMENT - " . $lmi_sys_trans_no . "; ";
                $strPS_STATUS_DESCRIPTION .= "дата платежа - " . $lmi_sys_trans_date . "";
                $strPS_STATUS_MESSAGE = "";
                $strPS_STATUS_MESSAGE .= "кошелек покупателя или его e-mail  - " . $lmi_payer_purse . "; ";
                $arFields = array("PS_STATUS" => "Y", "PS_STATUS_CODE" => "-", "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION, "PS_STATUS_MESSAGE" => $strPS_STATUS_MESSAGE, "PS_SUM" => $lmi_payment_amount, "PS_CURRENCY" => $arOrder["CURRENCY"], "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))), "USER_ID" => $arOrder["USER_ID"]);
                // You can comment this code if you want PAYED flag not to be set automatically
                CSaleOrder::PayOrder($arOrder["ID"], "Y");
                CSaleOrder::Update($arOrder["ID"], $arFields);
            }
        }
    }
}
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_after.php";
コード例 #12
0
 $arResult["ORDER_ID"] = CSaleOrder::DoSaveOrder($arOrderDat, $arFields, 0, $arResult["ERROR"]);
 $arResult["ORDER_ID"] = IntVal($arResult["ORDER_ID"]);
 if ($arResult["ORDER_ID"] > 0 && empty($arResult["ERROR"])) {
     $arOrder = CSaleOrder::GetByID($arResult["ORDER_ID"]);
     CSaleBasket::OrderBasket($arResult["ORDER_ID"], CSaleBasket::GetBasketUserID(), SITE_ID, false);
     $arResult["ACCOUNT_NUMBER"] = $arResult["ORDER_ID"] <= 0 ? $arResult["ORDER_ID"] : $arOrder["ACCOUNT_NUMBER"];
 }
 $withdrawSum = 0.0;
 if (empty($arResult["ERROR"])) {
     if ($arResult["PAY_FROM_ACCOUNT"] == "Y" && $arUserResult["PAY_CURRENT_ACCOUNT"] == "Y" && ($arParams["ONLY_FULL_PAY_FROM_ACCOUNT"] == "Y" && DoubleVal($arResult["USER_ACCOUNT"]["CURRENT_BUDGET"]) >= DoubleVal($orderTotalSum) || $arParams["ONLY_FULL_PAY_FROM_ACCOUNT"] != "Y")) {
         $withdrawSum = CSaleUserAccount::Withdraw($USER->GetID(), $orderTotalSum, $arResult["BASE_LANG_CURRENCY"], $arResult["ORDER_ID"]);
         if ($withdrawSum > 0) {
             $arFields = array("SUM_PAID" => $withdrawSum, "USER_ID" => $USER->GetID());
             CSaleOrder::Update($arResult["ORDER_ID"], $arFields);
             if ($withdrawSum == $orderTotalSum) {
                 CSaleOrder::PayOrder($arResult["ORDER_ID"], "Y", False, False);
             }
         }
     }
     if ($arResult["HAVE_PREPAYMENT"]) {
         if ($psPreAction && $psPreAction->IsAction()) {
             $psPreAction->orderId = $arResult["ORDER_ID"];
             $psPreAction->orderAmount = $orderTotalSum;
             $psPreAction->deliveryAmount = $arResult["DELIVERY_PRICE"];
             $psPreAction->taxAmount = $arResult["TAX_PRICE"];
             $orderData = array();
             $dbBasketItems = CSaleBasket::GetList(array("ID" => "ASC"), array("FUSER_ID" => CSaleBasket::GetBasketUserID(), "LID" => SITE_ID, "ORDER_ID" => $arResult["ORDER_ID"]), false, false, array("ID", "QUANTITY", "PRICE", "WEIGHT", "NAME", "CURRENCY", "PRODUCT_ID", "DETAIL_PAGE_URL"));
             while ($arItem = $dbBasketItems->Fetch()) {
                 $orderData['BASKET_ITEMS'][] = $arItem;
             }
             $psPreAction->payOrder($orderData);
コード例 #13
0
ファイル: order_detail.php プロジェクト: akniyev/arteva.ru
		if (strlen($errorMessageTmp) <= 0)
		{
			$ORDER_ID = IntVal($ORDER_ID);
			$arOrder = CSaleOrder::GetByID($ORDER_ID);
			if (!$arOrder)
				$errorMessageTmp .= str_replace("#ID#", $ORDER_ID, GetMessage("SOD_NO_ORDER")).". ";
		}
		if (strlen($errorMessageTmp) <= 0)
		{
			if ($arOrder["PS_STATUS"] == "Y" && $arOrder["PAYED"] == "N")
			{
				if ($arOrder["CURRENCY"] == $arOrder["PS_CURRENCY"]
					&& doubleval($arOrder["PRICE"]) == doubleval($arOrder["PS_SUM"]))
				{
					if (!CSaleOrder::PayOrder($arOrder["ID"], "Y", True, True))
					{
						if ($ex = $APPLICATION->GetException())
							$errorMessageTmp .= $ex->GetString();
						else
							$errorMessageTmp .= str_replace("#ID#", $ORDER_ID, GetMessage("SOD_CANT_PAY")).". ";
					}
				}
			}
		}

		if ($errorMessageTmp != "")
			$errorMessage .= $errorMessageTmp;

		if (strlen($errorMessage) <= 0)
		{
コード例 #14
0
ファイル: ok.php プロジェクト: aldegtyarev/goodidea.by
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("Оплата заказа");

if (CModule::IncludeModule("sale"))
{ if ( $_REQUEST['wsb_tid'] ){ ?>

	Счет <?php 
echo $_REQUEST['wsb_order_num'];
?>
 оплачен. <br/> Код транзакции <?php 
echo $_REQUEST['wsb_tid'];
?>
    <br/> <br/>
    Информация об оплате в скором времени будет подтвеждена администратором.  
	<br/> <br/>
	<a href="<?php 
echo SITE_DIR;
?>
/personal">Перейти в линый кабинет</a>
<?
  if (!CSaleOrder::PayOrder($_REQUEST['wsb_order_num'], "Y", True, True, 0, array("PAY_VOUCHER_NUM" => $_REQUEST['wsb_tid'])))
  {
     echo "Ошибка обновления информации о заказе.";
  } 
  
 } else 
 	echo 'Не переданы параметры.';
}
?>
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>
コード例 #15
0
ファイル: step1.php プロジェクト: ASDAFF/entask.ru
			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;
?>
コード例 #16
0
	if($response->getTrackingId() == $tracking_id) {
		$arOrder = CSaleOrder::GetByID($order_id);
    $message = array();
    $message []= Loc::getMessage("SALE_BEGATEWAY_STATUS_MESSAGE_UID") . ' ' . $response->getUid(). ". " . Loc::getMessage("SALE_BEGATEWAY_STATUS_MESSAGE_TIME") . ' ' . $response->getResponse()->transaction->paid_at;

    if(isset($response->getResponse()->transaction->three_d_secure_verification->pa_status)) {
      $message[] = "3-D Secure: " .$response->getResponse()->transaction->three_d_secure_verification->pa_status;
    }
    $arFields = array(
      "PS_STATUS" => ($response->isSuccess() ? "Y" : "N"),
      "PS_STATUS_DESCRIPTION" => implode("\n",$message),
      "PS_SUM" => $money->getAmount(),
      "PS_CURRENCY" => $money->getCurrency(),
      "PS_RESPONSE_DATE" => new \Bitrix\Main\Type\DateTime(),
      "USER_ID" => $arOrder["USER_ID"]
    );

    if (CSalePaySystemAction::GetParamValue("PAYED") != "Y" &&
        $arFields["PS_STATUS"] == "Y" &&
        $arOrder["PRICE"] == $money->getAmount()) {
      CSaleOrder::PayOrder($arOrder["ID"], "Y", True, True, 0, $arFields);
      CSaleOrder::StatusOrder($arOrder["ID"], "P");
    }

    return true;
	}
}

return false;
コード例 #17
0
        $content .= fgets($fp, 128);
    }
    fclose($fp);
    if (strlen($content) > 0) {
        require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/xml.php";
        $objXML = new CDataXML();
        $objXML->LoadString($content);
        $arResult = $objXML->GetArray();
        if (!empty($arResult)) {
            $method = $arResult["Envelope"]["#"]["Body"][0]["#"]["checkBillResponse"];
            if (!empty($method)) {
                if ($arOrder = CSaleOrder::GetByID($orderID)) {
                    $phone = $method[0]["#"]["user"][0]["#"];
                    $amount = $method[0]["#"]["amount"][0]["#"];
                    $date = $method[0]["#"]["date"][0]["#"];
                    $status = $method[0]["#"]["status"][0]["#"];
                    //$strPS_STATUS_DESCRIPTION = GetMessage("SALE_STATUS")." - ".$status." (".GetMessage("CLASS_STATUS_".$status).")"." ; ";
                    $strPS_STATUS_DESCRIPTION = GetMessage("SALE_STATUS_PHONE") . " - " . $phone . "; ";
                    $strPS_STATUS_DESCRIPTION .= GetMessage("SALE_STATUS_AMOUNT") . " - " . $amount . "; ";
                    $strPS_STATUS_DESCRIPTION .= GetMessage("SALE_STATUS_DATE") . " - " . $date . "; ";
                    $strPS_STATUS_MESSAGE = GetMessage("CLASS_STATUS_" . $status);
                    $arFields = array("PS_STATUS" => $status == 60 ? "Y" : "N", "PS_STATUS_CODE" => $status, "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION, "PS_STATUS_MESSAGE" => $strPS_STATUS_MESSAGE, "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))));
                    if ($status == 60 && DoubleVal($arOrder["PRICE"]) == DoubleVal($amount)) {
                        CSaleOrder::PayOrder($orderID, "Y", true, true);
                    }
                    CSaleOrder::Update($orderID, $arFields);
                }
            }
        }
    }
}
コード例 #18
0
ファイル: result.php プロジェクト: ASDAFF/bitrix-2
<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();?>
<?
CModule::IncludeModule('sale');
$ORDER_ID = $GLOBALS['ORDER_ID'];
$resProp = CSaleOrderPropsValue::GetList(array(), array('ORDER_ID' => $ORDER_ID, 'CODE'=>CSalePaySystemAction::GetParamValue('ORDER_BANK')), false, false, array());
if ($arProp = $resProp->GetNext()) {
  $orderId = $arProp['VALUE'];
  $url = CSalePaySystemAction::GetParamValue('URL_API').'getOrderStatus.do?';
  $json = file_get_contents( $url.'userName='******'LOGIN') ).'&password='******'PASS') ).'&orderId='.urlencode($orderId) );
  $obj = json_decode($json);
  if($obj->{'errorCode'} == 0 && $obj->{'OrderStatus'} == 2) {
    // оплачено
    CSaleOrder::PayOrder($ORDER_ID, 'Y');
    if (CSalePaySystemAction::GetParamValue('STATUS_PAY')) {
      CSaleOrder::Update($ORDER_ID, array('STATUS_ID'=>CSalePaySystemAction::GetParamValue('STATUS_PAY')));
    }
    return true;
  }
}
return false;
コード例 #19
0
function AutoPayOrder($ORDER_ID)
{
	$ORDER_ID = (int)$ORDER_ID;
	if ($ORDER_ID <= 0)
		return false;

	$arOrder = CSaleOrder::GetByID($ORDER_ID);
	if (!$arOrder)
		return false;
	if ($arOrder["PS_STATUS"] != "Y")
		return false;
	if ($arOrder["PAYED"] != "N")
		return false;

	if ($arOrder["CURRENCY"] == $arOrder["PS_CURRENCY"]
		&& DoubleVal($arOrder["PRICE"]) == DoubleVal($arOrder["PS_SUM"]))
	{
		if (CSaleOrder::PayOrder($arOrder["ID"], "Y", true, false))
			return true;
	}

	return false;
}
コード例 #20
0
ファイル: include.php プロジェクト: ASDAFF/entask.ru
<? $GLOBALS['_____1282105777']= array(base64_decode(''.'SW5jbHVkZ'.'U1'.'vZHVsZ'.'U'.'xhbmdGaWxl'),base64_decode('SW'.'5jbH'.'VkZU1vZHVsZQ=='),base64_decode('QWR'.'kQXV0b2xvYWRD'.'b'.'GFz'.'c2'.'V'.'z'),base64_decode(''.'R2V0TGlzdA=='),base64_decode('R2V'.'0'.'TGlz'.'dA=='),base64_decode(''.'R'.'2V0TmV4dA=='),base64_decode('R2V0Q'.'n'.'lJRA'.'=='),base64_decode('R2'.'V'.'0'.'QnlJR'.'A='.'='),base64_decode('VGhyb3dF'.'eGN'.'lcHRp'.'b24='),base64_decode('R2V0'.'Qn'.'lJRA='.'='),base64_decode(''.'R'.'2V0'.'T3B0'.'aW'.'9uU3RyaW5n'),base64_decode('R2V0Q'.'nl'.'JRA=='),base64_decode('Rm'.'V0'.'Y2g='),base64_decode('S'.'W'.'5j'.'bHVkZU1vZ'.'HVsZ'.'Q=='),base64_decode('R2V'.'0TGl'.'zdA='.'='),base64_decode('RmV0Y2g='),base64_decode('R2'.'V0TGl'.'zdA=='),base64_decode('Rm'.'V0Y'.'2g='),base64_decode('SW5'.'jbH'.'VkZU1vZHVsZQ=='),base64_decode('R2'.'V0TGl'.'zdA=='),base64_decode('R2V0Tm'.'V4dA=='),base64_decode(''.'SW5jbHVkZU'.'1'.'vZHVsZQ='.'='),base64_decode(''.'R2V0TGlzdA'.'=='),base64_decode('R'.'mV'.'0Y2g'.'='),base64_decode('R2V0TGl'.'zdA=='),base64_decode('R2V0TmV4dA=='));?><? $GLOBALS['____22046643']= array(base64_decode(''.'ZGVm'.'aW5l'),base64_decode('ZGVmaW5l'),base64_decode('ZGVmaW5'.'l'),base64_decode(''.'Z'.'GVmaW'.'5l'),base64_decode(''.'c'.'3RybGV'.'u'),base64_decode('c'.'3RybGVu'),base64_decode(''.'Zml'.'sZV9'.'l'.'eGl'.'z'.'dH'.'M'.'='),base64_decode(''.'dW5zZXJ'.'pYWxp'.'emU='),base64_decode(''.'YXJyY'.'X'.'lfa'.'2V5X2V4aX'.'N0cw'.'=='),base64_decode('aXNfYXJyYXk='),base64_decode('YXJyYXlfa2V5'.'cw=='),base64_decode('YXJyY'.'XlfdW5p'.'cXVl'),base64_decode('YXJyYXlfZmlsdGVy'),base64_decode('YXJyY'.'XlfdW5pcXVl'),base64_decode('aX'.'NfYXJy'.'YXk'.'='),base64_decode(''.'a'.'W5fYXJyYXk='),base64_decode('ZXh'.'wbG9kZQ='.'='));?><? function ___235676882($_1524664495){static $_975833971= false; if($_975833971 == false) $_975833971=array('U0F'.'M'.'RV'.'9'.'ERUJVRw==','U0F'.'MRV9G'.'SUVMRF9UW'.'VBFUw==',''.'Q'.'0hFQ0'.'tCT1g'.'=','U'.'0FMR'.'V9UWVBF'.'X0'.'NIRUNLQk9Y',''.'VEVYVA==','U0FMR'.'V9UWVB'.'FX1R'.'FW'.'FQ=','U'.'0VMRUNU',''.'U0FMRV9UWVB'.'FX1NFTEV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'.'F'.'MR'.'V'.'9N'.'RU5'.'VX0NBV'.'EFM'.'T0d'.'fQ0'.'xFQVI=','WQ'.'==','QVZB'.'SUxBQkxFX0'.'9S'.'REVSX'.'0ZJRUx'.'EUw==','SUQ=','Q09MVU1OX05'.'B'.'TUU=','SUQ=','TkFN'.'R'.'Q'.'==','U'.'0'.'lfT1JERV'.'JfSUQ=',''.'U0VMRUNU','SUQs'.'REFU'.'RV9JTl'.'NFUlQ=','Q1VTVE9N','WQ==','U09SVA'.'==','SUQ'.'=','TElE','Q0'.'9MVU1OX05BTUU'.'=','U0l'.'fU0lURQ'.'==','Tk'.'FNR'.'Q==','U0'.'lfU0lURQ==','U0VMRUNU','TElE','Q1V'.'T'.'VE9N','T'.'g'.'==','U09SVA==','TElE',''.'UEVSU09OX'.'1RZ'.'UEU'.'=',''.'Q09M'.'V'.'U'.'1OX05BT'.'UU=','U0lfUEFZRV'.'JfVFlQR'.'Q==','T'.'kFNRQ==',''.'U0lf'.'UE'.'FZRVJ'.'fVFlQRQ==','U'.'0VMRUNU','U'.'EVSU09O'.'X1RZUEVfSUQ=','Q1'.'VTVE9N','WQ==',''.'U09S'.'VA==','UEV'.'SU09OX1R'.'ZUEV'.'fSUQ=',''.'UE'.'FZR'.'UQ=',''.'Q'.'09MVU1OX'.'0'.'5'.'BTUU=',''.'U0lfUEFJRA'.'==','TkFNRQ==','U0lfUEFJRF9'.'PUkRF'.'Ug==','U0VMRUNU','UE'.'FZRUQsREFURV'.'9QQ'.'V'.'lFRCxFTVBfUEFZ'.'RUR'.'fS'.'UQ=','Q1VTVE9N','WQ==','U09S'.'VA==','UE'.'FZR'.'UQ=','UEFZX1ZP'.'VUNIRVJ'.'fTlV'.'N',''.'Q09MVU1OX'.'05BT'.'U'.'U=','U'.'0lf'.'Tk'.'9f'.'UFA=','Tk'.'FN'.'RQ='.'=','U0lfTk9fUFBfR'.'E9D',''.'U0VM'.'RUN'.'U','U'.'E'.'FZ'.'X1ZPVUNI'.'R'.'VJ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TkFNRQ==',''.'U0lfREVMSV'.'ZFUllfU'.'1lT','U0VMRUNU','REVM'.'SVZFUllfSUQ=','Q1VTVE9N',''.'WQ==',''.'U09SVA==',''.'REV'.'MSVZF'.'Ul'.'lfS'.'UQ=','REF'.'URV9VUER'.'BVEU=','Q0'.'9MV'.'U1OX0'.'5'.'BTUU=','U0lfREFURV'.'9VU'.'ER'.'BVEU'.'=','TkFNR'.'Q==','U0lfREFURV9V'.'UERBV'.'E'.'U'.'=','U0'.'VMRUNU',''.'REFUR'.'V9VU'.'ERBVEU=','Q1VTVE9N','Tg==','U09S'.'VA==','REF'.'U'.'RV9V'.'UE'.'RBVE'.'U=','UFNfU'.'1'.'R'.'B'.'V'.'FVT','Q09MVU1OX05B'.'TUU=','U0lf'.'UEFZTUVO'.'VF9QUw==','Tk'.'FNRQ==','U0lfUFNf'.'U1RBVF'.'VT','U0VM'.'RUN'.'U','UF'.'N'.'fU1RB'.'VFV'.'TLFBTX1JFU1BPTlNFX0RBVEU=','Q1VTV'.'E9'.'N','T'.'g==','U'.'09SVA==',''.'UFNfU1'.'RBVF'.'VT','UFNfU1V'.'N','Q09MVU1OX0'.'5B'.'TU'.'U=',''.'U'.'0lfU'.'FNf'.'U1VN','T'.'kFNRQ==',''.'U0lfUF'.'NfU1V'.'NMQ==','U'.'0VM'.'R'.'UNU','UFNfU1VNLFBTX0'.'NVUlJF'.'T'.'kN'.'Z',''.'Q1VTV'.'E'.'9N','W'.'Q==','U'.'09SVA==',''.'U'.'F'.'N'.'fU1VN',''.'VEFYX'.'1ZB'.'TFV'.'F','Q09MVU1OX0'.'5BTUU=','U0lfV'.'EFY','TkFNRQ==','U0lfVE'.'FYX'.'1NVTQ='.'=',''.'U'.'0VMR'.'UNU','VEFY'.'X1ZBTFVFLENVUl'.'JFTkN'.'Z','Q1V'.'T'.'VE9N','WQ==',''.'U09'.'S'.'VA'.'==','V'.'EF'.'YX'.'1ZBTFVF','Qk'.'FT'.'S'.'0V'.'U','Q'.'09M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'UQ=','T'.'UVB'.'U1VS'.'RQ'.'==','S'.'UQ=','SU'.'Q'.'=','TUV'.'BU1VS'.'RQ='.'=','TUVBU1VSRQ==','TUV'.'BU1VSR'.'Q'.'==','TUVBU1VSRQ'.'='.'=',''.'TUVBU1'.'VSRQ'.'==','SUQ=','SUQ=','SUQ=',''.'U1lNQ'.'k'.'9'.'M'.'X1J'.'V'.'U'.'w==',''.'SU'.'Q=','SUQ'.'=',''.'SUQ=','SU'.'Q=','SUQ=',''.'T'.'U'.'V'.'BU'.'1V'.'SRV9URVhU','U1lNQ'.'k9MX1JVU'.'w==','T'.'U'.'VBU1VS'.'RQ='.'=','S'.'UQ=','Y'.'2F0Y'.'WxvZw==','UF'.'JPRFVDVF'.'9JR'.'A==','UF'.'JPRFVD'.'VF9JRA==','UFJ'.'P'.'RF'.'VDVF'.'9JRA==',''.'T'.'UVBU1'.'VSRV9SQVR'.'JT'.'w'.'==','UkF'.'U'.'SU'.'8=',''.'aWJsb2N'.'r','Y'.'2hlY'.'2tQcm9kdWN0UHJv'.'cE'.'NvZ'.'GU=',''.'P'.'UlE','S'.'U'.'Q'.'=','S'.'UJMT0NL'.'X0l'.'E','S'.'UJM'.'T0NL'.'X0lE',''.'SUQ=','S'.'UJMT0NL'.'X'.'0lE',''.'PUlE','SUQ'.'=','LCA=','LCA=','','U'.'FJPU'.'E'.'VS'.'V'.'F'.'lf');return base64_decode($_975833971[$_1524664495]);}?><?  $GLOBALS['____22046643'][0](___235676882(0), false);  global $DBType; $GLOBALS['_____1282105777'][0](__FILE__); $GLOBALS[___235676882(1)]= array( ___235676882(2) => GetMessage(___235676882(3)), ___235676882(4) => GetMessage(___235676882(5)), ___235676882(6) => GetMessage(___235676882(7)), ___235676882(8) => GetMessage(___235676882(9)), ___235676882(10) => GetMessage(___235676882(11)), ___235676882(12) => GetMessage(___235676882(13)), ___235676882(14) => GetMessage(___235676882(15)), ___235676882(16) => GetMessage(___235676882(17))); if(!CModule::$GLOBALS['_____1282105777'][1](___235676882(18))){  return false;} Define(___235676882(19), round(0+0.6+0.6+0.6+0.6+0.6)); Define(___235676882(20), round(0+1+1+1)); Define(___235676882(21), round(0+21600+21600)); Define(___235676882(22), round(0+3600+3600)); Define(___235676882(23), ___235676882(24)); Define(___235676882(25), round(0+1200+1200+1200)*round(0+12+12)); global $SALE_TIME_PERIOD_TYPES; $SALE_TIME_PERIOD_TYPES= array( ___235676882(26) => GetMessage(___235676882(27)), ___235676882(28) => GetMessage(___235676882(29)), ___235676882(30) => GetMessage(___235676882(31)), ___235676882(32) => GetMessage(___235676882(33)), ___235676882(34) => GetMessage(___235676882(35)), ___235676882(36) => GetMessage(___235676882(37)), ___235676882(38) => GetMessage(___235676882(39))); $GLOBALS['____22046643'][1](___235676882(40), round(0+0.66666666666667+0.66666666666667+0.66666666666667)); $GLOBALS['____22046643'][2](___235676882(41), round(0+0.75+0.75+0.75+0.75)); $GLOBALS['____22046643'][3](___235676882(42), ___235676882(43)); $GLOBALS[___235676882(44)]= array( ___235676882(45) => array(___235676882(46) => ___235676882(47), ___235676882(48) => GetMessage(___235676882(49)), ___235676882(50) => ___235676882(51), ___235676882(52) => ___235676882(53), ___235676882(54) => ___235676882(55)), ___235676882(56) => array(___235676882(57) => GetMessage(___235676882(58)), ___235676882(59) => GetMessage(___235676882(60)), ___235676882(61) => ___235676882(62), ___235676882(63) => ___235676882(64), ___235676882(65) => ___235676882(66)), ___235676882(67) => array(___235676882(68) => GetMessage(___235676882(69)), ___235676882(70) => GetMessage(___235676882(71)), ___235676882(72) => ___235676882(73), ___235676882(74) => ___235676882(75), ___235676882(76) => ___235676882(77)), ___235676882(78) => array(___235676882(79) => GetMessage(___235676882(80)), ___235676882(81) => GetMessage(___235676882(82)), ___235676882(83) => ___235676882(84), ___235676882(85) => ___235676882(86), ___235676882(87) => ___235676882(88)), ___235676882(89) => array(___235676882(90) => GetMessage(___235676882(91)), ___235676882(92) => GetMessage(___235676882(93)), ___235676882(94) => ___235676882(95), ___235676882(96) => ___235676882(97), ___235676882(98) => ___235676882(99)), ___235676882(100) => array(___235676882(101) => GetMessage(___235676882(102)), ___235676882(103) => GetMessage(___235676882(104)), ___235676882(105) => ___235676882(106), ___235676882(107) => ___235676882(108), ___235676882(109) => ___235676882(110)), ___235676882(111) => array(___235676882(112) => GetMessage(___235676882(113)), ___235676882(114) => GetMessage(___235676882(115)), ___235676882(116) => ___235676882(117), ___235676882(118) => ___235676882(119), ___235676882(120) => ___235676882(121)), ___235676882(122) => array(___235676882(123) => GetMessage(___235676882(124)), ___235676882(125) => GetMessage(___235676882(126)), ___235676882(127) => ___235676882(128), ___235676882(129) => ___235676882(130), ___235676882(131) => ___235676882(132)), ___235676882(133) => array(___235676882(134) => GetMessage(___235676882(135)), ___235676882(136) => GetMessage(___235676882(137)), ___235676882(138) => ___235676882(139), ___235676882(140) => ___235676882(141), ___235676882(142) => ___235676882(143)), ___235676882(144) => array(___235676882(145) => GetMessage(___235676882(146)), ___235676882(147) => GetMessage(___235676882(148)), ___235676882(149) => ___235676882(150), ___235676882(151) => ___235676882(152), ___235676882(153) => ___235676882(154)), ___235676882(155) => array(___235676882(156) => GetMessage(___235676882(157)), ___235676882(158) => GetMessage(___235676882(159)), ___235676882(160) => ___235676882(161), ___235676882(162) => ___235676882(163), ___235676882(164) => ___235676882(165)), ___235676882(166) => array(___235676882(167) => GetMessage(___235676882(168)), ___235676882(169) => GetMessage(___235676882(170)), ___235676882(171) => ___235676882(172), ___235676882(173) => ___235676882(174), ___235676882(175) => ___235676882(176)), ___235676882(177) => array(___235676882(178) => GetMessage(___235676882(179)), ___235676882(180) => GetMessage(___235676882(181)), ___235676882(182) => ___235676882(183), ___235676882(184) => ___235676882(185), ___235676882(186) => ___235676882(187)), ___235676882(188) => array(___235676882(189) => GetMessage(___235676882(190)), ___235676882(191) => GetMessage(___235676882(192)), ___235676882(193) => ___235676882(194), ___235676882(195) => ___235676882(196), ___235676882(197) => ___235676882(198)), ___235676882(199) => array(___235676882(200) => GetMessage(___235676882(201)), ___235676882(202) => GetMessage(___235676882(203)), ___235676882(204) => ___235676882(205), ___235676882(206) => ___235676882(207), ___235676882(208) => ___235676882(209)), ___235676882(210) => array(___235676882(211) => GetMessage(___235676882(212)), ___235676882(213) => GetMessage(___235676882(214)), ___235676882(215) => ___235676882(216), ___235676882(217) => ___235676882(218), ___235676882(219) => ___235676882(220)), ___235676882(221) => array(___235676882(222) => GetMessage(___235676882(223)), ___235676882(224) => GetMessage(___235676882(225)), ___235676882(226) => ___235676882(227), ___235676882(228) => ___235676882(229), ___235676882(230) => ___235676882(231)), ___235676882(232) => array(___235676882(233) => GetMessage(___235676882(234)), ___235676882(235) => GetMessage(___235676882(236)), ___235676882(237) => ___235676882(238), ___235676882(239) => ___235676882(240), ___235676882(241) => ___235676882(242)), ___235676882(243) => array(___235676882(244) => GetMessage(___235676882(245)), ___235676882(246) => GetMessage(___235676882(247)), ___235676882(248) => ___235676882(249), ___235676882(250) => ___235676882(251), ___235676882(252) => ___235676882(253)), ___235676882(254) => array(___235676882(255) => GetMessage(___235676882(256)), ___235676882(257) => GetMessage(___235676882(258)), ___235676882(259) => ___235676882(260), ___235676882(261) => ___235676882(262), ___235676882(263) => ___235676882(264)), ___235676882(265) => array(___235676882(266) => GetMessage(___235676882(267)), ___235676882(268) => GetMessage(___235676882(269)), ___235676882(270) => ___235676882(271), ___235676882(272) => ___235676882(273), ___235676882(274) => ___235676882(275)), ___235676882(276) => array(___235676882(277) => GetMessage(___235676882(278)), ___235676882(279) => GetMessage(___235676882(280)), ___235676882(281) => ___235676882(282), ___235676882(283) => ___235676882(284), ___235676882(285) => ___235676882(286))); CModule::$GLOBALS['_____1282105777'][2]( ___235676882(287), array( ___235676882(288) => $DBType.___235676882(289), ___235676882(290) => $DBType.___235676882(291), ___235676882(292) => ___235676882(293), ___235676882(294) => ___235676882(295), ___235676882(296) => $DBType.___235676882(297), ___235676882(298) => $DBType.___235676882(299), ___235676882(300) => $DBType.___235676882(301), ___235676882(302) => ___235676882(303), ___235676882(304) => $DBType.___235676882(305), ___235676882(306) => $DBType.___235676882(307), ___235676882(308) => $DBType.___235676882(309), ___235676882(310) => $DBType.___235676882(311), ___235676882(312) => $DBType.___235676882(313), ___235676882(314) => $DBType.___235676882(315), ___235676882(316) => $DBType.___235676882(317), ___235676882(318) => $DBType.___235676882(319), ___235676882(320) => $DBType.___235676882(321), ___235676882(322) => ___235676882(323), ___235676882(324) => $DBType.___235676882(325), ___235676882(326) => $DBType.___235676882(327), ___235676882(328) => ___235676882(329), ___235676882(330) => ___235676882(331), ___235676882(332) => $DBType.___235676882(333), ___235676882(334) => $DBType.___235676882(335), ___235676882(336) => $DBType.___235676882(337), ___235676882(338) => $DBType.___235676882(339), ___235676882(340) => $DBType.___235676882(341), ___235676882(342) => $DBType.___235676882(343), ___235676882(344) => $DBType.___235676882(345), ___235676882(346) => $DBType.___235676882(347), ___235676882(348) => $DBType.___235676882(349), ___235676882(350) => $DBType.___235676882(351), ___235676882(352) => $DBType.___235676882(353), ___235676882(354) => $DBType.___235676882(355), ___235676882(356) => $DBType.___235676882(357), ___235676882(358) => $DBType.___235676882(359), ___235676882(360) => $DBType.___235676882(361), ___235676882(362) => $DBType.___235676882(363), ___235676882(364) => $DBType.___235676882(365), ___235676882(366) => $DBType.___235676882(367), ___235676882(368) => $DBType.___235676882(369), ___235676882(370) => ___235676882(371), ___235676882(372) => ___235676882(373), ___235676882(374) => $DBType.___235676882(375), ___235676882(376) => $DBType.___235676882(377), ___235676882(378) => ___235676882(379), ___235676882(380) => ___235676882(381), ___235676882(382) => ___235676882(383), ___235676882(384) => ___235676882(385), ___235676882(386) => ___235676882(387), ___235676882(388) => ___235676882(389), ___235676882(390) => ___235676882(391), ___235676882(392) => ___235676882(393), ___235676882(394) => ___235676882(395), ___235676882(396) => ___235676882(397), ___235676882(398) => $DBType.___235676882(399), ___235676882(400) => $DBType.___235676882(401), ___235676882(402) => ___235676882(403), ___235676882(404) => ___235676882(405), ___235676882(406) => ___235676882(407), ___235676882(408) => ___235676882(409), ___235676882(410) => ___235676882(411), ___235676882(412) => ___235676882(413), ___235676882(414) => ___235676882(415), ___235676882(416) => ___235676882(417), ___235676882(418) => ___235676882(419), ___235676882(420) => ___235676882(421), ___235676882(422) => ___235676882(423), ___235676882(424) => ___235676882(425), ___235676882(426) => ___235676882(427), ___235676882(428) => ___235676882(429), ___235676882(430) => ___235676882(431), ___235676882(432) => ___235676882(433), ___235676882(434) => ___235676882(435), ___235676882(436) => ___235676882(437), ___235676882(438) => ___235676882(439), ___235676882(440) => ___235676882(441), ___235676882(442) => ___235676882(443), ___235676882(444) => ___235676882(445), ___235676882(446) => ___235676882(447), ___235676882(448) => ___235676882(449), ___235676882(450) => ___235676882(451), ___235676882(452) => ___235676882(453), ___235676882(454) => ___235676882(455), ___235676882(456) => ___235676882(457), ___235676882(458) => ___235676882(459), ___235676882(460) => ___235676882(461), ___235676882(462) => ___235676882(463), ___235676882(464) => ___235676882(465), ___235676882(466) => ___235676882(467), ___235676882(468) => ___235676882(469), ___235676882(470) => ___235676882(471), ___235676882(472) => ___235676882(473), ___235676882(474) => ___235676882(475), ___235676882(476) => ___235676882(477), ___235676882(478) => ___235676882(479), ___235676882(480) => ___235676882(481), ___235676882(482) => ___235676882(483), ___235676882(484) => ___235676882(485), ___235676882(486) => ___235676882(487), ___235676882(488) => ___235676882(489), ___235676882(490) => ___235676882(491), ___235676882(492) => ___235676882(493), ___235676882(494) => ___235676882(495), ___235676882(496) => ___235676882(497), ___235676882(498) => ___235676882(499), ___235676882(500) => ___235676882(501), ___235676882(502) => ___235676882(503))); function GetBasketListSimple($_776936337= False){ $_1565306292= CSaleBasket::GetBasketUserID($_776936337); if($_1565306292>(776-2*388)) return CSaleBasket::$GLOBALS['_____1282105777'][3]( array(___235676882(504) => ___235676882(505)), array(___235676882(506) => $_1565306292, ___235676882(507) => SITE_ID, ___235676882(508) => ___235676882(509))); else return False;} function GetBasketList($_776936337= False){ $_1565306292= CSaleBasket::GetBasketUserID($_776936337); $_1716398923= array(); if($_1565306292> min(78,0,26)){ $_1650393563= CSaleBasket::$GLOBALS['_____1282105777'][4]( array(___235676882(510) => ___235676882(511)), array(___235676882(512) => $_1565306292, ___235676882(513) => SITE_ID, ___235676882(514) => ___235676882(515))); while($_59417835= $_1650393563->$GLOBALS['_____1282105777'][5]()){ if($GLOBALS['____22046643'][4]($_59417835[___235676882(516)])>(168*2-336) || $GLOBALS['____22046643'][5]($_59417835[___235676882(517)])>(1152/2-576)){ CSaleBasket::UpdatePrice($_59417835[___235676882(518)], $_59417835[___235676882(519)], $_59417835[___235676882(520)], $_59417835[___235676882(521)], $_59417835[___235676882(522)], $_59417835[___235676882(523)]); $_59417835= CSaleBasket::$GLOBALS['_____1282105777'][6]($_59417835[___235676882(524)]);} $_1716398923[]= $_59417835;}} return $_1716398923;} function SaleFormatCurrency($_1997147511, $_604679138, $_1359775739= false){ return CCurrencyLang::CurrencyFormat($_1997147511, $_604679138,!($_1359775739 === true));} function AutoPayOrder($_482265164){ $_482265164= (int)$_482265164; if($_482265164 <=(1300/2-650)) return false; $_638491738= CSaleOrder::$GLOBALS['_____1282105777'][7]($_482265164); if(!$_638491738) return false; if($_638491738[___235676882(525)] != ___235676882(526)) return false; if($_638491738[___235676882(527)] != ___235676882(528)) return false; if($_638491738[___235676882(529)] == $_638491738[___235676882(530)] && DoubleVal($_638491738[___235676882(531)]) == DoubleVal($_638491738[___235676882(532)])){ if(CSaleOrder::PayOrder($_638491738[___235676882(533)], ___235676882(534), true, false)) return true;} return false;} function CurrencyModuleUnInstallSale(){ $GLOBALS[___235676882(535)]->$GLOBALS['_____1282105777'][8](GetMessage(___235676882(536)), ___235676882(537)); return false;} if($GLOBALS['____22046643'][6]($_SERVER[___235676882(538)].___235676882(539))) include($_SERVER[___235676882(540)].___235676882(541)); function PayUserAccountDeliveryOrderCallback($_1497994248, $_1025479703, $_998371442, $_391139049, $_1130343874= 1){ global $DB; $_1497994248= IntVal($_1497994248); $_1025479703= IntVal($_1025479703); $_998371442=($_998371442? True: False); $_391139049= IntVal($_391139049); if($_1025479703 <= min(202,0,67.333333333333)) return False; if($_391139049 <= min(212,0,70.666666666667)) return False; if(!($_638491738= CSaleOrder::$GLOBALS['_____1282105777'][9]($_391139049))) return False; $_1591734238= CSaleLang::GetLangCurrency($_638491738[___235676882(542)]); $_1663215846= $GLOBALS['____22046643'][7](COption::$GLOBALS['_____1282105777'][10](___235676882(543), ___235676882(544), ___235676882(545))); if(!$GLOBALS['____22046643'][8]($_1497994248, $_1663215846)) return False; $_1484605098= $_1663215846[$_1497994248][___235676882(546)]* $_1130343874; $_1563884325= $_1663215846[$_1497994248][___235676882(547)]; if($_1663215846[$_1497994248][___235676882(548)] != $_1591734238){ $_1484605098= CCurrencyRates::ConvertCurrency($_1663215846[$_1497994248][___235676882(549)], $_1663215846[$_1497994248][___235676882(550)], $_1591734238)* $_1130343874; $_1563884325= $_1591734238;} if(!CSaleUserAccount::UpdateAccount($_1025479703,($_998371442? $_1484605098:-$_1484605098), $_1563884325, ___235676882(551), $_391139049, ___235676882(552))) return False; return True;}  function GetFormatedUserName($_1817622884, $_502221729= true){ $_244421456= ___235676882(553); $_1817622884= IntVal($_1817622884); if($_1817622884>(212*2-424)){ if(!isset($_2076110432[$_1817622884]) ||!$GLOBALS['____22046643'][9]($_2076110432[$_1817622884])){ $_1631632678= CUser::$GLOBALS['_____1282105777'][11]($_1817622884); if($_352008160= $_1631632678->$GLOBALS['_____1282105777'][12]()){ $_2076110432[$_1817622884]= CUser::FormatName( CSite::GetNameFormat(false), array( ___235676882(554) => $_352008160[___235676882(555)], ___235676882(556) => $_352008160[___235676882(557)], ___235676882(558) => $_352008160[___235676882(559)], ___235676882(560) => $_352008160[___235676882(561)]), true, true);}} if($_502221729) $_244421456 .= ___235676882(562).$_1817622884.___235676882(563).LANGUAGE_ID.___235676882(564).$_1817622884.___235676882(565); if(CBXFeatures::IsFeatureEnabled(___235676882(566))) $_244421456 .= ___235676882(567).$_1817622884.___235676882(568).LANGUAGE_ID.___235676882(569); else $_244421456 .= ___235676882(570).$_1817622884.___235676882(571).LANGUAGE_ID.___235676882(572); $_244421456 .= $_2076110432[$_1817622884]; $_244421456 .= ___235676882(573);} return $_244421456;}  function getMeasures($_6121167){ if(CModule::$GLOBALS['_____1282105777'][13](___235676882(574))){ $_1042780166= CCatalogMeasure::getDefaultMeasure(true, true); $_1961657287= array(); $_1142064415= array(); foreach($_6121167 as $_155943633 => $_1268822353){ $_1497994248= (int)$_1268822353[___235676882(575)]; if(!isset($_1142064415[$_1497994248])) $_1142064415[$_1497994248][]= $_155943633; $_1961657287[]= $_1497994248; $_6121167[$_155943633][___235676882(576)]= $_1042780166[___235676882(577)]; $_6121167[$_155943633][___235676882(578)]=(854-2*427);} unset($_1497994248, $_155943633, $_1268822353); if(!empty($_1961657287)){ $_1450283703= array(); $_2111772175= CCatalogProduct::$GLOBALS['_____1282105777'][14]( array(), array(___235676882(579) => $_1961657287), false, false, array(___235676882(580), ___235676882(581))); while($_1716398923= $_2111772175->$GLOBALS['_____1282105777'][15]()){ $_1716398923[___235676882(582)]= (int)$_1716398923[___235676882(583)]; $_1716398923[___235676882(584)]= (int)$_1716398923[___235676882(585)]; if(!isset($_1450283703[$_1716398923[___235676882(586)]])) $_1450283703[$_1716398923[___235676882(587)]]= array(); $_1450283703[$_1716398923[___235676882(588)]][]= $_1716398923[___235676882(589)];} unset($_1716398923, $_2111772175); if(!empty($_1450283703)){ $_1641266948= CCatalogMeasure::$GLOBALS['_____1282105777'][16]( array(), array(___235676882(590) => $GLOBALS['____22046643'][10]($_1450283703)), false, false, array(___235676882(591), ___235676882(592))); while($_1986602539= $_1641266948->$GLOBALS['_____1282105777'][17]()){ $_1986602539[___235676882(593)]= (int)$_1986602539[___235676882(594)]; if(isset($_1450283703[$_1986602539[___235676882(595)]]) &&!empty($_1450283703[$_1986602539[___235676882(596)]])){ foreach($_1450283703[$_1986602539[___235676882(597)]] as&$_1497994248){ if(isset($_1142064415[$_1497994248]) &&!empty($_1142064415[$_1497994248])){ foreach($_1142064415[$_1497994248] as&$_155943633){ $_6121167[$_155943633][___235676882(598)]= $_1986602539[___235676882(599)]; $_6121167[$_155943633][___235676882(600)]= $_1986602539[___235676882(601)];} unset($_155943633);}} unset($_1497994248);}}}} return $_6121167;} else return false;}  function getRatio($_6121167){ if(CModule::$GLOBALS['_____1282105777'][18](___235676882(602))){ $_1961657287= array(); foreach($_6121167 as $_1268822353) $_1961657287[]= $_1268822353[___235676882(603)]; if(!empty($_1961657287)){ $_1693590091= CCatalogMeasureRatio::$GLOBALS['_____1282105777'][19](array(), $GLOBALS['____22046643'][11]($_1961657287)); while($_167103222= $_1693590091->$GLOBALS['_____1282105777'][20]()){ foreach($_6121167 as&$_280419804){ if($_167103222[___235676882(604)] == $_280419804[___235676882(605)]) $_280419804[___235676882(606)]= $_167103222[___235676882(607)];}} unset($_280419804); return $_6121167;}}}  function getProductProps($_1961657287, $_1906068973){ if(!CModule::$GLOBALS['_____1282105777'][21](___235676882(608))) return array(); if(empty($_1961657287)) return array(); $_1906068973= $GLOBALS['____22046643'][12]($_1906068973, ___235676882(609)); $_633545976= array(); $_1549582466= array(); $_59417835= CIBlockElement::$GLOBALS['_____1282105777'][22]( array(), array(___235676882(610) => $GLOBALS['____22046643'][13]($_1961657287)), false, false, array(___235676882(611), ___235676882(612))); while($_1522978085= $_59417835->$GLOBALS['_____1282105777'][23]()) $_1549582466[$_1522978085[___235676882(613)]][]= $_1522978085[___235676882(614)];  foreach($_1549582466 as $_66102774 => $_82694648) { $_59417835= CIBlockElement::$GLOBALS['_____1282105777'][24]( array(), array(___235676882(615) => $_66102774, ___235676882(616) => $_82694648), false, false, $_1906068973); while($_1522978085= $_59417835->$GLOBALS['_____1282105777'][25]()){ $_1690643474= $_1522978085[___235676882(617)]; foreach($_1522978085 as $_1904493370 => $_1108731414){ if(!isset($_633545976[$_1690643474])) $_633545976[$_1690643474]= array(); if(isset($_633545976[$_1690643474][$_1904493370]) &&!$GLOBALS['____22046643'][14]($_633545976[$_1690643474][$_1904493370]) &&!$GLOBALS['____22046643'][15]($_1108731414, $GLOBALS['____22046643'][16](___235676882(618), $_633545976[$_1690643474][$_1904493370]))) { $_633545976[$_1690643474][$_1904493370] .= ___235676882(619).$_1108731414;} elseif(empty($_633545976[$_1690643474][$_1904493370])){ $_633545976[$_1690643474][$_1904493370]= $_1108731414;}}}} return $_633545976;} function checkProductPropCode($_1646845836){ return($_1646845836 !== null && $_1646845836 !== ___235676882(620) && $_1646845836 !== ___235676882(621));} ?>
コード例 #21
0
ファイル: order.php プロジェクト: akniyev/itprom_dobrohost
 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"];
             }
         }
         if (CModule::IncludeModule("statistic")) {
             CStatEvent::AddByEvents("eStore", "order_cancel", $ID, "", $arOrder["STAT_GID"]);
         }
     }
     return $res;
 }
コード例 #22
0
ファイル: result_rec.php プロジェクト: DarneoStudio/bitrix
        }
    } else {
        qiwiWalletXmlResponse(QIWI_WALLET_ERROR_CODE_AUTH);
    }
}
if ($order = CSaleOrder::getById($_POST['bill_id'])) {
    $paidInfo = array("PS_STATUS" => $_POST['status'] == "paid" ? "Y" : "N", "PS_STATUS_CODE" => substr($_POST['status'], 0, 5), "PS_STATUS_MESSAGE" => Loc::getMessage("SALE_QWH_STATUS_MESSAGE_" . strtoupper($_POST['status'])), "PS_RESPONSE_DATE" => \Bitrix\Main\Type\DateTime::createFromTimestamp(time()), "PS_SUM" => (double) $_POST['amount'], "PS_CURRENCY" => $_POST['ccy'], "PS_STATUS_DESCRIPTION" => "");
    if ((int) $_POST['error']) {
        $paidInfo['PS_STATUS_DESCRIPTION'] = "Error: " . Loc::getMessage("SALE_QWH_ERROR_CODE_" . $_POST['error']);
        CSaleOrder::Update($order['ID'], $paidInfo);
        qiwiWalletXmlResponse(QIWI_WALLET_ERROR_CODE_OTHER);
    }
    foreach ($_POST as $key => $value) {
        $paidInfo['PS_STATUS_DESCRIPTION'] .= "{$key}:{$value}, ";
    }
    CSaleOrder::Update($order['ID'], $paidInfo);
    $changeStatusPay = CSalePaySystemAction::GetParamValue("CHANGE_STATUS_PAY") == "Y";
    $difference = (double) $_POST['amount'] - (double) $order['PRICE'];
    if ($difference < 0) {
        qiwiWalletXmlResponse(QIWI_WALLET_ERROR_CODE_TOO_LOW);
    } elseif ($difference > 0) {
        qiwiWalletXmlResponse(QIWI_WALLET_ERROR_CODE_TOO_HIGH);
    } else {
        if ($_POST['status'] == "paid" && $changeStatusPay) {
            CSaleOrder::PayOrder($order['ID'], "Y", true, true);
        }
        qiwiWalletXmlResponse(QIWI_WALLET_ERROR_CODE_NONE);
    }
} else {
    qiwiWalletXmlResponse(QIWI_WALLET_ERROR_CODE_NOT_FOUND);
}
コード例 #23
0
 function nodeHandler(CDataXML $value)
 {
     $value = $value->GetArray();
     $value = $value[GetMessage("CC_BSC1_DOCUMENT")];
     if ($value["#"][GetMessage("CC_BSC1_OPERATION")][0]["#"] == GetMessage("CC_BSC1_ORDER")) {
         $orderId = IntVal($value["#"][GetMessage("CC_BSC1_NUMBER")][0]["#"]);
         $arOrder = array();
         $arItem = array();
         $arOrder["AMOUNT"] = $value["#"][GetMessage("CC_BSC1_SUMM")][0]["#"];
         $arOrder["AMOUNT"] = str_replace($SumFormat, ".", $arOrder["AMOUNT"]);
         $arOrder["COMMENT"] = $value["#"][GetMessage("CC_BSC1_COMMENT")][0]["#"];
         foreach ($value["#"][GetMessage("CC_BSC1_REK_VALUES")][0]["#"][GetMessage("CC_BSC1_REK_VALUE")] as $val) {
             $arOrder["TRAITS"][$val["#"][GetMessage("CC_BSC1_NAME")][0]["#"]] = $val["#"][GetMessage("CC_BSC1_VALUE")][0]["#"];
         }
         $taxValue = 0;
         $taxValueTmp = 0;
         $taxName = "";
         if (is_array($value["#"][GetMessage("CC_BSC1_ITEMS")][0]["#"][GetMessage("CC_BSC1_ITEM")])) {
             foreach ($value["#"][GetMessage("CC_BSC1_ITEMS")][0]["#"][GetMessage("CC_BSC1_ITEM")] as $val) {
                 $val = $val["#"];
                 $productID = $val[GetMessage("CC_BSC1_ID")][0]["#"];
                 $bGood = false;
                 $discountPrice = "";
                 $priceAll = str_replace($SumFormat, ".", $val[GetMessage("CC_BSC1_SUMM")][0]["#"]);
                 $priceone = str_replace($SumFormat, ".", $val[GetMessage("CC_BSC1_PRICE_PER_UNIT")][0]["#"]);
                 $quantity = str_replace($QuantityFormat, ".", $val[GetMessage("CC_BSC1_QUANTITY")][0]["#"]);
                 $price = $priceAll / $quantity;
                 if ($priceone != $price) {
                     $discountPrice = $priceone - $price;
                 }
                 //DISCOUNTS!
                 $arItem[$productID] = array("NAME" => $val[GetMessage("CC_BSC1_NAME")][0]["#"], "PRICE" => $price, "QUANTITY" => $quantity, "DISCOUNT_PRICE" => $discountPrice);
                 if (is_array($val[GetMessage("CC_BSC1_PROPS_ITEMS")][0]["#"][GetMessage("CC_BSC1_PROP_ITEM")])) {
                     foreach ($val[GetMessage("CC_BSC1_PROPS_ITEMS")][0]["#"][GetMessage("CC_BSC1_PROP_ITEM")] as $val1) {
                         $arItem[$productID]["ATTRIBUTES"][$val1["#"][GetMessage("CC_BSC1_NAME")][0]["#"]] = $val1["#"][GetMessage("CC_BSC1_VALUE")][0]["#"];
                     }
                 }
                 if (is_array($val[GetMessage("CC_BSC1_REK_VALUES")][0]["#"][GetMessage("CC_BSC1_REK_VALUE")])) {
                     foreach ($val[GetMessage("CC_BSC1_REK_VALUES")][0]["#"][GetMessage("CC_BSC1_REK_VALUE")] as $val1) {
                         if ($val1["#"][GetMessage("CC_BSC1_NAME")][0]["#"] == GetMessage("CC_BSC1_ITEM_TYPE")) {
                             $arItem[$productID]["TYPE"] = $val1["#"][GetMessage("CC_BSC1_VALUE")][0]["#"];
                         }
                     }
                 }
                 if (strlen($value["#"][GetMessage("CC_BSC1_TAXES")][0]["#"][GetMessage("CC_BSC1_TAX")][0]["#"][GetMessage("CC_BSC1_NAME")][0]["#"]) > 0) {
                     $taxValueTmp = $val[GetMessage("CC_BSC1_TAXES")][0]["#"][GetMessage("CC_BSC1_TAX")][0]["#"][GetMessage("CC_BSC1_TAX_VALUE")][0]["#"];
                     $arItem[$productID]["VAT_RATE"] = $taxValueTmp / 100;
                     if (IntVal($taxValueTmp) > IntVal($taxValue)) {
                         $taxName = $val[GetMessage("CC_BSC1_TAXES")][0]["#"][GetMessage("CC_BSC1_TAX")][0]["#"][GetMessage("CC_BSC1_NAME")][0]["#"];
                         $taxValue = $taxValueTmp;
                     }
                 }
             }
         }
         if (IntVal($taxValue) > 0) {
             $price = str_replace($SumFormat, ".", $value["#"][GetMessage("CC_BSC1_TAXES")][0]["#"][GetMessage("CC_BSC1_TAX")][0]["#"][GetMessage("CC_BSC1_SUMM")][0]["#"]);
             $arOrder["TAX"] = array("NAME" => $taxName, "VALUE" => $taxValue, "IS_IN_PRICE" => $value["#"][GetMessage("CC_BSC1_TAXES")][0]["#"][GetMessage("CC_BSC1_TAX")][0]["#"][GetMessage("CC_BSC1_IN_PRICE")][0]["#"] == "true" ? "Y" : "N", "VALUE_MONEY" => $price);
         }
         $arOrder["items"] = $arItem;
         $v = $arOrder;
         if ($orderInfo = CSaleOrder::GetByID($orderId)) {
             if ($orderInfo["PAYED"] != "Y" && $orderInfo["ALLOW_DELIVERY"] != "Y" && $orderInfo["STATUS_ID"] != "F") {
                 $dbOrderTax = CSaleOrderTax::GetList(array(), array("ORDER_ID" => $orderId), false, false, array("ID", "TAX_NAME", "VALUE", "VALUE_MONEY", "CODE", "IS_IN_PRICE"));
                 $bTaxFound = false;
                 if ($arOrderTax = $dbOrderTax->Fetch()) {
                     $bTaxFound = true;
                     if (IntVal($arOrderTax["VALUE_MONEY"]) != IntVal($v["TAX"]["VALUE_MONEY"]) || IntVal($arOrderTax["VALUE"]) != IntVal($v["TAX"]["VALUE"]) || $arOrderTax["IS_IN_PRICE"] != $v["TAX"]["IS_IN_PRICE"]) {
                         if (IntVal($v["TAX"]["VALUE"]) > 0) {
                             $arFields = array("TAX_NAME" => $v["TAX"]["NAME"], "ORDER_ID" => $orderId, "VALUE" => $v["TAX"]["VALUE"], "IS_PERCENT" => "Y", "IS_IN_PRICE" => $v["TAX"]["IS_IN_PRICE"], "VALUE_MONEY" => $v["TAX"]["VALUE_MONEY"], "CODE" => "VAT1C", "APPLY_ORDER" => "100");
                             CSaleOrderTax::Update($arOrderTax["ID"], $arFields);
                             CSaleOrder::Update($orderId, array("TAX_VALUE" => $v["TAX"]["VALUE_MONEY"]));
                         } else {
                             CSaleOrderTax::Delete($arOrderTax["ID"]);
                             CSaleOrder::Update($orderId, array("TAX_VALUE" => 0));
                         }
                     }
                 }
                 if (!$bTaxFound) {
                     if (IntVal($v["TAX"]["VALUE"]) > 0) {
                         $arFields = array("TAX_NAME" => $v["TAX"]["NAME"], "ORDER_ID" => $orderId, "VALUE" => $v["TAX"]["VALUE"], "IS_PERCENT" => "Y", "IS_IN_PRICE" => $v["TAX"]["IS_IN_PRICE"], "VALUE_MONEY" => $v["TAX"]["VALUE_MONEY"]);
                         CSaleOrderTax::Add($arFields);
                         CSaleOrder::Update($orderId, array("TAX_VALUE" => $v["TAX"]["VALUE_MONEY"]));
                     }
                 }
                 $dbBasket = CSaleBasket::GetList(array("NAME" => "ASC"), array("ORDER_ID" => $orderId));
                 $basketSum = 0;
                 while ($arBasket = $dbBasket->Fetch()) {
                     $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));
         }
     }
 }
コード例 #24
0
ファイル: result_rec.php プロジェクト: DarneoStudio/bitrix
 $strPS_STATUS_DESCRIPTION .= "RC: " . $p_rc . "; ";
 $strPS_STATUS_DESCRIPTION .= "APPROVAL: " . $p_approval . "; ";
 $strPS_STATUS_DESCRIPTION .= "RRN: " . $p_rrn . "; ";
 $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;
コード例 #25
0
ファイル: order_new.php プロジェクト: ASDAFF/entask.ru
									array(),
									array(
										"USER_ID" => $arOrder["USER_ID"],
										"CURRENCY" => $arOrder["CURRENCY"],
									)
								);
								if ($arUserAccount = $dbUserAccount->Fetch())
								{
									if (floatval($arUserAccount["CURRENT_BUDGET"]) >= $arOrder["PRICE"])
										$bPay = false;
								}
							}
							if ($PAYED == "N" && $PAY_FROM_ACCOUNT_BACK != "Y")
								$bWithdraw = false;

							if (!CSaleOrder::PayOrder($ID, $PAYED, $bWithdraw, $bPay, 0, $arAdditionalFields))
							{
								if ($ex = $APPLICATION->GetException())
								{
									if ($ex->GetID() != "ALREADY_FLAG")
										$errorMessageTmp .= $ex->GetString();
								}
								else
									$errorMessageTmp .= GetMessage("ERROR_PAY_ORDER").". ";
							}
						}
						if ($errorMessageTmp != "")
							$arErrors[] = $errorMessageTmp;
					}
					else
					{
コード例 #26
0
ファイル: recurring.php プロジェクト: ASDAFF/bxApiDocs
	/**
	 * <p>Метод осуществляет продление подписки с кодом ID.</p> <p><b>Примечание</b>. Метод использует внутреннюю транзакцию. Если у вас используется <b>MySQL</b> и <b>InnoDB</b>, и ранее была открыта транзакция, то ее необходимо закрыть до подключения метода.</p>
	 *
	 *
	 *
	 *
	 * @param int $ID  Код записи с информацией о продлении.
	 *
	 *
	 *
	 * @return bool <p>Метод возвращает <i>true</i> в случае успешного продления или <i>false</i>
	 * в случае ошибки.</p><br><br>
	 *
	 * @static
	 * @link http://dev.1c-bitrix.ru/api_help/sale/classes/csalerecurring/csalerecurring.nextpayment.php
	 * @author Bitrix
	 */
	public static function NextPayment($ID)
	{
		global $DB;
		global $USER;

		$ID = IntVal($ID);
		if ($ID <= 0)
		{
			$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGR_NO_RECID"), "NO_RECORD_ID");
			return False;
		}

		$arRecur = CSaleRecurring::GetByID($ID);
		if (!$arRecur)
		{
			$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $ID, GetMessage("SKGR_NO_RECID1")), "NO_RECORD");
			return False;
		}

		$arOrder = CSaleOrder::GetByID($arRecur["ORDER_ID"]);
		if (!$arOrder)
		{
			$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arRecur["ORDER_ID"], GetMessage("SKGR_NO_ORDER1")), "NO_ORDER");
			return False;
		}


		$bSuccess = True;
		$newOrderID = IntVal($arRecur["ORDER_ID"]);

		/** @var $productProvider IBXSaleProductProvider */
		if ($productProvider = CSaleBasket::GetProductProvider($arRecur))
		{
			$arProduct = $productProvider::RecurringOrderProduct(array(
				"PRODUCT_ID" => $arRecur["PRODUCT_ID"],
				"USER_ID"    => $arOrder["USER_ID"]
			));
		}
		else
		{
			$arProduct = CSaleRecurring::ExecuteCallbackFunction(
					$arRecur["CALLBACK_FUNC"],
					$arRecur["MODULE"],
					$arRecur["PRODUCT_ID"],
					$arOrder["USER_ID"]
				);
		}

		if (!$arProduct || !is_array($arProduct) || count($arProduct) <= 0)
		{
			CSaleRecurring::CancelRecurring($arRecur["ID"], "Y", "Product is not found");

			/*
			$arFields = array(
					"CANCELED" => "Y",
					"DATE_CANCELED" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))),
					"CANCELED_REASON" => "Product is not found"
				);
			CSaleRecurring::Update($arRecur["ID"], $arFields);
			*/
			//CSaleRecurring::Delete($arRecur["ID"]);

			return True;
		}

		if ($arProduct["WITHOUT_ORDER"] == "Y" || $arRecur["SUCCESS_PAYMENT"] == "Y")
		{
			$baseSiteCurrency = CSaleLang::GetLangCurrency($arOrder["LID"]);
			$productPrice = roundEx(CCurrencyRates::ConvertCurrency($arProduct["PRICE"], $arProduct["CURRENCY"], $baseSiteCurrency), SALE_VALUE_PRECISION);

			// Delivery
			$deliveryPrice = 0;
			$deliveryID = 0;
			$arOrder["DELIVERY_ID"] = IntVal($arOrder["DELIVERY_ID"]);
			if ($arOrder["DELIVERY_ID"] > 0)
			{
				$deliveryLocation = 0;
				$dbOrderPropValues = CSaleOrderPropsValue::GetList(
						array(),
						array(
								"ORDER_ID" => $arRecur["ORDER_ID"],
								"PROP_IS_LOCATION" => "Y"
							),
						false,
						false,
						array("VALUE")
					);
				if ($arOrderPropValues = $dbOrderPropValues->Fetch())
					$deliveryLocation = IntVal($arOrderPropValues["VALUE"]);

				$dbDelivery = CSaleDelivery::GetList(
						array("SORT" => "ASC", "NAME" => "ASC"),
						array(
								"LID" => $arOrder["LID"],
								"WEIGHT" => DoubleVal($arProduct["WEIGHT"]) * DoubleVal($arProduct["QUANTITY"]), // Changed by Sigurd, 2007-08-16
								"ORDER_PRICE" => $productPrice * DoubleVal($arProduct["QUANTITY"]),
								"ACTIVE" => "Y",
								"LOCATION" => $deliveryLocation
							)
					);
				while ($arDelivery = $dbDelivery->Fetch())
				{
					$deliveryPriceTmp = roundEx(CCurrencyRates::ConvertCurrency($arDelivery["PRICE"], $arDelivery["CURRENCY"], $baseSiteCurrency), SALE_VALUE_PRECISION);
					if (IntVal($arDelivery["ID"]) == $arOrder["DELIVERY_ID"])
					{
						$deliveryID = IntVal($arDelivery["ID"]);
						$deliveryPrice = $deliveryPriceTmp;
						break;
					}
					if ($deliveryPriceTmp < $deliveryPrice || $deliveryID <= 0)
					{
						$deliveryID = IntVal($arDelivery["ID"]);
						$deliveryPrice = $deliveryPriceTmp;
					}
				}

				if ($deliveryID <= 0)
				{
					$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGR_NO_DELIVERY"), "NO_DELIVERY");
					return False;
				}
			}

			// Sale discounts
			$discount = 0;
			$discountPrice = $productPrice;
			$discountProduct = 0;
			$dbDiscount = CSaleDiscount::GetList(
					array("SORT" => "ASC"),
					array(
							"LID" => $arOrder["LID"],
							"ACTIVE" => "Y",
							"!>ACTIVE_FROM" => Date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL"))),
							"!<ACTIVE_TO" => Date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL"))),
							"<=PRICE_FROM" => $productPrice,
							">=PRICE_TO" => $productPrice,
							"USER_GROUPS" => $USER->GetUserGroup($arOrder['USER_ID']),
						)
				);
			if ($arDiscount = $dbDiscount->Fetch())
			{
				if ($arDiscount["DISCOUNT_TYPE"] == "P")
				{
					$discountProduct = roundEx($productPrice * $arDiscount["DISCOUNT_VALUE"] / 100, SALE_VALUE_PRECISION);
					$discount = roundEx($discountProduct * DoubleVal($arProduct["QUANTITY"]), SALE_VALUE_PRECISION); // Changed by Sigurd, 2007-08-16
					$discountPrice = $productPrice - $discountProduct;
				}
				else
				{
					$discountValue = CCurrencyRates::ConvertCurrency($arDiscount["DISCOUNT_VALUE"], $arDiscount["CURRENCY"], $baseSiteCurrency);
					$discountValue = roundEx($discountValue, SALE_VALUE_PRECISION);

					$discountProduct = roundEx(1.0 * $discountValue / DoubleVal($arProduct["QUANTITY"]), SALE_VALUE_PRECISION);// Changed by Sigurd, 2007-08-16
					$discount = roundEx($curDiscount * DoubleVal($arProduct["QUANTITY"]), SALE_VALUE_PRECISION);
					$discountPrice = $productPrice - $discountProduct;
				}
			}

			$bUseVat = false;
			$vatRate = 0;
			if(DoubleVal($arProduct["VAT_RATE"]) > 0)
			{
				$bUseVat = true;
				$vatRate = $arProduct["VAT_RATE"];
			}

			// Tax
			$arTaxExempt = array();
			$dbUserGroups = CUser::GetUserGroupEx($arOrder["USER_ID"]);
			while ($arUserGroups = $dbUserGroups->Fetch())
			{
				$dbTaxExemptTmp = CSaleTax::GetExemptList(array("GROUP_ID" => $arUserGroups["GROUP_ID"]));
				while ($arTaxExemptTmp = $dbTaxExemptTmp->Fetch())
				{
					$arTaxExemptTmp["TAX_ID"] = IntVal($arTaxExemptTmp["TAX_ID"]);
					if (!in_array($arTaxExemptTmp["TAX_ID"], $arTaxExempt))
						$arTaxExempt[] = $arTaxExemptTmp["TAX_ID"];
				}
			}

			$taxPrice = 0;
			$taxVatPrice = 0;
			if(!$bUseVat)
			{
				$taxLocation = 0;
				$dbOrderPropValues = CSaleOrderPropsValue::GetList(
						array(),
						array(
								"ORDER_ID" => $arRecur["ORDER_ID"],
								"PROP_IS_LOCATION4TAX" => "Y"
							),
						false,
						false,
						array("VALUE")
					);
				if ($arOrderPropValues = $dbOrderPropValues->Fetch())
					$taxLocation = IntVal($arOrderPropValues["VALUE"]);

				$arTaxList = array();
				$dbTaxRateTmp = CSaleTaxRate::GetList(
						array("APPLY_ORDER" => "ASC"),
						array(
								"LID" => $arOrder["LID"],
								"PERSON_TYPE_ID" => $arOrder["PERSON_TYPE_ID"],
								"ACTIVE" => "Y",
								"LOCATION" => $taxLocation
							)
					);
				while ($arTaxRateTmp = $dbTaxRateTmp->Fetch())
				{
					if (!in_array(IntVal($arTaxRateTmp["TAX_ID"]), $arTaxExempt))
					{
						$arTaxList[] = $arTaxRateTmp;
					}
				}
			}
			else
			{
				$arTaxList[] = Array(
							"ID" => 0,
							"TAX_NAME" => GetMessage("SKGR_VAT"),
							"IS_PERCENT" => "Y",
							"VALUE" => $vatRate*100,
							"VALUE_MONEY" => 0,
							"APPLY_ORDER" => 100,
							"IS_IN_PRICE" => "Y",
							"CODE" => "VAT"
				);
			}


			$arTaxSums = array();

			if (!empty($arTaxList))
			{
				if(!$bUseVat)
				{
					$taxPriceTmp = CSaleOrderTax::CountTaxes(
							$discountPrice * DoubleVal($arProduct["QUANTITY"]),
							$arTaxList,
							$baseSiteCurrency
						);

					for ($di = 0, $intCount = count($arTaxList); $di < $intCount; $di++)
					{
						$arTaxList[$di]["VALUE_MONEY"] += $arTaxList[$di]["TAX_VAL"];
					}

					for ($di = 0, $intCount = count($arTaxList); $di < $intCount; $di++)
					{
						$arTaxSums[$arTaxList[$di]["TAX_ID"]]["VALUE"] = $arTaxList[$di]["VALUE_MONEY"];
						$arTaxSums[$arTaxList[$di]["TAX_ID"]]["NAME"] = $arTaxList[$di]["NAME"];
						if ($arTaxList[$di]["IS_IN_PRICE"] != "Y")
						{
							$taxPrice += $arTaxList[$di]["VALUE_MONEY"];
						}
					}
				}
				else
				{
					$arTaxList[0]["VALUE_MONEY"] = (($discountPrice / ($vatRate +1)) * $vatRate) * DoubleVal($arProduct["QUANTITY"]);
					$taxVatPrice = $arTaxList[0]["VALUE_MONEY"];
				}
			}


			// Changed by Sigurd, 2007-08-16
			$totalOrderPrice = $discountPrice * DoubleVal($arProduct["QUANTITY"]) + $deliveryPrice + $taxPrice;

			$arProduct["WITHOUT_ORDER"] = (($arProduct["WITHOUT_ORDER"]=="Y") ? "Y" : "N");
			if ($arProduct["WITHOUT_ORDER"] == "N")
			{
				$DB->StartTransaction();

				// Saving
				$arSaleUser = CSaleUser::GetList(Array(), Array("USER_ID" => $arOrder["USER_ID"]));
				if(!empty($arSaleUser))
				{
					$currentFUser = $arSaleUser["ID"];
				}
				else
				{
					$currentFUser = CSaleUser::_Add(
							array(
									"=DATE_INSERT" => $DB->GetNowFunction(),
									"=DATE_UPDATE" => $DB->GetNowFunction(),
									"USER_ID" => $arOrder["USER_ID"]
								)
						);
				}

				$arFields = array(
						"FUSER_ID" => $currentFUser,
						"PRODUCT_ID" => $arProduct["PRODUCT_ID"],
						"PRODUCT_NAME" => $arProduct["PRODUCT_NAME"],
						"PRODUCT_URL" => $arProduct["PRODUCT_URL"],
						"PRODUCT_PRICE_ID" => $arProduct["PRODUCT_PRICE_ID"],
						"PRICE" => $arProduct["PRICE"],
						"CURRENCY" => $arProduct["CURRENCY"],
						"WEIGHT" => $arProduct["WEIGHT"],
						"QUANTITY" => $arProduct["QUANTITY"],
						"LID" => $arOrder["LID"],
						"DELAY" => "N",
						"CAN_BUY" => "Y",
						"NAME" => $arProduct["NAME"],
						"CALLBACK_FUNC" => $arProduct["CALLBACK_FUNC"],
						"ORDER_CALLBACK_FUNC" => $arProduct["ORDER_CALLBACK_FUNC"],
						"CANCEL_CALLBACK_FUNC" => $arProduct["CANCEL_CALLBACK_FUNC"],
						"PAY_CALLBACK_FUNC" => $arProduct["PAY_CALLBACK_FUNC"],
						"PRODUCT_PROVIDER_CLASS" => $arProduct["PRODUCT_PROVIDER_CLASS"],
						"MODULE" => $arRecur["MODULE"],
						"NOTES" => $arProduct["CATALOG_GROUP_NAME"],
						"DETAIL_PAGE_URL" => $arProduct["DETAIL_PAGE_URL"],
						"VATE_RATE" => $arProduct["VATE_RATE"],
						"PRODUCT_XML_ID" => $arProduct["PRODUCT_XML_ID"],
						"RENEWAL" => "Y"
					);

				$basketID = CSaleBasket::Add($arFields);

				$basketID = IntVal($basketID);
				if ($basketID <= 0)
					$bSuccess = False;

				if ($bSuccess)
				{
					if (CModule::IncludeModule("statistic"))
						CStatistic::Set_Event("eStore", "add2basket", $arFields["PRODUCT_ID"]);

					$arFields = array(
							"LID" => $arOrder["LID"],
							"PERSON_TYPE_ID" => $arOrder["PERSON_TYPE_ID"],
							"PAYED" => "N",
							"CANCELED" => "N",
							"STATUS_ID" => "N",
							"PRICE_DELIVERY" => $deliveryPrice,
							"ALLOW_DELIVERY" => "N",
							"PRICE" => $totalOrderPrice,
							"CURRENCY" => $baseSiteCurrency,
							"DISCOUNT_VALUE" => $discount,
							"USER_ID" => $arOrder["USER_ID"],
							"PAY_SYSTEM_ID" => $arOrder["PAY_SYSTEM_ID"],
							"DELIVERY_ID" => $deliveryID,
							"USER_DESCRIPTION" => $arOrder["USER_DESCRIPTION"],
							"TAX_VALUE" => (($bUseVat)? $taxVatPrice : $taxPrice),
							"STAT_GID" => $arOrder["STAT_GID"],
							"RECURRING_ID" => $arRecur["ID"]
						);

					$newOrderID = CSaleOrder::Add($arFields);

					$newOrderID = IntVal($newOrderID);
					if ($newOrderID <= 0)
						$bSuccess = False;
				}

				if ($bSuccess)
				{
					$arDiscounts = array();
					$arDiscounts[$basketID] = $discountProduct;
					CSaleBasket::OrderBasket($newOrderID, $currentFUser, $arOrder["LID"], $arDiscounts);
				}

				if ($bSuccess)
				{
					for ($it = 0, $intCount = count($arTaxList); $it < $intCount; $it++)
					{
						$arFields = array(
							"ORDER_ID" => $newOrderID,
							"TAX_NAME" => $arTaxList[$it]["TAX_NAME"],
							"IS_PERCENT" => $arTaxList[$it]["IS_PERCENT"],
							"VALUE" => ($arTaxList[$it]["IS_PERCENT"]=="Y") ? $arTaxList[$it]["VALUE"] : RoundEx(CCurrencyRates::ConvertCurrency($arTaxList[$it]["VALUE"], $arTaxList[$it]["CURRENCY"], $baseSiteCurrency), 2),
							"VALUE_MONEY" => $arTaxList[$it]["VALUE_MONEY"],
							"APPLY_ORDER" => $arTaxList[$it]["APPLY_ORDER"],
							"IS_IN_PRICE" => $arTaxList[$it]["IS_IN_PRICE"],
							"CODE" => $arTaxList[$it]["CODE"]
							);
						CSaleOrderTax::Add($arFields);
					}

					$dbOrderPropValues = CSaleOrderPropsValue::GetList(
							array(),
							array("ORDER_ID" => $arRecur["ORDER_ID"]),
							false,
							false,
							array("ORDER_PROPS_ID", "NAME", "CODE", "VALUE", "PROP_IS_PAYER", "PROP_IS_EMAIL")
						);
					while ($arOrderPropValues = $dbOrderPropValues->Fetch())
					{
						$arFields = array(
							"ORDER_ID" => $newOrderID,
							"ORDER_PROPS_ID" => $arOrderPropValues["ORDER_PROPS_ID"],
							"NAME" => $arOrderPropValues["NAME"],
							"CODE" => $arOrderPropValues["CODE"],
							"VALUE" => $arOrderPropValues["VALUE"]
							);
						CSaleOrderPropsValue::Add($arFields);

						if ($arOrderPropValues["PROP_IS_PAYER"] == "Y")
							$payerName = $arOrderPropValues["VALUE"];
						if ($arOrderPropValues["PROP_IS_EMAIL"] == "Y")
							$payerEMail = $arOrderPropValues["VALUE"];
					}
				}

				if ($bSuccess)
				{
					if (CModule::IncludeModule("statistic"))
						CStatistic::Set_Event("eStore", "order_create", $newOrderID);
				}

				if ($bSuccess)
				{
					$strOrderList = "";
					$dbBasketTmp = CSaleBasket::GetList(
						array("NAME" => "ASC"),
						array("ORDER_ID" => $newOrderID)
					);
					while ($arBasketTmp = $dbBasketTmp->Fetch())
					{
						$strOrderList .= $arBasketTmp["NAME"]." - ".$arBasketTmp["QUANTITY"]." ".GetMessage("SALE_QUANTITY_UNIT");
						$strOrderList .= "\n";
					}

					if (strlen($payerName) <= 0 || strlen($payerEMail) <= 0)
					{
						$dbUser = CUser::GetByID($arOrder["USER_ID"]);
						if ($arUser = $dbUser->Fetch())
						{
							if (strlen($payerName) <= 0)
								$payerName = $arUser["NAME"].((strlen($arUser["NAME"])<=0 || strlen($arUser["LAST_NAME"])<=0) ? "" : " ").$arUser["LAST_NAME"];
							if (strlen($payerEMail) <= 0)
								$payerEMail = $arUser["EMAIL"];
						}
					}

					$arFields = Array(
						"ORDER_ID" => $newOrderID,
						"ORDER_DATE" => Date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT", $arOrder["LID"]))),
						"ORDER_USER" => $payerName,
						"PRICE" => SaleFormatCurrency($totalOrderPrice, $baseSiteCurrency),
						"BCC" => COption::GetOptionString("sale", "order_email", "order@".$SERVER_NAME),
						"EMAIL" => $payerEMail,
						"ORDER_LIST" => $strOrderList,
						"SALE_EMAIL" => COption::GetOptionString("sale", "order_email", "order@".$SERVER_NAME)
					);
					$eventName = "SALE_NEW_ORDER_RECURRING";

					$bSend = true;
					foreach(GetModuleEvents("sale", "OnOrderRecurringSendEmail", true) as $arEvent)
					{
						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"],
					"WITHOUT_ORDER" => $arProduct["WITHOUT_ORDER"],
					"PRIOR_DATE" => Date($GLOBALS["DB"]->DateFormatToPHP(CLang::GetDateFormat("FULL", SITE_ID))),
					"NEXT_DATE" => $arProduct["NEXT_DATE"],
					"REMAINING_ATTEMPTS" => (Defined("SALE_PROC_REC_ATTEMPTS") ? SALE_PROC_REC_ATTEMPTS : 3),
					"SUCCESS_PAYMENT" => "Y"
				);

				CSaleRecurring::Update($arRecur["ID"], $arFields);
			}
			else
			{
				$arFields = array(
						"ORDER_ID" => $newOrderID,
						"PRODUCT_NAME" => $arProduct["PRODUCT_NAME"],
						"PRODUCT_URL" => $arProduct["PRODUCT_URL"],
						"PRICE_TYPE" => $arProduct["PRICE_TYPE"],
						"RECUR_SCHEME_LENGTH" => $arProduct["RECUR_SCHEME_LENGTH"],
						"RECUR_SCHEME_TYPE" => $arProduct["RECUR_SCHEME_TYPE"],
						"WITHOUT_ORDER" => $arProduct["WITHOUT_ORDER"],
						"NEXT_DATE" => Date($GLOBALS["DB"]->DateFormatToPHP(CLang::GetDateFormat("FULL", SITE_ID)), time() + SALE_PROC_REC_TIME + CTimeZone::GetOffset()),
						"REMAINING_ATTEMPTS" => (IntVal($arRecur["REMAINING_ATTEMPTS"]) - 1),
						"SUCCESS_PAYMENT" => "N"
					);
				CSaleRecurring::Update($arRecur["ID"], $arFields);

				if ((IntVal($arRecur["REMAINING_ATTEMPTS"]) - 1) <= 0)
				{
					CSaleRecurring::CancelRecurring($arRecur["ID"], "Y", "Can't pay order");
					/*
					$arFields["CANCELED"] = "Y";
					$arFields["DATE_CANCELED"] = Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG)));
					$arFields["CANCELED_REASON"] = "Can't pay order";
					*/
				}
			}
		}

		return $res;
	}
コード例 #27
0
ファイル: order.php プロジェクト: k-kalashnikov/geekcon_new
 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;
         }
     }
     return $res;
 }
コード例 #28
0
ファイル: ajax.php プロジェクト: Satariall/izurit
            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);
            }
            $bWithdraw = true;
            $bPay = true;
            if ($_REQUEST["pay_from_account"] == "Y") {
                $bPay = false;
            }
            if ($payed == "N" && $_REQUEST["pay_from_account_back"] != "Y") {
                $bWithdraw = false;
            }
            $result = CSaleOrder::PayOrder($id, $payed, $bWithdraw, $bPay, 0, $arAdditionalFields);
            break;
    }
    echo $result;
}
コード例 #29
0
ファイル: payment.php プロジェクト: DarneoStudio/bitrix
 // Zip
 $parms .= "&STREET=" . urlencode($address1);
 // Address
 $parms .= "&COMMENT1=" . urlencode($ORDER_ID);
 $parms .= "&COMMENT2=" . urlencode($GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["DATE_INSERT"]);
 $ret_com = "{$strExePath} {$PF_HOST} {$PF_PORT} \"{$parms}\" 30";
 putenv("PFPRO_CERT_PATH=" . $PFPRO_CERT_PATH);
 putenv("LD_LIBRARY_PATH=" . $strExeDir);
 exec($ret_com, $arOutput, $ret_var);
 $strOutput = $arOutput[0];
 parse_str($strOutput, $arResult);
 if (is_array($arResult) && strlen($arResult["RESULT"]) > 0) {
     $arFields = array("PS_STATUS" => $arResult["RESULT"] == 0 ? "Y" : "N", "PS_STATUS_CODE" => $arResult["RESULT"], "PS_STATUS_DESCRIPTION" => $arResult["RESPMSG"] . " - " . $arResult["PREFPSMSG"], "PS_STATUS_MESSAGE" => $arResult["PNREF"], "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))));
     $arResult["RESULT"] = IntVal($arResult["RESULT"]);
     if ($arResult["RESULT"] == 0) {
         CSaleOrder::PayOrder($ORDER_ID, "Y");
     }
     CSaleOrder::Update($ORDER_ID, $arFields);
     $arResult["RESULT"] = IntVal($arResult["RESULT"]);
     if ($arResult["RESULT"] == 0) {
         $bNonePay = False;
     } else {
         if ($arResult["RESULT"] < 0) {
             $strErrorTmp .= "Communication Error: [" . $arResult["RESULT"] . "] " . $arResult["RESPMSG"] . " - " . $arResult["PREFPSMSG"] . ". ";
         } elseif ($arPaySysRes_tmp["RESULT"] == 125) {
             $strErrorTmp .= "Your payment is declined by Fraud Service. Please contact us to make payment. ";
         } elseif ($arResult["RESULT"] == 126) {
             $strErrorTmp .= "Your payment is under review by Fraud Service. We contact you in 48 hours to get more specific information. ";
         } elseif (is_set($arErrorCodes, $arResult["RESULT"])) {
             $strErrorTmp .= $arErrorCodes[$arResult["RESULT"]] . ". ";
         } else {
コード例 #30
0
 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;
 }