Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php class Vfde_Superorder_Helper_Client extends Omnius_Superorder_Helper_Client { use V..

Decoded Output download

<?php 
class Vfde_Superorder_Helper_Client extends Omnius_Superorder_Helper_Client { use Vfde_Core_Traits_ObjectInstantiator; protected $installBaseOverwrites = []; protected $manuallyRefusedItems = []; protected $_calculator; protected $configurationData; public const CONTRACT_END_DATE = 1; public const CATEGORY_PATH = "->"; public const MOBILE_POSTPAID_TARIFF = 'TARIFF'; public const ASAP = 2; public const WISH_DATE = 3; public const CATEGORY_MULTISIM = 'Mobile/SAP_SKU_Physical_MULTISIM'; public const MULTISIM_SLOT_CATEGORY = 'Mobile/Multisim_Slots'; public const BACKEND_MASRH = 'Marsh'; public const ATTRIBUTE_CODE_TARGETDATE = 'TARGETDATE'; public const ADDON_NAME_FUNCTION_ID = 'function@ID'; public const DATE = 'date'; public const DATE_TIME = 'datetime'; public const CONTRACT_MODE = 'GenerateContract'; public const ORDER_MODE = 'Fulfillment'; public const ACCOUNT_CATEGORY_UNKNOWN = "Unknown"; public const CONTRACT_SUMMARY_YES = 1; public const CONTRACT_SUMMARY_NO = 0; public const CONTRACT_SUMMARY_LINE_OF_BUSINESS_ALL = 'ALL'; public const CONTRACT_SUMMARY_DOCUMENT_TYPE_C = 'C'; public const CONTRACT_SUMMARY_DOCUMENT_TYPE_P = 'P'; public const BILLING_TYPE_MAIL = 'mail'; public const BILLING_TYPE_INVOICE = 'invoice'; public const ATTRIBUTE_CODE_ORDER_ID = 'orderId'; public $processContext = null; public const CONTRACT_SUMMARY = 'contractSummary'; public const ATTRIBUTE_CODE_HOME_ID = 'HOME_ID'; public static $defaultPhoneBookPersonalFields = ['Address' => null, 'InverseSearchIndicator' => null, 'TelephoneInfoUse' => null, 'NamePrefix' => null, 'FaxDirectoryIndicator' => null, 'VoiceDirectoryIndicator' => null, 'NameSuffix' => null, 'InverseSearch' => null, 'InformationUse' => null, 'ElecListIndicator' => null, 'PrintListIndicator' => null, 'PublishAddress' => null, 'AltUserFirstName' => null, 'AltUserLastName' => null]; protected $isHwDiscountIncluded = false; public function getItemStatusModel() { return Mage::getModel('vfde_configurator/itemStatus'); } public static function getCustomerEntities($spf0635b) { $spf71e81 = array(); $sp49cd5b = static::getInstalledBaseCustomerEntities(); $sp79e5cf = Mage::getSingleton('omnius_address/storage')->getServiceAbility(); foreach ($spf0635b as $sp439c5e) { $sp33f611 = $sp439c5e->getParentAccountNumber(); $sp2d0ca5 = self::getPackageType($sp439c5e->getType()); if (isset($sp49cd5b[$sp33f611]['address_ids']) && !in_array($sp79e5cf['address_id'], $sp49cd5b[$sp33f611]['address_ids'])) { $sp33f611 = null; } if (isset($sp49cd5b[$sp33f611]) && $sp49cd5b[$sp33f611] && isset($sp49cd5b[$sp33f611]['installed_base_entity'])) { $sp49cd5b[$sp33f611]['installed_base_entity'] = false; } elseif (!isset($spf71e81[$sp2d0ca5])) { $spf71e81[$sp2d0ca5] = ['customer_number' => $sp33f611, 'account_type' => $sp2d0ca5, 'package_type' => strtolower($sp439c5e->getType()), 'installed_base_entity' => false]; } } return $sp49cd5b + $spf71e81; } public function getCustomerTypeShort($sp99e42d) { $sp43f4d7 = 'Vfde_Customer_Model_Client_RetrieveCustomerInfo'; $sp6b21fa = $this->getCustomerType($sp99e42d); $spe804d9 = [$sp43f4d7::PARTY_TYPE_PRIVATE => $sp43f4d7::PARTY_TYPE_SHORT_PRIVATE, $sp43f4d7::PARTY_TYPE_SOHO => $sp43f4d7::PARTY_TYPE_SHORT_SOHO]; return $spe804d9[$sp6b21fa] ?? null; } public static function getCustomerEntitiesForSupportOrder($spf0635b) { $spf71e81 = []; $sp97bf5f = static::getInstalledBaseCustomerEntities(); if (!isset($spf0635b)) { return $sp97bf5f; } foreach ($spf0635b as $sp439c5e) { $sp33f611 = $sp439c5e->getParentAccountNumber(); $sp2d0ca5 = self::getPackageType($sp439c5e->getType()); if (self::checkAccountNumberAndType($sp97bf5f, $sp439c5e)) { continue; } if (!isset($spf71e81[$sp2d0ca5])) { $spf71e81[$sp2d0ca5] = ['customer_number' => $sp33f611 ?? '', 'account_type' => $sp2d0ca5, 'package_type' => strtolower($sp439c5e->getType()), 'installed_base_entity' => false]; } } return $sp97bf5f + $spf71e81; } public static function getInstalledBaseCustomerEntities() { $spf71e81 = array(); $sp8b600d = Mage::getSingleton('vfde_customer/session')->getCustomerProducts(); foreach ($sp8b600d as $spd7a64f => $spa24412) { foreach ($spa24412 as $spd989d3 => $spd5febf) { $spb013f6 = []; $spa1508e = []; foreach ($spd5febf['contracts'] as $spe6d87d) { if (isset($spe6d87d['subscriptions'])) { foreach ($spe6d87d['subscriptions'] as $sp02fc97) { if (isset($sp02fc97['package_creation_type'])) { $spb013f6 = $sp02fc97; break; } } } self::getServiceAddress($spe6d87d, $spa1508e); } $spd5be92 = self::getProductPackageType($spd7a64f, $spb013f6); $sp2d0ca5 = self::getPackageType($spd5be92); if (strtolower($sp2d0ca5) == strtolower(self::ACCOUNT_CATEGORY_UNKNOWN) && strtolower($spd7a64f) == strtolower(Omnius_Customer_Helper_Services::ACCOUNT_CATEGORY_KD)) { $sp2d0ca5 = Omnius_Customer_Model_Customer::ACCOUNT_CATEGORY_CABLE; } $spf71e81[$spd989d3] = ['customer_number' => $spd989d3, 'account_type' => $sp2d0ca5, 'package_type' => $spd5be92, 'installed_base_entity' => true, 'address_ids' => strtolower($spd7a64f) == strtolower(Vfde_Customer_Helper_Services::ACCOUNT_CATEGORY_KD) ? $spa1508e : null]; } } return $spf71e81; } public function getPaymentMethod($sp439c5e, $spb014f6 = null) { if ($spb014f6 === null) { if (Vfde_Core_Helper_Data::isAnyTrue([$sp439c5e->isFixed(), $sp439c5e->isCable()])) { $spb014f6 = 'RC'; } else { $spb014f6 = 'OTC'; } } switch ($spb014f6) { case 'RC': $sp6b21fa = $this->getCheckout('payment[monthly][type]'); if ($sp6b21fa == Vfde_Checkout_Helper_Fields::PAYMENT_SPLIT_PAYMENT) { $sp6b21fa = $this->getCheckout('payment[pakket][' . $sp439c5e->getPackageId() . '][type]'); } break; case 'OTC': $sp6b21fa = $this->getCheckout('payment[one_time][type]'); break; default: $sp6b21fa = ''; } if (strpos($sp6b21fa, '|') !== false) { $sp6b21fa = substr($sp6b21fa, 0, strpos($sp6b21fa, '|')); } $spba0ab0 = null; foreach ($sp439c5e->getItems() as $sp008ee3) { if (Vfde_Catalog_Model_Type::getCheckoutSelfReferrerSkus() == $sp008ee3->getData('sku')) { if ($sp6b21fa == Vfde_Checkout_Helper_Fields::PAYMENT_BANK_TRANSFER) { $spba0ab0 = 'GI'; } break; } } $spba0ab0 = $this->setPayment($spba0ab0, $sp6b21fa); return $spba0ab0; } public function getAccountOwnerValue($sp439c5e) : string { $spd46943 = $this->getModel('customer/customer'); $sp45fdc1 = $spd46943->isSohoRvOrBusinessCustomer(); $sp81ab9c = ''; if ($this->getCheckout('payment[monthly][type]') == Vfde_Checkout_Helper_Fields::PAYMENT_SPLIT_PAYMENT) { $spc7a1af = $this->getCheckout('payment[pakket][' . $sp439c5e->getPackageId() . '][alternative_account_holder]'); if ($spc7a1af == Vfde_Checkout_Block_Cart_Steps_SaveCustomer::ALTERNATIVE_ACCOUNT_HOLDER) { $sp81ab9c = $this->getCheckout('payment[pakket][' . $sp439c5e->getPackageId() . '][alternative][firstname]') . ' ' . $this->getCheckout('payment[pakket][' . $sp439c5e->getPackageId() . '][alternative][firstname]'); } } else { $spc7a1af = $this->getCheckout('payment[monthly][alternative_account_holder]'); if ($spc7a1af == Vfde_Checkout_Block_Cart_Steps_SaveCustomer::ALTERNATIVE_ACCOUNT_HOLDER) { $sp132d65 = $this->getCheckout('payment[monthly][alternative][gender]'); if ($sp132d65 == Omnius_Superorder_Helper_Client::GENDER_FIRMA) { $sp81ab9c = trim($this->getCheckout('payment[monthly][alternative][company_name]') . ' ' . $this->getCheckout('payment[monthly][alternative][company_additional_name]')); } else { $sp81ab9c = $this->getCheckout('payment[monthly][alternative][firstname]') . ' ' . $this->getCheckout('payment[monthly][alternative][lastname]'); } } if ($this->getCustomerSession()->getCustomer()->isSohoRvOrBusinessCustomer() && $spc7a1af == Vfde_Checkout_Block_Cart_Steps_SaveCustomer::ALTERNATIVE_ACCOUNT_HOLDER_TWO) { $sp81ab9c = $this->getCheckout('payment[monthly][account_holder]'); } } if (!$sp45fdc1 && empty(trim($sp81ab9c))) { $sp81ab9c = $this->getCheckout('customer[firstname]') . ' ' . $this->getCheckout('customer[lastname]'); } if ($sp45fdc1 && empty(trim($sp81ab9c))) { $sp81ab9c = mb_substr(trim($this->getCheckout('customer[address][company_name]') . ' ' . $this->getCheckout('customer[address][company_additional_name]')), 0, 32); } return $sp81ab9c; } protected function processSocs($sp223325, &$sp2ba766, &$sp30ca2a) { list($sp00d3cc, $spe2ab18, $spd6d708, $sp008ee3, $sp8d4ba0, $sp68625a) = $sp223325; $sp93f21f = false; foreach ($sp00d3cc as $sp6c2238) { if ($sp6c2238 && in_array($sp6c2238->getData('backend'), array(self::BACKEND_KIAS, self::BACKEND_SAP, self::BACKEND_MASRH))) { if ($spe2ab18 || $this->serviceExpressionIsFalse($sp6c2238)) { continue; } $sp6c2238->setData('sku', $spd6d708->getSku()); $sp6c2238->setData('name', $sp008ee3->getName()); $sp6c2238->setData('activityTypeIndication', $this->getComponentActivityTypeIndication($sp008ee3)); $sp6c2238->setData('socAction', $this->getComponentAction($sp008ee3)); $sp6c2238->setData('isTariffSoc', $sp8d4ba0->isSubscription()); $sp6c2238->setData('isSimOnly', $sp8d4ba0->getSimOnly()); $sp6c2238->setData('product_name', $sp8d4ba0->getName()); $sp6c2238->setData('display_name_communication', $sp8d4ba0->getDisplayNameCommunication()); $sp6c2238->setData('additional_text', strip_tags($sp8d4ba0->getServiceDescription())); $sp6c2238->setData('mapperComponentType', $spd6d708->getComponentType()); $sp6c2238->setData('tariffOptionCategoryTree', $sp68625a); $sp2ba766[] = $sp6c2238; if (!$sp93f21f) { $this->log("... ... Multimapper details entries:"); $this->log("... ... ----------------------------"); $sp93f21f = true; } foreach ($sp6c2238->getData() as $sp40ef26 => $sp6b21fa) { if (!empty($sp6b21fa)) { $this->log("... ... {$sp40ef26}: {$sp6b21fa}"); } } $sp30ca2a[$spd6d708->getSku()] = $sp8d4ba0->getAttributeSetId(); } } } protected function initResultDataForMobile($sp223325) { list($sp6e3776, $sp439c5e, $spad77cf, list($spf48840, $spcc67f2, $spf431db), $sp7fc045) = $sp223325; list($sp7b1c9f, $sp8e5ae0) = $this->getShippingTextAndPrice($sp6e3776, $sp439c5e, $sp7fc045); $sp06be97 = $this->componentArray($spad77cf[0], $this->getComponentAction($spad77cf[0]), $this->getComponentActivityTypeIndication($spad77cf[0])); $sp06be97['ComponentType'] = isset($spf48840) ? $spf48840->getComponentType() : null; $sp06be97['TariffOptionDescription'] = trim($spf431db) != "" ? $spf431db : null; $sp06be97['TariffOptionName'] = $spcc67f2 ?? null; $sp06be97['TN'] = $sp439c5e->getComponentTn() ?: null; $sp06be97['SAPArticleID'] = trim($sp6e3776); $sp06be97['DeviceID'] = $this->getDeviceId($sp439c5e); if ($this->isHwDiscountIncluded) { $sp06be97['SAPDiscountCode'] = ''; } else { $sp06be97['SAPDiscountCode'] = $sp439c5e->getDiscountCodeSap(); } $sp06be97['ShippingFeeNetPrice'] = isset($sp7b1c9f) && $sp7b1c9f > 0 ? $sp7b1c9f : $this->getZeroShippingFee(); $sp06be97['ShippingFeeText'] = isset($sp7b1c9f) && $sp7b1c9f > 0 ? $sp8e5ae0 : ''; $sp06be97['SimOnlyTariffInd'] = 'false'; $sp06be97['MultiSimList'] = null; return $sp06be97; } protected function initResultDataForInstalledBase($sp223325) { list($sp439c5e, $sp02efce, , , , $spec52f8, $spfd2f85, $sp24a771, $sp0af27c) = $sp223325; $sp06be97 = $this->componentArray($sp02efce, $sp0af27c, self::COMPONENT_ACTIVITY_TYPE_INDICATION_AUTOMATIC); $sp7fc045 = $this->getShippingFeeNetPrice(); $sp7b1c9f = $spfd2f85->getBackend() == self::BACKEND_SAP && !empty($spfd2f85->getTechnicalId()) ? $sp7fc045['ShippingFeeNetPrice'] : null; $sp8e5ae0 = isset($sp7b1c9f) && $sp7b1c9f > 0 ? $sp7fc045['ShippingFeeText'] : null; $this->setResultProperties([$sp439c5e, $spec52f8, $sp24a771, $spfd2f85, $sp02efce], $sp06be97); $sp06be97['ProductID'] = $sp439c5e->isCable() ? $spfd2f85->getTechnicalId() : null; $sp06be97['ShippingFeeNetPrice'] = isset($sp7b1c9f) && $sp7b1c9f > 0 ? $sp7b1c9f : null; $sp06be97['ShippingFeeText'] = isset($sp7b1c9f) && $sp7b1c9f > 0 ? $sp8e5ae0 : null; return $sp06be97; } protected function processHandsetSoc($sp223325, &$sp06be97) { list($sp6e3776, , $spad77cf) = $sp223325; if ($sp6e3776) { $sp06be97[] = $this->initResultDataForMobile($sp223325); $sp40ae88[$spad77cf[0]->getSku()] = $this->getComponentAction($spad77cf[0]); $spdadb9d = $sp81bff6 = $sp9f5deb = 0; $this->_calculator = Mage::getSingleton('tax/calculation'); foreach ($spad77cf as $sp2629ef) { $sp11fca2 = $sp2629ef->getOriginalPrice(); $spe86b78 = $this->calculateSapDeviceDiscount($sp2629ef); if ($this->isHwDiscountIncluded) { if ($sp2629ef->getHwiIndicator() === 'M') { $sp11fca2 = $sp2629ef->getRowTotalInclTax() - $sp2629ef->getDiscountAmount() + $sp2629ef->getHwiAmount(); } else { $sp11fca2 = $sp2629ef->getRowTotalInclTax() - $sp2629ef->getDiscountAmount(); } $spe86b78 = null; } $spdadb9d += $sp11fca2 * 100 / ($sp2629ef->getTaxPercent() + 100); $sp81bff6 += $sp11fca2; $sp9f5deb += $spe86b78; } foreach ($sp06be97 as $sp74b8c9 => $sp405761) { if ($sp06be97[$sp74b8c9]['SAPArticleID'] && $sp06be97[$sp74b8c9]['Action'] !== Omnius_Superorder_Helper_Client::COMPONENT_ACTION_REMOVE) { $sp06be97[$sp74b8c9]['SAPArticleNetPrice'] = number_format($spdadb9d, 2, '.', ''); $sp06be97[$sp74b8c9]['SAPArticleGrossPrice'] = number_format($sp81bff6, 2, '.', ''); $sp06be97[$sp74b8c9]['SAPDiscount1'] = $spe86b78 ? number_format(round($sp9f5deb, 4), 2, '.', '') : '0.00'; $sp06be97[$sp74b8c9]['SAPDiscount2'] = number_format('0.0000', 2, '.', ''); } elseif ($sp06be97[$sp74b8c9]['Action'] === Omnius_Superorder_Helper_Client::COMPONENT_ACTION_REMOVE) { $sp06be97[$sp74b8c9]['SAPArticleID'] = null; } } } } protected function processMappers($sp223325, &$sp2ba766, &$sp30ca2a) { list($sp008ee3, $sp68625a) = $sp223325; $spdf4210 = $this->getMultimapperModel()->getMappersBySku($sp008ee3->getSku()); $sp8d4ba0 = $sp008ee3->getProduct(); if (!$sp8d4ba0->getServiceDescription()) { $sp8d4ba0 = $this->getModel('catalog/product')->load($sp8d4ba0->getId()); } $sp04c439 = false; foreach ($spdf4210 as $spd6d708) { $sp04c439 = $this->returnEnteredHeaderPrinted($sp04c439); foreach ($spd6d708->getData() as $sp40ef26 => $sp6b21fa) { if (!empty($sp6b21fa)) { $this->log("... {$sp40ef26}: {$sp6b21fa}"); } } $sp00d3cc = $this->getAddonModel()->getAddonByMapperId($spd6d708->getId()); $spe2ab18 = $this->serviceExpressionIsFalse($spd6d708); if ($spe2ab18 === false) { $this->log('... Service expression was evaluated to: true'); } $spf2ddc9 = [$sp00d3cc, $spe2ab18, $spd6d708, $sp008ee3, $sp8d4ba0, $sp68625a]; $this->processSocs($spf2ddc9, $sp2ba766, $sp30ca2a); } } protected function logEntries($spad77cf, &$sp6e3776) { $sp06be97 = [null, null, null]; if (count($spad77cf) != 0) { $spf48840 = $this->getModel('multimapper/mapper')->getMappersBySku($spad77cf[0]->getSku())->getFirstItem(); if ($spf48840->getId()) { $sp6e3776 = $this->getModel('omnius_multimapper/addon')->getSingleAddonByMapperId($spf48840->getId()); $this->log("Multimapper entries fetched:"); $this->log("----------------------------"); foreach ($spf48840->getData() as $sp40ef26 => $sp6b21fa) { if (!empty($sp6b21fa)) { $this->log("... {$sp40ef26}: {$sp6b21fa}"); } } $this->log("... ... Multimapper details entries:"); $this->log("... ... ----------------------------"); foreach ($sp6e3776->getData() as $sp40ef26 => $sp6b21fa) { if (!empty($sp6b21fa)) { $this->log("... ... {$sp40ef26}: {$sp6b21fa}"); } } } $sp26168c = $spad77cf[0]->getProduct(); $sp6e3776 = $this->getHandsetSoc($sp6e3776); $sp06be97 = [$spf48840, $sp26168c ? $sp26168c->getName() : null, strip_tags($sp26168c ? $sp26168c->getServiceDescription() : '')]; } return $sp06be97; } protected function updateAction(&$sp06be97, &$sp40ae88, $sp9580b1 = false) { foreach ($sp06be97 as &$sp405761) { if (isset($sp40ae88[$sp405761['SkuID']])) { if ($sp9580b1 && $sp40ae88[$sp405761['SkuID']] === self::COMPONENT_ACTION_REFUSE) { $sp405761['Action'] = self::COMPONENT_ACTION_REFUSE; } else { $sp40ae88[$sp405761['SkuID']] = $sp405761['Action']; } } } } protected function updateProductActivityTypes($sp439c5e, $sp40ae88) { foreach ($sp439c5e->getItems() as $sp008ee3) { if (isset($sp40ae88[$sp008ee3->getSku()])) { $this->saveProductActivity($sp008ee3, $sp40ae88); } } } public function getComponentsForMobilePackage(Omnius_Package_Model_Package $sp439c5e) { $this->isHwDiscountIncluded = false; $sp40ae88 = $sp06be97 = array(); $this->processContext = $sp439c5e->getSaleType(); $sp6e3776 = $sp68625a = null; $sp0f4664 = $sp439c5e->getItems(Vfde_Catalog_Model_Type::MOBILE_SUBTYPE_SUBSCRIPTION); if (isset($sp0f4664[0])) { $sp9c7da0 = $sp439c5e->getItems(null, array(Vfde_Catalog_Model_Type::MOBILE_SUBTYPE_SUBSCRIPTION, Vfde_Catalog_Model_Type::MOBILE_SUBTYPE_DEVICE)); $sp9c7da0 = array_merge($sp0f4664, $sp9c7da0); $sp2ba766 = $sp30ca2a = array(); $sp4e8465 = 1; foreach ($sp9c7da0 as $sp008ee3) { if (!$this->isHwDiscountIncluded && in_array(strtolower(Vfde_Checkout_Model_SalesRule_Quote_Discount::MINIMUM_HW_PRICE_CATEGORY), array_map('strtolower', $sp008ee3->getProduct()->getCategoryPaths()))) { $this->isHwDiscountIncluded = true; } $sp68625a = $this->getTariffOptionCategory($sp008ee3); $this->log(''); $this->log('Evaluating SKU: ' . $sp008ee3->getSku()); $this->log('... product index: ' . $sp4e8465++); $sp40ae88[$sp008ee3->getSku()] = $this->getComponentAction($sp008ee3); $sp1ffffe = [$sp008ee3, $sp68625a]; $this->processMappers($sp1ffffe, $sp2ba766, $sp30ca2a); } $spad77cf = $sp439c5e->getItemsWithForceQuoteItems(Vfde_Catalog_Model_Type::MOBILE_SUBTYPE_DEVICE); $sp2b7807 = $this->logEntries($spad77cf, $sp6e3776); if (empty($sp2ba766) && empty($sp6e3776)) { return null; } $sp7fc045 = $this->getShippingFeeNetPrice(); if ($sp439c5e->getPackageAction() == Omnius_Package_Model_Package::PACKAGE_ACTION_DEBIT_TO_CREDIT) { $sp439c5e->setComponentTn(['PhoneNumber' => $this->getComponentMsisdn($sp439c5e) ?: null]); } if ($sp2ba766) { $this->getMobileComponentData($sp2ba766, $sp30ca2a, $sp7fc045, $sp439c5e, $sp06be97); } $this->processHandsetSoc([$sp6e3776, $sp439c5e, $spad77cf, $sp2b7807, $sp7fc045], $sp06be97); } $this->updateAction($sp06be97, $sp40ae88); $this->setPreOrderingDataForMobilePackage($sp439c5e); $this->updateProductActivityTypes($sp439c5e, $sp40ae88); return empty($sp06be97) ? null : $sp06be97; } public function saveProductActivity($sp008ee3, $sp40ae88) { $sp008ee3->setProductActivityType($sp40ae88[$sp008ee3->getSku()])->save(); } public function calculateSapDeviceDiscount($sp2629ef) { $sp59fa27 = 0; if ($sp2629ef->getHwiIndicator() == "M") { $sp59fa27 += ($sp2629ef->getOriginalPrice() - $sp2629ef->getPriceInclTax() - $sp2629ef->getHwiAmount()) / (1 + $sp2629ef->getTaxPercent() / 100); } else { $sp59fa27 += ($sp2629ef->getOriginalPrice() - $sp2629ef->getPriceInclTax()) / (1 + $sp2629ef->getTaxPercent() / 100); } return $sp59fa27; } public function getPortingPhoneNumbers(Omnius_Package_Model_Package $sp439c5e, $sp6b2060 = null, $sp7f07db = false) { $sp8e0745 = $this->getHelper('omnius_service'); $sp06be97 = array(); $sp981e5c = 0; $spd5be92 = strtolower($sp439c5e->getType()); $sp51cebe = $this->getCheckout('provider[' . $spd5be92 . '][no_phones_transfer]'); if ($sp7f07db || !empty($sp51cebe)) { while (is_array($this->getCheckoutFieldDataArr("provider[" . $spd5be92 . "][phone_transfer_list][telephone][{$sp981e5c}]"))) { if ($this->getCheckout("provider[" . $spd5be92 . "][phone_transfer_list][telephone][{$sp981e5c}]") && $this->getCheckout("provider[" . $spd5be92 . "][phone_transfer_list][telephone_prefix][{$sp981e5c}]")) { $sp06be97[] = array('CountryCode' => $sp8e0745->getGeneralConfig('country_code') ? $sp8e0745->getGeneralConfig('country_code') : Vfde_Customer_Model_Customer::COUNTRY_CODE, 'PhoneNumber' => $this->getCheckout("provider[" . $spd5be92 . "][phone_transfer_list][telephone][{$sp981e5c}]"), 'LocalAreaCode' => $this->getCheckout("provider[" . $spd5be92 . "][phone_transfer_list][telephone_prefix][{$sp981e5c}]"), 'Type' => $sp7f07db ? null : $sp6b2060); if ($sp7f07db) { break; } } $sp981e5c++; } } return $sp06be97 ?: null; } public function setPreOrderingDataForMobilePackage($sp439c5e) { $sp0486be = Mage::getModel('checkout/cart')->getQuote(); if ($sp0486be) { foreach ($sp0486be->getAllItemsByPackageId($sp439c5e->getPackageId()) as $sp8652fa) { $spa3fda5 = $sp8652fa->getProductId(); $sp343f5f = $sp439c5e->getItemsByProductId($spa3fda5); $sp343f5f->setPreOrdering($sp8652fa->getPreOrdering())->save(); $sp343f5f->setEstimatedDeliveryDate($sp8652fa->getEstimatedDeliveryDate())->save(); } } } protected function processAddons($sp223325, &$sp4595ab) { list($sp33374c, $sp9aa7a3, $spe2ab18) = $sp223325; $sp4a6021 = $this->getAddonModel()->getAddonByMapperId($sp33374c->getId()); $sp93f21f = false; foreach ($sp4a6021 as $spdee135) { $spdee135->setData('sku', $sp33374c->getSku()); $spdee135->setData('componentType', $sp33374c->getComponentType()); if (($this->processContext == Omnius_Catalog_Model_ProcessContext::ACQ || $this->processContext == Omnius_Catalog_Model_ProcessContext::MIGCOC) && in_array($sp33374c->getSku(), $sp9aa7a3)) { $spce6fc9 = self::COMPONENT_ACTIVITY_TYPE_INDICATION_MANUAL; } else { $spce6fc9 = null; } $spdee135->setComponentActivityTypeIndication($spce6fc9); if ($this->serviceExpressionIsFalse($spdee135)) { continue; } if ($spe2ab18) { continue; } $sp4595ab[] = $spdee135; if (!$sp93f21f) { $this->log("... ... Multimapper details entries:"); $this->log("... ... ----------------------------"); $sp93f21f = true; } foreach ($spdee135->getData() as $sp40ef26 => $sp6b21fa) { if (!empty($sp6b21fa)) { $this->log("... ... {$sp40ef26}: {$sp6b21fa}"); } } } } public function getComponentsForCablePackage(Omnius_Package_Model_Package $sp439c5e) { $this->processContext = $sp439c5e->getSaleType(); $this->manuallyRefusedItems = $this->getRefusedComponentsAsSku($sp439c5e); $sp06be97 = $sp4595ab = []; list($sp9aa396, $sp40ae88, $spdc39fd, $sp9aa7a3) = $this->setSkusAndAction($sp439c5e); $sp87261f = $this->getMultimapperModel()->getMappersBySkus($sp9aa396); if ($sp87261f->count()) { $sp4e8465 = 1; foreach ($sp87261f as $sp33374c) { $this->log(''); $this->log('Evaluating SKU: ' . $sp33374c->getData('sku')); $this->log('... product index: ' . $sp4e8465++); $this->returnEnteredHeaderPrinted(false); foreach ($sp33374c->getData() as $sp40ef26 => $sp6b21fa) { if (!empty($sp6b21fa)) { $this->log("... {$sp40ef26}: {$sp6b21fa}"); } } if (($spe2ab18 = $this->serviceExpressionIsFalse($sp33374c)) === false) { $this->log('... Service expression was evaluated to: true'); } $this->processAddons([$sp33374c, $sp9aa7a3, $spe2ab18], $sp4595ab); } } foreach ($sp4595ab as $sp5b3e84) { if (Vfde_Core_Helper_Data::areAllTrue([!isset($spdc39fd['items'][$sp5b3e84->getSku()]), !in_array($sp5b3e84->getSku(), $sp9aa7a3)])) { continue; } $sp06be97[] = $this->getCableComponentsDetails($sp5b3e84, $sp439c5e, $spdc39fd, $sp9aa7a3, null); } $this->updateAction($sp06be97, $sp40ae88, true); $this->updateProductActivityTypes($sp439c5e, $sp40ae88); return !empty($sp06be97) ? $sp06be97 : null; } public function getComponents($sp439c5e, $sp0e4c43 = false, $spb07caf = []) { $this->dynaCoreHelper = $this->getHelper('vfde_core'); $this->inputParams = ['customer' => $this->getModel('vfde_configurator/expression_customer')->setPackage($sp439c5e), 'availability' => $this->getModel('vfde_configurator/expression_availability'), 'orderPackage' => $this->getModel('vfde_configurator/expression_package')->setPackage($sp439c5e), 'agent' => $this->getModel('vfde_configurator/expression_agent')]; $this->setInputParamsOrder($sp439c5e, $sp0e4c43); if (empty($this->shippingFee[$sp439c5e->getPackageId()])) { list($sp630982, $sp77f2c9) = $this->setSuperorderItemsAndPackageIds($sp0e4c43, $spb07caf, $sp439c5e); if (!empty($sp630982)) { $sp7fc045 = array(); foreach ($sp630982 as $sp3664e8 => $spa93dca) { if ($sp439c5e->getPackageId() != $sp3664e8) { continue; } $sp159184 = $this->getHelper('vfde_checkout/fields')->getOrderCheckoutFieldsByPackage(Vfde_Checkout_Model_Client_ShippingFeeCalculateClient::SHIPPING_FEE_PAIDAMOUNT_CHECKOUT_STEP, $sp77f2c9); $sp610c74 = $sp159184['paidAmount[pakket][' . $sp3664e8 . ']'] ?? 0; foreach ($spa93dca as $sp008ee3) { if ($sp008ee3->getSku() == Vfde_Catalog_Model_Type::MOBILE_SHIPPING_SKU) { $sp7fc045[$sp3664e8] = ['PaidAmount' => number_format((double) $sp610c74, 2, '.', ''), 'GrossPrice' => $sp008ee3->getPriceInclTax(), 'NetPrice' => $sp008ee3->getPrice()]; break 2; } } } $this->setShippingFee($sp439c5e, $sp7fc045); } } $this->log(''); $this->log('Evaluating multimappers for package: ' . $sp439c5e->getPackageId()); if (Vfde_Core_Helper_Data::areAllTrue([!empty($sp439c5e->getInstalledBaseProducts()), $sp439c5e->getInitialInstalledBaseProducts()])) { if ($sp439c5e->isFixed()) { return $this->getComponentsForFixedInstalledBase($sp439c5e); } return $this->getComponentsForInstalledBase($sp439c5e); } $sp06be97 = $this->getComponentsForPackageType($sp439c5e, $sp0e4c43); if ($sp06be97 !== false) { return $sp06be97; } return null; } public function getHardwareComponents($sp439c5e, $sp0e4c43) { $sp9b7456 = Vfde_MultiMapper_Model_Mapper::OGW_COMPONENT_ID_HARDWARE; $sp40889c = $this->getModel('multimapper/mapper'); $sp4a1190 = $spd83bed = $sp9aa396 = []; $sp24a771 = $spce6fc9 = $sp0af27c = null; foreach ($this->packageItems as $sp008ee3) { $spdf4210 = $sp40889c->getFilteredMappers(array('sku' => $sp008ee3->getSku(), 'ogw_component_id_reference' => $sp9b7456, 'direction' => Vfde_MultiMapper_Model_Mapper::DIRECTION_BOTH)); foreach ($spdf4210 as $spd6d708) { if ($this->serviceExpressionIsFalse($spd6d708)) { continue; } $sp4a6021 = $this->getModel('omnius_multimapper/addon')->getAddonsWithDirection($spd6d708->getId(), $this->processContext, Vfde_MultiMapper_Model_Mapper::DIRECTION_OUT); foreach ($sp4a6021 as $spdee135) { if (Vfde_Core_Helper_Data::isAnyTrue([$this->serviceExpressionIsFalse($spdee135), !$this->hasValidBasketAction($sp008ee3, $spdee135)])) { continue; } if ($spc75609 = $this->getFnComponentAdditionalData($sp008ee3, $spdee135, $sp439c5e->getParentAccountNumber(), $sp439c5e->getServiceLineId(), $sp0e4c43)) { $sp4a1190 = array_merge($sp4a1190, $spc75609); $sp24a771 = $this->getItemIfIsNotNull($sp24a771, $spd6d708->getComponentType()); $spce6fc9 = $this->getItemIfIsNotNull($spce6fc9, $this->getComponentActivityTypeIndication($sp008ee3)); $sp0af27c = $this->getItemIfIsNotNull($sp0af27c, $this->getFnComponentAction($sp008ee3)); $sp9aa396[] = $sp008ee3->getSku(); } } } } if ($this->processContext != Omnius_Catalog_Model_ProcessContext::ACQ) { $spbf05f5 = $this->getFNInstalledBaseData($sp9b7456, $sp439c5e->getParentAccountNumber(), $sp4a1190, $sp439c5e->getServiceLineId()); $spbf05f5 = $this->overwriteInstallBaseComponents($spbf05f5); $sp4a1190 = array_merge($sp4a1190, $spbf05f5); } if (!empty($sp4a1190)) { $sp4a1190 = $this->removeGenerateContractDuplicateComponents($sp4a1190, $sp0e4c43); $spcfc051 = $this->getSplitComponentAdditionalData($sp4a1190); $sp7fc045 = $this->getShippingFeeNetPrice(); foreach ($spcfc051 as $sp220e09 => $sp65646d) { $spe963fe = array('SourceComponentID' => $sp9b7456, 'Action' => $sp0af27c, 'ComponentType' => $sp24a771, 'ComponentActivityTypeIndication' => $spce6fc9, 'SkuID' => implode(",", array_unique($sp9aa396)), 'ComponentAdditionalData' => $sp65646d, 'TariffOptionName' => null, 'SimOnlyTariffInd' => null, 'MultiSimList' => null); $spe963fe = array_merge($spe963fe, $this->componentDefaults()); $this->getShippingFeeNetPriceAndText($sp7fc045, $spe963fe); $spd83bed[] = $spe963fe; } } return $spd83bed; } public function getComponentsForFixedPackage(Omnius_Package_Model_Package $sp439c5e, $sp0e4c43) { $this->processContext = $sp439c5e->getSaleType(); $sp40ae88 = $sp06be97 = array(); $spa93dca = $sp439c5e->getItems(); $this->packageItems = $spa93dca; $sp24a771 = null; $sp40889c = $this->getModel('multimapper/mapper'); foreach (Vfde_MultiMapper_Model_Mapper::getMergedComponentIds() as $sp9b7456) { $sp9aa396 = $sp4a1190 = []; $sp0af27c = $spdf280a = $sp2ce64b = null; $sp4e8465 = 1; foreach ($spa93dca as $sp008ee3) { $spdf4210 = $sp40889c->getFilteredMappers(array('sku' => $sp008ee3->getSku(), 'ogw_component_id_reference' => $sp9b7456, 'direction' => Vfde_MultiMapper_Model_Mapper::DIRECTION_BOTH)); if (count($spdf4210)) { $this->log("******************************************"); $this->log("Processing mappers with OGW reference id: " . $sp9b7456); $this->log("----------------------------------------- "); $this->log("Evaluating SKU: " . $sp008ee3->getSku()); $this->log('... product index: ' . $sp4e8465); foreach ($spdf4210 as $spd6d708) { if ($this->serviceExpressionIsFalse($spd6d708)) { $this->log("Mapper service expression is false, skipping all addons"); continue; } $this->getComponentsForFP([$sp439c5e, $spd6d708, $sp008ee3, $sp0e4c43], $sp9aa396, $sp4a1190, $sp2ce64b, $spdf280a, $sp0af27c); } $sp4e8465++; } } if ($this->processContext != Omnius_Catalog_Model_ProcessContext::ACQ) { $spbf05f5 = $this->getFNInstalledBaseData($sp9b7456, $sp439c5e->getParentAccountNumber(), $sp4a1190, $sp439c5e->getServiceLineId()); $spbf05f5 = $this->overwriteInstallBaseComponents($spbf05f5); $sp4a1190 = array_merge($sp4a1190, $spbf05f5); } if (!empty($sp4a1190)) { $sp4a1190 = $this->removeGenerateContractDuplicateComponents($sp4a1190, $sp0e4c43); $sp804f01 = array_unique($sp9aa396); $spe963fe = array('SourceComponentID' => $sp9b7456, 'Action' => $sp0af27c ?? self::COMPONENT_ACTION_EXISTING, 'ComponentType' => $sp2ce64b, 'ComponentActivityTypeIndication' => $spdf280a ?? self::COMPONENT_ACTIVITY_TYPE_INDICATION_AUTOMATIC, 'SkuID' => implode(',', $sp804f01), 'ComponentAdditionalData' => $sp4a1190, 'SimOnlyTariffInd' => null, 'MultiSimList' => null); $spe963fe = array_merge($spe963fe, $this->componentDefaults()); foreach ($sp804f01 as $spcc0f2f) { $sp40ae88[$spcc0f2f] = $spe963fe['Action']; } $sp06be97[] = $spe963fe; } } $sp06be97 = array_merge($sp06be97, $this->getHardwareComponents($sp439c5e, $sp0e4c43)); $this->setActivityType($sp439c5e, $sp06be97, $sp40ae88); return empty($sp06be97) ? null : $sp06be97; } protected function getFNInstalledBaseData($sp9b7456, $sp33f611, $sp2880e3, $spa24247) { $sp4ee75e = $this->getCustomerSession(); $sp5648f5 = []; if ($spd5febf = $sp4ee75e->getCustomerByParentAccountNumber($sp33f611)) { if ($sp9b7456 == Vfde_MultiMapper_Model_Mapper::OGW_COMPONENT_ID_SALES_PACKAGE) { $spa4d455 = isset($spd5febf['Contract'][0]) ? $spd5febf['Contract'][0] : $spd5febf['Contract']; $sp5648f5 = $spa4d455['Product']['Component']['ComponentAdditionalData']; $this->removeAccessComponents($sp5648f5); } elseif ($sp9b7456 == Vfde_MultiMapper_Model_Mapper::OGW_COMPONENT_ID_HARDWARE) { $this->mergeIbWithAdditional($spd5febf, $sp33f611, $sp5648f5); $this->removeAccessComponents($sp5648f5); } elseif ($sp9b7456 == Vfde_MultiMapper_Model_Mapper::OGW_COMPONENT_ID_ACCESS) { $this->getFnIbSubscriptions($spd5febf, $sp369f8a); $this->getFnIbDataForAccess($sp369f8a, $sp5648f5); $this->getFnIbDataDevice($spd5febf, $sp33f611, $sp5648f5); } else { $this->getFnIbContracts($spd5febf, $sp19ca60); $this->getFnIbContractSubscriptions($sp19ca60, $spa24247, $sp369f8a); $this->getFnIbData($sp369f8a, $sp9b7456, $sp5648f5); $this->removeAccessComponents($sp5648f5); } } return $this->removeDuplicateComponents($sp5648f5, $sp2880e3); } protected function removeDuplicateComponents($sp1ac8a2, $sp2880e3) { $spdeffe7 = false; $spb8b0d2 = array(); foreach ($sp2880e3 as $spf46da8) { if ($spf46da8['Code'] == 'processingType') { $spdeffe7 = true; $spb8b0d2[] = $spf46da8['AdditionalValue']; } } foreach ($sp1ac8a2 as $sp40ef26 => $sp65646d) { if ($spdeffe7 && $sp65646d['Code'] == 'processingType' && in_array($sp65646d['AdditionalValue'], $spb8b0d2)) { unset($sp1ac8a2[$sp40ef26]); } elseif ($sp65646d['Code'] == 'refComponentId') { unset($sp1ac8a2[$sp40ef26]); } } return $sp1ac8a2; } protected function removeGenerateContractDuplicateComponents($sp4a1190, $sp0e4c43) { $sp53d41d = []; foreach ($sp4a1190 as $sp40ef26 => $sp6b21fa) { if (!$sp0e4c43 && $sp6b21fa['Code'] == 'GenerateContract') { unset($sp4a1190[$sp40ef26]); continue; } $sp53d41d[] = $sp6b21fa; $spca5f76 = array_column($sp53d41d, 'Code'); $sp6bf7f6 = array_count_values($spca5f76); if ($sp6bf7f6['GenerateContract'] > 1 && in_array('GenerateContract', $spca5f76)) { unset($sp53d41d[$sp40ef26]); } } return $sp53d41d; } protected function removeAccessComponents(&$sp5648f5) { foreach ($sp5648f5 as $sp40ef26 => $spcdf811) { if (strpos($spcdf811['AdditionalValue'], '/accesses/') === 0) { unset($sp5648f5[$sp40ef26]); } } } protected function getCableComponentsDetails($sp5b3e84, $sp439c5e, $spdc39fd, $sp9aa7a3, $sp7fc045) { if (!$sp5b3e84->getTechnicalId()) { return null; } $spe7d719 = $this->getDeviceDetails($sp5b3e84, $sp439c5e); $sp3aaad1 = $sp5b3e84->getSku(); $sp008ee3 = $spdc39fd['items'][$sp3aaad1] ?? null; $spe55f48 = isset($spdc39fd['dropped'][$sp3aaad1]) && $spdc39fd['dropped'][$sp3aaad1]; $spd14b79 = in_array($sp3aaad1, $sp9aa7a3) ? $sp3aaad1 : null; $sp123385 = $sp008ee3 ? $this->getCableILSComponentAction($sp008ee3, $sp9aa7a3, $spe55f48, $spd14b79) : null; $sp06be97 = $this->componentArray($sp5b3e84, $sp123385, $sp5b3e84->getComponentType()); $sp06be97['ComponentActivityTypeIndication'] = $sp5b3e84->getComponentActivityTypeIndication() ?: ($sp008ee3 != null ? $this->getComponentActivityTypeIndication($sp008ee3) : null); $sp06be97['DeviceID'] = $sp5b3e84->getTechnicalId() == $spe7d719['productSku'] ? $spe7d719['sn'] : null; $sp06be97['ProductID'] = $sp5b3e84->getTechnicalId(); $sp06be97['ShippingFeeNetPrice'] = $sp7fc045; $sp06be97['MultiSimList'] = null; return $sp06be97; } protected function getMobileComponentData($sp2ba766, $sp30ca2a, $sp7fc045, $sp439c5e, &$sp06be97) { foreach ($sp2ba766 as $spac72f6) { $sp840d96 = $this->setComponentData($sp30ca2a, $sp439c5e, $spac72f6, $sp7fc045); $this->setComponentActivityTypeIndication($sp439c5e, $spac72f6, $sp840d96); if (Vfde_Core_Helper_Data::areAllTrue([strtolower($sp439c5e->getType()) == strtolower(Vfde_Catalog_Model_Type::TYPE_MOBILE), isset($sp840d96['SAPArticleID'])])) { $sp840d96['ComponentAdditionalData'] = array('Code' => 'SimOnly', 'Value' => $spac72f6->getData('isSimOnly') == 1 ? 'Yes' : 'No'); if ($spac72f6->getData('isSimOnly')) { $this->isSapSimOnlyPackage[$sp439c5e->getId()] = true; } } $sp06be97[] = $sp840d96; if (!isset($this->isSapSimOnlyPackage[$sp439c5e->getId()]) || !$this->isSapSimOnlyPackage[$sp439c5e->getId()]) { $spad77cf = $sp439c5e->getItems(Vfde_Catalog_Model_Type::MOBILE_SUBTYPE_DEVICE); $spdadb9d = 0; $sp81bff6 = 0; $sp9f5deb = 0; $this->_calculator = $this->getSingleton('tax/calculation'); foreach ($spad77cf as $sp2629ef) { $spdadb9d += $sp2629ef->getOriginalPrice() * 100 / ($sp2629ef->getTaxPercent() + 100); $sp81bff6 += $sp2629ef->getOriginalPrice(); $sp9f5deb += $this->calculateSapDeviceDiscount($sp2629ef); } foreach ($sp06be97 as $sp74b8c9 => $sp405761) { if ($sp06be97[$sp74b8c9]['SAPArticleID']) { $sp06be97[$sp74b8c9]['SAPArticleNetPrice'] = number_format($spdadb9d, 2, '.', ''); $sp06be97[$sp74b8c9]['SAPArticleGrossPrice'] = number_format($sp81bff6, 2, '.', ''); $sp06be97[$sp74b8c9]['SAPDiscount1'] = number_format(round($sp9f5deb, 4), 2, '.', ''); $sp06be97[$sp74b8c9]['SAPDiscount2'] = number_format('0.0000', 2, '.', ''); } } } } } public function getDeviceId($sp439c5e) { $sp9726bc = $this->getModel('vfde_superorder/client_submitOrderClient_packageSubscriber'); $spbe0107 = $sp9726bc->getDeviceData($sp439c5e); return !empty($spbe0107[0]['ID']) ? $spbe0107[0]['ID'] : null; } protected function processFixedIbAddons($sp223325, &$sp06be97) { list($sp02efce, $spec52f8, $spfd8b82, $sp541598) = $sp223325; $spaac9e6 = $sp02efce->getExtraIndicator('HIS'); $sp24a771 = $spec52f8->getComponentType(); $sp12e594 = ['serviceCode', 'serviceBillingName']; $sp6fffc1 = $this->getComponentModel(); $sp6fffc1->setAddons($spfd8b82); $sp256b10 = $spbe41e8 = $this->componentArray($sp02efce, self::COMPONENT_ACTION_ADD, self::COMPONENT_ACTIVITY_TYPE_INDICATION_AUTOMATIC); $sp256b10['ComponentAdditionalData'] = $spbe41e8['ComponentAdditionalData'] = []; if (in_array($sp02efce->getSku(), $sp541598)) { if ($sp6fffc1->isVoice()) { $sp256b10['Action'] = self::COMPONENT_ACTION_CHANGE; $this->setComponentAdditionalData($spfd8b82, $sp256b10, $spbe41e8); $sp06be97[] = $sp256b10; $sp06be97[] = $spbe41e8; $sp40ae88[$sp02efce->getSku()] = $spbe41e8['Action']; } else { $sp256b10['Action'] = self::COMPONENT_ACTION_EXISTING; $sp256b10['ComponentType'] = $spaac9e6 == null ? $sp24a771 : $spaac9e6; foreach ($spfd8b82 as $spfd2f85) { if ($spfd2f85->getAddonName() != 'processingType') { $spee4aab['ComponentAdditionalData'][] = $this->setCodeValForComponent($spfd2f85); } } $sp06be97[] = $sp256b10; $sp40ae88[$sp02efce->getSku()] = $sp256b10['Action']; } } else { foreach ($spfd8b82 as $spfd2f85) { $sp8ed7ef = in_array($spfd2f85->getAddonName(), $sp12e594); if ($sp8ed7ef || $spfd2f85->getAddonName() == self::ADDON_NAME_FUNCTION_ID) { $sp256b10['ComponentAdditionalData'][] = $this->setCodeValForComponent($spfd2f85); } if (strpos($spfd2f85->getAddonName(), 'condition') !== false) { $spbe41e8['ComponentAdditionalData'][] = $this->setCodeValForComponent($spfd2f85); } } $sp06be97[] = $sp256b10; $sp06be97[] = $spbe41e8; $sp40ae88[$sp02efce->getSku()] = $spbe41e8['Action']; } } public function getComponentsForFixedInstalledBase($sp439c5e) { $sp40ae88 = $sp06be97 = array(); $sp541598 = explode(',', $sp439c5e->getInitialInstalledBaseProducts()); $sp27a8e4 = $sp439c5e->getInstalledBaseProducts(); $sp4e8465 = 1; foreach ($sp27a8e4 as $sp9a64a0) { $sp02efce = $sp9a64a0->getProduct(); $this->log(''); $this->log('Evaluating SKU: ' . $sp02efce->getSku()); $this->log('... product index: ' . $sp4e8465++); $spec52f8 = $this->getMultimapperModel()->getSingleMappersBySku($sp02efce->getSku()); if (!$spec52f8 || !$spec52f8->getId()) { continue; } $this->log("Multimapper entries fetched:"); $this->log("----------------------------"); foreach ($spec52f8->getData() as $sp40ef26 => $sp6b21fa) { if (!empty($sp6b21fa)) { $this->log("... {$sp40ef26}: {$sp6b21fa}"); } } $sp4f6c22 = $spec52f8->getData('entity_id'); $spfd8b82 = $this->getAddonModel()->getAddonByMapperId($sp4f6c22, $sp439c5e->getSaleType()); if (!$spfd8b82->count()) { continue; } $this->log("... ... Multimapper details entries:"); $this->log("... ... ----------------------------"); $sp223325 = [$sp02efce, $spec52f8, $spfd8b82, $sp541598]; $this->processFixedIbAddons($sp223325, $sp06be97); } $this->updateAction($sp06be97, $sp40ae88); $this->updateProductActivityTypes($sp439c5e, $sp40ae88); return empty($sp06be97) ? null : $sp06be97; } protected function processItemAddonsForIB($sp223325, &$sp06be97) { list($sp439c5e, $sp02efce, $sp488724, $spb6c95a, $spfd8b82) = $sp223325; $spd91268 = $sp02efce->getSku(); foreach ($spfd8b82 as $spfd2f85) { $sp24a771 = null; if ($spfd2f85->getData('addon_name') == 'ComponentType') { $sp24a771 = $spfd2f85->getData('addon_value'); } if (in_array($spd91268, $sp488724)) { $sp0af27c = self::COMPONENT_ACTION_REMOVE; } else { if (in_array($spd91268, $spb6c95a)) { $sp0af27c = self::COMPONENT_ACTION_ADD; } else { $sp0af27c = self::COMPONENT_ACTION_EXISTING; } } if ($sp439c5e->isMobile()) { $sp48d9f0 = $this->packageContainsBundleMarker($sp439c5e); $sp2cc4ba = $spfd2f85->getTechnicalId() == Vfde_Customer_Model_Client_RetrieveCustomerInfo::KIAS_ELIGIBLE_BUNDLE_SOC; if ($sp48d9f0 && $sp2cc4ba) { $sp0af27c = self::COMPONENT_ACTION_IGNORE; } } $sp06be97[] = $this->initResultDataForInstalledBase(array_merge($sp223325, [$spfd2f85, $sp24a771, $sp0af27c])); $sp40ae88[$spd91268] = $sp06be97['Action']; $this->setSapResult($sp06be97); foreach ($spfd2f85->getData() as $sp40ef26 => $sp6b21fa) { if (!empty($sp6b21fa)) { $this->log("... ... {$sp40ef26}: {$sp6b21fa}"); } } } } public function getComponentsForInstalledBase($sp439c5e) { $sp40ae88 = $sp06be97 = array(); $sp50f4f6 = $sp439c5e->getInstalledBaseProducts(); $sp28f1a9 = array_map(function ($sp008ee3) { return $sp008ee3->getSku(); }, $sp50f4f6); $speeac15 = explode(',', $sp439c5e->getInitialInstalledBaseProducts()); $spb6c95a = array_diff($sp28f1a9, $speeac15); $sp488724 = array_diff($speeac15, $sp28f1a9); $spd72100 = array_merge($spb6c95a, $sp488724); $sp1830c6 = $sp439c5e->getData(); if (Vfde_Core_Helper_Data::areAllTrue([empty($spb6c95a), empty($sp488724), $sp1830c6['bundle_types'] == Vfde_Bundles_Model_BundleRule::TYPE_RED_PLUS])) { $spd72100 = $sp28f1a9; } $spf46a88 = $this->getProductModel()->getCollection()->addAttributeToFilter('sku', array('in' => $spd72100)); if (!$spf46a88->count()) { return null; } $sp4e8465 = 1; foreach ($spf46a88 as $sp02efce) { $spd91268 = $sp02efce->getSku(); $this->log(''); $this->log('Evaluating SKU: ' . $spd91268); $this->log('... product index: ' . $sp4e8465++); $spec52f8 = $this->getMultimapperModel()->getMappersBySku($spd91268); if ($sp439c5e->isMobile()) { $spec52f8 = $spec52f8->addFieldtoFilter('component_type', array('eq' => 'TariffOption')); } $spec52f8 = $spec52f8->setPageSize(1)->setCurPage(1)->getLastItem(); $sp4f6c22 = $spec52f8->getId(); if (!$sp4f6c22) { continue; } $this->log("Multimapper entries fetched:"); $this->log("----------------------------"); foreach ($spec52f8->getData() as $sp40ef26 => $sp6b21fa) { if (!empty($sp6b21fa)) { $this->log("... {$sp40ef26}: {$sp6b21fa}"); } } $spfd8b82 = $this->getItemAddons($sp439c5e, $sp4f6c22); if (!$spfd8b82->count()) { continue; } $this->log("... ... Multimapper details entries:"); $this->log("... ... ----------------------------"); $sp223325 = [$sp439c5e, $sp02efce, $sp488724, $spb6c95a, $spfd8b82, $spec52f8]; $this->processItemAddonsForIB($sp223325, $sp06be97); } $this->updateAction($sp06be97, $sp40ae88); $this->updateProductActivityTypes($sp439c5e, $sp40ae88); return empty($sp06be97) ? null : $sp06be97; } protected function packageContainsBundleMarker($sp439c5e) { $sp28f1a9 = []; $spc7d726 = []; if (!empty($sp439c5e->getInstalledBaseProducts()) && $sp439c5e->getInitialInstalledBaseProducts()) { $sp28f1a9 = array_map(function ($sp9a64a0) { return $sp9a64a0->getSku(); }, $sp439c5e->getInitialInstalledBaseProducts()); } if (count($sp28f1a9)) { $spc7d726 = $this->getHelper('multimapper')->getSkusBySoc(Vfde_Customer_Model_Client_RetrieveCustomerInfo::KIAS_PART_OF_BUNDLE_SOC); } $sp9fe3b4 = array_intersect($spc7d726, $sp28f1a9); return count($sp9fe3b4); } public function getResidentialBuildingInfo($sp84713c = true) { $sp787036 = array(); $sp787036[] = $this->getProviderHomeType(true); $sp13696a = $this->getCheckout('provider[home_entrance]'); $sp9c8eec = Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::getDslHomeEntranceOptionsForOGW(); $sp787036[] = isset($sp9c8eec[$sp13696a]) ? $sp9c8eec[$sp13696a] : null; $sp8b9dfb = $this->getCheckout('provider[home_floor]'); $spa684d3 = Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::getDslHomeFloorsOptions(); $sp787036[] = isset($spa684d3[$sp8b9dfb]) ? $spa684d3[$sp8b9dfb] : null; $spaf9dd7 = $this->getCheckout('provider[home_location]'); $sp670ef7 = Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::getDslApartmentLocationOptionsForOGW(); $sp787036[] = isset($sp670ef7[$spaf9dd7]) ? $sp670ef7[$spaf9dd7] : null; $sp787036[] = $this->getCheckout('provider[phone_socket_no]'); if ($sp84713c) { $sp787036[] = $this->getCheckout('provider[comment_installer]'); } $sp787036 = array_filter($sp787036); return $sp787036 ? implode(', ', $sp787036) : null; } protected function getCableILSComponentAction($sp008ee3, $sp9aa7a3, $spe55f48 = false, $spd14b79 = null) { if ($this->processContext == Omnius_Catalog_Model_ProcessContext::ACQ || $this->processContext == Omnius_Catalog_Model_ProcessContext::MIGCOC) { $sp195552 = isset($sp008ee3) ? $sp008ee3->getSku() : $spd14b79; return in_array($sp195552, $sp9aa7a3) ? self::COMPONENT_ACTION_REFUSE : self::COMPONENT_ACTION_ADD; } if ($spe55f48) { return self::COMPONENT_ACTION_REMOVE; } return $sp008ee3 != null ? $this->getComponentAction($sp008ee3) : null; } public function getCarrierContractCancel($spd5be92, $sp3664e8) { return $this->getCheckout("provider[{$spd5be92}][change_provider][{$sp3664e8}]") == Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::YES_CHANGE_PROVIDER ? 'true' : 'false'; } public function getSepaMandate($sp439c5e) { $sp66e01b = null; $spd1296c = null; $spf6a5a7 = $this->getCheckout('payment[monthly][type]'); $spd1b667 = $this->getCheckoutHelper()->checkCableUnityProduct($this->getQuote()->getCartPackages()); switch ($spf6a5a7) { case Vfde_Checkout_Helper_Fields::PAYMENT_SPLIT_PAYMENT: $spe9b6a6 = $this->getCheckout('payment[pakket][' . $sp439c5e->getPackageId() . '][type]'); switch ($spe9b6a6) { case Vfde_Checkout_Helper_Fields::PAYMENT_DIRECT_DEBIT: $sp66e01b = (int) $this->getCheckout('payment[pakket][' . $sp439c5e->getPackageId() . '][sepa_mandate][type][new]'); $spd1296c = $this->getCheckout('payment[pakket][' . $sp439c5e->getPackageId() . '][sepa_mandate][type][new_existing]'); break; case Vfde_Checkout_Helper_Fields::PAYMENT_DIRECT_DEBIT_DIFF: $sp66e01b = (int) $this->getCheckout('payment[pakket][' . $sp439c5e->getPackageId() . '][sepa_mandate][type][diff]'); $spd1296c = $this->getCheckout('payment[pakket][' . $sp439c5e->getPackageId() . '][sepa_mandate][type][diff_existing]'); break; default: $sp66e01b = null; $spd1296c = null; } break; case Vfde_Checkout_Helper_Fields::PAYMENT_DIRECT_DEBIT: $sp66e01b = (int) $this->getCheckout('payment[monthly][sepa_mandate][type][new]'); $spd1296c = $this->getCheckout('payment[monthly][sepa_mandate][type][new_existing]'); break; case Vfde_Checkout_Helper_Fields::PAYMENT_DIRECT_DEBIT_DIFF: $sp66e01b = (int) $this->getCheckout('payment[monthly][sepa_mandate][type][diff]'); $spd1296c = $this->getCheckout('payment[monthly][sepa_mandate][type][diff_existing]'); break; default: $sp66e01b = null; $spd1296c = null; } $sp4dec47 = null; $spd1296c = (int) $spd1296c; switch (true) { case $spd1296c == 1 && !$spd1b667: $sp4dec47 = 'EXISTING'; break; case $sp66e01b === 0 && !$spd1b667: $sp4dec47 = 'ONLINE'; break; case $sp66e01b === 1 || $spd1b667 === true: $sp4dec47 = 'PAPER'; break; default: $sp4dec47 = 'EXISTING'; } return $sp4dec47; } protected function addInstallBaseOverwrite($spdee135) { $this->installBaseOverwrites[] = array('Code' => $spdee135->getData('addon_name'), 'Value' => $spdee135->getData('addon_value'), 'AdditionalValue' => $spdee135->getData('addon_additional_value')); } protected function getFnComponentAdditionalData($sp008ee3, $spdee135, $spd989d3, $spa24247, $sp0e4c43 = false) { $sp3936e2 = $this->getCheckoutHelper()->isRetailChannel(); if (empty($spdee135->getData('addon_name')) || empty($spdee135->getData('addon_additional_value'))) { return null; } if ($spdee135->getData('attribute_action') == Vfde_MultiMapper_Model_Addon::ATTRIBUTE_ACTION_TAKEOVER && empty($spdee135->getData('addon_value'))) { return $this->getInstallBaseAdditionalData($spdee135, $spd989d3, $spa24247); } elseif ($spdee135->getData('attribute_action') == Vfde_MultiMapper_Model_Addon::ATTRIBUTE_ACTION_OVERWRITE) { $this->addInstallBaseOverwrite($spdee135); return null; } elseif (!empty($spdee135->getData('addon_value'))) { if ($spdee135->getData('addon_name') == self::ATTRIBUTE_CODE_TARGETDATE) { $sp32ec56 = $this->getCheckout('target_date[' . $sp008ee3->getPackageId() . '][' . $sp008ee3->getPackageType() . ']'); if ($sp32ec56) { return array(array('Code' => $spdee135->getData('addon_name'), 'Value' => $sp32ec56, 'AdditionalValue' => $spdee135->getData('addon_additional_value'))); } } else { if ($spdee135->getData('addon_name') == self::ATTRIBUTE_CODE_ORDER_ID && $spdee135->getData('addon_value') == self::ATTRIBUTE_CODE_ORDER_ID) { $spc93e16 = Mage::getSingleton('customer/session')->getCustomerOrders(); foreach ($spc93e16['dsl'] as $sp1fb39e) { return array(array('Code' => $spdee135->getData('addon_name'), 'Value' => $sp1fb39e['order_id'], 'AdditionalValue' => $spdee135->getData('addon_additional_value'))); } } elseif ($spdee135->getData('addon_name') == self::ATTRIBUTE_CODE_HOME_ID) { if (!empty($this->getCheckout('provider[home_id]'))) { return array(array('Code' => $spdee135->getData('addon_name'), 'Value' => $this->getCheckout('provider[home_id]'), 'AdditionalValue' => $spdee135->getData('addon_additional_value'))); } else { return null; } } elseif ($spdee135->getData('addon_name') == Vfde_Address_Model_Client_CheckServiceAbilityClient::SERVICEABILITY_ADDITIONAL_ITEM_PROPERTY_MULTIMAPPER) { $sped909d = Mage::getSingleton('omnius_address/storage'); if ($sped909d->getProjectReferenceValue()) { return array(array('Code' => $spdee135->getData('addon_name'), 'Value' => $sped909d->getProjectReferenceValue(), 'AdditionalValue' => $spdee135->getData('addon_additional_value'))); } else { return null; } } elseif ($spdee135->getData('addon_name') == Vfde_Address_Model_Client_CheckServiceAbilityClient::FIBER_ADDITION_ACCESS_SUPPLIER) { $sped909d = Mage::getSingleton('omnius_address/storage'); if ($sped909d->getAccessSupplierValue() && ($sp3936e2 || !$sp3936e2 && !$sp0e4c43)) { return array(array('Code' => $spdee135->getData('addon_name'), 'Value' => $sped909d->getAccessSupplierValue(), 'AdditionalValue' => $spdee135->getData('addon_additional_value'))); } else { return null; } } elseif (strtoupper($spdee135->getData('addon_name')) == Vfde_Address_Model_Client_CheckServiceAbilityClient::FIBER_ADDITION_ROLLOUT_STATUS) { $sped909d = Mage::getSingleton('omnius_address/storage'); if ($sped909d->getRollOutStatusValue() && ($sp3936e2 || !$sp3936e2 && !$sp0e4c43)) { return array(array('Code' => $spdee135->getData('addon_name'), 'Value' => $sped909d->getRollOutStatusValue(), 'AdditionalValue' => $spdee135->getData('addon_additional_value'))); } else { return null; } } else { return array(array('Code' => $spdee135->getData('addon_name'), 'Value' => $spdee135->getData('addon_value'), 'AdditionalValue' => $spdee135->getData('addon_additional_value'))); } } } else { return null; } } protected function overwriteInstallBaseComponents($sp87f123) { foreach ($this->installBaseOverwrites as $sp1d5d7d) { foreach ($sp87f123 as &$sp65646d) { if ($sp1d5d7d['Code'] == $sp65646d['Code'] && $sp1d5d7d['AdditionalValue'] == $sp65646d['AdditionalValue']) { if ($sp65646d['Code'] == self::ATTRIBUTE_CODE_ORDER_ID && $sp65646d['Value'] == self::ATTRIBUTE_CODE_ORDER_ID) { $spc93e16 = Mage::getSingleton('customer/session')->getCustomerOrders(); foreach ($spc93e16['dsl'] as $sp1fb39e) { $sp65646d['Value'] = $sp1fb39e['order_id']; } } else { $sp65646d['Value'] = $sp1d5d7d['Value']; } } } } return $sp87f123; } public function throwErrorsIfNotSuccess($sp8b8c55) { if (!$sp8b8c55['Success']) { $spd4e938 = ''; if (is_string($sp8b8c55['Status']['StatusReasonCode'])) { $spd4e938 = $sp8b8c55['Status']['StatusReasonCode']; } if (is_string($sp8b8c55['Status']['StatusReason'])) { $spd4e938 .= (!empty($spd4e938) ? ':' : '') . $sp8b8c55['Status']['StatusReason']; } if (!$spd4e938) { $spd4e938 = $this->__('Could not create order'); } throw new Exception($spd4e938); } } public function getEndOfTermMode($spd5be92 = null) { $sp06be97 = null; $sp1e2c25 = $this->getCheckout('provider_notice_date_radio[' . strtolower($spd5be92) . ']'); switch ($sp1e2c25) { case Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::CONTRACT_ALREADY_TERMINATED: $sp06be97 = Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::TERMINATION_DATE_NOT_FILLED_CONTRACT_END; break; case Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::LAST_POSSIBLE_DATE_NOTICE: $sp06be97 = Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::TERMINATION_MODE_END_DATE; break; case Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::TERMINATION_DATE_NOT_RELEVANT: $sp06be97 = $this->getCheckout('provider[cable_internet_phone][termination_date_reason]') ?: Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::TERMINATION_DATE_NOT_FILLED_NOW; break; case Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::NO_MINIMUM_CONTRACT_DATE: $sp06be97 = Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::TERMINATION_DATE_NOT_FILLED_NO_PERIOD; break; case Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::AS_SOON_AS_POSSIBLE: $sp06be97 = Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::TERMINATION_DATE_NOT_FILLED_NO_PERIOD; break; default: $sp06be97 = null; } return $sp06be97; } protected function hasValidBasketAction($sp008ee3, $spdee135, $spd6d708 = '') { $sp06be97 = false; $this->log(sprintf("... Evaluating basket action for item %s and addon %s", $sp008ee3->getSku(), $spdee135->getId())); $this->log(sprintf("... Item system action: %s, addon basket action: %s", $sp008ee3->getSystemAction(), $spdee135->getBasketAction())); if (!$spdee135->getBasketAction()) { $this->log("... Addon is VALID - no basket action set"); return true; } switch ($spdee135->getBasketAction()) { case Vfde_MultiMapper_Model_Addon::BASKET_ACTION_ADD: $sp9c4c30 = $sp008ee3->getSystemAction(); $spac6893 = array(Vfde_Checkout_Model_Sales_Quote_Item::SYSTEM_ACTION_ADD, Vfde_Checkout_Model_Sales_Quote_Item::SYSTEM_ACTION_NOT_APPLICABLE); $sp06be97 = Vfde_Core_Helper_Data::areAllTrue([!$sp9c4c30 || in_array($sp9c4c30, $spac6893), !$this->isProductChanged($sp008ee3, $spd6d708, $spdee135->getBasketAction()), !$sp008ee3->getIsContractDrop()]); break; case Vfde_MultiMapper_Model_Addon::BASKET_ACTION_KEEP: $sp06be97 = $sp008ee3->getSystemAction() == Vfde_Checkout_Model_Sales_Quote_Item::SYSTEM_ACTION_EXISTING && !$sp008ee3->getIsContractDrop(); break; case Vfde_MultiMapper_Model_Addon::BASKET_ACTION_REMOVE: $sp06be97 = $sp008ee3->getIsContractDrop(); break; case Vfde_MultiMapper_Model_Addon::BASKET_ACTION_CHANGE: $sp06be97 = $this->processContext != Omnius_Catalog_Model_ProcessContext::ACQ && $this->isProductChanged($sp008ee3, $spd6d708, $spdee135->getBasketAction()); break; default: break; } if ($sp06be97) { $this->log("... Addon is VALID"); } else { $this->log("... Addon is INVALID"); } return $sp06be97; } public function getCustomerNumber($sp8409a7) { $spd5febf = Mage::getSingleton('customer/session')->getCustomer(); $spd989d3 = null; if (true === empty($spd5febf->isCustomerLoggedIn())) { return self::DUMMY_PARTY_IDENTIFICATION; } else { $spf0635b = $sp8409a7->getOrderNumber() ? $sp8409a7->getPackages() : $sp8409a7->getCartPackages(); foreach ($spf0635b as $sp439c5e) { if ($sp439c5e->getData('parent_account_number') != '') { $spd989d3 = $sp439c5e->getData('parent_account_number') == Vfde_Customer_Helper_Customer::NEW_ACCOUNT_BAN ? self::DUMMY_PARTY_IDENTIFICATION : $sp439c5e->getData('parent_account_number'); break; } } if ($spd989d3 == null) { $spd989d3 = self::DUMMY_PARTY_IDENTIFICATION; } } return $spd989d3; } protected function getZeroShippingFee() { return number_format((double) 0, 2, '.', ''); } public function getPaymentMethodBic($sp504436, $sp3664e8) { switch ($sp504436) { case "direct_debit": $sp8b1c19 = $this->getCheckout('payment[monthly][direct_debit][bic][new]'); break; case "direct_debit_diff": $sp8b1c19 = $this->getCheckout('payment[monthly][direct_debit][bic][diff]'); break; case "direct_debit_reuse": $sp8b1c19 = $this->getCheckout('payment[monthly][direct_debit][bic][reuse]'); break; case "split": $sp8b1c19 = $this->getBICFieldValueForSplitPayment($sp3664e8); break; default: $sp8b1c19 = null; } return $sp8b1c19; } public function getBICFieldValue($sp439c5e, $spb014f6) { $sp8b1c19 = null; switch ($spb014f6) { case "RC": $sp504436 = $this->getCheckout('payment[monthly][type]'); if (strpos($sp504436, '|') !== false) { [$sp504436] = explode('|', $sp504436); } $sp3664e8 = $sp439c5e->getPackageId(); $sp8b1c19 = $this->getPaymentMethodBic($sp504436, $sp3664e8); break; case "OTC": $sp504436 = $this->getCheckout('payment[one_time][type]'); if ($sp504436 == Vfde_Checkout_Helper_Fields::PAYMENT_DIRECT_DEBIT) { $sp8b1c19 = $this->getCheckout('payment[one_time][direct_debit][bic]'); if (empty($sp8b1c19)) { $sp8b1c19 = $this->getBICFieldValue($sp439c5e, 'RC'); } } break; default: $sp8b1c19 = null; } return $sp8b1c19; } public function getBICFieldValueForSplitPayment($sp3664e8) { $sp0d2d6d = $this->getCheckout('payment[pakket][' . $sp3664e8 . '][type]'); if (strpos($sp0d2d6d, '|') !== false) { [$sp0d2d6d] = explode('|', $sp0d2d6d); } switch ($sp0d2d6d) { case "direct_debit": $sp8b1c19 = $this->getCheckout('payment[pakket][' . $sp3664e8 . '][direct_debit][bic][new]'); break; case "direct_debit_diff": $sp8b1c19 = $this->getCheckout('payment[pakket][' . $sp3664e8 . '][direct_debit][bic][diff]'); break; case "direct_debit_reuse": $sp8b1c19 = $this->getCheckout('payment[pakket][' . $sp3664e8 . '][direct_debit][bic][reuse]'); break; default: $sp8b1c19 = null; } return $sp8b1c19; } public function checkIfUseCaseIndicationContainsCrossSell($spd793e7) { $spfbe40f = array(Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_MOB_MOB, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_MOB_DSL, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_MOB_CAB, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_MOB_DSL_CAB, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_CAB_CAB, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_CAB_DSL, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_CAB_MOB, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_DSL_DSL, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_DSL_CAB, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_DSL_MOB); if (in_array($spd793e7, $spfbe40f, false)) { return true; } else { return false; } } public function checkIfUseCaseIndicationContainsCrossStack($spd793e7) { $spfbe40f = array(Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_MOB_DSL, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_MOB_CAB, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_MOB_DSL_CAB, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_CAB_DSL, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_CAB_MOB, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_DSL_CAB, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_DSL_MOB); if (in_array($spd793e7, $spfbe40f, false)) { return true; } else { return false; } } public function getProductCategory($sp008ee3, $sp18782a, $spa61e46) { $spd91268 = $sp008ee3->getSku(); if (empty($spd91268)) { return null; } $spa3fda5 = $spd91268 ? $spa61e46->getIdBySku($spd91268) : null; if (empty($spa3fda5)) { return null; } $sp7a613d = $sp18782a->getProductCategoryIds($spa3fda5); if (in_array(Vfde_Catalog_Model_Type::MOBILE_SUBTYPE_ADDON, $sp008ee3->getProduct()->getType()) && !in_array(Vfde_Catalog_Model_Type::MOBILE_SUBTYPE_SUBSCRIPTION, $sp008ee3->getProduct()->getType())) { $spca95da = Vfde_Checkout_Helper_Data::MOBILE_CATEGORY_VODAFONE_COVER_PLUS; $sp5ea83d = $sp18782a->getCategoryByNamePath('Mobile/' . $spca95da); $spa9bebc = $sp5ea83d ? $sp5ea83d->getId() : null; if ($spa9bebc && in_array($spa9bebc, $sp7a613d)) { return Vfde_Catalog_Model_Type::TYPE_MOBILE . self::CATEGORY_PATH . $spca95da; } } if (isset($sp7a613d) && in_array(Vfde_Catalog_Model_Type::MOBILE_SUBTYPE_SUBSCRIPTION, $sp008ee3->getProduct()->getType())) { $spb9a813 = $this->getParentAndSubCategoryNamesByIds($sp7a613d, $sp18782a); foreach ($spb9a813 as $spbc27a3) { if ($spbc27a3 && strtoupper($spbc27a3['parentCategoryName']) == self::MOBILE_POSTPAID_TARIFF) { return Vfde_Catalog_Model_Type::TYPE_MOBILE . self::CATEGORY_PATH . $spbc27a3['parentCategoryName'] . self::CATEGORY_PATH . $spbc27a3['subCategoryName']; } } } return null; } public function getParentAndSubCategoryNamesByIds($sp6cbe65, $sp18782a) { $sp7a613d = $sp18782a->getCollection()->addAttributeToSelect(['name', 'parent_id'])->addAttributeToFilter('entity_id', array('in' => $sp6cbe65))->load(); $sp7da9f6 = array(); if (isset($sp7a613d)) { foreach ($sp7a613d as $spbc27a3) { $spece97b = $spbc27a3->getParentCategory(); $sp7da9f6[$spbc27a3->getId()] = array('parentCategoryName' => $spece97b->getName(), 'subCategoryName' => $spbc27a3->getName()); } return $sp7da9f6; } return null; } protected function getComponentAdditionalDataForMatchedProjectReference($spdee135, $sped909d) { $sp46bd27 = $sped909d->getProjectReferenceValue() ?? ''; return [['Code' => $spdee135->getData('addon_name'), 'Value' => $sp46bd27, 'AdditionalValue' => $spdee135->getData('addon_additional_value')]]; } public function getPaymentMethodList($sp439c5e, $spb014f6) { return ['PaymentChargeType' => [['PaymentMethod' => $this->getPaymentMethod($sp439c5e, $spb014f6), 'PaymentMethodType' => 'ServiceCharges']]]; } public function componentArray($sp02efce, $sp123385, $spdf280a) { $sp24b6fd = array('SourceComponentID' => null, 'Action' => $sp123385, 'ComponentType' => null, 'ComponentActivityTypeIndication' => $spdf280a, 'SkuID' => $sp02efce->getSku(), 'ComponentAdditionalData' => null, 'SimOnlyTariffInd' => null); return array_merge($sp24b6fd, $this->componentDefaults()); } public function setCodeValForComponent($spfd2f85) { return ['Code' => $spfd2f85->getData('addon_name'), 'Value' => $spfd2f85->getData('addon_value'), 'AdditionalValue' => $spfd2f85->getData('addon_additional_value')]; } public function returnEnteredHeaderPrinted($sp0a0a33) { if (!$sp0a0a33) { $this->log("Multimapper entries fetched:"); $this->log("----------------------------"); $sp0a0a33 = true; } else { $this->log('...'); } return $sp0a0a33; } public function getPhoneBookPersonalFields($sp2d0ca5, $spd5be92, $sp3664e8, $sp4fa723 = null, $spd9a11b = null) { $sp7382c4 = $this->getCheckout($spd9a11b); $sp0c6e8c = $this->getCheckout($sp4fa723 . '[' . $sp3664e8 . '][' . $spd5be92 . '][profession]') ?? null; $sp201879 = $this->getCheckout($sp4fa723 . '[' . $sp3664e8 . '][' . $spd5be92 . '][keyword]') ?? null; $spcdf811 = ''; switch ($sp7382c4) { case self::PHONE_BOOK_STANDARD: $sp24d538 = $this->getCheckout('customer[type]') == 'Soho'; $spaae2e3 = $sp2d0ca5 ? $this->getContactPhoneNumbers() : ''; $spcdf811 = $this->determinePhoneBookPersonalFields([$sp7382c4, $spaae2e3, $sp0c6e8c, $sp201879, null, null]); $spcdf811['InformationUse'] = $spcdf811['InformationUse'] ?? 'M'; break; case self::PHONE_BOOK_NONE: $spcdf811 = null; break; case self::PHONE_BOOK_EXTENDED: break; } return $spcdf811; } public function getRefusedComponentsAsSku($sp439c5e) { $sp06be97 = []; $sp26b0aa = []; try { $sp26b0aa = $this->getItemStatusModel()->getCollection()->addFieldtoFilter('package_id', $sp439c5e->getData('entity_id'))->addFieldtoFilter('is_refused', '1')->getData(); } catch (Exception $sp1074a4) { Mage::getSingleton('core/logger')->logException($sp1074a4); } foreach ($sp26b0aa as $sp008ee3) { $sp06be97[] = $sp008ee3['sku']; } return $sp06be97; } public function formatDateTime($sp7569ab, $sp6b2060) { $sp06be97 = ""; $sp3878aa = Mage::getModel('core/date'); $sp4d6dec = $sp3878aa->timestamp(strtotime($sp7569ab)); if ($sp6b2060 == self::DATE) { $sp06be97 = date("Ymd", $sp4d6dec); } elseif ($sp6b2060 == self::DATE_TIME) { $sp06be97 = date("YmdHis", $sp4d6dec); } return $sp06be97; } protected function getInstallBaseAdditionalData($spdee135, $spd989d3, $spa24247) { $sp4ee75e = $this->getSingleton('customer/session'); foreach ($sp4ee75e->getCustomersForStack(Vfde_Customer_Helper_Services::ACCOUNT_CATEGORY_FN) as $sp3f4e7d) { if ($sp3f4e7d['ParentAccountNumber']['ID'] == $spd989d3) { if (!isset($sp3f4e7d['Contract'][0])) { $sp3f4e7d['Contract'] = [$sp3f4e7d['Contract']]; } $sp9d7541 = null; foreach ($sp3f4e7d['Contract'] as $spa4d455) { $sp9d7541 = $this->getIbContract($spa24247, $spa4d455); if ($sp9d7541) { $spfaf465 = $this->getAllFnInstalledBaseComponents($sp9d7541); foreach ($spfaf465 as $spe963fe) { foreach ($spe963fe['ComponentAdditionalData'] as $sp65646d) { if ($sp65646d['Code'] == $spdee135->getData('addon_name') && $sp65646d['AdditionalValue'] == $spdee135->getData('source_attribute_additional_value')) { return array(array('Code' => $spdee135->getData('addon_name'), 'Value' => $sp65646d['Value'], 'AdditionalValue' => $spdee135->getData('addon_additional_value'))); } } } } } } } return null; } public function determinePhoneBookPersonalFields(array $sp223325) { list($sp37472e, $spaae2e3, $sp0c6e8c, $sp201879, $spd5be92, $sp3664e8) = $sp223325; return array_merge(Vfde_Superorder_Helper_Client::$defaultPhoneBookPersonalFields, array('PersonalDetails' => $this->sp34b9d2($spaae2e3, $spd5be92, $sp3664e8), 'Type' => self::getPhoneBookTypeValue($sp37472e), 'Profession' => $sp0c6e8c, 'KeyWord' => $sp201879)); } private function sp34b9d2($spaae2e3, $spd5be92 = null, $sp3664e8 = null) { $sp892cee = 'customer[firstname]'; $sp843627 = 'customer[lastname]'; $sp4b40cd = 'customer[prefix]'; if (!is_null($sp3664e8) && !is_null($spd5be92)) { $sp892cee = 'other[extended][' . $sp3664e8 . '][' . $spd5be92 . '][firstname]'; $sp843627 = 'other[extended][' . $sp3664e8 . '][' . $spd5be92 . '][lastname]'; $sp4b40cd = 'other[extended][' . $sp3664e8 . '][' . $spd5be92 . '][prefix]'; } return ['FirstName' => $this->getCheckout($sp892cee) ?: null, 'FamilyName' => $this->getCheckout($sp843627) ?: null, 'Title' => $this->getCheckout($sp4b40cd) ?: null, 'ContactPhoneNumber' => $spaae2e3]; } public function getSuperOrderModel() { return Mage::getModel('superorder/superorder'); } public function getConfiguratorHelper() { return Mage::helper('vfde_configurator'); } public function getCustomerSession() : Mage_Customer_Model_Session { return Mage::getSingleton('customer/session'); } public function agentDealerModel() { return Mage::getModel('agent/dealer'); } public function componentDefaults() { return array('TariffOption' => null, 'TariffOptionCategory_Tree' => null, 'TariffOptionDescription' => null, 'TariffOptionName' => null, 'Agreement' => null, 'SAPArticleID' => null, 'Country' => null, 'DeviceID' => null, 'ProductID' => null, 'SAPArticleNetPrice' => null, 'SAPArticleGrossPrice' => null, 'SAPDiscount1' => null, 'SAPDiscount2' => null, 'ShippingFeeNetPrice' => null, 'ShippingFeeText' => null); } public function getCallDetailTypeAndDigitMask(?string $sp48dbf8, &$sp47acd3, &$sp5d3eac) : void { switch ($sp48dbf8) { case Omnius_Superorder_Helper_Client::CONNECTION_NONE: $sp47acd3 = 'N'; $sp5d3eac = '0'; break; case Omnius_Superorder_Helper_Client::CONNECTION_FULL: $sp47acd3 = 'M'; $sp5d3eac = '0'; break; case Omnius_Superorder_Helper_Client::CONNECTION_CONDENSED: $sp47acd3 = 'M'; $sp5d3eac = '3'; break; } } public function getNumberOfPortings(?string $spb54415, &$sp141936) : void { if ($this->getCheckoutHelper()->checkCableUnityProduct($this->getQuote()->getCartPackages())) { $this->getNumberOfPortingsForUnity($spb54415, $sp141936); } else { $this->getNumberOfPortingsForNonUnity($spb54415, $sp141936); } } protected function getNumberOfPortingsForUnity(?string $spb54415, &$sp141936) : void { switch ($spb54415) { case Vfde_Checkout_Model_Cart::UME_PORTING_ONE_NUMBER: $sp141936 = Vfde_Checkout_Model_Cart::PORTING_ONE_NUMBER_TEXT; break; case Vfde_Checkout_Model_Cart::UME_PORTING_TWO_NUMBER: case Vfde_Checkout_Model_Cart::UME_PORTING_THREE_NUMBER: case Vfde_Checkout_Model_Cart::UME_PORTING_FOUR_NUMBER: case Vfde_Checkout_Model_Cart::UME_PORTING_FIVE_NUMBER: case Vfde_Checkout_Model_Cart::UME_PORTING_SIX_NUMBER: $sp141936 = Vfde_Checkout_Model_Cart::PORTING_MULTIPLE_NUMBERS_TEXT; break; default: $sp141936 = null; } } protected function getNumberOfPortingsForNonUnity(?string $spb54415, &$sp141936) : void { switch ($spb54415) { case Omnius_Superorder_Helper_Client::PORTING_ALL_NUMBERS: $sp141936 = Vfde_Checkout_Model_Cart::PORTING_ALL_NUMBERS_TEXT; break; case Omnius_Superorder_Helper_Client::PORTING_ONE_NUMBER: $sp141936 = Vfde_Checkout_Model_Cart::PORTING_ONE_NUMBER_TEXT; break; case Omnius_Superorder_Helper_Client::PORTING_MULTIPLE_NUMBERS: $sp141936 = Vfde_Checkout_Model_Cart::PORTING_MULTIPLE_NUMBERS_TEXT; break; default: $sp141936 = null; } } public function setPriceIncExcTax($spbbedc5, $sp59fa27, $spd705fe, $sp185067) { if (array_key_exists('paymentInterval', $spbbedc5) && $spbbedc5['paymentInterval'] == Vfde_Superorder_Model_Client_SubmitOrderClient_Package::PAYMENT_INTERVAL_REC) { $spbbedc5['chargePeriod'] = Vfde_Superorder_Model_Client_SubmitOrderClient_Package::CHARGE_PERIOD_MONTHLY; } $spbbedc5['priceIncTax'] = $sp59fa27 * $spd705fe; $spbbedc5['priceExcTax'] = $sp59fa27 * $sp185067; return $spbbedc5; } protected function getCategoryModel() { return Mage::getModel("catalog/category"); } protected function getProductModel() { return Mage::getModel("catalog/product"); } protected function getMultimapperModel() { return Mage::getModel('multimapper/mapper'); } protected function getAddonModel() { return Mage::getModel('multimapper/addon'); } protected function getComponentModel() { return Mage::getModel('superorder/component'); } protected function mergeIbWithAdditional($spd5febf, $sp33f611, &$sp5648f5) : void { if (isset($spd5febf['Device']) && !isset($spd5febf['Device'][0])) { $spd5febf['Device'] = [$spd5febf['Device']]; } foreach ($spd5febf['Device'] as $sp2629ef) { if ($sp2629ef['BackEndCustomerID'] == $sp33f611) { $sp5648f5 = array_merge($sp5648f5, $sp2629ef['Component']['ComponentAdditionalData']); } } } protected function getFnIbSubscriptions($spd5febf, &$sp369f8a) : void { $sp369f8a = $spd5febf['Contract']['Subscription']; if (!isset($sp369f8a[0])) { $sp369f8a = [$sp369f8a]; } } protected function getFnIbDataForAccess($sp369f8a, &$sp5648f5) : void { $sp5648f5 = []; foreach ($sp369f8a as $sp02fc97) { foreach ($sp02fc97['Product']['Component']['ComponentAdditionalData'] as $sp65646d) { if (strpos($sp65646d['AdditionalValue'], '/accesses/') === 0) { $sp5648f5[] = $sp65646d; } } } } protected function getFnIbDataDevice($spd5febf, $sp33f611, &$sp5648f5) : void { if (isset($spd5febf['Device']) && !isset($spd5febf['Device'][0])) { $spd5febf['Device'] = [$spd5febf['Device']]; } foreach ($spd5febf['Device'] as $sp2629ef) { if ($sp2629ef['BackEndCustomerID'] == $sp33f611) { foreach ($sp2629ef['Component']['ComponentAdditionalData'] as $sp65646d) { if (strpos($sp65646d['AdditionalValue'], '/accesses/') === 0) { $sp5648f5[] = $sp65646d; } } } } } protected function getFnIbContracts($spd5febf, &$sp19ca60) : void { $sp19ca60 = $spd5febf['Contract']; if (!isset($spd5febf['Contract'][0])) { $sp19ca60 = [$sp19ca60]; } } protected function getFnIbContractSubscriptions($sp19ca60, $spa24247, &$sp369f8a) : void { foreach ($sp19ca60 as $spa4d455) { $sp369f8a = $spa4d455['Subscription']; if (!isset($sp369f8a[0])) { $sp369f8a = [$sp369f8a]; } foreach ($sp369f8a as $sp02fc97) { if ($sp02fc97['Product']['StandardItemIdentification']['ID'] == $spa24247) { break 2; } } $sp369f8a = []; } } protected function getFnIbData($sp369f8a, $sp9b7456, &$sp5648f5) : void { foreach ($sp369f8a as $sp02fc97) { foreach ($sp02fc97['Product']['Component']['ComponentAdditionalData'] as $sp65646d) { if ($sp65646d['Code'] == 'refComponentId' && $sp65646d['Value'] == $sp9b7456) { $sp5648f5 = $sp02fc97['Product']['Component']['ComponentAdditionalData']; break; } } } } public function getCommissionReportPackage($spf0635b) { $speb36ae = $this->getBewPermissionForOrders($spf0635b); foreach ($spf0635b as $sp40ef26 => $sp439c5e) { $sp1830c6 = $this->loadPackage($sp439c5e['id']); $spf0635b[$sp40ef26]['products'] = $this->getPackageProductName(explode(',', $sp439c5e['products'])); if ($sp439c5e['lineOfBusiness'] == Vfde_PriceRules_Model_ImportPriceRules::MOBILE_TYPE) { $sp379072 = $this->getComponentMsisdn($sp1830c6); } else { $sp379072 = $sp439c5e['parentAccountNumber']; } $spf0635b[$sp40ef26]['customerId'] = $sp379072; if ($speb36ae[$sp439c5e['orderNumber']]['bewPermission'] == 'YES') { $spf0635b[$sp40ef26]['bewPermission'] = 'YES'; } else { $spf0635b[$sp40ef26]['bewPermission'] = 'NO'; } } return $spf0635b; } public function getPackageProductName($spf46a88 = [], $spfed516 = 'entity_id', $sp4c4f2e = " | ") { $sp1d9853 = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('name')->addAttributeToSelect('display_name_communication')->addAttributeToFilter($spfed516, ['in' => $spf46a88]); $spf46a88 = ''; foreach ($sp1d9853->getItems() as $sp02efce) { $spf46a88 .= ($sp02efce->getDisplayNameCommunication() ?: $sp02efce->getName()) . $sp4c4f2e; } $spf46a88 = rtrim($spf46a88, $sp4c4f2e); return $spf46a88; } public function loadPackage($spe30be3) { return $this->loadPackageModel()->load($spe30be3); } public function getCheckoutField() { return Mage::helper("vfde_checkout/fields"); } public function loadPackageModel() { return Mage::getModel('package/package'); } public function validateCommissionReportFilter($spd2542f, &$sp3ba04d) { $spa79e33 = $this->errorCommissionFilterMessage($spd2542f['filters']); if (!empty($spa79e33)) { return $spa79e33; } else { $spc027b6 = str_replace('.', '-', $spd2542f['filters']['date']['from']); $spd9e404 = str_replace('.', '-', $spd2542f['filters']['date']['to']); $sp3ba04d = ['currentPage' => $spd2542f['pagination']['currentPage'] ?? 1, 'perPage' => $spd2542f['pagination']['perPage'] ?? 30, 'from' => $spc027b6 ? date('d.m.Y', strtotime($spc027b6)) : '', 'to' => $spd9e404 ? date('d.m.Y', strtotime($spd9e404)) : '', 'processContext' => $spd2542f['filters']['processContext'] ?? [], 'orderBy' => $spd2542f['orderBy'] ?? 'order_number', 'orderType' => $spd2542f['orderType'] ?? 'DESC']; return $spa79e33; } } public function errorCommissionFilterMessage($sp7ddc57) { $spa79e33 = []; $spd3f06b = $this->getConfiguratorHelper(); $spfe6c04 = $spd3f06b->validatorHelper(); if (!empty($sp7ddc57['date']['from']) && !empty($sp7ddc57['date']['to'])) { $spda215e = $spd3f06b->validateDateRange($sp7ddc57['date']); if ($spda215e) { $spa79e33['date'] = $spda215e; } } else { if ($sp7ddc57['date']['from'] != '' && !$spfe6c04->validateIsDate($sp7ddc57['date']['from'])) { $spa79e33['date'] = 'From date is invalid'; } else { if ($sp7ddc57['date']['to'] != '' && !$spfe6c04->validateIsDate($sp7ddc57['date']['to'])) { $spa79e33['date'] = 'To date is invalid'; } } } if (!empty($sp7ddc57['processContext'])) { if (!in_array($sp7ddc57['processContext'], $this->getAllProcessContext())) { $spa79e33['processContext'] = 'Invalid process context'; } } return $spa79e33; } public function getAllProcessContext() { return Mage::getModel('omnius_catalog/processContext')->getAllProcessContextIdCodePairs(); } public function getComponentAction($sp008ee3) { if ($this->processContext == Omnius_Catalog_Model_ProcessContext::ACQ) { return self::COMPONENT_ACTION_ADD; } $sp0af27c = null; switch ($sp008ee3->getSystemAction()) { case Omnius_Checkout_Model_Sales_Quote_Item::SYSTEM_ACTION_EXISTING: if ($sp008ee3->getIsContractDrop()) { $sp0af27c = self::COMPONENT_ACTION_REMOVE; } else { $sp0af27c = self::COMPONENT_ACTION_EXISTING; } break; case Omnius_Checkout_Model_Sales_Quote_Item::SYSTEM_ACTION_NOT_APPLICABLE: $sp0af27c = self::COMPONENT_ACTION_REMOVE; break; default: $sp0af27c = self::COMPONENT_ACTION_ADD; break; } return $sp0af27c; } protected function setPayment($spba0ab0, $sp6b21fa) { if ($spba0ab0 === null) { switch ($sp6b21fa) { case Vfde_Checkout_Helper_Fields::PAYMENT_BANK_TRANSFER: case Vfde_Checkout_Helper_Fields::PAYMENT_CHECKMO: $spba0ab0 = 'GI'; break; case Vfde_Checkout_Helper_Fields::PAYMENT_CASH_ON_DELIVERY: $spba0ab0 = 'CA'; break; case Vfde_Checkout_Helper_Fields::PAYMENT_DIRECT_DEBIT: case Vfde_Checkout_Helper_Fields::PAYMENT_DIRECT_DEBIT_REUSE: case Vfde_Checkout_Helper_Fields::PAYMENT_DIRECT_DEBIT_DIFF: $spba0ab0 = 'DD'; break; case Vfde_Checkout_Helper_Fields::PAYMENT_PAY_IN_STORE: $spba0ab0 = 'CO'; break; default: $spba0ab0 = null; } } return $spba0ab0; } protected function getItemAddons($sp439c5e, $sp4f6c22) { $spfd8b82 = $this->getAddonModel()->getAddonByMapperId($sp4f6c22); if ($sp439c5e->isMobile() || $sp439c5e->isCable()) { $spfd8b82->addFieldToFilter('technical_id', array('neq' => 'NULL')); } return $spfd8b82; } protected function setSapResult(&$sp06be97) { foreach ($sp06be97 as $sp74b8c9 => $sp405761) { if ($sp06be97[$sp74b8c9]['SAPArticleID']) { $sp06be97[$sp74b8c9]['SAPArticleNetPrice'] = 0; $sp06be97[$sp74b8c9]['SAPArticleGrossPrice'] = 0; $sp06be97[$sp74b8c9]['SAPDiscount1'] = 0; $sp06be97[$sp74b8c9]['SAPDiscount2'] = 0; } } } protected function getDeviceDetails($sp5b3e84, $sp439c5e) { $spe7d719 = null; if (in_array($sp5b3e84->getTechnicalId(), Vfde_Catalog_Model_Type::getOwnReceiverSkus())) { $spe7d719 = $sp439c5e->getReceiverSerialNumber(); } elseif ($sp5b3e84->getTechnicalId() == Vfde_Catalog_Model_Type::OWN_SMARTCARD_SKU) { $spe7d719 = $sp439c5e->getSmartcardSerialNumber(); } if (!$spe7d719 && ($sp439c5e->getReceiverSerialNumber() || $sp439c5e->getSmartcardSerialNumber())) { $spe7d719 = $sp439c5e->getReceiverSerialNumber() ?: $sp439c5e->getSmartcardSerialNumber(); } if (!is_null($spe7d719)) { $spe7d719 = $this->getHelper('core')->jsonDecode($spe7d719); } return $spe7d719; } protected function getShippingTextAndPrice($sp6e3776, $sp439c5e, $sp7fc045) { $sp7b1c9f = !empty(trim($sp6e3776)) && $sp439c5e->containsHardware() ? !empty($sp7fc045[$sp439c5e->getPackageId()]) ? $sp7fc045[$sp439c5e->getPackageId()]['ShippingFeeNetPrice'] : $sp7fc045['ShippingFeeNetPrice'] : null; $sp8e5ae0 = !empty(trim($sp6e3776)) && $sp439c5e->containsHardware() ? !empty($sp7fc045[$sp439c5e->getPackageId()]) ? $sp7fc045[$sp439c5e->getPackageId()]['ShippingFeeText'] : $sp7fc045['ShippingFeeText'] : null; return array($sp7b1c9f, $sp8e5ae0); } protected function getHandsetSoc($sp6e3776) { return isset($sp6e3776) && $sp6e3776 ? $sp6e3776->getData('technical_id') : null; } protected function getTariffOptionCategory($sp008ee3) { $sp68625a = null; if (strtoupper($sp008ee3->getPackageType()) == strtoupper(Vfde_Catalog_Model_Type::TYPE_MOBILE) && (in_array(Vfde_Catalog_Model_Type::MOBILE_SUBTYPE_SUBSCRIPTION, $sp008ee3->getProduct()->getType()) || in_array(Vfde_Catalog_Model_Type::MOBILE_SUBTYPE_ADDON, $sp008ee3->getProduct()->getType()))) { $sp68625a = $this->getProductCategory($sp008ee3, $this->getCategoryModel(), $this->getProductModel()); } return $sp68625a; } protected function setComponentAdditionalData($spfd8b82, &$sp256b10, &$spbe41e8) { $sp12e594 = ['serviceCode', 'serviceBillingName']; foreach ($spfd8b82 as $spfd2f85) { $sp8ed7ef = in_array($spfd2f85->getAddonName(), $sp12e594); if (!$sp8ed7ef && $spfd2f85->getAddonName() != 'processingType') { $sp256b10['ComponentAdditionalData'][] = $this->setCodeValForComponent($spfd2f85); } if ($sp8ed7ef || $spfd2f85->getAddonName() == self::ADDON_NAME_FUNCTION_ID) { $spbe41e8['ComponentAdditionalData'][] = $this->setCodeValForComponent($spfd2f85); } foreach ($spfd2f85->getData() as $sp40ef26 => $sp6b21fa) { if (!empty($sp6b21fa)) { $this->log("... ... {$sp40ef26}: {$sp6b21fa}"); } } } } protected function getIbContract($spa24247, $spa4d455) { $sp9d7541 = null; if (!isset($spa4d455['Subscription'][0])) { $spa4d455['Subscription'] = [$spa4d455['Subscription']]; } foreach ($spa4d455['Subscription'] as $sp02fc97) { if ($sp02fc97['Product']['StandardItemIdentification']['ID'] == $spa24247) { $sp9d7541 = $spa4d455; break; } } return $sp9d7541; } protected function getItemIfIsNotNull($sp24a771, $spc07dfe) { return $sp24a771 === null ? $spc07dfe : $sp24a771; } protected function getSplitComponentAdditionalData($sp4a1190) { $spcfc051 = []; foreach ($sp4a1190 as $sp496a27) { if (preg_match("/\/functions\/hardware\[@ID=(.*?)\]/", $sp496a27['AdditionalValue'], $sp3bbb97)) { $sp220e09 = $sp3bbb97[1]; $spcfc051[$sp220e09][] = $sp496a27; } else { $spcfc051[0][] = $sp496a27; } } return $spcfc051; } protected function getShippingFeeNetPriceAndText($sp7fc045, &$spe963fe) { $spe963fe['ShippingFeeNetPrice'] = isset($sp7fc045['ShippingFeeNetPrice']) && $sp7fc045['ShippingFeeNetPrice'] > 0 ? $sp7fc045['ShippingFeeNetPrice'] : $this->getZeroShippingFee(); $spe963fe['ShippingFeeText'] = isset($sp7fc045['ShippingFeeNetPrice']) && $sp7fc045['ShippingFeeNetPrice'] > 0 ? $sp7fc045['ShippingFeeText'] : ''; } protected function setSkusAndAction($sp439c5e) { $sp9aa396 = $sp40ae88 = []; $spdc39fd = array('items' => array(), 'dropped' => array()); $sp9aa7a3 = ($spcc28d3 = $sp439c5e->getRefusedDefaultedItems()) ? explode(',', $spcc28d3) : []; foreach ($sp439c5e->getItems() as $sp008ee3) { $sp9aa396[] = $sp3aaad1 = $sp008ee3->getSku(); $sp40ae88[$sp3aaad1] = $this->getComponentAction($sp008ee3); if ($sp008ee3->getIsContractDrop()) { $spdc39fd['dropped'][$sp3aaad1] = true; } $spdc39fd['items'][$sp3aaad1] = $sp008ee3; if (($sp40ef26 = array_search($sp008ee3->getSku(), $this->manuallyRefusedItems)) !== false) { unset($this->manuallyRefusedItems[$sp40ef26]); } } if (isset($this->manuallyRefusedItems)) { $sp9aa396 = array_merge($sp9aa396, $this->manuallyRefusedItems); $sp9aa7a3 = array_unique(array_merge($sp9aa7a3, $this->manuallyRefusedItems)); foreach ($this->manuallyRefusedItems as $sp008ee3) { $sp40ae88[$sp008ee3] = self::COMPONENT_ACTION_REFUSE; } } if (!empty($sp9aa7a3)) { $sp9aa396 = array_unique(array_merge($sp9aa396, $sp9aa7a3)); } return array($sp9aa396, $sp40ae88, $spdc39fd, $sp9aa7a3); } protected function setResultProperties($sp223325, &$sp06be97) { list($sp439c5e, $spec52f8, $sp24a771, $spfd2f85, $sp02efce) = $sp223325; $spaac9e6 = $sp02efce->getExtraIndicator('HIS'); $sp06be97['ComponentType'] = Vfde_Core_Helper_Data::areAllTrue([$sp439c5e->isMobile(), $spec52f8->getComponentType()]) ? $spec52f8->getComponentType() : ($spaac9e6 == null ? $sp24a771 : $spaac9e6); $sp06be97['ComponentAdditionalData'] = $sp439c5e->isFixed() && $sp24a771 != 'ComponentType' ? array('Code' => $spfd2f85->getData('addon_name'), 'Value' => $spfd2f85->getData('addon_value'), 'AdditionalValue' => $spfd2f85->getData('addon_additional_value')) : null; $sp06be97['TariffOption'] = $sp02efce->isSubscription() && $spfd2f85->getBackend() != self::BACKEND_SAP ? trim($spfd2f85->getTechnicalId()) : null; $sp06be97['Agreement'] = $sp02efce->isSubscription() || $spfd2f85->getBackend() != self::BACKEND_KIAS ? null : array('AgreementSOC' => $spfd2f85->getTechnicalId(), 'AgreementSOCDescription' => null, 'AgreementServiceType' => null, 'AgreementEffectiveDate' => null, 'AgreementExpirationDate' => null, 'AgreementTariffOption' => null); $sp06be97['SAPArticleID'] = $spfd2f85->getBackend() == self::BACKEND_SAP ? $spfd2f85->getTechnicalId() : null; } protected function setShippingFee($sp439c5e, $sp7fc045) { if (!empty($sp7fc045[$sp439c5e->getPackageId()])) { $spa7481e = array_keys($sp439c5e->getAllProductIds()); $sp145f81 = $this->getModel("omnius_multimapper/addon")->quoteSkuMappersHaveSAPAddons($spa7481e, $sp439c5e->getSaleType()); if (Vfde_Core_Helper_Data::isAnyTrue([$sp145f81, $sp439c5e->hasSimOnly()])) { $sp7b1c9f = $sp7fc045[$sp439c5e->getPackageId()]['NetPrice'] ? number_format((double) $sp7fc045[$sp439c5e->getPackageId()]['NetPrice'], 2, '.', '') : null; $sp8e5ae0 = isset($sp7b1c9f) && $sp7b1c9f > 0 ? Vfde_Checkout_Helper_Delivery::getSapDeliveryText() : null; $this->shippingFee = array($sp439c5e->getPackageId() => array('ShippingFeeNetPrice' => isset($sp7b1c9f) && $sp7b1c9f > 0 ? $sp7b1c9f : null, 'ShippingFeeText' => isset($sp7b1c9f) && $sp7b1c9f > 0 ? $sp8e5ae0 : null)); } } } protected function setComponentData($sp30ca2a, $sp439c5e, $spac72f6, $sp7fc045) { list($sp7b1c9f, $sp8e5ae0) = $this->setShipping($sp439c5e, $spac72f6, $sp7fc045); $spc41d5d = $this->getPartialData($spac72f6); $spa7cbb5 = $this->getTariffOptionData($spac72f6, $sp30ca2a); return array_merge($spc41d5d, $spa7cbb5, array('TN' => $sp439c5e->getComponentTn(), 'Country' => null, 'DeviceID' => $this->getDeviceId($sp439c5e), 'ProductID' => null, 'SAPArticleNetPrice' => null, 'SAPArticleGrossPrice' => null, 'SAPDiscount1' => null, 'SAPDiscount2' => null, 'ShippingFeeNetPrice' => isset($sp7b1c9f) && $sp7b1c9f > 0 ? $sp7b1c9f : $spac72f6->getData('isSimOnly') == 1 && $spac72f6->getData('socAction') != Omnius_Superorder_Helper_Client::COMPONENT_ACTION_REMOVE ? $this->getZeroShippingFee() : null, 'ShippingFeeText' => isset($sp7b1c9f) && $sp7b1c9f > 0 ? $sp8e5ae0 : $spac72f6->getData('isSimOnly') == 1 && $spac72f6->getData('socAction') != Omnius_Superorder_Helper_Client::COMPONENT_ACTION_REMOVE ? '' : null, 'SimOnlyTariffInd' => $spac72f6->getData('isSimOnly') == 1 ? 'true' : 'false', 'MultiSimList' => $this->getMultiSimCategoryProduct(self::MULTISIM_SLOT_CATEGORY) == substr($spac72f6->getSku(), 1) ? $this->getMultiSims($sp439c5e) : null)); } protected function getPartialData($spac72f6) { $sp432894 = $this->getItemData($spac72f6, 'technical_id'); $spef89a2 = $this->getItemData($spac72f6, 'backend'); return ['Action' => $spac72f6->getData('socAction'), 'ComponentType' => $spac72f6->getData('mapperComponentType'), 'SkuID' => $spac72f6->getData('sku'), 'name' => $spac72f6->getData('name'), 'ComponentAdditionalData' => null, 'Agreement' => $spac72f6->getData('isTariffSoc') || !in_array($spef89a2, array(self::BACKEND_KIAS, self::BACKEND_MASRH)) ? null : array('AgreementSOC' => $sp432894, 'AgreementSOCDescription' => null, 'AgreementServiceType' => null, 'AgreementEffectiveDate' => null, 'AgreementExpirationDate' => null, 'AgreementTariffOption' => null), 'SAPArticleID' => $spac72f6->getData('socAction') != Omnius_Superorder_Helper_Client::COMPONENT_ACTION_REMOVE ? $spef89a2 == self::BACKEND_SAP ? $sp432894 : null : null]; } protected function getTariffOptionData($spac72f6, $sp30ca2a) { $sp432894 = $this->getItemData($spac72f6, 'technical_id'); $spef89a2 = $this->getItemData($spac72f6, 'backend'); $spf3c104 = $this->getModel('eav/entity_attribute_set'); $sp63badf = $spac72f6->getData('display_name_communication'); return ['TariffOption' => $spac72f6->getData('isTariffSoc') && $spef89a2 != self::BACKEND_SAP ? trim($sp432894) : null, 'TariffOptionCategory' => isset($sp30ca2a[$spac72f6->getData('sku')]) && $sp30ca2a[$spac72f6->getData('sku')] ? $spf3c104->load($sp30ca2a[$spac72f6->getData('sku')])->getAttributeSetName() : null, 'TariffOptionCategory_Tree' => $spac72f6->getData('tariffOptionCategoryTree') ?: '', 'TariffOptionDescription' => trim($spac72f6->getData('additional_text')) != "" ? $spac72f6->getData('additional_text') : null, 'TariffOptionName' => isset($sp63badf) ? $sp63badf : $spac72f6->getData('product_name')]; } protected function setComponentActivityTypeIndication($sp439c5e, $spac72f6, &$sp840d96) { if (in_array($this->processContext, Omnius_Catalog_Model_ProcessContext::getProlongationProcessContexts()) || in_array($this->processContext, Omnius_Catalog_Model_ProcessContext::ILSProcessContexts())) { if ($spac72f6->getData('isTariffSoc')) { $sp840d96['ComponentActivityTypeIndication'] = $sp439c5e->ilsTariffChanged() ? self::COMPONENT_ACTIVITY_TYPE_INDICATION_MANUAL : self::COMPONENT_ACTIVITY_TYPE_INDICATION_AUTOMATIC; } else { $sp840d96['ComponentActivityTypeIndication'] = $spac72f6->getData('activityTypeIndication'); } } else { $sp840d96['ComponentActivityTypeIndication'] = null; } } protected function getItemData($sp008ee3, $sp40ef26) { return $sp008ee3->getData($sp40ef26) ? $sp008ee3->getData($sp40ef26) : null; } protected function setSuperorderItemsAndPackageIds($sp0e4c43, $spb07caf, $sp439c5e) { $sp77f2c9 = []; $sp03031e = $sp439c5e->getSuperOrder(); if ($sp0e4c43) { $sp630982 = $this->getSingleton('checkout/session')->getQuote()->getAllItems(); } else { $sp630982 = $sp03031e->getOrderedItems(true); $spa9c61d = $sp03031e->getPackages(); $sp77f2c9 = $spb07caf; foreach ($spa9c61d as $sp6264d3) { $sp77f2c9[] = $sp6264d3->getEntityId(); } } return array($sp630982, $sp77f2c9); } protected function setInputParamsOrder($sp439c5e, $sp0e4c43) { $sp03031e = $sp439c5e->getSuperOrder(); if ($sp0e4c43) { $this->inputParams['cart'] = $this->getModel('vfde_configurator/expression_cart'); $this->inputParams['order'] = $this->getModel('vfde_configurator/expression_order')->setPackage($sp439c5e); } else { $this->inputParams['order'] = $this->getModel('vfde_configurator/expression_order')->setSuperOrder($sp03031e)->setPackage($sp439c5e); } } protected function getComponentsForFP($sp223325, &$sp9aa396, &$sp4a1190, &$sp2ce64b, &$spdf280a, &$sp0af27c) { list($sp439c5e, $spd6d708, $sp008ee3, $sp0e4c43) = $sp223325; $sp4a6021 = $this->getModel('omnius_multimapper/addon')->getAddonsWithDirection($spd6d708->getId(), $this->processContext, Vfde_MultiMapper_Model_Mapper::DIRECTION_OUT); foreach ($sp4a6021 as $spdee135) { if (Vfde_Core_Helper_Data::isAnyTrue([$this->serviceExpressionIsFalse($spdee135), !$this->hasValidBasketAction($sp008ee3, $spdee135, $spd6d708)])) { $this->log("Skipping addon with id " . $spdee135->getId() . ": invalid BASKET_ACTION or SERVICE_EXPRESSION"); continue; } $sp24a771 = null; if ($spdee135->getData('addon_name') == 'ComponentType') { $sp24a771 = $spdee135->getData('addon_value'); } if ($sp24a771 != 'ComponentType') { if ($spc75609 = $this->getFnComponentAdditionalData($sp008ee3, $spdee135, $sp439c5e->getParentAccountNumber(), $sp439c5e->getServiceLineId(), $sp0e4c43)) { $sp9aa396[] = $sp008ee3->getSku(); $sp4a1190 = array_merge($sp4a1190, $spc75609); if (!isset($sp2ce64b)) { $sp2ce64b = $spd6d708->getComponentType() ?: null; } if (!isset($spdf280a)) { $spdf280a = $this->getComponentActivityTypeIndication($sp008ee3); } if (!isset($sp0af27c)) { $sp0af27c = $this->getFnComponentAction($sp008ee3); } } } } } protected function setActivityType($sp439c5e, $sp06be97, $sp40ae88) { foreach ($sp06be97 as $sp405761) { if (isset($sp40ae88[$sp405761['SkuID']])) { $sp40ae88[$sp405761['SkuID']] = $sp405761['Action']; } } foreach ($sp439c5e->getItems() as $sp008ee3) { if (isset($sp40ae88[$sp008ee3->getSku()])) { $sp008ee3->setProductActivityType($sp40ae88[$sp008ee3->getSku()])->save(); } } } protected function setShipping($sp439c5e, $spac72f6, $sp7fc045) { $sp432894 = $this->getItemData($spac72f6, 'technical_id'); $spef89a2 = $this->getItemData($spac72f6, 'backend'); $sp7b1c9f = $spef89a2 == self::BACKEND_SAP && !empty($sp432894) && $spac72f6->getData('socAction') != Omnius_Superorder_Helper_Client::COMPONENT_ACTION_REMOVE ? !empty($sp7fc045[$sp439c5e->getPackageId()]) ? $sp7fc045[$sp439c5e->getPackageId()]['ShippingFeeNetPrice'] : $sp7fc045['ShippingFeeNetPrice'] : null; $sp8e5ae0 = $spef89a2 == self::BACKEND_SAP && !empty($sp432894) && $spac72f6->getData('socAction') != Omnius_Superorder_Helper_Client::COMPONENT_ACTION_REMOVE ? !empty($sp7fc045[$sp439c5e->getPackageId()]) ? $sp7fc045[$sp439c5e->getPackageId()]['ShippingFeeText'] : $sp7fc045['ShippingFeeText'] : null; return [$sp7b1c9f, $sp8e5ae0]; } protected function getComponentsForPackageType($sp439c5e, $sp0e4c43) { if ($sp439c5e->isFixed()) { return $this->getComponentsForFixedPackage($sp439c5e, $sp0e4c43); } elseif ($sp439c5e->isMobile()) { return $this->getComponentsForMobilePackage($sp439c5e); } elseif ($sp439c5e->isCable()) { return $this->getComponentsForCablePackage($sp439c5e); } return false; } protected static function checkAccountNumberAndType($sp97bf5f, $sp439c5e) { $sp33f611 = $sp439c5e->getParentAccountNumber(); $sp2d0ca5 = self::getPackageType($sp439c5e->getType()); return isset($sp33f611) && array_key_exists($sp33f611, $sp97bf5f) || !isset($sp33f611) && $sp2d0ca5 === Vfde_Customer_Model_Customer::ACCOUNT_CATEGORY_MOBILE_PREPAID || $sp2d0ca5 != Vfde_Customer_Model_Customer::ACCOUNT_CATEGORY_MOBILE_POSTPAID && isset($sp33f611) && $sp439c5e->isMobile() && !in_array($sp33f611, [Vfde_Customer_Helper_Customer::NEW_ACCOUNT_BAN, Vfde_Customer_Helper_Customer::PRE_POST_BAN], false); } protected static function getProductPackageType($spd7a64f, $spb013f6) { $spd5be92 = ''; if (strtolower($spd7a64f) == strtolower(Vfde_Customer_Helper_Services::ACCOUNT_CATEGORY_KD)) { foreach ($spb013f6['products'] as $spf46a88) { foreach ($spf46a88 as $sp02efce) { if ($sp02efce['package_type']) { $spd5be92 = $sp02efce['package_type']; break 2; } } } } else { $spd5be92 = $spb013f6['package_creation_type']; } return $spd5be92; } protected static function getServiceAddress($spe6d87d, &$spa1508e) { if (isset($spe6d87d['service_address'])) { $sp77daf5 = !isset($spe6d87d['service_address'][0]) ? [$spe6d87d['service_address']] : $spe6d87d['service_address']; foreach ($sp77daf5 as $sp4dbee5) { if (isset($sp4dbee5['address_id'])) { $spa1508e[] = $sp4dbee5['address_id']; } } } } public function getMultiSims($sp439c5e = null) { $sp3936e2 = $this->getCheckoutHelper()->isRetailChannel(); $sp3664e8 = $sp439c5e->getPackageId(); foreach ($sp439c5e->getMultiSimPackageItems(false) as $sp008ee3) { $sp3aaad1 = $sp008ee3->getSku(); $sp02efce = $this->getProductModel()->loadByAttribute('sku', $sp3aaad1); $spead020 = $this->getComponentAction($sp008ee3); if ($sp02efce->hasNoMultiSimCheckout()) { if (!empty($sp02efce->getMinNoOfSlots()) && !empty($sp02efce->getMaxNoOfSlots()) && $sp02efce->getMinNoOfSlots() == $sp02efce->getMaxNoOfSlots() && in_array($spead020, [self::COMPONENT_ACTION_ADD, self::COMPONENT_ACTION_REMOVE])) { $spead020 == self::COMPONENT_ACTION_REMOVE ? $spead020 = Vfde_Package_Model_Package::ACTIVITY_REMOVE : null; $sp4ad4aa['MultiSIM'][] = ['SIMSerialNumber' => null, 'SIMCardType' => null, 'ActivityType' => $spead020, 'SIMCardArticleID' => null, 'ProductOption' => !empty($sp02efce->getUcpoCode()) ? $sp02efce->getUcpoCode() : null]; } continue; } $spabb831 = (int) $this->getCheckout('simcard[mobile][' . $sp3664e8 . '][' . $sp3aaad1 . '][no_of_slots]'); $sp05f28e = (int) $this->getCheckout('simcard[mobile][' . $sp3664e8 . '][' . $sp3aaad1 . '][ib_no_of_slots]'); if (!$spabb831 && (int) $sp008ee3->getIsContractDrop()) { $sp91d458 = $this->getCheckoutLayoutHelper()->packageGetNoOfSimSlotsCheckout($sp3aaad1, $sp439c5e); if ($sp91d458 < 0) { continue; } $sp7c81b3 = $this->getInstallBase()->packageGetMultiSims($sp439c5e); $sp7c81b3 = $this->getInstallBase()->productGetMultiSims($sp3aaad1, $sp7c81b3); foreach ($sp7c81b3 as $spf8f358 => $spedf2c7) { $sp4ad4aa['MultiSIM'][] = ['SIMSerialNumber' => $spedf2c7['UltraCardSim'], 'SIMCardType' => null, 'ActivityType' => Vfde_Package_Model_Package::ACTIVITY_REMOVE, 'SIMCardArticleID' => null, 'ProductOption' => !empty($sp02efce->getUcpoCode()) ? $sp02efce->getUcpoCode() : null]; } } $sp0cdf52 = max(abs($spabb831), abs($sp05f28e)); for ($sp488991 = 1; $sp488991 <= $sp0cdf52; $sp488991++) { $spe47b8f = $this->getCheckout('simcard[mobile][' . $sp3664e8 . '][' . $sp3aaad1 . '][additional][' . $sp488991 . '][type]') == Vfde_Superorder_Model_Client_SubmitOrderClient_Package::SIM_TYPE_S ? $this->getMultiSimCategoryProduct(self::CATEGORY_MULTISIM) : null; if ($spabb831 < 0) { $sp0a34d5 = (int) $this->getCheckout('simcard[mobile][' . $sp3664e8 . '][' . $sp3aaad1 . '][additional][' . $sp488991 . '][remove]'); if (!$sp0a34d5) { continue; } $spead020 = Vfde_Package_Model_Package::ACTIVITY_REMOVE; $sp88cf6b = $this->getCheckout('simcard[mobile][' . $sp3664e8 . '][' . $sp3aaad1 . '][additional][' . $sp488991 . '][ib]') ?? null; $sp537526 = null; } else { $spead020 = Vfde_Package_Model_Package::ACTIVITY_ADD; $sp88cf6b = $sp3936e2 ? $this->getCheckout('simcard[mobile][' . $sp3664e8 . '][' . $sp3aaad1 . '][additional][' . $sp488991 . '][serial]') : null; if ($sp3936e2 && $sp88cf6b == null && $spabb831 < $sp05f28e) { continue; } $sp537526 = !$sp3936e2 ? $this->getCheckout('simcard[mobile][' . $sp3664e8 . '][' . $sp3aaad1 . '][additional][' . $sp488991 . '][type]') : null; } $sp4ad4aa['MultiSIM'][] = ['SIMSerialNumber' => $sp88cf6b, 'SIMCardType' => $sp537526, 'ActivityType' => $spead020, 'SIMCardArticleID' => $spe47b8f, 'ProductOption' => !empty($sp02efce->getUcpoCode()) ? $sp02efce->getUcpoCode() : null]; } } return $sp4ad4aa ?? null; } protected function getCheckoutLayoutHelper() { return Mage::helper("vfde_checkout/layout"); } public function getSIMCardArticleID($sp3664e8, $sp488991) { return $this->getCheckout('simcard[mobile][' . $sp3664e8 . '][additional][' . $sp488991 . '][type]') == Vfde_Superorder_Model_Client_SubmitOrderClient_Package::SIM_TYPE_S ? $this->getMultiSimCategoryProduct(self::CATEGORY_MULTISIM) : null; } public function getInstallBase() { return Mage::getModel('vfde_configurator/expression_installBase'); } public function getMultiSimCategoryProduct($spbc27a3) { $sp552a17 = Mage::getModel('vfde_superorder/client_submitOrderClient_package')->getCategoryIdByPath($spbc27a3); return Mage::getModel('vfde_superorder/client_submitOrderClient_package')->getCategoryProduct($sp552a17); } public function getCatalogHelper() { return Mage::helper('vfde_catalog'); } public function getProductVisibilityForExtendedSC($sp02efce) { return $this->getCatalogHelper()->getVisibility(Omnius_Catalog_Model_Product::PRODUCT_VISIBILITY_EXTENDED_SHOPPING_CART, $sp02efce->getSku(), $sp02efce); } public function getProductVisibilityForContractSummary($sp02efce) { return $this->getCatalogHelper()->getVisibility(Vfde_Catalog_Model_Product::PRODUCT_VISIBILITY_CONTRACT_SUMMARY, $sp02efce->getSku(), $sp02efce); } public function getBillingType($sp439c5e = false) { if ($sp439c5e !== false) { if (strtoupper($sp439c5e->getSaleType() === Omnius_Catalog_Model_ProcessContext::ACQ) && $sp439c5e->isSolstice()) { return $this->getCheckout('billing[billing_type]'); } foreach ($sp439c5e->getItems() as $sp008ee3) { if (Omnius_Catalog_Model_Type::getSendInvoiceByPostSkus() == $sp008ee3->getData('sku')) { return self::BILLING_LETTER; } } } if ($this->getCheckout('billing[billing_type]') == self::BILLING_TYPE_MAIL) { return self::BILLING_WEBBILL; } else { $sp3b347b = Omnius_Checkout_Block_Cart_Steps_SaveCustomer::SAME_AS_CUSTOMER_ADDRESS; $sp21fbfc = Omnius_Checkout_Block_Cart_Steps_SaveCustomer::BILLING_ANOTHER_ADDRESS; if ($this->getCheckout('billing[other_address][selected]') && in_array($this->getCheckout('billing[other_address][selected]'), [$sp3b347b, $sp21fbfc]) || $this->getCheckout('billing[billing_type]') == self::BILLING_TYPE_INVOICE) { if ($sp439c5e->isMobile() || $sp439c5e->isCable()) { return self::BILLING_PAPER; } elseif ($sp439c5e->isFixed()) { return self::BILLING_LETTER; } } } return self::BILLING_PAPER; } protected function getQuote() { return Mage::getSingleton('checkout/cart')->getQuote(); } protected function getCheckoutHelper() { return Mage::helper('vfde_checkout'); } public function getCheckoutData() { return $this->checkoutData; } public function setCheckoutData($spcdf811) { return $this->checkoutData = $spcdf811; } protected function isProductChanged($sp008ee3, $spd6d708 = '', $sp13ce70 = '') { $sp02efce = $sp008ee3->getProduct(); $sp04ed1a = $spf401a0 = false; $sp6a87a7 = $sp02efce->getPackageSubtypeModel()->getCardinalityForProcessContext($this->processContext)->getCardinality(); $spf401a0 = $sp6a87a7 == Omnius_Package_Model_PackageSubtypeCardinality::PACKAGE_SUBTYPE_CARDINALITY_ONE; $sp18782a = Mage::getModel('omnius_catalog/category'); $spd3733f = $sp18782a->getAllExclusiveFamilyCategoryIds(); $sp87173b = []; foreach ($sp02efce->getCategoryCollection() as $spbc27a3) { if (in_array($spbc27a3->getId(), $spd3733f)) { $sp04ed1a = true; $sp87173b[] = $spbc27a3->getId(); } } if (!($spf401a0 || $sp04ed1a) || $this->processContext == Omnius_Catalog_Model_ProcessContext::ACQ) { return false; } if ($spf401a0) { $sp0af32e = $this->getItemsInSubtype($sp008ee3->getProduct()->getPackageSubtypeModel()); foreach ($sp0af32e as $sp94a7e0) { if ($sp94a7e0->getId() !== $sp008ee3->getId() && $sp94a7e0->getIsContractDrop() && $sp13ce70 != Vfde_MultiMapper_Model_Addon::BASKET_ACTION_ADD && $spd6d708['ogw_component_id_reference'] != Vfde_MultiMapper_Model_Mapper::OGW_COMPONENT_ID_REVOCATION) { return true; } } } if ($sp04ed1a) { $spc595f4 = $this->getItemsInCategories($sp87173b); foreach ($spc595f4 as $sp83cfda) { if ($sp83cfda->getId() !== $sp008ee3->getId() && $sp83cfda->getIsContractDrop()) { return true; } } } return false; } public function orderNumberCache(?string $sp91e806 = null) : ?string { $sp32711f = $this->getSingleton('omnius_cache/cache'); $spd81527 = $this->getSingleton("core/session")->getEncryptedSessionId(); $spb90672 = 'last_created_order_number_' . $spd81527; if ($sp06be97 = $sp32711f->load($spb90672)) { if (isset($sp91e806) && $sp06be97 != $sp91e806) { $sp32711f->save($sp91e806, $spb90672); } return $sp06be97; } elseif ($sp91e806) { $sp32711f->save($sp91e806, $spb90672); } return null; } public function appendOrderNumberDuringException(?string $sp91e806, Exception $sp1074a4) : Exception { if (isset($sp91e806)) { return new Exception("Order number: {$sp91e806} -- {$sp1074a4->getMessage()}", 0, $sp1074a4); } return $sp1074a4; } public function logExceptionWithOrderNumber(Exception $sp1074a4) : self { $this->mageLogException($this->appendOrderNumberDuringException($this->orderNumberCache() ?? null, $sp1074a4)); return $this; } public function getCustomerSubType(string $sp99e42d = '') : string { $spda3dfc = ''; switch (strtolower($this->getCheckout($sp99e42d))) { case Vfde_Checkout_Helper_Layout::SALUTATION_COMPANY_STRING: $spda3dfc = Vfde_Customer_Helper_Services::SOHO_PARTY_SUBTYPE_BUSINESS; break; default: $spda3dfc = ''; } return $spda3dfc; } public function getCustomerType($sp99e42d) { switch (strtolower($this->getCheckout($sp99e42d))) { case 'privat': $sp645138 = Omnius_Customer_Model_Client_RetrieveCustomerInfo::PARTY_TYPE_PRIVATE; break; case 'soho': case 'firma': $sp645138 = Omnius_Customer_Model_Client_RetrieveCustomerInfo::PARTY_TYPE_SOHO; break; default: $sp645138 = null; } return $sp645138; } public function getCustomerTypeMapped(string $sp6b2060) { switch ($sp6b2060) { case 'privat': $sp645138 = Omnius_Customer_Model_Client_RetrieveCustomerInfo::PARTY_TYPE_PRIVATE; break; case 'soho': case 'firma': $sp645138 = Omnius_Customer_Model_Client_RetrieveCustomerInfo::PARTY_TYPE_SOHO; break; default: $sp645138 = null; } return $sp645138; } public static function getPackageType($sp6b2060) { $spbc27a3 = "Unknown"; switch (strtolower($sp6b2060)) { case strtolower(Omnius_Catalog_Model_Type::TYPE_CABLE_INDEPENDENT): case strtolower(Omnius_Catalog_Model_Type::TYPE_CABLE_INTERNET_PHONE): case strtolower(Omnius_Catalog_Model_Type::TYPE_CABLE_TV): case strtolower(Omnius_Customer_Model_Customer::ACCOUNT_CATEGORY_CABLE): $spbc27a3 = Omnius_Customer_Model_Customer::ACCOUNT_CATEGORY_CABLE; break; case strtolower(Omnius_Catalog_Model_Type::TYPE_MOBILE): case strtolower(Omnius_Catalog_Model_Type::TYPE_REDPLUS): $spbc27a3 = Omnius_Customer_Model_Customer::ACCOUNT_CATEGORY_MOBILE_POSTPAID; break; case strtolower(Omnius_Catalog_Model_Type::TYPE_PREPAID): $spbc27a3 = Omnius_Customer_Model_Customer::ACCOUNT_CATEGORY_MOBILE_PREPAID; break; case strtolower(Omnius_Catalog_Model_Type::TYPE_FIXED_DSL): case strtolower(Omnius_Catalog_Model_Type::TYPE_LTE): case strtolower('Fixed'): $spbc27a3 = Omnius_Customer_Model_Customer::ACCOUNT_CATEGORY_FIXED; break; case strtolower(Vfde_Catalog_Model_Type::TYPE_SOLSTICE): return Vfde_Customer_Helper_Services::ACCOUNT_CATEGORY_SOLSTICE; default: break; } return $spbc27a3; } public function getPackageModel(int $sp3ec972 = null) : Omnius_Package_Model_Resource_Package_Collection { $sp06be97 = Mage::getModel('package/package')->getCollection()->addFieldToFilter('order_id', $sp3ec972); if (count($sp06be97) !== 0) { return $sp06be97; } $sp03031e = $this->getSuperOrderModel()->getCollection()->addFieldToFilter('entity_id', $sp3ec972)->getFirstItem(); $sp0320b9 = $sp03031e->getData('quote_id'); return Mage::getModel('package/package')->getCollection()->addFieldToFilter('quote_id_cc', $sp0320b9); } public function getCheckoutFieldDataArr($sp7157d4) { if (!is_null($this->checkoutData)) { $sp64d7bf = is_array($this->checkoutData) ? $this->checkoutData : $this->checkoutData->getData(); foreach ($sp64d7bf as $sp16ad8a) { if (isset($sp16ad8a['field_name']) && $sp16ad8a['field_name'] == $sp7157d4) { return array($sp16ad8a['field_name'] => $sp16ad8a['field_value']); } } return null; } } public function getBewPermissionForOrders($spf0635b) { $spc671ea = array(); foreach ($spf0635b as $sp40ef26 => $sp439c5e) { $sp159184 = $this->getCheckoutField()->getCheckoutFieldsByPackage("save_bew_permission", $sp439c5e['id']); if ($sp159184['bewpermission[' . Vfde_Checkout_Model_BewPermission::BEW_PERMISSION_ID_ADV . ']'] || $sp159184['bewpermission[' . Vfde_Checkout_Model_BewPermission::BEW_PERMISSION_ID_DEV . ']']) { $spc671ea[$sp439c5e['orderNumber']]['bewPermission'] = 'YES'; } } return $spc671ea; } public function getContactPhoneNumbers($spf0635b = null) { $sp8e0745 = $this->getHelper('omnius_service'); $sp31755d = array(); $sp981e5c = 0; $spa2fd45 = $sp1cad37 = null; while ($this->getCheckout("customer[contact_details][phone_list][{$sp981e5c}][telephone]")) { if ($this->orderContainsSolsticeACQ($spf0635b)) { $spa2fd45 = $this->getSolsticeCustomerC1Key(Vfde_CustomerDataHub_Model_Checkout_COneReferenceData::TELEPHONE_TYPE, $this->getContactPhoneNumberType("customer[contact_details][phone_list][{$sp981e5c}][telephone_type]", $spf0635b)); $sp1cad37 = 'true'; if ($sp981e5c == 1) { $sp1cad37 = 'false'; } } $sp472e6c = $this->getCheckout("customer[contact_details][phone_list][{$sp981e5c}][telephone_prefix]"); $sp312855 = $this->getCheckout("customer[contact_details][phone_list][{$sp981e5c}][telephone]"); $sp31755d[] = array('CountryCode' => $sp8e0745->getGeneralConfig('country_code') ? $sp8e0745->getGeneralConfig('country_code') : Omnius_Customer_Model_Customer::COUNTRY_CODE, 'LocalAreaCode' => $sp472e6c, 'PhoneNumber' => $sp312855, 'Type' => $this->getContactPhoneNumberType("customer[contact_details][phone_list][{$sp981e5c}][telephone_type]", $spf0635b), 'TypeC1Key' => $spa2fd45, 'Preferred' => $sp1cad37); $sp981e5c++; } $sp472e6c = $this->getCheckout("customer[contact_person_details][0][telephone_prefix]"); $sp312855 = $this->getCheckout("customer[contact_person_details][0][telephone]"); if ($sp472e6c && $sp312855) { $sp31755d[] = array('CountryCode' => $sp8e0745->getGeneralConfig('country_code') ? $sp8e0745->getGeneralConfig('country_code') : Omnius_Customer_Model_Customer::COUNTRY_CODE, 'LocalAreaCode' => $sp472e6c, 'PhoneNumber' => $sp312855, 'Type' => $this->getContactPhoneNumberType("customer[contact_person_details][0][telephone_type]", $spf0635b)); } return !empty($sp31755d) && (!empty($sp31755d[0]) || !empty($sp31755d['PhoneNumber'])) ? $sp31755d : null; } public function getContactPhoneNumberType($sp99e42d, $spf0635b = null) { $sp911f29 = $this->orderContainsSolsticeACQ($spf0635b); switch ($this->getCheckout($sp99e42d)) { case $sp911f29: return $this->getCheckout($sp99e42d); case 'landline': return 'FIXED_PHONE'; case 'mobile': return 'MOBILE_PHONE'; } return null; } public function orderContainsSolsticeACQ($spf0635b) : bool { foreach ($spf0635b as $sp439c5e) { if (strtoupper($sp439c5e->getSaleType()) === Omnius_Catalog_Model_ProcessContext::ACQ && $sp439c5e->isSolstice()) { return true; } } return false; } public function getSalutation($sp7465d3) { if (!is_numeric($sp7465d3)) { $sp3a1eb9 = $this->getCheckout($sp7465d3); $sp7465d3 = empty($sp3a1eb9) && !empty($sp7465d3) ? $sp7465d3 : $sp3a1eb9; } switch ($sp7465d3) { case self::GENDER_HERR: $sp9ad2ed = 'R'; break; case self::GENDER_FRAU: $sp9ad2ed = 'S'; break; case self::GENDER_FIRMA: $sp9ad2ed = 'F'; break; default: if (is_string($sp7465d3) && !empty($sp7465d3)) { return $sp7465d3; } $sp9ad2ed = 'N'; } return $sp9ad2ed; } public function getSolsticeCustomerC1Key($sp4911f7, $sp63badf) { $sp05241c = $this->getConfigurationDataList()[$sp4911f7]; $sp117b90 = array_search($sp63badf, $sp05241c); return $sp117b90; } protected function getConfigurationDataList() { return $this->getModel('vfde_configurator/configuration')->getConfigurationData(); } } ?>

Did this file decode correctly?

Original Code

<?php
class Vfde_Superorder_Helper_Client extends Omnius_Superorder_Helper_Client { use Vfde_Core_Traits_ObjectInstantiator; protected $installBaseOverwrites = []; protected $manuallyRefusedItems = []; protected $_calculator; protected $configurationData; public const CONTRACT_END_DATE = 1; public const CATEGORY_PATH = "->"; public const MOBILE_POSTPAID_TARIFF = 'TARIFF'; public const ASAP = 2; public const WISH_DATE = 3; public const CATEGORY_MULTISIM = 'Mobile/SAP_SKU_Physical_MULTISIM'; public const MULTISIM_SLOT_CATEGORY = 'Mobile/Multisim_Slots'; public const BACKEND_MASRH = 'Marsh'; public const ATTRIBUTE_CODE_TARGETDATE = 'TARGETDATE'; public const ADDON_NAME_FUNCTION_ID = 'function@ID'; public const DATE = 'date'; public const DATE_TIME = 'datetime'; public const CONTRACT_MODE = 'GenerateContract'; public const ORDER_MODE = 'Fulfillment'; public const ACCOUNT_CATEGORY_UNKNOWN = "Unknown"; public const CONTRACT_SUMMARY_YES = 1; public const CONTRACT_SUMMARY_NO = 0; public const CONTRACT_SUMMARY_LINE_OF_BUSINESS_ALL = 'ALL'; public const CONTRACT_SUMMARY_DOCUMENT_TYPE_C = 'C'; public const CONTRACT_SUMMARY_DOCUMENT_TYPE_P = 'P'; public const BILLING_TYPE_MAIL = 'mail'; public const BILLING_TYPE_INVOICE = 'invoice'; public const ATTRIBUTE_CODE_ORDER_ID = 'orderId'; public $processContext = null; public const CONTRACT_SUMMARY = 'contractSummary'; public const ATTRIBUTE_CODE_HOME_ID = 'HOME_ID'; public static $defaultPhoneBookPersonalFields = ['Address' => null, 'InverseSearchIndicator' => null, 'TelephoneInfoUse' => null, 'NamePrefix' => null, 'FaxDirectoryIndicator' => null, 'VoiceDirectoryIndicator' => null, 'NameSuffix' => null, 'InverseSearch' => null, 'InformationUse' => null, 'ElecListIndicator' => null, 'PrintListIndicator' => null, 'PublishAddress' => null, 'AltUserFirstName' => null, 'AltUserLastName' => null]; protected $isHwDiscountIncluded = false; public function getItemStatusModel() { return Mage::getModel('vfde_configurator/itemStatus'); } public static function getCustomerEntities($spf0635b) { $spf71e81 = array(); $sp49cd5b = static::getInstalledBaseCustomerEntities(); $sp79e5cf = Mage::getSingleton('omnius_address/storage')->getServiceAbility(); foreach ($spf0635b as $sp439c5e) { $sp33f611 = $sp439c5e->getParentAccountNumber(); $sp2d0ca5 = self::getPackageType($sp439c5e->getType()); if (isset($sp49cd5b[$sp33f611]['address_ids']) && !in_array($sp79e5cf['address_id'], $sp49cd5b[$sp33f611]['address_ids'])) { $sp33f611 = null; } if (isset($sp49cd5b[$sp33f611]) && $sp49cd5b[$sp33f611] && isset($sp49cd5b[$sp33f611]['installed_base_entity'])) { $sp49cd5b[$sp33f611]['installed_base_entity'] = false; } elseif (!isset($spf71e81[$sp2d0ca5])) { $spf71e81[$sp2d0ca5] = ['customer_number' => $sp33f611, 'account_type' => $sp2d0ca5, 'package_type' => strtolower($sp439c5e->getType()), 'installed_base_entity' => false]; } } return $sp49cd5b + $spf71e81; } public function getCustomerTypeShort($sp99e42d) { $sp43f4d7 = 'Vfde_Customer_Model_Client_RetrieveCustomerInfo'; $sp6b21fa = $this->getCustomerType($sp99e42d); $spe804d9 = [$sp43f4d7::PARTY_TYPE_PRIVATE => $sp43f4d7::PARTY_TYPE_SHORT_PRIVATE, $sp43f4d7::PARTY_TYPE_SOHO => $sp43f4d7::PARTY_TYPE_SHORT_SOHO]; return $spe804d9[$sp6b21fa] ?? null; } public static function getCustomerEntitiesForSupportOrder($spf0635b) { $spf71e81 = []; $sp97bf5f = static::getInstalledBaseCustomerEntities(); if (!isset($spf0635b)) { return $sp97bf5f; } foreach ($spf0635b as $sp439c5e) { $sp33f611 = $sp439c5e->getParentAccountNumber(); $sp2d0ca5 = self::getPackageType($sp439c5e->getType()); if (self::checkAccountNumberAndType($sp97bf5f, $sp439c5e)) { continue; } if (!isset($spf71e81[$sp2d0ca5])) { $spf71e81[$sp2d0ca5] = ['customer_number' => $sp33f611 ?? '', 'account_type' => $sp2d0ca5, 'package_type' => strtolower($sp439c5e->getType()), 'installed_base_entity' => false]; } } return $sp97bf5f + $spf71e81; } public static function getInstalledBaseCustomerEntities() { $spf71e81 = array(); $sp8b600d = Mage::getSingleton('vfde_customer/session')->getCustomerProducts(); foreach ($sp8b600d as $spd7a64f => $spa24412) { foreach ($spa24412 as $spd989d3 => $spd5febf) { $spb013f6 = []; $spa1508e = []; foreach ($spd5febf['contracts'] as $spe6d87d) { if (isset($spe6d87d['subscriptions'])) { foreach ($spe6d87d['subscriptions'] as $sp02fc97) { if (isset($sp02fc97['package_creation_type'])) { $spb013f6 = $sp02fc97; break; } } } self::getServiceAddress($spe6d87d, $spa1508e); } $spd5be92 = self::getProductPackageType($spd7a64f, $spb013f6); $sp2d0ca5 = self::getPackageType($spd5be92); if (strtolower($sp2d0ca5) == strtolower(self::ACCOUNT_CATEGORY_UNKNOWN) && strtolower($spd7a64f) == strtolower(Omnius_Customer_Helper_Services::ACCOUNT_CATEGORY_KD)) { $sp2d0ca5 = Omnius_Customer_Model_Customer::ACCOUNT_CATEGORY_CABLE; } $spf71e81[$spd989d3] = ['customer_number' => $spd989d3, 'account_type' => $sp2d0ca5, 'package_type' => $spd5be92, 'installed_base_entity' => true, 'address_ids' => strtolower($spd7a64f) == strtolower(Vfde_Customer_Helper_Services::ACCOUNT_CATEGORY_KD) ? $spa1508e : null]; } } return $spf71e81; } public function getPaymentMethod($sp439c5e, $spb014f6 = null) { if ($spb014f6 === null) { if (Vfde_Core_Helper_Data::isAnyTrue([$sp439c5e->isFixed(), $sp439c5e->isCable()])) { $spb014f6 = 'RC'; } else { $spb014f6 = 'OTC'; } } switch ($spb014f6) { case 'RC': $sp6b21fa = $this->getCheckout('payment[monthly][type]'); if ($sp6b21fa == Vfde_Checkout_Helper_Fields::PAYMENT_SPLIT_PAYMENT) { $sp6b21fa = $this->getCheckout('payment[pakket][' . $sp439c5e->getPackageId() . '][type]'); } break; case 'OTC': $sp6b21fa = $this->getCheckout('payment[one_time][type]'); break; default: $sp6b21fa = ''; } if (strpos($sp6b21fa, '|') !== false) { $sp6b21fa = substr($sp6b21fa, 0, strpos($sp6b21fa, '|')); } $spba0ab0 = null; foreach ($sp439c5e->getItems() as $sp008ee3) { if (Vfde_Catalog_Model_Type::getCheckoutSelfReferrerSkus() == $sp008ee3->getData('sku')) { if ($sp6b21fa == Vfde_Checkout_Helper_Fields::PAYMENT_BANK_TRANSFER) { $spba0ab0 = 'GI'; } break; } } $spba0ab0 = $this->setPayment($spba0ab0, $sp6b21fa); return $spba0ab0; } public function getAccountOwnerValue($sp439c5e) : string { $spd46943 = $this->getModel('customer/customer'); $sp45fdc1 = $spd46943->isSohoRvOrBusinessCustomer(); $sp81ab9c = ''; if ($this->getCheckout('payment[monthly][type]') == Vfde_Checkout_Helper_Fields::PAYMENT_SPLIT_PAYMENT) { $spc7a1af = $this->getCheckout('payment[pakket][' . $sp439c5e->getPackageId() . '][alternative_account_holder]'); if ($spc7a1af == Vfde_Checkout_Block_Cart_Steps_SaveCustomer::ALTERNATIVE_ACCOUNT_HOLDER) { $sp81ab9c = $this->getCheckout('payment[pakket][' . $sp439c5e->getPackageId() . '][alternative][firstname]') . ' ' . $this->getCheckout('payment[pakket][' . $sp439c5e->getPackageId() . '][alternative][firstname]'); } } else { $spc7a1af = $this->getCheckout('payment[monthly][alternative_account_holder]'); if ($spc7a1af == Vfde_Checkout_Block_Cart_Steps_SaveCustomer::ALTERNATIVE_ACCOUNT_HOLDER) { $sp132d65 = $this->getCheckout('payment[monthly][alternative][gender]'); if ($sp132d65 == Omnius_Superorder_Helper_Client::GENDER_FIRMA) { $sp81ab9c = trim($this->getCheckout('payment[monthly][alternative][company_name]') . ' ' . $this->getCheckout('payment[monthly][alternative][company_additional_name]')); } else { $sp81ab9c = $this->getCheckout('payment[monthly][alternative][firstname]') . ' ' . $this->getCheckout('payment[monthly][alternative][lastname]'); } } if ($this->getCustomerSession()->getCustomer()->isSohoRvOrBusinessCustomer() && $spc7a1af == Vfde_Checkout_Block_Cart_Steps_SaveCustomer::ALTERNATIVE_ACCOUNT_HOLDER_TWO) { $sp81ab9c = $this->getCheckout('payment[monthly][account_holder]'); } } if (!$sp45fdc1 && empty(trim($sp81ab9c))) { $sp81ab9c = $this->getCheckout('customer[firstname]') . ' ' . $this->getCheckout('customer[lastname]'); } if ($sp45fdc1 && empty(trim($sp81ab9c))) { $sp81ab9c = mb_substr(trim($this->getCheckout('customer[address][company_name]') . ' ' . $this->getCheckout('customer[address][company_additional_name]')), 0, 32); } return $sp81ab9c; } protected function processSocs($sp223325, &$sp2ba766, &$sp30ca2a) { list($sp00d3cc, $spe2ab18, $spd6d708, $sp008ee3, $sp8d4ba0, $sp68625a) = $sp223325; $sp93f21f = false; foreach ($sp00d3cc as $sp6c2238) { if ($sp6c2238 && in_array($sp6c2238->getData('backend'), array(self::BACKEND_KIAS, self::BACKEND_SAP, self::BACKEND_MASRH))) { if ($spe2ab18 || $this->serviceExpressionIsFalse($sp6c2238)) { continue; } $sp6c2238->setData('sku', $spd6d708->getSku()); $sp6c2238->setData('name', $sp008ee3->getName()); $sp6c2238->setData('activityTypeIndication', $this->getComponentActivityTypeIndication($sp008ee3)); $sp6c2238->setData('socAction', $this->getComponentAction($sp008ee3)); $sp6c2238->setData('isTariffSoc', $sp8d4ba0->isSubscription()); $sp6c2238->setData('isSimOnly', $sp8d4ba0->getSimOnly()); $sp6c2238->setData('product_name', $sp8d4ba0->getName()); $sp6c2238->setData('display_name_communication', $sp8d4ba0->getDisplayNameCommunication()); $sp6c2238->setData('additional_text', strip_tags($sp8d4ba0->getServiceDescription())); $sp6c2238->setData('mapperComponentType', $spd6d708->getComponentType()); $sp6c2238->setData('tariffOptionCategoryTree', $sp68625a); $sp2ba766[] = $sp6c2238; if (!$sp93f21f) { $this->log("... ... Multimapper details entries:"); $this->log("... ... ----------------------------"); $sp93f21f = true; } foreach ($sp6c2238->getData() as $sp40ef26 => $sp6b21fa) { if (!empty($sp6b21fa)) { $this->log("... ... {$sp40ef26}: {$sp6b21fa}"); } } $sp30ca2a[$spd6d708->getSku()] = $sp8d4ba0->getAttributeSetId(); } } } protected function initResultDataForMobile($sp223325) { list($sp6e3776, $sp439c5e, $spad77cf, list($spf48840, $spcc67f2, $spf431db), $sp7fc045) = $sp223325; list($sp7b1c9f, $sp8e5ae0) = $this->getShippingTextAndPrice($sp6e3776, $sp439c5e, $sp7fc045); $sp06be97 = $this->componentArray($spad77cf[0], $this->getComponentAction($spad77cf[0]), $this->getComponentActivityTypeIndication($spad77cf[0])); $sp06be97['ComponentType'] = isset($spf48840) ? $spf48840->getComponentType() : null; $sp06be97['TariffOptionDescription'] = trim($spf431db) != "" ? $spf431db : null; $sp06be97['TariffOptionName'] = $spcc67f2 ?? null; $sp06be97['TN'] = $sp439c5e->getComponentTn() ?: null; $sp06be97['SAPArticleID'] = trim($sp6e3776); $sp06be97['DeviceID'] = $this->getDeviceId($sp439c5e); if ($this->isHwDiscountIncluded) { $sp06be97['SAPDiscountCode'] = ''; } else { $sp06be97['SAPDiscountCode'] = $sp439c5e->getDiscountCodeSap(); } $sp06be97['ShippingFeeNetPrice'] = isset($sp7b1c9f) && $sp7b1c9f > 0 ? $sp7b1c9f : $this->getZeroShippingFee(); $sp06be97['ShippingFeeText'] = isset($sp7b1c9f) && $sp7b1c9f > 0 ? $sp8e5ae0 : ''; $sp06be97['SimOnlyTariffInd'] = 'false'; $sp06be97['MultiSimList'] = null; return $sp06be97; } protected function initResultDataForInstalledBase($sp223325) { list($sp439c5e, $sp02efce, , , , $spec52f8, $spfd2f85, $sp24a771, $sp0af27c) = $sp223325; $sp06be97 = $this->componentArray($sp02efce, $sp0af27c, self::COMPONENT_ACTIVITY_TYPE_INDICATION_AUTOMATIC); $sp7fc045 = $this->getShippingFeeNetPrice(); $sp7b1c9f = $spfd2f85->getBackend() == self::BACKEND_SAP && !empty($spfd2f85->getTechnicalId()) ? $sp7fc045['ShippingFeeNetPrice'] : null; $sp8e5ae0 = isset($sp7b1c9f) && $sp7b1c9f > 0 ? $sp7fc045['ShippingFeeText'] : null; $this->setResultProperties([$sp439c5e, $spec52f8, $sp24a771, $spfd2f85, $sp02efce], $sp06be97); $sp06be97['ProductID'] = $sp439c5e->isCable() ? $spfd2f85->getTechnicalId() : null; $sp06be97['ShippingFeeNetPrice'] = isset($sp7b1c9f) && $sp7b1c9f > 0 ? $sp7b1c9f : null; $sp06be97['ShippingFeeText'] = isset($sp7b1c9f) && $sp7b1c9f > 0 ? $sp8e5ae0 : null; return $sp06be97; } protected function processHandsetSoc($sp223325, &$sp06be97) { list($sp6e3776, , $spad77cf) = $sp223325; if ($sp6e3776) { $sp06be97[] = $this->initResultDataForMobile($sp223325); $sp40ae88[$spad77cf[0]->getSku()] = $this->getComponentAction($spad77cf[0]); $spdadb9d = $sp81bff6 = $sp9f5deb = 0; $this->_calculator = Mage::getSingleton('tax/calculation'); foreach ($spad77cf as $sp2629ef) { $sp11fca2 = $sp2629ef->getOriginalPrice(); $spe86b78 = $this->calculateSapDeviceDiscount($sp2629ef); if ($this->isHwDiscountIncluded) { if ($sp2629ef->getHwiIndicator() === 'M') { $sp11fca2 = $sp2629ef->getRowTotalInclTax() - $sp2629ef->getDiscountAmount() + $sp2629ef->getHwiAmount(); } else { $sp11fca2 = $sp2629ef->getRowTotalInclTax() - $sp2629ef->getDiscountAmount(); } $spe86b78 = null; } $spdadb9d += $sp11fca2 * 100 / ($sp2629ef->getTaxPercent() + 100); $sp81bff6 += $sp11fca2; $sp9f5deb += $spe86b78; } foreach ($sp06be97 as $sp74b8c9 => $sp405761) { if ($sp06be97[$sp74b8c9]['SAPArticleID'] && $sp06be97[$sp74b8c9]['Action'] !== Omnius_Superorder_Helper_Client::COMPONENT_ACTION_REMOVE) { $sp06be97[$sp74b8c9]['SAPArticleNetPrice'] = number_format($spdadb9d, 2, '.', ''); $sp06be97[$sp74b8c9]['SAPArticleGrossPrice'] = number_format($sp81bff6, 2, '.', ''); $sp06be97[$sp74b8c9]['SAPDiscount1'] = $spe86b78 ? number_format(round($sp9f5deb, 4), 2, '.', '') : '0.00'; $sp06be97[$sp74b8c9]['SAPDiscount2'] = number_format('0.0000', 2, '.', ''); } elseif ($sp06be97[$sp74b8c9]['Action'] === Omnius_Superorder_Helper_Client::COMPONENT_ACTION_REMOVE) { $sp06be97[$sp74b8c9]['SAPArticleID'] = null; } } } } protected function processMappers($sp223325, &$sp2ba766, &$sp30ca2a) { list($sp008ee3, $sp68625a) = $sp223325; $spdf4210 = $this->getMultimapperModel()->getMappersBySku($sp008ee3->getSku()); $sp8d4ba0 = $sp008ee3->getProduct(); if (!$sp8d4ba0->getServiceDescription()) { $sp8d4ba0 = $this->getModel('catalog/product')->load($sp8d4ba0->getId()); } $sp04c439 = false; foreach ($spdf4210 as $spd6d708) { $sp04c439 = $this->returnEnteredHeaderPrinted($sp04c439); foreach ($spd6d708->getData() as $sp40ef26 => $sp6b21fa) { if (!empty($sp6b21fa)) { $this->log("... {$sp40ef26}: {$sp6b21fa}"); } } $sp00d3cc = $this->getAddonModel()->getAddonByMapperId($spd6d708->getId()); $spe2ab18 = $this->serviceExpressionIsFalse($spd6d708); if ($spe2ab18 === false) { $this->log('... Service expression was evaluated to: true'); } $spf2ddc9 = [$sp00d3cc, $spe2ab18, $spd6d708, $sp008ee3, $sp8d4ba0, $sp68625a]; $this->processSocs($spf2ddc9, $sp2ba766, $sp30ca2a); } } protected function logEntries($spad77cf, &$sp6e3776) { $sp06be97 = [null, null, null]; if (count($spad77cf) != 0) { $spf48840 = $this->getModel('multimapper/mapper')->getMappersBySku($spad77cf[0]->getSku())->getFirstItem(); if ($spf48840->getId()) { $sp6e3776 = $this->getModel('omnius_multimapper/addon')->getSingleAddonByMapperId($spf48840->getId()); $this->log("Multimapper entries fetched:"); $this->log("----------------------------"); foreach ($spf48840->getData() as $sp40ef26 => $sp6b21fa) { if (!empty($sp6b21fa)) { $this->log("... {$sp40ef26}: {$sp6b21fa}"); } } $this->log("... ... Multimapper details entries:"); $this->log("... ... ----------------------------"); foreach ($sp6e3776->getData() as $sp40ef26 => $sp6b21fa) { if (!empty($sp6b21fa)) { $this->log("... ... {$sp40ef26}: {$sp6b21fa}"); } } } $sp26168c = $spad77cf[0]->getProduct(); $sp6e3776 = $this->getHandsetSoc($sp6e3776); $sp06be97 = [$spf48840, $sp26168c ? $sp26168c->getName() : null, strip_tags($sp26168c ? $sp26168c->getServiceDescription() : '')]; } return $sp06be97; } protected function updateAction(&$sp06be97, &$sp40ae88, $sp9580b1 = false) { foreach ($sp06be97 as &$sp405761) { if (isset($sp40ae88[$sp405761['SkuID']])) { if ($sp9580b1 && $sp40ae88[$sp405761['SkuID']] === self::COMPONENT_ACTION_REFUSE) { $sp405761['Action'] = self::COMPONENT_ACTION_REFUSE; } else { $sp40ae88[$sp405761['SkuID']] = $sp405761['Action']; } } } } protected function updateProductActivityTypes($sp439c5e, $sp40ae88) { foreach ($sp439c5e->getItems() as $sp008ee3) { if (isset($sp40ae88[$sp008ee3->getSku()])) { $this->saveProductActivity($sp008ee3, $sp40ae88); } } } public function getComponentsForMobilePackage(Omnius_Package_Model_Package $sp439c5e) { $this->isHwDiscountIncluded = false; $sp40ae88 = $sp06be97 = array(); $this->processContext = $sp439c5e->getSaleType(); $sp6e3776 = $sp68625a = null; $sp0f4664 = $sp439c5e->getItems(Vfde_Catalog_Model_Type::MOBILE_SUBTYPE_SUBSCRIPTION); if (isset($sp0f4664[0])) { $sp9c7da0 = $sp439c5e->getItems(null, array(Vfde_Catalog_Model_Type::MOBILE_SUBTYPE_SUBSCRIPTION, Vfde_Catalog_Model_Type::MOBILE_SUBTYPE_DEVICE)); $sp9c7da0 = array_merge($sp0f4664, $sp9c7da0); $sp2ba766 = $sp30ca2a = array(); $sp4e8465 = 1; foreach ($sp9c7da0 as $sp008ee3) { if (!$this->isHwDiscountIncluded && in_array(strtolower(Vfde_Checkout_Model_SalesRule_Quote_Discount::MINIMUM_HW_PRICE_CATEGORY), array_map('strtolower', $sp008ee3->getProduct()->getCategoryPaths()))) { $this->isHwDiscountIncluded = true; } $sp68625a = $this->getTariffOptionCategory($sp008ee3); $this->log(''); $this->log('Evaluating SKU: ' . $sp008ee3->getSku()); $this->log('... product index: ' . $sp4e8465++); $sp40ae88[$sp008ee3->getSku()] = $this->getComponentAction($sp008ee3); $sp1ffffe = [$sp008ee3, $sp68625a]; $this->processMappers($sp1ffffe, $sp2ba766, $sp30ca2a); } $spad77cf = $sp439c5e->getItemsWithForceQuoteItems(Vfde_Catalog_Model_Type::MOBILE_SUBTYPE_DEVICE); $sp2b7807 = $this->logEntries($spad77cf, $sp6e3776); if (empty($sp2ba766) && empty($sp6e3776)) { return null; } $sp7fc045 = $this->getShippingFeeNetPrice(); if ($sp439c5e->getPackageAction() == Omnius_Package_Model_Package::PACKAGE_ACTION_DEBIT_TO_CREDIT) { $sp439c5e->setComponentTn(['PhoneNumber' => $this->getComponentMsisdn($sp439c5e) ?: null]); } if ($sp2ba766) { $this->getMobileComponentData($sp2ba766, $sp30ca2a, $sp7fc045, $sp439c5e, $sp06be97); } $this->processHandsetSoc([$sp6e3776, $sp439c5e, $spad77cf, $sp2b7807, $sp7fc045], $sp06be97); } $this->updateAction($sp06be97, $sp40ae88); $this->setPreOrderingDataForMobilePackage($sp439c5e); $this->updateProductActivityTypes($sp439c5e, $sp40ae88); return empty($sp06be97) ? null : $sp06be97; } public function saveProductActivity($sp008ee3, $sp40ae88) { $sp008ee3->setProductActivityType($sp40ae88[$sp008ee3->getSku()])->save(); } public function calculateSapDeviceDiscount($sp2629ef) { $sp59fa27 = 0; if ($sp2629ef->getHwiIndicator() == "M") { $sp59fa27 += ($sp2629ef->getOriginalPrice() - $sp2629ef->getPriceInclTax() - $sp2629ef->getHwiAmount()) / (1 + $sp2629ef->getTaxPercent() / 100); } else { $sp59fa27 += ($sp2629ef->getOriginalPrice() - $sp2629ef->getPriceInclTax()) / (1 + $sp2629ef->getTaxPercent() / 100); } return $sp59fa27; } public function getPortingPhoneNumbers(Omnius_Package_Model_Package $sp439c5e, $sp6b2060 = null, $sp7f07db = false) { $sp8e0745 = $this->getHelper('omnius_service'); $sp06be97 = array(); $sp981e5c = 0; $spd5be92 = strtolower($sp439c5e->getType()); $sp51cebe = $this->getCheckout('provider[' . $spd5be92 . '][no_phones_transfer]'); if ($sp7f07db || !empty($sp51cebe)) { while (is_array($this->getCheckoutFieldDataArr("provider[" . $spd5be92 . "][phone_transfer_list][telephone][{$sp981e5c}]"))) { if ($this->getCheckout("provider[" . $spd5be92 . "][phone_transfer_list][telephone][{$sp981e5c}]") && $this->getCheckout("provider[" . $spd5be92 . "][phone_transfer_list][telephone_prefix][{$sp981e5c}]")) { $sp06be97[] = array('CountryCode' => $sp8e0745->getGeneralConfig('country_code') ? $sp8e0745->getGeneralConfig('country_code') : Vfde_Customer_Model_Customer::COUNTRY_CODE, 'PhoneNumber' => $this->getCheckout("provider[" . $spd5be92 . "][phone_transfer_list][telephone][{$sp981e5c}]"), 'LocalAreaCode' => $this->getCheckout("provider[" . $spd5be92 . "][phone_transfer_list][telephone_prefix][{$sp981e5c}]"), 'Type' => $sp7f07db ? null : $sp6b2060); if ($sp7f07db) { break; } } $sp981e5c++; } } return $sp06be97 ?: null; } public function setPreOrderingDataForMobilePackage($sp439c5e) { $sp0486be = Mage::getModel('checkout/cart')->getQuote(); if ($sp0486be) { foreach ($sp0486be->getAllItemsByPackageId($sp439c5e->getPackageId()) as $sp8652fa) { $spa3fda5 = $sp8652fa->getProductId(); $sp343f5f = $sp439c5e->getItemsByProductId($spa3fda5); $sp343f5f->setPreOrdering($sp8652fa->getPreOrdering())->save(); $sp343f5f->setEstimatedDeliveryDate($sp8652fa->getEstimatedDeliveryDate())->save(); } } } protected function processAddons($sp223325, &$sp4595ab) { list($sp33374c, $sp9aa7a3, $spe2ab18) = $sp223325; $sp4a6021 = $this->getAddonModel()->getAddonByMapperId($sp33374c->getId()); $sp93f21f = false; foreach ($sp4a6021 as $spdee135) { $spdee135->setData('sku', $sp33374c->getSku()); $spdee135->setData('componentType', $sp33374c->getComponentType()); if (($this->processContext == Omnius_Catalog_Model_ProcessContext::ACQ || $this->processContext == Omnius_Catalog_Model_ProcessContext::MIGCOC) && in_array($sp33374c->getSku(), $sp9aa7a3)) { $spce6fc9 = self::COMPONENT_ACTIVITY_TYPE_INDICATION_MANUAL; } else { $spce6fc9 = null; } $spdee135->setComponentActivityTypeIndication($spce6fc9); if ($this->serviceExpressionIsFalse($spdee135)) { continue; } if ($spe2ab18) { continue; } $sp4595ab[] = $spdee135; if (!$sp93f21f) { $this->log("... ... Multimapper details entries:"); $this->log("... ... ----------------------------"); $sp93f21f = true; } foreach ($spdee135->getData() as $sp40ef26 => $sp6b21fa) { if (!empty($sp6b21fa)) { $this->log("... ... {$sp40ef26}: {$sp6b21fa}"); } } } } public function getComponentsForCablePackage(Omnius_Package_Model_Package $sp439c5e) { $this->processContext = $sp439c5e->getSaleType(); $this->manuallyRefusedItems = $this->getRefusedComponentsAsSku($sp439c5e); $sp06be97 = $sp4595ab = []; list($sp9aa396, $sp40ae88, $spdc39fd, $sp9aa7a3) = $this->setSkusAndAction($sp439c5e); $sp87261f = $this->getMultimapperModel()->getMappersBySkus($sp9aa396); if ($sp87261f->count()) { $sp4e8465 = 1; foreach ($sp87261f as $sp33374c) { $this->log(''); $this->log('Evaluating SKU: ' . $sp33374c->getData('sku')); $this->log('... product index: ' . $sp4e8465++); $this->returnEnteredHeaderPrinted(false); foreach ($sp33374c->getData() as $sp40ef26 => $sp6b21fa) { if (!empty($sp6b21fa)) { $this->log("... {$sp40ef26}: {$sp6b21fa}"); } } if (($spe2ab18 = $this->serviceExpressionIsFalse($sp33374c)) === false) { $this->log('... Service expression was evaluated to: true'); } $this->processAddons([$sp33374c, $sp9aa7a3, $spe2ab18], $sp4595ab); } } foreach ($sp4595ab as $sp5b3e84) { if (Vfde_Core_Helper_Data::areAllTrue([!isset($spdc39fd['items'][$sp5b3e84->getSku()]), !in_array($sp5b3e84->getSku(), $sp9aa7a3)])) { continue; } $sp06be97[] = $this->getCableComponentsDetails($sp5b3e84, $sp439c5e, $spdc39fd, $sp9aa7a3, null); } $this->updateAction($sp06be97, $sp40ae88, true); $this->updateProductActivityTypes($sp439c5e, $sp40ae88); return !empty($sp06be97) ? $sp06be97 : null; } public function getComponents($sp439c5e, $sp0e4c43 = false, $spb07caf = []) { $this->dynaCoreHelper = $this->getHelper('vfde_core'); $this->inputParams = ['customer' => $this->getModel('vfde_configurator/expression_customer')->setPackage($sp439c5e), 'availability' => $this->getModel('vfde_configurator/expression_availability'), 'orderPackage' => $this->getModel('vfde_configurator/expression_package')->setPackage($sp439c5e), 'agent' => $this->getModel('vfde_configurator/expression_agent')]; $this->setInputParamsOrder($sp439c5e, $sp0e4c43); if (empty($this->shippingFee[$sp439c5e->getPackageId()])) { list($sp630982, $sp77f2c9) = $this->setSuperorderItemsAndPackageIds($sp0e4c43, $spb07caf, $sp439c5e); if (!empty($sp630982)) { $sp7fc045 = array(); foreach ($sp630982 as $sp3664e8 => $spa93dca) { if ($sp439c5e->getPackageId() != $sp3664e8) { continue; } $sp159184 = $this->getHelper('vfde_checkout/fields')->getOrderCheckoutFieldsByPackage(Vfde_Checkout_Model_Client_ShippingFeeCalculateClient::SHIPPING_FEE_PAIDAMOUNT_CHECKOUT_STEP, $sp77f2c9); $sp610c74 = $sp159184['paidAmount[pakket][' . $sp3664e8 . ']'] ?? 0; foreach ($spa93dca as $sp008ee3) { if ($sp008ee3->getSku() == Vfde_Catalog_Model_Type::MOBILE_SHIPPING_SKU) { $sp7fc045[$sp3664e8] = ['PaidAmount' => number_format((double) $sp610c74, 2, '.', ''), 'GrossPrice' => $sp008ee3->getPriceInclTax(), 'NetPrice' => $sp008ee3->getPrice()]; break 2; } } } $this->setShippingFee($sp439c5e, $sp7fc045); } } $this->log(''); $this->log('Evaluating multimappers for package: ' . $sp439c5e->getPackageId()); if (Vfde_Core_Helper_Data::areAllTrue([!empty($sp439c5e->getInstalledBaseProducts()), $sp439c5e->getInitialInstalledBaseProducts()])) { if ($sp439c5e->isFixed()) { return $this->getComponentsForFixedInstalledBase($sp439c5e); } return $this->getComponentsForInstalledBase($sp439c5e); } $sp06be97 = $this->getComponentsForPackageType($sp439c5e, $sp0e4c43); if ($sp06be97 !== false) { return $sp06be97; } return null; } public function getHardwareComponents($sp439c5e, $sp0e4c43) { $sp9b7456 = Vfde_MultiMapper_Model_Mapper::OGW_COMPONENT_ID_HARDWARE; $sp40889c = $this->getModel('multimapper/mapper'); $sp4a1190 = $spd83bed = $sp9aa396 = []; $sp24a771 = $spce6fc9 = $sp0af27c = null; foreach ($this->packageItems as $sp008ee3) { $spdf4210 = $sp40889c->getFilteredMappers(array('sku' => $sp008ee3->getSku(), 'ogw_component_id_reference' => $sp9b7456, 'direction' => Vfde_MultiMapper_Model_Mapper::DIRECTION_BOTH)); foreach ($spdf4210 as $spd6d708) { if ($this->serviceExpressionIsFalse($spd6d708)) { continue; } $sp4a6021 = $this->getModel('omnius_multimapper/addon')->getAddonsWithDirection($spd6d708->getId(), $this->processContext, Vfde_MultiMapper_Model_Mapper::DIRECTION_OUT); foreach ($sp4a6021 as $spdee135) { if (Vfde_Core_Helper_Data::isAnyTrue([$this->serviceExpressionIsFalse($spdee135), !$this->hasValidBasketAction($sp008ee3, $spdee135)])) { continue; } if ($spc75609 = $this->getFnComponentAdditionalData($sp008ee3, $spdee135, $sp439c5e->getParentAccountNumber(), $sp439c5e->getServiceLineId(), $sp0e4c43)) { $sp4a1190 = array_merge($sp4a1190, $spc75609); $sp24a771 = $this->getItemIfIsNotNull($sp24a771, $spd6d708->getComponentType()); $spce6fc9 = $this->getItemIfIsNotNull($spce6fc9, $this->getComponentActivityTypeIndication($sp008ee3)); $sp0af27c = $this->getItemIfIsNotNull($sp0af27c, $this->getFnComponentAction($sp008ee3)); $sp9aa396[] = $sp008ee3->getSku(); } } } } if ($this->processContext != Omnius_Catalog_Model_ProcessContext::ACQ) { $spbf05f5 = $this->getFNInstalledBaseData($sp9b7456, $sp439c5e->getParentAccountNumber(), $sp4a1190, $sp439c5e->getServiceLineId()); $spbf05f5 = $this->overwriteInstallBaseComponents($spbf05f5); $sp4a1190 = array_merge($sp4a1190, $spbf05f5); } if (!empty($sp4a1190)) { $sp4a1190 = $this->removeGenerateContractDuplicateComponents($sp4a1190, $sp0e4c43); $spcfc051 = $this->getSplitComponentAdditionalData($sp4a1190); $sp7fc045 = $this->getShippingFeeNetPrice(); foreach ($spcfc051 as $sp220e09 => $sp65646d) { $spe963fe = array('SourceComponentID' => $sp9b7456, 'Action' => $sp0af27c, 'ComponentType' => $sp24a771, 'ComponentActivityTypeIndication' => $spce6fc9, 'SkuID' => implode(",", array_unique($sp9aa396)), 'ComponentAdditionalData' => $sp65646d, 'TariffOptionName' => null, 'SimOnlyTariffInd' => null, 'MultiSimList' => null); $spe963fe = array_merge($spe963fe, $this->componentDefaults()); $this->getShippingFeeNetPriceAndText($sp7fc045, $spe963fe); $spd83bed[] = $spe963fe; } } return $spd83bed; } public function getComponentsForFixedPackage(Omnius_Package_Model_Package $sp439c5e, $sp0e4c43) { $this->processContext = $sp439c5e->getSaleType(); $sp40ae88 = $sp06be97 = array(); $spa93dca = $sp439c5e->getItems(); $this->packageItems = $spa93dca; $sp24a771 = null; $sp40889c = $this->getModel('multimapper/mapper'); foreach (Vfde_MultiMapper_Model_Mapper::getMergedComponentIds() as $sp9b7456) { $sp9aa396 = $sp4a1190 = []; $sp0af27c = $spdf280a = $sp2ce64b = null; $sp4e8465 = 1; foreach ($spa93dca as $sp008ee3) { $spdf4210 = $sp40889c->getFilteredMappers(array('sku' => $sp008ee3->getSku(), 'ogw_component_id_reference' => $sp9b7456, 'direction' => Vfde_MultiMapper_Model_Mapper::DIRECTION_BOTH)); if (count($spdf4210)) { $this->log("******************************************"); $this->log("Processing mappers with OGW reference id: " . $sp9b7456); $this->log("----------------------------------------- "); $this->log("Evaluating SKU: " . $sp008ee3->getSku()); $this->log('... product index: ' . $sp4e8465); foreach ($spdf4210 as $spd6d708) { if ($this->serviceExpressionIsFalse($spd6d708)) { $this->log("Mapper service expression is false, skipping all addons"); continue; } $this->getComponentsForFP([$sp439c5e, $spd6d708, $sp008ee3, $sp0e4c43], $sp9aa396, $sp4a1190, $sp2ce64b, $spdf280a, $sp0af27c); } $sp4e8465++; } } if ($this->processContext != Omnius_Catalog_Model_ProcessContext::ACQ) { $spbf05f5 = $this->getFNInstalledBaseData($sp9b7456, $sp439c5e->getParentAccountNumber(), $sp4a1190, $sp439c5e->getServiceLineId()); $spbf05f5 = $this->overwriteInstallBaseComponents($spbf05f5); $sp4a1190 = array_merge($sp4a1190, $spbf05f5); } if (!empty($sp4a1190)) { $sp4a1190 = $this->removeGenerateContractDuplicateComponents($sp4a1190, $sp0e4c43); $sp804f01 = array_unique($sp9aa396); $spe963fe = array('SourceComponentID' => $sp9b7456, 'Action' => $sp0af27c ?? self::COMPONENT_ACTION_EXISTING, 'ComponentType' => $sp2ce64b, 'ComponentActivityTypeIndication' => $spdf280a ?? self::COMPONENT_ACTIVITY_TYPE_INDICATION_AUTOMATIC, 'SkuID' => implode(',', $sp804f01), 'ComponentAdditionalData' => $sp4a1190, 'SimOnlyTariffInd' => null, 'MultiSimList' => null); $spe963fe = array_merge($spe963fe, $this->componentDefaults()); foreach ($sp804f01 as $spcc0f2f) { $sp40ae88[$spcc0f2f] = $spe963fe['Action']; } $sp06be97[] = $spe963fe; } } $sp06be97 = array_merge($sp06be97, $this->getHardwareComponents($sp439c5e, $sp0e4c43)); $this->setActivityType($sp439c5e, $sp06be97, $sp40ae88); return empty($sp06be97) ? null : $sp06be97; } protected function getFNInstalledBaseData($sp9b7456, $sp33f611, $sp2880e3, $spa24247) { $sp4ee75e = $this->getCustomerSession(); $sp5648f5 = []; if ($spd5febf = $sp4ee75e->getCustomerByParentAccountNumber($sp33f611)) { if ($sp9b7456 == Vfde_MultiMapper_Model_Mapper::OGW_COMPONENT_ID_SALES_PACKAGE) { $spa4d455 = isset($spd5febf['Contract'][0]) ? $spd5febf['Contract'][0] : $spd5febf['Contract']; $sp5648f5 = $spa4d455['Product']['Component']['ComponentAdditionalData']; $this->removeAccessComponents($sp5648f5); } elseif ($sp9b7456 == Vfde_MultiMapper_Model_Mapper::OGW_COMPONENT_ID_HARDWARE) { $this->mergeIbWithAdditional($spd5febf, $sp33f611, $sp5648f5); $this->removeAccessComponents($sp5648f5); } elseif ($sp9b7456 == Vfde_MultiMapper_Model_Mapper::OGW_COMPONENT_ID_ACCESS) { $this->getFnIbSubscriptions($spd5febf, $sp369f8a); $this->getFnIbDataForAccess($sp369f8a, $sp5648f5); $this->getFnIbDataDevice($spd5febf, $sp33f611, $sp5648f5); } else { $this->getFnIbContracts($spd5febf, $sp19ca60); $this->getFnIbContractSubscriptions($sp19ca60, $spa24247, $sp369f8a); $this->getFnIbData($sp369f8a, $sp9b7456, $sp5648f5); $this->removeAccessComponents($sp5648f5); } } return $this->removeDuplicateComponents($sp5648f5, $sp2880e3); } protected function removeDuplicateComponents($sp1ac8a2, $sp2880e3) { $spdeffe7 = false; $spb8b0d2 = array(); foreach ($sp2880e3 as $spf46da8) { if ($spf46da8['Code'] == 'processingType') { $spdeffe7 = true; $spb8b0d2[] = $spf46da8['AdditionalValue']; } } foreach ($sp1ac8a2 as $sp40ef26 => $sp65646d) { if ($spdeffe7 && $sp65646d['Code'] == 'processingType' && in_array($sp65646d['AdditionalValue'], $spb8b0d2)) { unset($sp1ac8a2[$sp40ef26]); } elseif ($sp65646d['Code'] == 'refComponentId') { unset($sp1ac8a2[$sp40ef26]); } } return $sp1ac8a2; } protected function removeGenerateContractDuplicateComponents($sp4a1190, $sp0e4c43) { $sp53d41d = []; foreach ($sp4a1190 as $sp40ef26 => $sp6b21fa) { if (!$sp0e4c43 && $sp6b21fa['Code'] == 'GenerateContract') { unset($sp4a1190[$sp40ef26]); continue; } $sp53d41d[] = $sp6b21fa; $spca5f76 = array_column($sp53d41d, 'Code'); $sp6bf7f6 = array_count_values($spca5f76); if ($sp6bf7f6['GenerateContract'] > 1 && in_array('GenerateContract', $spca5f76)) { unset($sp53d41d[$sp40ef26]); } } return $sp53d41d; } protected function removeAccessComponents(&$sp5648f5) { foreach ($sp5648f5 as $sp40ef26 => $spcdf811) { if (strpos($spcdf811['AdditionalValue'], '/accesses/') === 0) { unset($sp5648f5[$sp40ef26]); } } } protected function getCableComponentsDetails($sp5b3e84, $sp439c5e, $spdc39fd, $sp9aa7a3, $sp7fc045) { if (!$sp5b3e84->getTechnicalId()) { return null; } $spe7d719 = $this->getDeviceDetails($sp5b3e84, $sp439c5e); $sp3aaad1 = $sp5b3e84->getSku(); $sp008ee3 = $spdc39fd['items'][$sp3aaad1] ?? null; $spe55f48 = isset($spdc39fd['dropped'][$sp3aaad1]) && $spdc39fd['dropped'][$sp3aaad1]; $spd14b79 = in_array($sp3aaad1, $sp9aa7a3) ? $sp3aaad1 : null; $sp123385 = $sp008ee3 ? $this->getCableILSComponentAction($sp008ee3, $sp9aa7a3, $spe55f48, $spd14b79) : null; $sp06be97 = $this->componentArray($sp5b3e84, $sp123385, $sp5b3e84->getComponentType()); $sp06be97['ComponentActivityTypeIndication'] = $sp5b3e84->getComponentActivityTypeIndication() ?: ($sp008ee3 != null ? $this->getComponentActivityTypeIndication($sp008ee3) : null); $sp06be97['DeviceID'] = $sp5b3e84->getTechnicalId() == $spe7d719['productSku'] ? $spe7d719['sn'] : null; $sp06be97['ProductID'] = $sp5b3e84->getTechnicalId(); $sp06be97['ShippingFeeNetPrice'] = $sp7fc045; $sp06be97['MultiSimList'] = null; return $sp06be97; } protected function getMobileComponentData($sp2ba766, $sp30ca2a, $sp7fc045, $sp439c5e, &$sp06be97) { foreach ($sp2ba766 as $spac72f6) { $sp840d96 = $this->setComponentData($sp30ca2a, $sp439c5e, $spac72f6, $sp7fc045); $this->setComponentActivityTypeIndication($sp439c5e, $spac72f6, $sp840d96); if (Vfde_Core_Helper_Data::areAllTrue([strtolower($sp439c5e->getType()) == strtolower(Vfde_Catalog_Model_Type::TYPE_MOBILE), isset($sp840d96['SAPArticleID'])])) { $sp840d96['ComponentAdditionalData'] = array('Code' => 'SimOnly', 'Value' => $spac72f6->getData('isSimOnly') == 1 ? 'Yes' : 'No'); if ($spac72f6->getData('isSimOnly')) { $this->isSapSimOnlyPackage[$sp439c5e->getId()] = true; } } $sp06be97[] = $sp840d96; if (!isset($this->isSapSimOnlyPackage[$sp439c5e->getId()]) || !$this->isSapSimOnlyPackage[$sp439c5e->getId()]) { $spad77cf = $sp439c5e->getItems(Vfde_Catalog_Model_Type::MOBILE_SUBTYPE_DEVICE); $spdadb9d = 0; $sp81bff6 = 0; $sp9f5deb = 0; $this->_calculator = $this->getSingleton('tax/calculation'); foreach ($spad77cf as $sp2629ef) { $spdadb9d += $sp2629ef->getOriginalPrice() * 100 / ($sp2629ef->getTaxPercent() + 100); $sp81bff6 += $sp2629ef->getOriginalPrice(); $sp9f5deb += $this->calculateSapDeviceDiscount($sp2629ef); } foreach ($sp06be97 as $sp74b8c9 => $sp405761) { if ($sp06be97[$sp74b8c9]['SAPArticleID']) { $sp06be97[$sp74b8c9]['SAPArticleNetPrice'] = number_format($spdadb9d, 2, '.', ''); $sp06be97[$sp74b8c9]['SAPArticleGrossPrice'] = number_format($sp81bff6, 2, '.', ''); $sp06be97[$sp74b8c9]['SAPDiscount1'] = number_format(round($sp9f5deb, 4), 2, '.', ''); $sp06be97[$sp74b8c9]['SAPDiscount2'] = number_format('0.0000', 2, '.', ''); } } } } } public function getDeviceId($sp439c5e) { $sp9726bc = $this->getModel('vfde_superorder/client_submitOrderClient_packageSubscriber'); $spbe0107 = $sp9726bc->getDeviceData($sp439c5e); return !empty($spbe0107[0]['ID']) ? $spbe0107[0]['ID'] : null; } protected function processFixedIbAddons($sp223325, &$sp06be97) { list($sp02efce, $spec52f8, $spfd8b82, $sp541598) = $sp223325; $spaac9e6 = $sp02efce->getExtraIndicator('HIS'); $sp24a771 = $spec52f8->getComponentType(); $sp12e594 = ['serviceCode', 'serviceBillingName']; $sp6fffc1 = $this->getComponentModel(); $sp6fffc1->setAddons($spfd8b82); $sp256b10 = $spbe41e8 = $this->componentArray($sp02efce, self::COMPONENT_ACTION_ADD, self::COMPONENT_ACTIVITY_TYPE_INDICATION_AUTOMATIC); $sp256b10['ComponentAdditionalData'] = $spbe41e8['ComponentAdditionalData'] = []; if (in_array($sp02efce->getSku(), $sp541598)) { if ($sp6fffc1->isVoice()) { $sp256b10['Action'] = self::COMPONENT_ACTION_CHANGE; $this->setComponentAdditionalData($spfd8b82, $sp256b10, $spbe41e8); $sp06be97[] = $sp256b10; $sp06be97[] = $spbe41e8; $sp40ae88[$sp02efce->getSku()] = $spbe41e8['Action']; } else { $sp256b10['Action'] = self::COMPONENT_ACTION_EXISTING; $sp256b10['ComponentType'] = $spaac9e6 == null ? $sp24a771 : $spaac9e6; foreach ($spfd8b82 as $spfd2f85) { if ($spfd2f85->getAddonName() != 'processingType') { $spee4aab['ComponentAdditionalData'][] = $this->setCodeValForComponent($spfd2f85); } } $sp06be97[] = $sp256b10; $sp40ae88[$sp02efce->getSku()] = $sp256b10['Action']; } } else { foreach ($spfd8b82 as $spfd2f85) { $sp8ed7ef = in_array($spfd2f85->getAddonName(), $sp12e594); if ($sp8ed7ef || $spfd2f85->getAddonName() == self::ADDON_NAME_FUNCTION_ID) { $sp256b10['ComponentAdditionalData'][] = $this->setCodeValForComponent($spfd2f85); } if (strpos($spfd2f85->getAddonName(), 'condition') !== false) { $spbe41e8['ComponentAdditionalData'][] = $this->setCodeValForComponent($spfd2f85); } } $sp06be97[] = $sp256b10; $sp06be97[] = $spbe41e8; $sp40ae88[$sp02efce->getSku()] = $spbe41e8['Action']; } } public function getComponentsForFixedInstalledBase($sp439c5e) { $sp40ae88 = $sp06be97 = array(); $sp541598 = explode(',', $sp439c5e->getInitialInstalledBaseProducts()); $sp27a8e4 = $sp439c5e->getInstalledBaseProducts(); $sp4e8465 = 1; foreach ($sp27a8e4 as $sp9a64a0) { $sp02efce = $sp9a64a0->getProduct(); $this->log(''); $this->log('Evaluating SKU: ' . $sp02efce->getSku()); $this->log('... product index: ' . $sp4e8465++); $spec52f8 = $this->getMultimapperModel()->getSingleMappersBySku($sp02efce->getSku()); if (!$spec52f8 || !$spec52f8->getId()) { continue; } $this->log("Multimapper entries fetched:"); $this->log("----------------------------"); foreach ($spec52f8->getData() as $sp40ef26 => $sp6b21fa) { if (!empty($sp6b21fa)) { $this->log("... {$sp40ef26}: {$sp6b21fa}"); } } $sp4f6c22 = $spec52f8->getData('entity_id'); $spfd8b82 = $this->getAddonModel()->getAddonByMapperId($sp4f6c22, $sp439c5e->getSaleType()); if (!$spfd8b82->count()) { continue; } $this->log("... ... Multimapper details entries:"); $this->log("... ... ----------------------------"); $sp223325 = [$sp02efce, $spec52f8, $spfd8b82, $sp541598]; $this->processFixedIbAddons($sp223325, $sp06be97); } $this->updateAction($sp06be97, $sp40ae88); $this->updateProductActivityTypes($sp439c5e, $sp40ae88); return empty($sp06be97) ? null : $sp06be97; } protected function processItemAddonsForIB($sp223325, &$sp06be97) { list($sp439c5e, $sp02efce, $sp488724, $spb6c95a, $spfd8b82) = $sp223325; $spd91268 = $sp02efce->getSku(); foreach ($spfd8b82 as $spfd2f85) { $sp24a771 = null; if ($spfd2f85->getData('addon_name') == 'ComponentType') { $sp24a771 = $spfd2f85->getData('addon_value'); } if (in_array($spd91268, $sp488724)) { $sp0af27c = self::COMPONENT_ACTION_REMOVE; } else { if (in_array($spd91268, $spb6c95a)) { $sp0af27c = self::COMPONENT_ACTION_ADD; } else { $sp0af27c = self::COMPONENT_ACTION_EXISTING; } } if ($sp439c5e->isMobile()) { $sp48d9f0 = $this->packageContainsBundleMarker($sp439c5e); $sp2cc4ba = $spfd2f85->getTechnicalId() == Vfde_Customer_Model_Client_RetrieveCustomerInfo::KIAS_ELIGIBLE_BUNDLE_SOC; if ($sp48d9f0 && $sp2cc4ba) { $sp0af27c = self::COMPONENT_ACTION_IGNORE; } } $sp06be97[] = $this->initResultDataForInstalledBase(array_merge($sp223325, [$spfd2f85, $sp24a771, $sp0af27c])); $sp40ae88[$spd91268] = $sp06be97['Action']; $this->setSapResult($sp06be97); foreach ($spfd2f85->getData() as $sp40ef26 => $sp6b21fa) { if (!empty($sp6b21fa)) { $this->log("... ... {$sp40ef26}: {$sp6b21fa}"); } } } } public function getComponentsForInstalledBase($sp439c5e) { $sp40ae88 = $sp06be97 = array(); $sp50f4f6 = $sp439c5e->getInstalledBaseProducts(); $sp28f1a9 = array_map(function ($sp008ee3) { return $sp008ee3->getSku(); }, $sp50f4f6); $speeac15 = explode(',', $sp439c5e->getInitialInstalledBaseProducts()); $spb6c95a = array_diff($sp28f1a9, $speeac15); $sp488724 = array_diff($speeac15, $sp28f1a9); $spd72100 = array_merge($spb6c95a, $sp488724); $sp1830c6 = $sp439c5e->getData(); if (Vfde_Core_Helper_Data::areAllTrue([empty($spb6c95a), empty($sp488724), $sp1830c6['bundle_types'] == Vfde_Bundles_Model_BundleRule::TYPE_RED_PLUS])) { $spd72100 = $sp28f1a9; } $spf46a88 = $this->getProductModel()->getCollection()->addAttributeToFilter('sku', array('in' => $spd72100)); if (!$spf46a88->count()) { return null; } $sp4e8465 = 1; foreach ($spf46a88 as $sp02efce) { $spd91268 = $sp02efce->getSku(); $this->log(''); $this->log('Evaluating SKU: ' . $spd91268); $this->log('... product index: ' . $sp4e8465++); $spec52f8 = $this->getMultimapperModel()->getMappersBySku($spd91268); if ($sp439c5e->isMobile()) { $spec52f8 = $spec52f8->addFieldtoFilter('component_type', array('eq' => 'TariffOption')); } $spec52f8 = $spec52f8->setPageSize(1)->setCurPage(1)->getLastItem(); $sp4f6c22 = $spec52f8->getId(); if (!$sp4f6c22) { continue; } $this->log("Multimapper entries fetched:"); $this->log("----------------------------"); foreach ($spec52f8->getData() as $sp40ef26 => $sp6b21fa) { if (!empty($sp6b21fa)) { $this->log("... {$sp40ef26}: {$sp6b21fa}"); } } $spfd8b82 = $this->getItemAddons($sp439c5e, $sp4f6c22); if (!$spfd8b82->count()) { continue; } $this->log("... ... Multimapper details entries:"); $this->log("... ... ----------------------------"); $sp223325 = [$sp439c5e, $sp02efce, $sp488724, $spb6c95a, $spfd8b82, $spec52f8]; $this->processItemAddonsForIB($sp223325, $sp06be97); } $this->updateAction($sp06be97, $sp40ae88); $this->updateProductActivityTypes($sp439c5e, $sp40ae88); return empty($sp06be97) ? null : $sp06be97; } protected function packageContainsBundleMarker($sp439c5e) { $sp28f1a9 = []; $spc7d726 = []; if (!empty($sp439c5e->getInstalledBaseProducts()) && $sp439c5e->getInitialInstalledBaseProducts()) { $sp28f1a9 = array_map(function ($sp9a64a0) { return $sp9a64a0->getSku(); }, $sp439c5e->getInitialInstalledBaseProducts()); } if (count($sp28f1a9)) { $spc7d726 = $this->getHelper('multimapper')->getSkusBySoc(Vfde_Customer_Model_Client_RetrieveCustomerInfo::KIAS_PART_OF_BUNDLE_SOC); } $sp9fe3b4 = array_intersect($spc7d726, $sp28f1a9); return count($sp9fe3b4); } public function getResidentialBuildingInfo($sp84713c = true) { $sp787036 = array(); $sp787036[] = $this->getProviderHomeType(true); $sp13696a = $this->getCheckout('provider[home_entrance]'); $sp9c8eec = Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::getDslHomeEntranceOptionsForOGW(); $sp787036[] = isset($sp9c8eec[$sp13696a]) ? $sp9c8eec[$sp13696a] : null; $sp8b9dfb = $this->getCheckout('provider[home_floor]'); $spa684d3 = Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::getDslHomeFloorsOptions(); $sp787036[] = isset($spa684d3[$sp8b9dfb]) ? $spa684d3[$sp8b9dfb] : null; $spaf9dd7 = $this->getCheckout('provider[home_location]'); $sp670ef7 = Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::getDslApartmentLocationOptionsForOGW(); $sp787036[] = isset($sp670ef7[$spaf9dd7]) ? $sp670ef7[$spaf9dd7] : null; $sp787036[] = $this->getCheckout('provider[phone_socket_no]'); if ($sp84713c) { $sp787036[] = $this->getCheckout('provider[comment_installer]'); } $sp787036 = array_filter($sp787036); return $sp787036 ? implode(', ', $sp787036) : null; } protected function getCableILSComponentAction($sp008ee3, $sp9aa7a3, $spe55f48 = false, $spd14b79 = null) { if ($this->processContext == Omnius_Catalog_Model_ProcessContext::ACQ || $this->processContext == Omnius_Catalog_Model_ProcessContext::MIGCOC) { $sp195552 = isset($sp008ee3) ? $sp008ee3->getSku() : $spd14b79; return in_array($sp195552, $sp9aa7a3) ? self::COMPONENT_ACTION_REFUSE : self::COMPONENT_ACTION_ADD; } if ($spe55f48) { return self::COMPONENT_ACTION_REMOVE; } return $sp008ee3 != null ? $this->getComponentAction($sp008ee3) : null; } public function getCarrierContractCancel($spd5be92, $sp3664e8) { return $this->getCheckout("provider[{$spd5be92}][change_provider][{$sp3664e8}]") == Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::YES_CHANGE_PROVIDER ? 'true' : 'false'; } public function getSepaMandate($sp439c5e) { $sp66e01b = null; $spd1296c = null; $spf6a5a7 = $this->getCheckout('payment[monthly][type]'); $spd1b667 = $this->getCheckoutHelper()->checkCableUnityProduct($this->getQuote()->getCartPackages()); switch ($spf6a5a7) { case Vfde_Checkout_Helper_Fields::PAYMENT_SPLIT_PAYMENT: $spe9b6a6 = $this->getCheckout('payment[pakket][' . $sp439c5e->getPackageId() . '][type]'); switch ($spe9b6a6) { case Vfde_Checkout_Helper_Fields::PAYMENT_DIRECT_DEBIT: $sp66e01b = (int) $this->getCheckout('payment[pakket][' . $sp439c5e->getPackageId() . '][sepa_mandate][type][new]'); $spd1296c = $this->getCheckout('payment[pakket][' . $sp439c5e->getPackageId() . '][sepa_mandate][type][new_existing]'); break; case Vfde_Checkout_Helper_Fields::PAYMENT_DIRECT_DEBIT_DIFF: $sp66e01b = (int) $this->getCheckout('payment[pakket][' . $sp439c5e->getPackageId() . '][sepa_mandate][type][diff]'); $spd1296c = $this->getCheckout('payment[pakket][' . $sp439c5e->getPackageId() . '][sepa_mandate][type][diff_existing]'); break; default: $sp66e01b = null; $spd1296c = null; } break; case Vfde_Checkout_Helper_Fields::PAYMENT_DIRECT_DEBIT: $sp66e01b = (int) $this->getCheckout('payment[monthly][sepa_mandate][type][new]'); $spd1296c = $this->getCheckout('payment[monthly][sepa_mandate][type][new_existing]'); break; case Vfde_Checkout_Helper_Fields::PAYMENT_DIRECT_DEBIT_DIFF: $sp66e01b = (int) $this->getCheckout('payment[monthly][sepa_mandate][type][diff]'); $spd1296c = $this->getCheckout('payment[monthly][sepa_mandate][type][diff_existing]'); break; default: $sp66e01b = null; $spd1296c = null; } $sp4dec47 = null; $spd1296c = (int) $spd1296c; switch (true) { case $spd1296c == 1 && !$spd1b667: $sp4dec47 = 'EXISTING'; break; case $sp66e01b === 0 && !$spd1b667: $sp4dec47 = 'ONLINE'; break; case $sp66e01b === 1 || $spd1b667 === true: $sp4dec47 = 'PAPER'; break; default: $sp4dec47 = 'EXISTING'; } return $sp4dec47; } protected function addInstallBaseOverwrite($spdee135) { $this->installBaseOverwrites[] = array('Code' => $spdee135->getData('addon_name'), 'Value' => $spdee135->getData('addon_value'), 'AdditionalValue' => $spdee135->getData('addon_additional_value')); } protected function getFnComponentAdditionalData($sp008ee3, $spdee135, $spd989d3, $spa24247, $sp0e4c43 = false) { $sp3936e2 = $this->getCheckoutHelper()->isRetailChannel(); if (empty($spdee135->getData('addon_name')) || empty($spdee135->getData('addon_additional_value'))) { return null; } if ($spdee135->getData('attribute_action') == Vfde_MultiMapper_Model_Addon::ATTRIBUTE_ACTION_TAKEOVER && empty($spdee135->getData('addon_value'))) { return $this->getInstallBaseAdditionalData($spdee135, $spd989d3, $spa24247); } elseif ($spdee135->getData('attribute_action') == Vfde_MultiMapper_Model_Addon::ATTRIBUTE_ACTION_OVERWRITE) { $this->addInstallBaseOverwrite($spdee135); return null; } elseif (!empty($spdee135->getData('addon_value'))) { if ($spdee135->getData('addon_name') == self::ATTRIBUTE_CODE_TARGETDATE) { $sp32ec56 = $this->getCheckout('target_date[' . $sp008ee3->getPackageId() . '][' . $sp008ee3->getPackageType() . ']'); if ($sp32ec56) { return array(array('Code' => $spdee135->getData('addon_name'), 'Value' => $sp32ec56, 'AdditionalValue' => $spdee135->getData('addon_additional_value'))); } } else { if ($spdee135->getData('addon_name') == self::ATTRIBUTE_CODE_ORDER_ID && $spdee135->getData('addon_value') == self::ATTRIBUTE_CODE_ORDER_ID) { $spc93e16 = Mage::getSingleton('customer/session')->getCustomerOrders(); foreach ($spc93e16['dsl'] as $sp1fb39e) { return array(array('Code' => $spdee135->getData('addon_name'), 'Value' => $sp1fb39e['order_id'], 'AdditionalValue' => $spdee135->getData('addon_additional_value'))); } } elseif ($spdee135->getData('addon_name') == self::ATTRIBUTE_CODE_HOME_ID) { if (!empty($this->getCheckout('provider[home_id]'))) { return array(array('Code' => $spdee135->getData('addon_name'), 'Value' => $this->getCheckout('provider[home_id]'), 'AdditionalValue' => $spdee135->getData('addon_additional_value'))); } else { return null; } } elseif ($spdee135->getData('addon_name') == Vfde_Address_Model_Client_CheckServiceAbilityClient::SERVICEABILITY_ADDITIONAL_ITEM_PROPERTY_MULTIMAPPER) { $sped909d = Mage::getSingleton('omnius_address/storage'); if ($sped909d->getProjectReferenceValue()) { return array(array('Code' => $spdee135->getData('addon_name'), 'Value' => $sped909d->getProjectReferenceValue(), 'AdditionalValue' => $spdee135->getData('addon_additional_value'))); } else { return null; } } elseif ($spdee135->getData('addon_name') == Vfde_Address_Model_Client_CheckServiceAbilityClient::FIBER_ADDITION_ACCESS_SUPPLIER) { $sped909d = Mage::getSingleton('omnius_address/storage'); if ($sped909d->getAccessSupplierValue() && ($sp3936e2 || !$sp3936e2 && !$sp0e4c43)) { return array(array('Code' => $spdee135->getData('addon_name'), 'Value' => $sped909d->getAccessSupplierValue(), 'AdditionalValue' => $spdee135->getData('addon_additional_value'))); } else { return null; } } elseif (strtoupper($spdee135->getData('addon_name')) == Vfde_Address_Model_Client_CheckServiceAbilityClient::FIBER_ADDITION_ROLLOUT_STATUS) { $sped909d = Mage::getSingleton('omnius_address/storage'); if ($sped909d->getRollOutStatusValue() && ($sp3936e2 || !$sp3936e2 && !$sp0e4c43)) { return array(array('Code' => $spdee135->getData('addon_name'), 'Value' => $sped909d->getRollOutStatusValue(), 'AdditionalValue' => $spdee135->getData('addon_additional_value'))); } else { return null; } } else { return array(array('Code' => $spdee135->getData('addon_name'), 'Value' => $spdee135->getData('addon_value'), 'AdditionalValue' => $spdee135->getData('addon_additional_value'))); } } } else { return null; } } protected function overwriteInstallBaseComponents($sp87f123) { foreach ($this->installBaseOverwrites as $sp1d5d7d) { foreach ($sp87f123 as &$sp65646d) { if ($sp1d5d7d['Code'] == $sp65646d['Code'] && $sp1d5d7d['AdditionalValue'] == $sp65646d['AdditionalValue']) { if ($sp65646d['Code'] == self::ATTRIBUTE_CODE_ORDER_ID && $sp65646d['Value'] == self::ATTRIBUTE_CODE_ORDER_ID) { $spc93e16 = Mage::getSingleton('customer/session')->getCustomerOrders(); foreach ($spc93e16['dsl'] as $sp1fb39e) { $sp65646d['Value'] = $sp1fb39e['order_id']; } } else { $sp65646d['Value'] = $sp1d5d7d['Value']; } } } } return $sp87f123; } public function throwErrorsIfNotSuccess($sp8b8c55) { if (!$sp8b8c55['Success']) { $spd4e938 = ''; if (is_string($sp8b8c55['Status']['StatusReasonCode'])) { $spd4e938 = $sp8b8c55['Status']['StatusReasonCode']; } if (is_string($sp8b8c55['Status']['StatusReason'])) { $spd4e938 .= (!empty($spd4e938) ? ':' : '') . $sp8b8c55['Status']['StatusReason']; } if (!$spd4e938) { $spd4e938 = $this->__('Could not create order'); } throw new Exception($spd4e938); } } public function getEndOfTermMode($spd5be92 = null) { $sp06be97 = null; $sp1e2c25 = $this->getCheckout('provider_notice_date_radio[' . strtolower($spd5be92) . ']'); switch ($sp1e2c25) { case Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::CONTRACT_ALREADY_TERMINATED: $sp06be97 = Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::TERMINATION_DATE_NOT_FILLED_CONTRACT_END; break; case Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::LAST_POSSIBLE_DATE_NOTICE: $sp06be97 = Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::TERMINATION_MODE_END_DATE; break; case Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::TERMINATION_DATE_NOT_RELEVANT: $sp06be97 = $this->getCheckout('provider[cable_internet_phone][termination_date_reason]') ?: Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::TERMINATION_DATE_NOT_FILLED_NOW; break; case Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::NO_MINIMUM_CONTRACT_DATE: $sp06be97 = Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::TERMINATION_DATE_NOT_FILLED_NO_PERIOD; break; case Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::AS_SOON_AS_POSSIBLE: $sp06be97 = Vfde_Checkout_Block_Cart_Steps_SaveChangeProvider::TERMINATION_DATE_NOT_FILLED_NO_PERIOD; break; default: $sp06be97 = null; } return $sp06be97; } protected function hasValidBasketAction($sp008ee3, $spdee135, $spd6d708 = '') { $sp06be97 = false; $this->log(sprintf("... Evaluating basket action for item %s and addon %s", $sp008ee3->getSku(), $spdee135->getId())); $this->log(sprintf("... Item system action: %s, addon basket action: %s", $sp008ee3->getSystemAction(), $spdee135->getBasketAction())); if (!$spdee135->getBasketAction()) { $this->log("... Addon is VALID - no basket action set"); return true; } switch ($spdee135->getBasketAction()) { case Vfde_MultiMapper_Model_Addon::BASKET_ACTION_ADD: $sp9c4c30 = $sp008ee3->getSystemAction(); $spac6893 = array(Vfde_Checkout_Model_Sales_Quote_Item::SYSTEM_ACTION_ADD, Vfde_Checkout_Model_Sales_Quote_Item::SYSTEM_ACTION_NOT_APPLICABLE); $sp06be97 = Vfde_Core_Helper_Data::areAllTrue([!$sp9c4c30 || in_array($sp9c4c30, $spac6893), !$this->isProductChanged($sp008ee3, $spd6d708, $spdee135->getBasketAction()), !$sp008ee3->getIsContractDrop()]); break; case Vfde_MultiMapper_Model_Addon::BASKET_ACTION_KEEP: $sp06be97 = $sp008ee3->getSystemAction() == Vfde_Checkout_Model_Sales_Quote_Item::SYSTEM_ACTION_EXISTING && !$sp008ee3->getIsContractDrop(); break; case Vfde_MultiMapper_Model_Addon::BASKET_ACTION_REMOVE: $sp06be97 = $sp008ee3->getIsContractDrop(); break; case Vfde_MultiMapper_Model_Addon::BASKET_ACTION_CHANGE: $sp06be97 = $this->processContext != Omnius_Catalog_Model_ProcessContext::ACQ && $this->isProductChanged($sp008ee3, $spd6d708, $spdee135->getBasketAction()); break; default: break; } if ($sp06be97) { $this->log("... Addon is VALID"); } else { $this->log("... Addon is INVALID"); } return $sp06be97; } public function getCustomerNumber($sp8409a7) { $spd5febf = Mage::getSingleton('customer/session')->getCustomer(); $spd989d3 = null; if (true === empty($spd5febf->isCustomerLoggedIn())) { return self::DUMMY_PARTY_IDENTIFICATION; } else { $spf0635b = $sp8409a7->getOrderNumber() ? $sp8409a7->getPackages() : $sp8409a7->getCartPackages(); foreach ($spf0635b as $sp439c5e) { if ($sp439c5e->getData('parent_account_number') != '') { $spd989d3 = $sp439c5e->getData('parent_account_number') == Vfde_Customer_Helper_Customer::NEW_ACCOUNT_BAN ? self::DUMMY_PARTY_IDENTIFICATION : $sp439c5e->getData('parent_account_number'); break; } } if ($spd989d3 == null) { $spd989d3 = self::DUMMY_PARTY_IDENTIFICATION; } } return $spd989d3; } protected function getZeroShippingFee() { return number_format((double) 0, 2, '.', ''); } public function getPaymentMethodBic($sp504436, $sp3664e8) { switch ($sp504436) { case "direct_debit": $sp8b1c19 = $this->getCheckout('payment[monthly][direct_debit][bic][new]'); break; case "direct_debit_diff": $sp8b1c19 = $this->getCheckout('payment[monthly][direct_debit][bic][diff]'); break; case "direct_debit_reuse": $sp8b1c19 = $this->getCheckout('payment[monthly][direct_debit][bic][reuse]'); break; case "split": $sp8b1c19 = $this->getBICFieldValueForSplitPayment($sp3664e8); break; default: $sp8b1c19 = null; } return $sp8b1c19; } public function getBICFieldValue($sp439c5e, $spb014f6) { $sp8b1c19 = null; switch ($spb014f6) { case "RC": $sp504436 = $this->getCheckout('payment[monthly][type]'); if (strpos($sp504436, '|') !== false) { [$sp504436] = explode('|', $sp504436); } $sp3664e8 = $sp439c5e->getPackageId(); $sp8b1c19 = $this->getPaymentMethodBic($sp504436, $sp3664e8); break; case "OTC": $sp504436 = $this->getCheckout('payment[one_time][type]'); if ($sp504436 == Vfde_Checkout_Helper_Fields::PAYMENT_DIRECT_DEBIT) { $sp8b1c19 = $this->getCheckout('payment[one_time][direct_debit][bic]'); if (empty($sp8b1c19)) { $sp8b1c19 = $this->getBICFieldValue($sp439c5e, 'RC'); } } break; default: $sp8b1c19 = null; } return $sp8b1c19; } public function getBICFieldValueForSplitPayment($sp3664e8) { $sp0d2d6d = $this->getCheckout('payment[pakket][' . $sp3664e8 . '][type]'); if (strpos($sp0d2d6d, '|') !== false) { [$sp0d2d6d] = explode('|', $sp0d2d6d); } switch ($sp0d2d6d) { case "direct_debit": $sp8b1c19 = $this->getCheckout('payment[pakket][' . $sp3664e8 . '][direct_debit][bic][new]'); break; case "direct_debit_diff": $sp8b1c19 = $this->getCheckout('payment[pakket][' . $sp3664e8 . '][direct_debit][bic][diff]'); break; case "direct_debit_reuse": $sp8b1c19 = $this->getCheckout('payment[pakket][' . $sp3664e8 . '][direct_debit][bic][reuse]'); break; default: $sp8b1c19 = null; } return $sp8b1c19; } public function checkIfUseCaseIndicationContainsCrossSell($spd793e7) { $spfbe40f = array(Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_MOB_MOB, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_MOB_DSL, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_MOB_CAB, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_MOB_DSL_CAB, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_CAB_CAB, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_CAB_DSL, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_CAB_MOB, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_DSL_DSL, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_DSL_CAB, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_DSL_MOB); if (in_array($spd793e7, $spfbe40f, false)) { return true; } else { return false; } } public function checkIfUseCaseIndicationContainsCrossStack($spd793e7) { $spfbe40f = array(Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_MOB_DSL, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_MOB_CAB, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_MOB_DSL_CAB, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_CAB_DSL, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_CAB_MOB, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_DSL_CAB, Vfde_Package_Model_Package::USE_CASE_CROSS_SELL_DSL_MOB); if (in_array($spd793e7, $spfbe40f, false)) { return true; } else { return false; } } public function getProductCategory($sp008ee3, $sp18782a, $spa61e46) { $spd91268 = $sp008ee3->getSku(); if (empty($spd91268)) { return null; } $spa3fda5 = $spd91268 ? $spa61e46->getIdBySku($spd91268) : null; if (empty($spa3fda5)) { return null; } $sp7a613d = $sp18782a->getProductCategoryIds($spa3fda5); if (in_array(Vfde_Catalog_Model_Type::MOBILE_SUBTYPE_ADDON, $sp008ee3->getProduct()->getType()) && !in_array(Vfde_Catalog_Model_Type::MOBILE_SUBTYPE_SUBSCRIPTION, $sp008ee3->getProduct()->getType())) { $spca95da = Vfde_Checkout_Helper_Data::MOBILE_CATEGORY_VODAFONE_COVER_PLUS; $sp5ea83d = $sp18782a->getCategoryByNamePath('Mobile/' . $spca95da); $spa9bebc = $sp5ea83d ? $sp5ea83d->getId() : null; if ($spa9bebc && in_array($spa9bebc, $sp7a613d)) { return Vfde_Catalog_Model_Type::TYPE_MOBILE . self::CATEGORY_PATH . $spca95da; } } if (isset($sp7a613d) && in_array(Vfde_Catalog_Model_Type::MOBILE_SUBTYPE_SUBSCRIPTION, $sp008ee3->getProduct()->getType())) { $spb9a813 = $this->getParentAndSubCategoryNamesByIds($sp7a613d, $sp18782a); foreach ($spb9a813 as $spbc27a3) { if ($spbc27a3 && strtoupper($spbc27a3['parentCategoryName']) == self::MOBILE_POSTPAID_TARIFF) { return Vfde_Catalog_Model_Type::TYPE_MOBILE . self::CATEGORY_PATH . $spbc27a3['parentCategoryName'] . self::CATEGORY_PATH . $spbc27a3['subCategoryName']; } } } return null; } public function getParentAndSubCategoryNamesByIds($sp6cbe65, $sp18782a) { $sp7a613d = $sp18782a->getCollection()->addAttributeToSelect(['name', 'parent_id'])->addAttributeToFilter('entity_id', array('in' => $sp6cbe65))->load(); $sp7da9f6 = array(); if (isset($sp7a613d)) { foreach ($sp7a613d as $spbc27a3) { $spece97b = $spbc27a3->getParentCategory(); $sp7da9f6[$spbc27a3->getId()] = array('parentCategoryName' => $spece97b->getName(), 'subCategoryName' => $spbc27a3->getName()); } return $sp7da9f6; } return null; } protected function getComponentAdditionalDataForMatchedProjectReference($spdee135, $sped909d) { $sp46bd27 = $sped909d->getProjectReferenceValue() ?? ''; return [['Code' => $spdee135->getData('addon_name'), 'Value' => $sp46bd27, 'AdditionalValue' => $spdee135->getData('addon_additional_value')]]; } public function getPaymentMethodList($sp439c5e, $spb014f6) { return ['PaymentChargeType' => [['PaymentMethod' => $this->getPaymentMethod($sp439c5e, $spb014f6), 'PaymentMethodType' => 'ServiceCharges']]]; } public function componentArray($sp02efce, $sp123385, $spdf280a) { $sp24b6fd = array('SourceComponentID' => null, 'Action' => $sp123385, 'ComponentType' => null, 'ComponentActivityTypeIndication' => $spdf280a, 'SkuID' => $sp02efce->getSku(), 'ComponentAdditionalData' => null, 'SimOnlyTariffInd' => null); return array_merge($sp24b6fd, $this->componentDefaults()); } public function setCodeValForComponent($spfd2f85) { return ['Code' => $spfd2f85->getData('addon_name'), 'Value' => $spfd2f85->getData('addon_value'), 'AdditionalValue' => $spfd2f85->getData('addon_additional_value')]; } public function returnEnteredHeaderPrinted($sp0a0a33) { if (!$sp0a0a33) { $this->log("Multimapper entries fetched:"); $this->log("----------------------------"); $sp0a0a33 = true; } else { $this->log('...'); } return $sp0a0a33; } public function getPhoneBookPersonalFields($sp2d0ca5, $spd5be92, $sp3664e8, $sp4fa723 = null, $spd9a11b = null) { $sp7382c4 = $this->getCheckout($spd9a11b); $sp0c6e8c = $this->getCheckout($sp4fa723 . '[' . $sp3664e8 . '][' . $spd5be92 . '][profession]') ?? null; $sp201879 = $this->getCheckout($sp4fa723 . '[' . $sp3664e8 . '][' . $spd5be92 . '][keyword]') ?? null; $spcdf811 = ''; switch ($sp7382c4) { case self::PHONE_BOOK_STANDARD: $sp24d538 = $this->getCheckout('customer[type]') == 'Soho'; $spaae2e3 = $sp2d0ca5 ? $this->getContactPhoneNumbers() : ''; $spcdf811 = $this->determinePhoneBookPersonalFields([$sp7382c4, $spaae2e3, $sp0c6e8c, $sp201879, null, null]); $spcdf811['InformationUse'] = $spcdf811['InformationUse'] ?? 'M'; break; case self::PHONE_BOOK_NONE: $spcdf811 = null; break; case self::PHONE_BOOK_EXTENDED: break; } return $spcdf811; } public function getRefusedComponentsAsSku($sp439c5e) { $sp06be97 = []; $sp26b0aa = []; try { $sp26b0aa = $this->getItemStatusModel()->getCollection()->addFieldtoFilter('package_id', $sp439c5e->getData('entity_id'))->addFieldtoFilter('is_refused', '1')->getData(); } catch (Exception $sp1074a4) { Mage::getSingleton('core/logger')->logException($sp1074a4); } foreach ($sp26b0aa as $sp008ee3) { $sp06be97[] = $sp008ee3['sku']; } return $sp06be97; } public function formatDateTime($sp7569ab, $sp6b2060) { $sp06be97 = ""; $sp3878aa = Mage::getModel('core/date'); $sp4d6dec = $sp3878aa->timestamp(strtotime($sp7569ab)); if ($sp6b2060 == self::DATE) { $sp06be97 = date("Ymd", $sp4d6dec); } elseif ($sp6b2060 == self::DATE_TIME) { $sp06be97 = date("YmdHis", $sp4d6dec); } return $sp06be97; } protected function getInstallBaseAdditionalData($spdee135, $spd989d3, $spa24247) { $sp4ee75e = $this->getSingleton('customer/session'); foreach ($sp4ee75e->getCustomersForStack(Vfde_Customer_Helper_Services::ACCOUNT_CATEGORY_FN) as $sp3f4e7d) { if ($sp3f4e7d['ParentAccountNumber']['ID'] == $spd989d3) { if (!isset($sp3f4e7d['Contract'][0])) { $sp3f4e7d['Contract'] = [$sp3f4e7d['Contract']]; } $sp9d7541 = null; foreach ($sp3f4e7d['Contract'] as $spa4d455) { $sp9d7541 = $this->getIbContract($spa24247, $spa4d455); if ($sp9d7541) { $spfaf465 = $this->getAllFnInstalledBaseComponents($sp9d7541); foreach ($spfaf465 as $spe963fe) { foreach ($spe963fe['ComponentAdditionalData'] as $sp65646d) { if ($sp65646d['Code'] == $spdee135->getData('addon_name') && $sp65646d['AdditionalValue'] == $spdee135->getData('source_attribute_additional_value')) { return array(array('Code' => $spdee135->getData('addon_name'), 'Value' => $sp65646d['Value'], 'AdditionalValue' => $spdee135->getData('addon_additional_value'))); } } } } } } } return null; } public function determinePhoneBookPersonalFields(array $sp223325) { list($sp37472e, $spaae2e3, $sp0c6e8c, $sp201879, $spd5be92, $sp3664e8) = $sp223325; return array_merge(Vfde_Superorder_Helper_Client::$defaultPhoneBookPersonalFields, array('PersonalDetails' => $this->sp34b9d2($spaae2e3, $spd5be92, $sp3664e8), 'Type' => self::getPhoneBookTypeValue($sp37472e), 'Profession' => $sp0c6e8c, 'KeyWord' => $sp201879)); } private function sp34b9d2($spaae2e3, $spd5be92 = null, $sp3664e8 = null) { $sp892cee = 'customer[firstname]'; $sp843627 = 'customer[lastname]'; $sp4b40cd = 'customer[prefix]'; if (!is_null($sp3664e8) && !is_null($spd5be92)) { $sp892cee = 'other[extended][' . $sp3664e8 . '][' . $spd5be92 . '][firstname]'; $sp843627 = 'other[extended][' . $sp3664e8 . '][' . $spd5be92 . '][lastname]'; $sp4b40cd = 'other[extended][' . $sp3664e8 . '][' . $spd5be92 . '][prefix]'; } return ['FirstName' => $this->getCheckout($sp892cee) ?: null, 'FamilyName' => $this->getCheckout($sp843627) ?: null, 'Title' => $this->getCheckout($sp4b40cd) ?: null, 'ContactPhoneNumber' => $spaae2e3]; } public function getSuperOrderModel() { return Mage::getModel('superorder/superorder'); } public function getConfiguratorHelper() { return Mage::helper('vfde_configurator'); } public function getCustomerSession() : Mage_Customer_Model_Session { return Mage::getSingleton('customer/session'); } public function agentDealerModel() { return Mage::getModel('agent/dealer'); } public function componentDefaults() { return array('TariffOption' => null, 'TariffOptionCategory_Tree' => null, 'TariffOptionDescription' => null, 'TariffOptionName' => null, 'Agreement' => null, 'SAPArticleID' => null, 'Country' => null, 'DeviceID' => null, 'ProductID' => null, 'SAPArticleNetPrice' => null, 'SAPArticleGrossPrice' => null, 'SAPDiscount1' => null, 'SAPDiscount2' => null, 'ShippingFeeNetPrice' => null, 'ShippingFeeText' => null); } public function getCallDetailTypeAndDigitMask(?string $sp48dbf8, &$sp47acd3, &$sp5d3eac) : void { switch ($sp48dbf8) { case Omnius_Superorder_Helper_Client::CONNECTION_NONE: $sp47acd3 = 'N'; $sp5d3eac = '0'; break; case Omnius_Superorder_Helper_Client::CONNECTION_FULL: $sp47acd3 = 'M'; $sp5d3eac = '0'; break; case Omnius_Superorder_Helper_Client::CONNECTION_CONDENSED: $sp47acd3 = 'M'; $sp5d3eac = '3'; break; } } public function getNumberOfPortings(?string $spb54415, &$sp141936) : void { if ($this->getCheckoutHelper()->checkCableUnityProduct($this->getQuote()->getCartPackages())) { $this->getNumberOfPortingsForUnity($spb54415, $sp141936); } else { $this->getNumberOfPortingsForNonUnity($spb54415, $sp141936); } } protected function getNumberOfPortingsForUnity(?string $spb54415, &$sp141936) : void { switch ($spb54415) { case Vfde_Checkout_Model_Cart::UME_PORTING_ONE_NUMBER: $sp141936 = Vfde_Checkout_Model_Cart::PORTING_ONE_NUMBER_TEXT; break; case Vfde_Checkout_Model_Cart::UME_PORTING_TWO_NUMBER: case Vfde_Checkout_Model_Cart::UME_PORTING_THREE_NUMBER: case Vfde_Checkout_Model_Cart::UME_PORTING_FOUR_NUMBER: case Vfde_Checkout_Model_Cart::UME_PORTING_FIVE_NUMBER: case Vfde_Checkout_Model_Cart::UME_PORTING_SIX_NUMBER: $sp141936 = Vfde_Checkout_Model_Cart::PORTING_MULTIPLE_NUMBERS_TEXT; break; default: $sp141936 = null; } } protected function getNumberOfPortingsForNonUnity(?string $spb54415, &$sp141936) : void { switch ($spb54415) { case Omnius_Superorder_Helper_Client::PORTING_ALL_NUMBERS: $sp141936 = Vfde_Checkout_Model_Cart::PORTING_ALL_NUMBERS_TEXT; break; case Omnius_Superorder_Helper_Client::PORTING_ONE_NUMBER: $sp141936 = Vfde_Checkout_Model_Cart::PORTING_ONE_NUMBER_TEXT; break; case Omnius_Superorder_Helper_Client::PORTING_MULTIPLE_NUMBERS: $sp141936 = Vfde_Checkout_Model_Cart::PORTING_MULTIPLE_NUMBERS_TEXT; break; default: $sp141936 = null; } } public function setPriceIncExcTax($spbbedc5, $sp59fa27, $spd705fe, $sp185067) { if (array_key_exists('paymentInterval', $spbbedc5) && $spbbedc5['paymentInterval'] == Vfde_Superorder_Model_Client_SubmitOrderClient_Package::PAYMENT_INTERVAL_REC) { $spbbedc5['chargePeriod'] = Vfde_Superorder_Model_Client_SubmitOrderClient_Package::CHARGE_PERIOD_MONTHLY; } $spbbedc5['priceIncTax'] = $sp59fa27 * $spd705fe; $spbbedc5['priceExcTax'] = $sp59fa27 * $sp185067; return $spbbedc5; } protected function getCategoryModel() { return Mage::getModel("catalog/category"); } protected function getProductModel() { return Mage::getModel("catalog/product"); } protected function getMultimapperModel() { return Mage::getModel('multimapper/mapper'); } protected function getAddonModel() { return Mage::getModel('multimapper/addon'); } protected function getComponentModel() { return Mage::getModel('superorder/component'); } protected function mergeIbWithAdditional($spd5febf, $sp33f611, &$sp5648f5) : void { if (isset($spd5febf['Device']) && !isset($spd5febf['Device'][0])) { $spd5febf['Device'] = [$spd5febf['Device']]; } foreach ($spd5febf['Device'] as $sp2629ef) { if ($sp2629ef['BackEndCustomerID'] == $sp33f611) { $sp5648f5 = array_merge($sp5648f5, $sp2629ef['Component']['ComponentAdditionalData']); } } } protected function getFnIbSubscriptions($spd5febf, &$sp369f8a) : void { $sp369f8a = $spd5febf['Contract']['Subscription']; if (!isset($sp369f8a[0])) { $sp369f8a = [$sp369f8a]; } } protected function getFnIbDataForAccess($sp369f8a, &$sp5648f5) : void { $sp5648f5 = []; foreach ($sp369f8a as $sp02fc97) { foreach ($sp02fc97['Product']['Component']['ComponentAdditionalData'] as $sp65646d) { if (strpos($sp65646d['AdditionalValue'], '/accesses/') === 0) { $sp5648f5[] = $sp65646d; } } } } protected function getFnIbDataDevice($spd5febf, $sp33f611, &$sp5648f5) : void { if (isset($spd5febf['Device']) && !isset($spd5febf['Device'][0])) { $spd5febf['Device'] = [$spd5febf['Device']]; } foreach ($spd5febf['Device'] as $sp2629ef) { if ($sp2629ef['BackEndCustomerID'] == $sp33f611) { foreach ($sp2629ef['Component']['ComponentAdditionalData'] as $sp65646d) { if (strpos($sp65646d['AdditionalValue'], '/accesses/') === 0) { $sp5648f5[] = $sp65646d; } } } } } protected function getFnIbContracts($spd5febf, &$sp19ca60) : void { $sp19ca60 = $spd5febf['Contract']; if (!isset($spd5febf['Contract'][0])) { $sp19ca60 = [$sp19ca60]; } } protected function getFnIbContractSubscriptions($sp19ca60, $spa24247, &$sp369f8a) : void { foreach ($sp19ca60 as $spa4d455) { $sp369f8a = $spa4d455['Subscription']; if (!isset($sp369f8a[0])) { $sp369f8a = [$sp369f8a]; } foreach ($sp369f8a as $sp02fc97) { if ($sp02fc97['Product']['StandardItemIdentification']['ID'] == $spa24247) { break 2; } } $sp369f8a = []; } } protected function getFnIbData($sp369f8a, $sp9b7456, &$sp5648f5) : void { foreach ($sp369f8a as $sp02fc97) { foreach ($sp02fc97['Product']['Component']['ComponentAdditionalData'] as $sp65646d) { if ($sp65646d['Code'] == 'refComponentId' && $sp65646d['Value'] == $sp9b7456) { $sp5648f5 = $sp02fc97['Product']['Component']['ComponentAdditionalData']; break; } } } } public function getCommissionReportPackage($spf0635b) { $speb36ae = $this->getBewPermissionForOrders($spf0635b); foreach ($spf0635b as $sp40ef26 => $sp439c5e) { $sp1830c6 = $this->loadPackage($sp439c5e['id']); $spf0635b[$sp40ef26]['products'] = $this->getPackageProductName(explode(',', $sp439c5e['products'])); if ($sp439c5e['lineOfBusiness'] == Vfde_PriceRules_Model_ImportPriceRules::MOBILE_TYPE) { $sp379072 = $this->getComponentMsisdn($sp1830c6); } else { $sp379072 = $sp439c5e['parentAccountNumber']; } $spf0635b[$sp40ef26]['customerId'] = $sp379072; if ($speb36ae[$sp439c5e['orderNumber']]['bewPermission'] == 'YES') { $spf0635b[$sp40ef26]['bewPermission'] = 'YES'; } else { $spf0635b[$sp40ef26]['bewPermission'] = 'NO'; } } return $spf0635b; } public function getPackageProductName($spf46a88 = [], $spfed516 = 'entity_id', $sp4c4f2e = " | ") { $sp1d9853 = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('name')->addAttributeToSelect('display_name_communication')->addAttributeToFilter($spfed516, ['in' => $spf46a88]); $spf46a88 = ''; foreach ($sp1d9853->getItems() as $sp02efce) { $spf46a88 .= ($sp02efce->getDisplayNameCommunication() ?: $sp02efce->getName()) . $sp4c4f2e; } $spf46a88 = rtrim($spf46a88, $sp4c4f2e); return $spf46a88; } public function loadPackage($spe30be3) { return $this->loadPackageModel()->load($spe30be3); } public function getCheckoutField() { return Mage::helper("vfde_checkout/fields"); } public function loadPackageModel() { return Mage::getModel('package/package'); } public function validateCommissionReportFilter($spd2542f, &$sp3ba04d) { $spa79e33 = $this->errorCommissionFilterMessage($spd2542f['filters']); if (!empty($spa79e33)) { return $spa79e33; } else { $spc027b6 = str_replace('.', '-', $spd2542f['filters']['date']['from']); $spd9e404 = str_replace('.', '-', $spd2542f['filters']['date']['to']); $sp3ba04d = ['currentPage' => $spd2542f['pagination']['currentPage'] ?? 1, 'perPage' => $spd2542f['pagination']['perPage'] ?? 30, 'from' => $spc027b6 ? date('d.m.Y', strtotime($spc027b6)) : '', 'to' => $spd9e404 ? date('d.m.Y', strtotime($spd9e404)) : '', 'processContext' => $spd2542f['filters']['processContext'] ?? [], 'orderBy' => $spd2542f['orderBy'] ?? 'order_number', 'orderType' => $spd2542f['orderType'] ?? 'DESC']; return $spa79e33; } } public function errorCommissionFilterMessage($sp7ddc57) { $spa79e33 = []; $spd3f06b = $this->getConfiguratorHelper(); $spfe6c04 = $spd3f06b->validatorHelper(); if (!empty($sp7ddc57['date']['from']) && !empty($sp7ddc57['date']['to'])) { $spda215e = $spd3f06b->validateDateRange($sp7ddc57['date']); if ($spda215e) { $spa79e33['date'] = $spda215e; } } else { if ($sp7ddc57['date']['from'] != '' && !$spfe6c04->validateIsDate($sp7ddc57['date']['from'])) { $spa79e33['date'] = 'From date is invalid'; } else { if ($sp7ddc57['date']['to'] != '' && !$spfe6c04->validateIsDate($sp7ddc57['date']['to'])) { $spa79e33['date'] = 'To date is invalid'; } } } if (!empty($sp7ddc57['processContext'])) { if (!in_array($sp7ddc57['processContext'], $this->getAllProcessContext())) { $spa79e33['processContext'] = 'Invalid process context'; } } return $spa79e33; } public function getAllProcessContext() { return Mage::getModel('omnius_catalog/processContext')->getAllProcessContextIdCodePairs(); } public function getComponentAction($sp008ee3) { if ($this->processContext == Omnius_Catalog_Model_ProcessContext::ACQ) { return self::COMPONENT_ACTION_ADD; } $sp0af27c = null; switch ($sp008ee3->getSystemAction()) { case Omnius_Checkout_Model_Sales_Quote_Item::SYSTEM_ACTION_EXISTING: if ($sp008ee3->getIsContractDrop()) { $sp0af27c = self::COMPONENT_ACTION_REMOVE; } else { $sp0af27c = self::COMPONENT_ACTION_EXISTING; } break; case Omnius_Checkout_Model_Sales_Quote_Item::SYSTEM_ACTION_NOT_APPLICABLE: $sp0af27c = self::COMPONENT_ACTION_REMOVE; break; default: $sp0af27c = self::COMPONENT_ACTION_ADD; break; } return $sp0af27c; } protected function setPayment($spba0ab0, $sp6b21fa) { if ($spba0ab0 === null) { switch ($sp6b21fa) { case Vfde_Checkout_Helper_Fields::PAYMENT_BANK_TRANSFER: case Vfde_Checkout_Helper_Fields::PAYMENT_CHECKMO: $spba0ab0 = 'GI'; break; case Vfde_Checkout_Helper_Fields::PAYMENT_CASH_ON_DELIVERY: $spba0ab0 = 'CA'; break; case Vfde_Checkout_Helper_Fields::PAYMENT_DIRECT_DEBIT: case Vfde_Checkout_Helper_Fields::PAYMENT_DIRECT_DEBIT_REUSE: case Vfde_Checkout_Helper_Fields::PAYMENT_DIRECT_DEBIT_DIFF: $spba0ab0 = 'DD'; break; case Vfde_Checkout_Helper_Fields::PAYMENT_PAY_IN_STORE: $spba0ab0 = 'CO'; break; default: $spba0ab0 = null; } } return $spba0ab0; } protected function getItemAddons($sp439c5e, $sp4f6c22) { $spfd8b82 = $this->getAddonModel()->getAddonByMapperId($sp4f6c22); if ($sp439c5e->isMobile() || $sp439c5e->isCable()) { $spfd8b82->addFieldToFilter('technical_id', array('neq' => 'NULL')); } return $spfd8b82; } protected function setSapResult(&$sp06be97) { foreach ($sp06be97 as $sp74b8c9 => $sp405761) { if ($sp06be97[$sp74b8c9]['SAPArticleID']) { $sp06be97[$sp74b8c9]['SAPArticleNetPrice'] = 0; $sp06be97[$sp74b8c9]['SAPArticleGrossPrice'] = 0; $sp06be97[$sp74b8c9]['SAPDiscount1'] = 0; $sp06be97[$sp74b8c9]['SAPDiscount2'] = 0; } } } protected function getDeviceDetails($sp5b3e84, $sp439c5e) { $spe7d719 = null; if (in_array($sp5b3e84->getTechnicalId(), Vfde_Catalog_Model_Type::getOwnReceiverSkus())) { $spe7d719 = $sp439c5e->getReceiverSerialNumber(); } elseif ($sp5b3e84->getTechnicalId() == Vfde_Catalog_Model_Type::OWN_SMARTCARD_SKU) { $spe7d719 = $sp439c5e->getSmartcardSerialNumber(); } if (!$spe7d719 && ($sp439c5e->getReceiverSerialNumber() || $sp439c5e->getSmartcardSerialNumber())) { $spe7d719 = $sp439c5e->getReceiverSerialNumber() ?: $sp439c5e->getSmartcardSerialNumber(); } if (!is_null($spe7d719)) { $spe7d719 = $this->getHelper('core')->jsonDecode($spe7d719); } return $spe7d719; } protected function getShippingTextAndPrice($sp6e3776, $sp439c5e, $sp7fc045) { $sp7b1c9f = !empty(trim($sp6e3776)) && $sp439c5e->containsHardware() ? !empty($sp7fc045[$sp439c5e->getPackageId()]) ? $sp7fc045[$sp439c5e->getPackageId()]['ShippingFeeNetPrice'] : $sp7fc045['ShippingFeeNetPrice'] : null; $sp8e5ae0 = !empty(trim($sp6e3776)) && $sp439c5e->containsHardware() ? !empty($sp7fc045[$sp439c5e->getPackageId()]) ? $sp7fc045[$sp439c5e->getPackageId()]['ShippingFeeText'] : $sp7fc045['ShippingFeeText'] : null; return array($sp7b1c9f, $sp8e5ae0); } protected function getHandsetSoc($sp6e3776) { return isset($sp6e3776) && $sp6e3776 ? $sp6e3776->getData('technical_id') : null; } protected function getTariffOptionCategory($sp008ee3) { $sp68625a = null; if (strtoupper($sp008ee3->getPackageType()) == strtoupper(Vfde_Catalog_Model_Type::TYPE_MOBILE) && (in_array(Vfde_Catalog_Model_Type::MOBILE_SUBTYPE_SUBSCRIPTION, $sp008ee3->getProduct()->getType()) || in_array(Vfde_Catalog_Model_Type::MOBILE_SUBTYPE_ADDON, $sp008ee3->getProduct()->getType()))) { $sp68625a = $this->getProductCategory($sp008ee3, $this->getCategoryModel(), $this->getProductModel()); } return $sp68625a; } protected function setComponentAdditionalData($spfd8b82, &$sp256b10, &$spbe41e8) { $sp12e594 = ['serviceCode', 'serviceBillingName']; foreach ($spfd8b82 as $spfd2f85) { $sp8ed7ef = in_array($spfd2f85->getAddonName(), $sp12e594); if (!$sp8ed7ef && $spfd2f85->getAddonName() != 'processingType') { $sp256b10['ComponentAdditionalData'][] = $this->setCodeValForComponent($spfd2f85); } if ($sp8ed7ef || $spfd2f85->getAddonName() == self::ADDON_NAME_FUNCTION_ID) { $spbe41e8['ComponentAdditionalData'][] = $this->setCodeValForComponent($spfd2f85); } foreach ($spfd2f85->getData() as $sp40ef26 => $sp6b21fa) { if (!empty($sp6b21fa)) { $this->log("... ... {$sp40ef26}: {$sp6b21fa}"); } } } } protected function getIbContract($spa24247, $spa4d455) { $sp9d7541 = null; if (!isset($spa4d455['Subscription'][0])) { $spa4d455['Subscription'] = [$spa4d455['Subscription']]; } foreach ($spa4d455['Subscription'] as $sp02fc97) { if ($sp02fc97['Product']['StandardItemIdentification']['ID'] == $spa24247) { $sp9d7541 = $spa4d455; break; } } return $sp9d7541; } protected function getItemIfIsNotNull($sp24a771, $spc07dfe) { return $sp24a771 === null ? $spc07dfe : $sp24a771; } protected function getSplitComponentAdditionalData($sp4a1190) { $spcfc051 = []; foreach ($sp4a1190 as $sp496a27) { if (preg_match("/\\/functions\\/hardware\\[@ID=(.*?)\\]/", $sp496a27['AdditionalValue'], $sp3bbb97)) { $sp220e09 = $sp3bbb97[1]; $spcfc051[$sp220e09][] = $sp496a27; } else { $spcfc051[0][] = $sp496a27; } } return $spcfc051; } protected function getShippingFeeNetPriceAndText($sp7fc045, &$spe963fe) { $spe963fe['ShippingFeeNetPrice'] = isset($sp7fc045['ShippingFeeNetPrice']) && $sp7fc045['ShippingFeeNetPrice'] > 0 ? $sp7fc045['ShippingFeeNetPrice'] : $this->getZeroShippingFee(); $spe963fe['ShippingFeeText'] = isset($sp7fc045['ShippingFeeNetPrice']) && $sp7fc045['ShippingFeeNetPrice'] > 0 ? $sp7fc045['ShippingFeeText'] : ''; } protected function setSkusAndAction($sp439c5e) { $sp9aa396 = $sp40ae88 = []; $spdc39fd = array('items' => array(), 'dropped' => array()); $sp9aa7a3 = ($spcc28d3 = $sp439c5e->getRefusedDefaultedItems()) ? explode(',', $spcc28d3) : []; foreach ($sp439c5e->getItems() as $sp008ee3) { $sp9aa396[] = $sp3aaad1 = $sp008ee3->getSku(); $sp40ae88[$sp3aaad1] = $this->getComponentAction($sp008ee3); if ($sp008ee3->getIsContractDrop()) { $spdc39fd['dropped'][$sp3aaad1] = true; } $spdc39fd['items'][$sp3aaad1] = $sp008ee3; if (($sp40ef26 = array_search($sp008ee3->getSku(), $this->manuallyRefusedItems)) !== false) { unset($this->manuallyRefusedItems[$sp40ef26]); } } if (isset($this->manuallyRefusedItems)) { $sp9aa396 = array_merge($sp9aa396, $this->manuallyRefusedItems); $sp9aa7a3 = array_unique(array_merge($sp9aa7a3, $this->manuallyRefusedItems)); foreach ($this->manuallyRefusedItems as $sp008ee3) { $sp40ae88[$sp008ee3] = self::COMPONENT_ACTION_REFUSE; } } if (!empty($sp9aa7a3)) { $sp9aa396 = array_unique(array_merge($sp9aa396, $sp9aa7a3)); } return array($sp9aa396, $sp40ae88, $spdc39fd, $sp9aa7a3); } protected function setResultProperties($sp223325, &$sp06be97) { list($sp439c5e, $spec52f8, $sp24a771, $spfd2f85, $sp02efce) = $sp223325; $spaac9e6 = $sp02efce->getExtraIndicator('HIS'); $sp06be97['ComponentType'] = Vfde_Core_Helper_Data::areAllTrue([$sp439c5e->isMobile(), $spec52f8->getComponentType()]) ? $spec52f8->getComponentType() : ($spaac9e6 == null ? $sp24a771 : $spaac9e6); $sp06be97['ComponentAdditionalData'] = $sp439c5e->isFixed() && $sp24a771 != 'ComponentType' ? array('Code' => $spfd2f85->getData('addon_name'), 'Value' => $spfd2f85->getData('addon_value'), 'AdditionalValue' => $spfd2f85->getData('addon_additional_value')) : null; $sp06be97['TariffOption'] = $sp02efce->isSubscription() && $spfd2f85->getBackend() != self::BACKEND_SAP ? trim($spfd2f85->getTechnicalId()) : null; $sp06be97['Agreement'] = $sp02efce->isSubscription() || $spfd2f85->getBackend() != self::BACKEND_KIAS ? null : array('AgreementSOC' => $spfd2f85->getTechnicalId(), 'AgreementSOCDescription' => null, 'AgreementServiceType' => null, 'AgreementEffectiveDate' => null, 'AgreementExpirationDate' => null, 'AgreementTariffOption' => null); $sp06be97['SAPArticleID'] = $spfd2f85->getBackend() == self::BACKEND_SAP ? $spfd2f85->getTechnicalId() : null; } protected function setShippingFee($sp439c5e, $sp7fc045) { if (!empty($sp7fc045[$sp439c5e->getPackageId()])) { $spa7481e = array_keys($sp439c5e->getAllProductIds()); $sp145f81 = $this->getModel("omnius_multimapper/addon")->quoteSkuMappersHaveSAPAddons($spa7481e, $sp439c5e->getSaleType()); if (Vfde_Core_Helper_Data::isAnyTrue([$sp145f81, $sp439c5e->hasSimOnly()])) { $sp7b1c9f = $sp7fc045[$sp439c5e->getPackageId()]['NetPrice'] ? number_format((double) $sp7fc045[$sp439c5e->getPackageId()]['NetPrice'], 2, '.', '') : null; $sp8e5ae0 = isset($sp7b1c9f) && $sp7b1c9f > 0 ? Vfde_Checkout_Helper_Delivery::getSapDeliveryText() : null; $this->shippingFee = array($sp439c5e->getPackageId() => array('ShippingFeeNetPrice' => isset($sp7b1c9f) && $sp7b1c9f > 0 ? $sp7b1c9f : null, 'ShippingFeeText' => isset($sp7b1c9f) && $sp7b1c9f > 0 ? $sp8e5ae0 : null)); } } } protected function setComponentData($sp30ca2a, $sp439c5e, $spac72f6, $sp7fc045) { list($sp7b1c9f, $sp8e5ae0) = $this->setShipping($sp439c5e, $spac72f6, $sp7fc045); $spc41d5d = $this->getPartialData($spac72f6); $spa7cbb5 = $this->getTariffOptionData($spac72f6, $sp30ca2a); return array_merge($spc41d5d, $spa7cbb5, array('TN' => $sp439c5e->getComponentTn(), 'Country' => null, 'DeviceID' => $this->getDeviceId($sp439c5e), 'ProductID' => null, 'SAPArticleNetPrice' => null, 'SAPArticleGrossPrice' => null, 'SAPDiscount1' => null, 'SAPDiscount2' => null, 'ShippingFeeNetPrice' => isset($sp7b1c9f) && $sp7b1c9f > 0 ? $sp7b1c9f : $spac72f6->getData('isSimOnly') == 1 && $spac72f6->getData('socAction') != Omnius_Superorder_Helper_Client::COMPONENT_ACTION_REMOVE ? $this->getZeroShippingFee() : null, 'ShippingFeeText' => isset($sp7b1c9f) && $sp7b1c9f > 0 ? $sp8e5ae0 : $spac72f6->getData('isSimOnly') == 1 && $spac72f6->getData('socAction') != Omnius_Superorder_Helper_Client::COMPONENT_ACTION_REMOVE ? '' : null, 'SimOnlyTariffInd' => $spac72f6->getData('isSimOnly') == 1 ? 'true' : 'false', 'MultiSimList' => $this->getMultiSimCategoryProduct(self::MULTISIM_SLOT_CATEGORY) == substr($spac72f6->getSku(), 1) ? $this->getMultiSims($sp439c5e) : null)); } protected function getPartialData($spac72f6) { $sp432894 = $this->getItemData($spac72f6, 'technical_id'); $spef89a2 = $this->getItemData($spac72f6, 'backend'); return ['Action' => $spac72f6->getData('socAction'), 'ComponentType' => $spac72f6->getData('mapperComponentType'), 'SkuID' => $spac72f6->getData('sku'), 'name' => $spac72f6->getData('name'), 'ComponentAdditionalData' => null, 'Agreement' => $spac72f6->getData('isTariffSoc') || !in_array($spef89a2, array(self::BACKEND_KIAS, self::BACKEND_MASRH)) ? null : array('AgreementSOC' => $sp432894, 'AgreementSOCDescription' => null, 'AgreementServiceType' => null, 'AgreementEffectiveDate' => null, 'AgreementExpirationDate' => null, 'AgreementTariffOption' => null), 'SAPArticleID' => $spac72f6->getData('socAction') != Omnius_Superorder_Helper_Client::COMPONENT_ACTION_REMOVE ? $spef89a2 == self::BACKEND_SAP ? $sp432894 : null : null]; } protected function getTariffOptionData($spac72f6, $sp30ca2a) { $sp432894 = $this->getItemData($spac72f6, 'technical_id'); $spef89a2 = $this->getItemData($spac72f6, 'backend'); $spf3c104 = $this->getModel('eav/entity_attribute_set'); $sp63badf = $spac72f6->getData('display_name_communication'); return ['TariffOption' => $spac72f6->getData('isTariffSoc') && $spef89a2 != self::BACKEND_SAP ? trim($sp432894) : null, 'TariffOptionCategory' => isset($sp30ca2a[$spac72f6->getData('sku')]) && $sp30ca2a[$spac72f6->getData('sku')] ? $spf3c104->load($sp30ca2a[$spac72f6->getData('sku')])->getAttributeSetName() : null, 'TariffOptionCategory_Tree' => $spac72f6->getData('tariffOptionCategoryTree') ?: '', 'TariffOptionDescription' => trim($spac72f6->getData('additional_text')) != "" ? $spac72f6->getData('additional_text') : null, 'TariffOptionName' => isset($sp63badf) ? $sp63badf : $spac72f6->getData('product_name')]; } protected function setComponentActivityTypeIndication($sp439c5e, $spac72f6, &$sp840d96) { if (in_array($this->processContext, Omnius_Catalog_Model_ProcessContext::getProlongationProcessContexts()) || in_array($this->processContext, Omnius_Catalog_Model_ProcessContext::ILSProcessContexts())) { if ($spac72f6->getData('isTariffSoc')) { $sp840d96['ComponentActivityTypeIndication'] = $sp439c5e->ilsTariffChanged() ? self::COMPONENT_ACTIVITY_TYPE_INDICATION_MANUAL : self::COMPONENT_ACTIVITY_TYPE_INDICATION_AUTOMATIC; } else { $sp840d96['ComponentActivityTypeIndication'] = $spac72f6->getData('activityTypeIndication'); } } else { $sp840d96['ComponentActivityTypeIndication'] = null; } } protected function getItemData($sp008ee3, $sp40ef26) { return $sp008ee3->getData($sp40ef26) ? $sp008ee3->getData($sp40ef26) : null; } protected function setSuperorderItemsAndPackageIds($sp0e4c43, $spb07caf, $sp439c5e) { $sp77f2c9 = []; $sp03031e = $sp439c5e->getSuperOrder(); if ($sp0e4c43) { $sp630982 = $this->getSingleton('checkout/session')->getQuote()->getAllItems(); } else { $sp630982 = $sp03031e->getOrderedItems(true); $spa9c61d = $sp03031e->getPackages(); $sp77f2c9 = $spb07caf; foreach ($spa9c61d as $sp6264d3) { $sp77f2c9[] = $sp6264d3->getEntityId(); } } return array($sp630982, $sp77f2c9); } protected function setInputParamsOrder($sp439c5e, $sp0e4c43) { $sp03031e = $sp439c5e->getSuperOrder(); if ($sp0e4c43) { $this->inputParams['cart'] = $this->getModel('vfde_configurator/expression_cart'); $this->inputParams['order'] = $this->getModel('vfde_configurator/expression_order')->setPackage($sp439c5e); } else { $this->inputParams['order'] = $this->getModel('vfde_configurator/expression_order')->setSuperOrder($sp03031e)->setPackage($sp439c5e); } } protected function getComponentsForFP($sp223325, &$sp9aa396, &$sp4a1190, &$sp2ce64b, &$spdf280a, &$sp0af27c) { list($sp439c5e, $spd6d708, $sp008ee3, $sp0e4c43) = $sp223325; $sp4a6021 = $this->getModel('omnius_multimapper/addon')->getAddonsWithDirection($spd6d708->getId(), $this->processContext, Vfde_MultiMapper_Model_Mapper::DIRECTION_OUT); foreach ($sp4a6021 as $spdee135) { if (Vfde_Core_Helper_Data::isAnyTrue([$this->serviceExpressionIsFalse($spdee135), !$this->hasValidBasketAction($sp008ee3, $spdee135, $spd6d708)])) { $this->log("Skipping addon with id " . $spdee135->getId() . ": invalid BASKET_ACTION or SERVICE_EXPRESSION"); continue; } $sp24a771 = null; if ($spdee135->getData('addon_name') == 'ComponentType') { $sp24a771 = $spdee135->getData('addon_value'); } if ($sp24a771 != 'ComponentType') { if ($spc75609 = $this->getFnComponentAdditionalData($sp008ee3, $spdee135, $sp439c5e->getParentAccountNumber(), $sp439c5e->getServiceLineId(), $sp0e4c43)) { $sp9aa396[] = $sp008ee3->getSku(); $sp4a1190 = array_merge($sp4a1190, $spc75609); if (!isset($sp2ce64b)) { $sp2ce64b = $spd6d708->getComponentType() ?: null; } if (!isset($spdf280a)) { $spdf280a = $this->getComponentActivityTypeIndication($sp008ee3); } if (!isset($sp0af27c)) { $sp0af27c = $this->getFnComponentAction($sp008ee3); } } } } } protected function setActivityType($sp439c5e, $sp06be97, $sp40ae88) { foreach ($sp06be97 as $sp405761) { if (isset($sp40ae88[$sp405761['SkuID']])) { $sp40ae88[$sp405761['SkuID']] = $sp405761['Action']; } } foreach ($sp439c5e->getItems() as $sp008ee3) { if (isset($sp40ae88[$sp008ee3->getSku()])) { $sp008ee3->setProductActivityType($sp40ae88[$sp008ee3->getSku()])->save(); } } } protected function setShipping($sp439c5e, $spac72f6, $sp7fc045) { $sp432894 = $this->getItemData($spac72f6, 'technical_id'); $spef89a2 = $this->getItemData($spac72f6, 'backend'); $sp7b1c9f = $spef89a2 == self::BACKEND_SAP && !empty($sp432894) && $spac72f6->getData('socAction') != Omnius_Superorder_Helper_Client::COMPONENT_ACTION_REMOVE ? !empty($sp7fc045[$sp439c5e->getPackageId()]) ? $sp7fc045[$sp439c5e->getPackageId()]['ShippingFeeNetPrice'] : $sp7fc045['ShippingFeeNetPrice'] : null; $sp8e5ae0 = $spef89a2 == self::BACKEND_SAP && !empty($sp432894) && $spac72f6->getData('socAction') != Omnius_Superorder_Helper_Client::COMPONENT_ACTION_REMOVE ? !empty($sp7fc045[$sp439c5e->getPackageId()]) ? $sp7fc045[$sp439c5e->getPackageId()]['ShippingFeeText'] : $sp7fc045['ShippingFeeText'] : null; return [$sp7b1c9f, $sp8e5ae0]; } protected function getComponentsForPackageType($sp439c5e, $sp0e4c43) { if ($sp439c5e->isFixed()) { return $this->getComponentsForFixedPackage($sp439c5e, $sp0e4c43); } elseif ($sp439c5e->isMobile()) { return $this->getComponentsForMobilePackage($sp439c5e); } elseif ($sp439c5e->isCable()) { return $this->getComponentsForCablePackage($sp439c5e); } return false; } protected static function checkAccountNumberAndType($sp97bf5f, $sp439c5e) { $sp33f611 = $sp439c5e->getParentAccountNumber(); $sp2d0ca5 = self::getPackageType($sp439c5e->getType()); return isset($sp33f611) && array_key_exists($sp33f611, $sp97bf5f) || !isset($sp33f611) && $sp2d0ca5 === Vfde_Customer_Model_Customer::ACCOUNT_CATEGORY_MOBILE_PREPAID || $sp2d0ca5 != Vfde_Customer_Model_Customer::ACCOUNT_CATEGORY_MOBILE_POSTPAID && isset($sp33f611) && $sp439c5e->isMobile() && !in_array($sp33f611, [Vfde_Customer_Helper_Customer::NEW_ACCOUNT_BAN, Vfde_Customer_Helper_Customer::PRE_POST_BAN], false); } protected static function getProductPackageType($spd7a64f, $spb013f6) { $spd5be92 = ''; if (strtolower($spd7a64f) == strtolower(Vfde_Customer_Helper_Services::ACCOUNT_CATEGORY_KD)) { foreach ($spb013f6['products'] as $spf46a88) { foreach ($spf46a88 as $sp02efce) { if ($sp02efce['package_type']) { $spd5be92 = $sp02efce['package_type']; break 2; } } } } else { $spd5be92 = $spb013f6['package_creation_type']; } return $spd5be92; } protected static function getServiceAddress($spe6d87d, &$spa1508e) { if (isset($spe6d87d['service_address'])) { $sp77daf5 = !isset($spe6d87d['service_address'][0]) ? [$spe6d87d['service_address']] : $spe6d87d['service_address']; foreach ($sp77daf5 as $sp4dbee5) { if (isset($sp4dbee5['address_id'])) { $spa1508e[] = $sp4dbee5['address_id']; } } } } public function getMultiSims($sp439c5e = null) { $sp3936e2 = $this->getCheckoutHelper()->isRetailChannel(); $sp3664e8 = $sp439c5e->getPackageId(); foreach ($sp439c5e->getMultiSimPackageItems(false) as $sp008ee3) { $sp3aaad1 = $sp008ee3->getSku(); $sp02efce = $this->getProductModel()->loadByAttribute('sku', $sp3aaad1); $spead020 = $this->getComponentAction($sp008ee3); if ($sp02efce->hasNoMultiSimCheckout()) { if (!empty($sp02efce->getMinNoOfSlots()) && !empty($sp02efce->getMaxNoOfSlots()) && $sp02efce->getMinNoOfSlots() == $sp02efce->getMaxNoOfSlots() && in_array($spead020, [self::COMPONENT_ACTION_ADD, self::COMPONENT_ACTION_REMOVE])) { $spead020 == self::COMPONENT_ACTION_REMOVE ? $spead020 = Vfde_Package_Model_Package::ACTIVITY_REMOVE : null; $sp4ad4aa['MultiSIM'][] = ['SIMSerialNumber' => null, 'SIMCardType' => null, 'ActivityType' => $spead020, 'SIMCardArticleID' => null, 'ProductOption' => !empty($sp02efce->getUcpoCode()) ? $sp02efce->getUcpoCode() : null]; } continue; } $spabb831 = (int) $this->getCheckout('simcard[mobile][' . $sp3664e8 . '][' . $sp3aaad1 . '][no_of_slots]'); $sp05f28e = (int) $this->getCheckout('simcard[mobile][' . $sp3664e8 . '][' . $sp3aaad1 . '][ib_no_of_slots]'); if (!$spabb831 && (int) $sp008ee3->getIsContractDrop()) { $sp91d458 = $this->getCheckoutLayoutHelper()->packageGetNoOfSimSlotsCheckout($sp3aaad1, $sp439c5e); if ($sp91d458 < 0) { continue; } $sp7c81b3 = $this->getInstallBase()->packageGetMultiSims($sp439c5e); $sp7c81b3 = $this->getInstallBase()->productGetMultiSims($sp3aaad1, $sp7c81b3); foreach ($sp7c81b3 as $spf8f358 => $spedf2c7) { $sp4ad4aa['MultiSIM'][] = ['SIMSerialNumber' => $spedf2c7['UltraCardSim'], 'SIMCardType' => null, 'ActivityType' => Vfde_Package_Model_Package::ACTIVITY_REMOVE, 'SIMCardArticleID' => null, 'ProductOption' => !empty($sp02efce->getUcpoCode()) ? $sp02efce->getUcpoCode() : null]; } } $sp0cdf52 = max(abs($spabb831), abs($sp05f28e)); for ($sp488991 = 1; $sp488991 <= $sp0cdf52; $sp488991++) { $spe47b8f = $this->getCheckout('simcard[mobile][' . $sp3664e8 . '][' . $sp3aaad1 . '][additional][' . $sp488991 . '][type]') == Vfde_Superorder_Model_Client_SubmitOrderClient_Package::SIM_TYPE_S ? $this->getMultiSimCategoryProduct(self::CATEGORY_MULTISIM) : null; if ($spabb831 < 0) { $sp0a34d5 = (int) $this->getCheckout('simcard[mobile][' . $sp3664e8 . '][' . $sp3aaad1 . '][additional][' . $sp488991 . '][remove]'); if (!$sp0a34d5) { continue; } $spead020 = Vfde_Package_Model_Package::ACTIVITY_REMOVE; $sp88cf6b = $this->getCheckout('simcard[mobile][' . $sp3664e8 . '][' . $sp3aaad1 . '][additional][' . $sp488991 . '][ib]') ?? null; $sp537526 = null; } else { $spead020 = Vfde_Package_Model_Package::ACTIVITY_ADD; $sp88cf6b = $sp3936e2 ? $this->getCheckout('simcard[mobile][' . $sp3664e8 . '][' . $sp3aaad1 . '][additional][' . $sp488991 . '][serial]') : null; if ($sp3936e2 && $sp88cf6b == null && $spabb831 < $sp05f28e) { continue; } $sp537526 = !$sp3936e2 ? $this->getCheckout('simcard[mobile][' . $sp3664e8 . '][' . $sp3aaad1 . '][additional][' . $sp488991 . '][type]') : null; } $sp4ad4aa['MultiSIM'][] = ['SIMSerialNumber' => $sp88cf6b, 'SIMCardType' => $sp537526, 'ActivityType' => $spead020, 'SIMCardArticleID' => $spe47b8f, 'ProductOption' => !empty($sp02efce->getUcpoCode()) ? $sp02efce->getUcpoCode() : null]; } } return $sp4ad4aa ?? null; } protected function getCheckoutLayoutHelper() { return Mage::helper("vfde_checkout/layout"); } public function getSIMCardArticleID($sp3664e8, $sp488991) { return $this->getCheckout('simcard[mobile][' . $sp3664e8 . '][additional][' . $sp488991 . '][type]') == Vfde_Superorder_Model_Client_SubmitOrderClient_Package::SIM_TYPE_S ? $this->getMultiSimCategoryProduct(self::CATEGORY_MULTISIM) : null; } public function getInstallBase() { return Mage::getModel('vfde_configurator/expression_installBase'); } public function getMultiSimCategoryProduct($spbc27a3) { $sp552a17 = Mage::getModel('vfde_superorder/client_submitOrderClient_package')->getCategoryIdByPath($spbc27a3); return Mage::getModel('vfde_superorder/client_submitOrderClient_package')->getCategoryProduct($sp552a17); } public function getCatalogHelper() { return Mage::helper('vfde_catalog'); } public function getProductVisibilityForExtendedSC($sp02efce) { return $this->getCatalogHelper()->getVisibility(Omnius_Catalog_Model_Product::PRODUCT_VISIBILITY_EXTENDED_SHOPPING_CART, $sp02efce->getSku(), $sp02efce); } public function getProductVisibilityForContractSummary($sp02efce) { return $this->getCatalogHelper()->getVisibility(Vfde_Catalog_Model_Product::PRODUCT_VISIBILITY_CONTRACT_SUMMARY, $sp02efce->getSku(), $sp02efce); } public function getBillingType($sp439c5e = false) { if ($sp439c5e !== false) { if (strtoupper($sp439c5e->getSaleType() === Omnius_Catalog_Model_ProcessContext::ACQ) && $sp439c5e->isSolstice()) { return $this->getCheckout('billing[billing_type]'); } foreach ($sp439c5e->getItems() as $sp008ee3) { if (Omnius_Catalog_Model_Type::getSendInvoiceByPostSkus() == $sp008ee3->getData('sku')) { return self::BILLING_LETTER; } } } if ($this->getCheckout('billing[billing_type]') == self::BILLING_TYPE_MAIL) { return self::BILLING_WEBBILL; } else { $sp3b347b = Omnius_Checkout_Block_Cart_Steps_SaveCustomer::SAME_AS_CUSTOMER_ADDRESS; $sp21fbfc = Omnius_Checkout_Block_Cart_Steps_SaveCustomer::BILLING_ANOTHER_ADDRESS; if ($this->getCheckout('billing[other_address][selected]') && in_array($this->getCheckout('billing[other_address][selected]'), [$sp3b347b, $sp21fbfc]) || $this->getCheckout('billing[billing_type]') == self::BILLING_TYPE_INVOICE) { if ($sp439c5e->isMobile() || $sp439c5e->isCable()) { return self::BILLING_PAPER; } elseif ($sp439c5e->isFixed()) { return self::BILLING_LETTER; } } } return self::BILLING_PAPER; } protected function getQuote() { return Mage::getSingleton('checkout/cart')->getQuote(); } protected function getCheckoutHelper() { return Mage::helper('vfde_checkout'); } public function getCheckoutData() { return $this->checkoutData; } public function setCheckoutData($spcdf811) { return $this->checkoutData = $spcdf811; } protected function isProductChanged($sp008ee3, $spd6d708 = '', $sp13ce70 = '') { $sp02efce = $sp008ee3->getProduct(); $sp04ed1a = $spf401a0 = false; $sp6a87a7 = $sp02efce->getPackageSubtypeModel()->getCardinalityForProcessContext($this->processContext)->getCardinality(); $spf401a0 = $sp6a87a7 == Omnius_Package_Model_PackageSubtypeCardinality::PACKAGE_SUBTYPE_CARDINALITY_ONE; $sp18782a = Mage::getModel('omnius_catalog/category'); $spd3733f = $sp18782a->getAllExclusiveFamilyCategoryIds(); $sp87173b = []; foreach ($sp02efce->getCategoryCollection() as $spbc27a3) { if (in_array($spbc27a3->getId(), $spd3733f)) { $sp04ed1a = true; $sp87173b[] = $spbc27a3->getId(); } } if (!($spf401a0 || $sp04ed1a) || $this->processContext == Omnius_Catalog_Model_ProcessContext::ACQ) { return false; } if ($spf401a0) { $sp0af32e = $this->getItemsInSubtype($sp008ee3->getProduct()->getPackageSubtypeModel()); foreach ($sp0af32e as $sp94a7e0) { if ($sp94a7e0->getId() !== $sp008ee3->getId() && $sp94a7e0->getIsContractDrop() && $sp13ce70 != Vfde_MultiMapper_Model_Addon::BASKET_ACTION_ADD && $spd6d708['ogw_component_id_reference'] != Vfde_MultiMapper_Model_Mapper::OGW_COMPONENT_ID_REVOCATION) { return true; } } } if ($sp04ed1a) { $spc595f4 = $this->getItemsInCategories($sp87173b); foreach ($spc595f4 as $sp83cfda) { if ($sp83cfda->getId() !== $sp008ee3->getId() && $sp83cfda->getIsContractDrop()) { return true; } } } return false; } public function orderNumberCache(?string $sp91e806 = null) : ?string { $sp32711f = $this->getSingleton('omnius_cache/cache'); $spd81527 = $this->getSingleton("core/session")->getEncryptedSessionId(); $spb90672 = 'last_created_order_number_' . $spd81527; if ($sp06be97 = $sp32711f->load($spb90672)) { if (isset($sp91e806) && $sp06be97 != $sp91e806) { $sp32711f->save($sp91e806, $spb90672); } return $sp06be97; } elseif ($sp91e806) { $sp32711f->save($sp91e806, $spb90672); } return null; } public function appendOrderNumberDuringException(?string $sp91e806, Exception $sp1074a4) : Exception { if (isset($sp91e806)) { return new Exception("Order number: {$sp91e806} -- {$sp1074a4->getMessage()}", 0, $sp1074a4); } return $sp1074a4; } public function logExceptionWithOrderNumber(Exception $sp1074a4) : self { $this->mageLogException($this->appendOrderNumberDuringException($this->orderNumberCache() ?? null, $sp1074a4)); return $this; } public function getCustomerSubType(string $sp99e42d = '') : string { $spda3dfc = ''; switch (strtolower($this->getCheckout($sp99e42d))) { case Vfde_Checkout_Helper_Layout::SALUTATION_COMPANY_STRING: $spda3dfc = Vfde_Customer_Helper_Services::SOHO_PARTY_SUBTYPE_BUSINESS; break; default: $spda3dfc = ''; } return $spda3dfc; } public function getCustomerType($sp99e42d) { switch (strtolower($this->getCheckout($sp99e42d))) { case 'privat': $sp645138 = Omnius_Customer_Model_Client_RetrieveCustomerInfo::PARTY_TYPE_PRIVATE; break; case 'soho': case 'firma': $sp645138 = Omnius_Customer_Model_Client_RetrieveCustomerInfo::PARTY_TYPE_SOHO; break; default: $sp645138 = null; } return $sp645138; } public function getCustomerTypeMapped(string $sp6b2060) { switch ($sp6b2060) { case 'privat': $sp645138 = Omnius_Customer_Model_Client_RetrieveCustomerInfo::PARTY_TYPE_PRIVATE; break; case 'soho': case 'firma': $sp645138 = Omnius_Customer_Model_Client_RetrieveCustomerInfo::PARTY_TYPE_SOHO; break; default: $sp645138 = null; } return $sp645138; } public static function getPackageType($sp6b2060) { $spbc27a3 = "Unknown"; switch (strtolower($sp6b2060)) { case strtolower(Omnius_Catalog_Model_Type::TYPE_CABLE_INDEPENDENT): case strtolower(Omnius_Catalog_Model_Type::TYPE_CABLE_INTERNET_PHONE): case strtolower(Omnius_Catalog_Model_Type::TYPE_CABLE_TV): case strtolower(Omnius_Customer_Model_Customer::ACCOUNT_CATEGORY_CABLE): $spbc27a3 = Omnius_Customer_Model_Customer::ACCOUNT_CATEGORY_CABLE; break; case strtolower(Omnius_Catalog_Model_Type::TYPE_MOBILE): case strtolower(Omnius_Catalog_Model_Type::TYPE_REDPLUS): $spbc27a3 = Omnius_Customer_Model_Customer::ACCOUNT_CATEGORY_MOBILE_POSTPAID; break; case strtolower(Omnius_Catalog_Model_Type::TYPE_PREPAID): $spbc27a3 = Omnius_Customer_Model_Customer::ACCOUNT_CATEGORY_MOBILE_PREPAID; break; case strtolower(Omnius_Catalog_Model_Type::TYPE_FIXED_DSL): case strtolower(Omnius_Catalog_Model_Type::TYPE_LTE): case strtolower('Fixed'): $spbc27a3 = Omnius_Customer_Model_Customer::ACCOUNT_CATEGORY_FIXED; break; case strtolower(Vfde_Catalog_Model_Type::TYPE_SOLSTICE): return Vfde_Customer_Helper_Services::ACCOUNT_CATEGORY_SOLSTICE; default: break; } return $spbc27a3; } public function getPackageModel(int $sp3ec972 = null) : Omnius_Package_Model_Resource_Package_Collection { $sp06be97 = Mage::getModel('package/package')->getCollection()->addFieldToFilter('order_id', $sp3ec972); if (count($sp06be97) !== 0) { return $sp06be97; } $sp03031e = $this->getSuperOrderModel()->getCollection()->addFieldToFilter('entity_id', $sp3ec972)->getFirstItem(); $sp0320b9 = $sp03031e->getData('quote_id'); return Mage::getModel('package/package')->getCollection()->addFieldToFilter('quote_id_cc', $sp0320b9); } public function getCheckoutFieldDataArr($sp7157d4) { if (!is_null($this->checkoutData)) { $sp64d7bf = is_array($this->checkoutData) ? $this->checkoutData : $this->checkoutData->getData(); foreach ($sp64d7bf as $sp16ad8a) { if (isset($sp16ad8a['field_name']) && $sp16ad8a['field_name'] == $sp7157d4) { return array($sp16ad8a['field_name'] => $sp16ad8a['field_value']); } } return null; } } public function getBewPermissionForOrders($spf0635b) { $spc671ea = array(); foreach ($spf0635b as $sp40ef26 => $sp439c5e) { $sp159184 = $this->getCheckoutField()->getCheckoutFieldsByPackage("save_bew_permission", $sp439c5e['id']); if ($sp159184['bewpermission[' . Vfde_Checkout_Model_BewPermission::BEW_PERMISSION_ID_ADV . ']'] || $sp159184['bewpermission[' . Vfde_Checkout_Model_BewPermission::BEW_PERMISSION_ID_DEV . ']']) { $spc671ea[$sp439c5e['orderNumber']]['bewPermission'] = 'YES'; } } return $spc671ea; } public function getContactPhoneNumbers($spf0635b = null) { $sp8e0745 = $this->getHelper('omnius_service'); $sp31755d = array(); $sp981e5c = 0; $spa2fd45 = $sp1cad37 = null; while ($this->getCheckout("customer[contact_details][phone_list][{$sp981e5c}][telephone]")) { if ($this->orderContainsSolsticeACQ($spf0635b)) { $spa2fd45 = $this->getSolsticeCustomerC1Key(Vfde_CustomerDataHub_Model_Checkout_COneReferenceData::TELEPHONE_TYPE, $this->getContactPhoneNumberType("customer[contact_details][phone_list][{$sp981e5c}][telephone_type]", $spf0635b)); $sp1cad37 = 'true'; if ($sp981e5c == 1) { $sp1cad37 = 'false'; } } $sp472e6c = $this->getCheckout("customer[contact_details][phone_list][{$sp981e5c}][telephone_prefix]"); $sp312855 = $this->getCheckout("customer[contact_details][phone_list][{$sp981e5c}][telephone]"); $sp31755d[] = array('CountryCode' => $sp8e0745->getGeneralConfig('country_code') ? $sp8e0745->getGeneralConfig('country_code') : Omnius_Customer_Model_Customer::COUNTRY_CODE, 'LocalAreaCode' => $sp472e6c, 'PhoneNumber' => $sp312855, 'Type' => $this->getContactPhoneNumberType("customer[contact_details][phone_list][{$sp981e5c}][telephone_type]", $spf0635b), 'TypeC1Key' => $spa2fd45, 'Preferred' => $sp1cad37); $sp981e5c++; } $sp472e6c = $this->getCheckout("customer[contact_person_details][0][telephone_prefix]"); $sp312855 = $this->getCheckout("customer[contact_person_details][0][telephone]"); if ($sp472e6c && $sp312855) { $sp31755d[] = array('CountryCode' => $sp8e0745->getGeneralConfig('country_code') ? $sp8e0745->getGeneralConfig('country_code') : Omnius_Customer_Model_Customer::COUNTRY_CODE, 'LocalAreaCode' => $sp472e6c, 'PhoneNumber' => $sp312855, 'Type' => $this->getContactPhoneNumberType("customer[contact_person_details][0][telephone_type]", $spf0635b)); } return !empty($sp31755d) && (!empty($sp31755d[0]) || !empty($sp31755d['PhoneNumber'])) ? $sp31755d : null; } public function getContactPhoneNumberType($sp99e42d, $spf0635b = null) { $sp911f29 = $this->orderContainsSolsticeACQ($spf0635b); switch ($this->getCheckout($sp99e42d)) { case $sp911f29: return $this->getCheckout($sp99e42d); case 'landline': return 'FIXED_PHONE'; case 'mobile': return 'MOBILE_PHONE'; } return null; } public function orderContainsSolsticeACQ($spf0635b) : bool { foreach ($spf0635b as $sp439c5e) { if (strtoupper($sp439c5e->getSaleType()) === Omnius_Catalog_Model_ProcessContext::ACQ && $sp439c5e->isSolstice()) { return true; } } return false; } public function getSalutation($sp7465d3) { if (!is_numeric($sp7465d3)) { $sp3a1eb9 = $this->getCheckout($sp7465d3); $sp7465d3 = empty($sp3a1eb9) && !empty($sp7465d3) ? $sp7465d3 : $sp3a1eb9; } switch ($sp7465d3) { case self::GENDER_HERR: $sp9ad2ed = 'R'; break; case self::GENDER_FRAU: $sp9ad2ed = 'S'; break; case self::GENDER_FIRMA: $sp9ad2ed = 'F'; break; default: if (is_string($sp7465d3) && !empty($sp7465d3)) { return $sp7465d3; } $sp9ad2ed = 'N'; } return $sp9ad2ed; } public function getSolsticeCustomerC1Key($sp4911f7, $sp63badf) { $sp05241c = $this->getConfigurationDataList()[$sp4911f7]; $sp117b90 = array_search($sp63badf, $sp05241c); return $sp117b90; } protected function getConfigurationDataList() { return $this->getModel('vfde_configurator/configuration')->getConfigurationData(); } }

Function Calls

None

Variables

None

Stats

MD5 a5f29069ac2ce7ab6944f6ee83830db5
Eval Count 0
Decode Time 119 ms