function fGetPaySystemsHTML($PERSON_TYPE_ID, $PAY_SYSTEM_ID) { $resultHtml = "<table width=\"100%\">"; $resultHtml .= "<tr class=\"adm-detail-required-field\">\n<td class=\"adm-detail-content-cell-l\" width=\"40%\">".GetMessage("SOE_PAY_SYSTEM").":</td><td class=\"adm-detail-content-cell-r\" width=\"60%\">"; $arPaySystem = CSalePaySystem::DoLoadPaySystems($PERSON_TYPE_ID); $resultHtml .= "<select name=\"PAY_SYSTEM_ID\" id=\"PAY_SYSTEM_ID\" onChange=\"fChangePaymentSystem();\">\n"; $resultHtml .= "<option value=\"\">(".GetMessage("SOE_SELECT").")</option>"; foreach ($arPaySystem as $key => $val) { $resultHtml .= "<option value=\"".$key."\""; if ($key == intval($PAY_SYSTEM_ID)) $resultHtml .= " selected"; $resultHtml .= ">".$val["NAME"]." [".$key."]</option>"; } $resultHtml .= "</select>"; $resultHtml .= "</td>\n</tr>"; $resultHtml .= "</table>"; return $resultHtml; }
} } } $arResult["DELIVERY"] = $arDeliveryResult; $arResult["DELIVERY_CHECHED_DESC"] = $deliveryCheckDesc; /* * paysystem */ $userAccount = ""; $dbUserAccount = CSaleUserAccount::GetList(array(), array("USER_ID" => $currentUserId, "CURRENCY" => $arResult["CURRENCY"], "LOCKED" => "N")); if ($arUserAccount = $dbUserAccount->GetNext()) { if (DoubleVal($arUserAccount["CURRENT_BUDGET"]) > 0) { $userAccount = SaleFormatCurrency($arUserAccount["CURRENT_BUDGET"], $arResult["CURRENCY"]); } } $arPaySystem = CSalePaySystem::DoLoadPaySystems($PERSON_TYPE); $arNewPaySystem = array(); $paysystemDesc = ""; $arNewPaySystem[0] = array("ID" => "", "NAME" => GetMessage("SBB_SELECT_PAYSYSTEM"), "CHECKED" => "Y"); foreach ($arPaySystem as $key => $val) { $arNewPaySystem[$key]["ID"] = $val["ID"]; $arNewPaySystem[$key]["NAME"] = $val["NAME"]; $arNewPaySystem[$key]["DESCRIPTION"] = $val["DESCRIPTION"]; $arNewPaySystem[$key]["ACTIVE"] = $val["ACTIVE"]; if ($_POST["PAYSYSTEM_ID"] == $key) { $arNewPaySystem[$key]["CHECKED"] = "Y"; $arNewPaySystem[0]["CHECKED"] = "N"; $paysystemDesc = $val["DESCRIPTION"]; } } //add pay from account
public static function GetPaySystems($personTypeId) { if (!CModule::IncludeModule('sale')) { return false; } if (self::$paySystems === null) { $arPersonTypes = self::getPersonTypeIDs(); if (!isset($arPersonTypes['COMPANY']) || !isset($arPersonTypes['CONTACT']) || $arPersonTypes['COMPANY'] <= 0 || $arPersonTypes['CONTACT'] <= 0) { return false; } $companyPaySystems = CSalePaySystem::DoLoadPaySystems($arPersonTypes['COMPANY']); $contactPaySystems = CSalePaySystem::DoLoadPaySystems($arPersonTypes['CONTACT']); self::$paySystems = array($arPersonTypes['COMPANY'] => $companyPaySystems, $arPersonTypes['CONTACT'] => $contactPaySystems); } if (!in_array($personTypeId, array_keys(self::$paySystems))) { return false; } return self::$paySystems[$personTypeId]; }