Exemplo n.º 1
0
 public static function delete($restrictionId, $deliveryId)
 {
     DeliveryPaySystemTable::setLinks($deliveryId, DeliveryPaySystemTable::ENTITY_TYPE_DELIVERY, array(), false);
     return parent::delete($restrictionId);
 }
Exemplo n.º 2
0
             }
         }
     } else {
         $ID = CSalePaySystem::Add($arFields);
         if ($ID <= 0) {
             if ($ex = $APPLICATION->GetException()) {
                 $errorMessage .= $ex->GetString() . ".<br>";
             } else {
                 $errorMessage .= GetMessage("ERROR_ADD_PAY_SYS") . ".<br>";
             }
         }
     }
 }
 if (strlen($errorMessage) <= 0) {
     if ($ID > 0) {
         \Bitrix\Sale\Internals\DeliveryPaySystemTable::setLinks($ID, \Bitrix\Sale\Internals\DeliveryPaySystemTable::ENTITY_TYPE_PAYSYSTEM, isset($_POST["DELIVERY_HANDLERS"]) && is_array($_POST["DELIVERY_HANDLERS"]) ? $_POST["DELIVERY_HANDLERS"] : array());
     }
     $arPersonTypes = array();
     $dbPersonType = CSalePersonType::GetList(array("SORT" => "ASC", "NAME" => "ASC"), array());
     while ($arPersonType = $dbPersonType->GetNext()) {
         $errorMessage1 = "";
         $arPersonTypes[] = IntVal($arPersonType["ID"]);
         $actionID = 0;
         $dbPSAction = CSalePaySystemAction::GetList(array(), array("PAY_SYSTEM_ID" => $ID, "PERSON_TYPE_ID" => $arPersonType["ID"]));
         if ($arPSAction = $dbPSAction->Fetch()) {
             $actionID = IntVal($arPSAction["ID"]);
         }
         if (${"PS_EXISTS_" . $arPersonType["ID"]} != "Y") {
             if ($actionID > 0) {
                 if (!CSalePaySystemAction::Delete($actionID)) {
                     if ($ex = $APPLICATION->GetException()) {