Overview
  • Package
  • Class
  • Tree
  • Todo

Packages

  • AddonValue
    • Interfaces
  • AdminHttpViewControllers
  • ApiV2Controllers
  • Authentication
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Strategies
  • Category
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • Customer
    • Address
    • Country
    • CountryZone
    • Interfaces
    • Storages
    • Validation
    • ValueObjects
  • Email
    • Collections
    • Entities
    • Exceptions
    • Interfaces
    • Repository
    • ValueObjects
  • Extensions
    • Customers
    • Emails
    • Geschaeftskundenversand
    • Helpers
    • Invoices
    • Orders
    • ParcelShopFinder
    • QuickEdit
    • Serializers
    • Templates
  • Geschaeftskundenversand
    • Exceptions
  • Http
    • Collections
    • Exceptions
    • Factories
    • Interfaces
    • ValueObjects
  • HttpViewControllers
  • InfoBox
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
  • Invoice
    • Interfaces
    • ValueObjects
  • Loaders
    • CrossCuttingLoader
    • GXCoreLoader
    • Interfaces
  • Modules
    • Collections
    • Controllers
    • Interfaces
  • Order
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Storages
    • ValueObjects
  • OrderStatus
    • Collections
    • Entities
    • Exceptions
    • Factories
    • Interfaces
    • Repositories
  • Precheck
  • Product
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • ProductModule
    • Collections
    • Deleter
    • Entities
    • Factories
    • Interface
    • Interfaces
    • Reader
    • Repositories
    • Writer
  • QuickEdit
    • Interfaces
    • Repositories
  • Shared
    • ClassFinder
    • Exceptions
    • FileSystem
    • Interfaces
    • Storage
    • Types
  • SharedShoppingCart
    • Interfaces
  • Slider
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Storages
  • Statistics
    • Interfaces
  • UserConfiguration
    • Interfaces
    • Repository
  • VersionInfo
    • Factories
    • Reader
    • ValueObjects

Classes

  • AbstractAddonValueServiceFactory
  • AbstractAddonValueStorage
  • AbstractApiV2Controller
  • AbstractCategoryServiceFactory
  • AbstractCollection
  • AbstractCreateAccountProcess
  • AbstractCustomerFactory
  • AbstractCustomerServiceFactory
  • AbstractFileStorage
  • AbstractHttpContextFactory
  • AbstractHttpViewControllerRegistryFactory
  • AbstractImagesApiV2Controller
  • AbstractInvoiceServiceFactory
  • AbstractJsonSerializer
  • AbstractModuleCenterModule
  • AbstractModuleCenterModuleController
  • AbstractOrderServiceFactory
  • AbstractProductAttributeServiceFactory
  • AbstractProductServiceFactory
  • AbstractSliderServiceFactory
  • AbstractVersionInfoItem
  • AbstractVersionInfoReader
  • AddonValueService
  • AddonValueServiceFactory
  • AddonValueStorageFactory
  • AddressBlock
  • AddressBookService
  • AddressClass
  • AddressesApiV2Controller
  • AddressFormatProvider
  • AddressFormatsApiV2Controller
  • AddressJsonSerializer
  • AdminFavoritesAjaxController
  • AdminHttpViewController
  • AdminInfoBoxAjaxController
  • AdminLayoutHttpControllerResponse
  • AdminPageHttpControllerResponse
  • AfterbuyAjaxController
  • AfterbuyModuleCenterModule
  • AfterbuyModuleCenterModuleController
  • AmazonAdvPaymentsModuleCenterModuleController
  • Asset
  • AssetCollection
  • AttachmentCollection
  • AttachmentName
  • AttachmentPath
  • AttachmentsApiV2Controller
  • AttachmentsHandler
  • AuthFactory
  • AuthService
  • AuthSettings
  • AuthStrategyCollection
  • BoolType
  • BrickfoxModuleCenterModule
  • BrickfoxModuleCenterModuleController
  • CacheTokenHelper
  • CartController
  • CartDropdownController
  • CartShippingCostsController
  • CategoriesApiV2Controller
  • Category
  • CategoryAddonValueStorage
  • CategoryFactory
  • CategoryIconsApiV2Controller
  • CategoryImagesApiV2Controller
  • CategoryJsonSerializer
  • CategoryListItem
  • CategoryListItemCollection
  • CategoryListItemJsonSerializer
  • CategoryListProvider
  • CategoryListProviderFactory
  • CategoryObjectService
  • CategoryReadService
  • CategoryRepository
  • CategoryRepositoryDeleter
  • CategoryRepositoryReader
  • CategoryRepositoryWriter
  • CategoryServiceFactory
  • CategorySettings
  • CategorySettingsRepository
  • CategorySettingsRepositoryReader
  • CategorySettingsRepositoryWriter
  • CategoryWriteService
  • CheckQuantityController
  • CheckStatusController
  • ClassFinder
  • ColorHelper
  • ContactCollection
  • ContactName
  • ContactType
  • ContentNavigationCollection
  • CookieBarController
  • CountriesApiV2Controller
  • CountryJsonSerializer
  • CountryService
  • CreateAccountProcess
  • CreateGuestController
  • CreateRegistreeController
  • CrossCuttingLoader
  • CurrencyCode
  • Customer
  • CustomerAccountInputValidator
  • CustomerAdditionalAddressInfo
  • CustomerAddonValueStorage
  • CustomerAddress
  • CustomerAddressDeleter
  • CustomerAddressInputValidator
  • CustomerAddressReader
  • CustomerAddressRepository
  • CustomerAddressWriter
  • CustomerB2BStatus
  • CustomerCallNumber
  • CustomerCity
  • CustomerCompany
  • CustomerCountry
  • CustomerCountryIso2
  • CustomerCountryIso3
  • CustomerCountryName
  • CustomerCountryReader
  • CustomerCountryRepository
  • CustomerCountryZone
  • CustomerCountryZoneIsoCode
  • CustomerCountryZoneName
  • CustomerCountryZoneReader
  • CustomerCountryZoneRepository
  • CustomerDateOfBirth
  • CustomerDeleter
  • CustomerEmail
  • CustomerFactory
  • CustomerFirstname
  • CustomerGender
  • CustomerHashedPassword
  • CustomerHouseNumber
  • CustomerInputToCollectionTransformer
  • CustomerInputValidator
  • CustomerInputValidatorSettings
  • CustomerJsonSerializer
  • CustomerLastname
  • CustomerLoginController
  • CustomerMemo
  • CustomerMemoCollection
  • CustomerNumber
  • CustomerPassword
  • CustomerPostcode
  • CustomerReader
  • CustomerReadService
  • CustomerRegistrationInputValidatorService
  • CustomerRepository
  • CustomersApiV2Controller
  • CustomerService
  • CustomerServiceFactory
  • CustomerServiceSettings
  • CustomerStatusHelper
  • CustomerStatusInformation
  • CustomerStatusProvider
  • CustomerStreet
  • CustomerSuburb
  • CustomerVatNumber
  • CustomerWriter
  • CustomerWriteService
  • DashboardController
  • DataTableColumn
  • DataTableColumnCollection
  • DataTableColumnType
  • DataTableHelper
  • DecimalType
  • DefaultApiV2Controller
  • DefaultTemplateSettings
  • DocumentFileStorage
  • DynamicShopMessagesController
  • EditableCollection
  • EditableKeyValueCollection
  • EkomiModuleCenterModule
  • EkomiModuleCenterModuleController
  • Email
  • EmailAddress
  • EmailAttachment
  • EmailCollection
  • EmailContact
  • EmailContent
  • EmailDeleter
  • EmailFactory
  • EmailJsonSerializer
  • EmailParser
  • EmailReader
  • EmailRepository
  • EmailsApiV2Controller
  • EmailsController
  • EmailService
  • EmailStringType
  • EmailSubject
  • EmailWriter
  • EmbeddedModuleController
  • EmptyCurrencyCode
  • EmptyDateTime
  • EmptyLanguageCode
  • EmptyProductImage
  • EnvCategoryServiceSettings
  • EnvInvoiceServiceSettings
  • EnvironmentClassFinderSettings
  • EnvironmentHttpContextFactory
  • EnvironmentHttpViewControllerRegistryFactory
  • EnvProductImageFileStorageSettings
  • EnvSlideImageFileStorageSettings
  • ExistingDirectory
  • ExistingFile
  • ExtraContentController
  • FileDownloadInformation
  • FilenameStringType
  • FilesystemHelper
  • FilterController
  • FindologicModuleCenterModule
  • FindologicModuleCenterModuleController
  • GeschaeftskundenversandConfigurationStorage
  • GeschaeftskundenversandController
  • GeschaeftskundenversandLogger
  • GeschaeftskundenversandModuleCenterModule
  • GeschaeftskundenversandModuleCenterModuleController
  • GeschaeftskundenversandProduct
  • GeschaeftskundenversandShipment
  • GeschaeftskundenversandSoapAdapter
  • GoogleAdwordConversionModuleCenterModule
  • GoogleAdwordConversionModuleCenterModuleController
  • GXCoreLoader
  • GXCoreLoaderSettings
  • GXEngineOrder
  • GXEngineProduct
  • HeidelpayModuleCenterModuleController
  • HermesModuleCenterModule
  • HermesModuleCenterModuleController
  • HttpApiV2Controller
  • HttpContext
  • HttpContextReader
  • HttpControllerResponse
  • HttpDispatcher
  • HttpResponseProcessor
  • HttpService
  • HttpServiceFactory
  • HttpViewController
  • HttpViewControllerFactory
  • HttpViewControllerRegistry
  • IdCollection
  • IdType
  • IloxxModuleCenterModule
  • IloxxModuleCenterModuleController
  • ImageFileStorage
  • ImageProcessingController
  • ImageRequestController
  • InfoBoxFactory
  • InfoBoxMessage
  • InfoBoxMessageCollection
  • InfoBoxRepository
  • InfoBoxRepositoryDeleter
  • InfoBoxRepositoryReader
  • InfoBoxRepositoryWriter
  • InfoBoxService
  • IntrashipModuleCenterModule
  • IntrashipModuleCenterModuleController
  • IntType
  • InvoiceActions
  • InvoiceArchiveReadService
  • InvoiceArchiveWriteService
  • InvoiceFileEntitler
  • InvoiceInformation
  • InvoiceListGenerator
  • InvoiceListItem
  • InvoiceListItemCollection
  • InvoiceRepository
  • InvoiceServiceFactory
  • InvoicesModalsAjaxController
  • InvoicesOverviewAjaxController
  • InvoicesOverviewColumns
  • InvoicesOverviewController
  • InvoicesOverviewTooltips
  • ItRechtModuleCenterModule
  • ItRechtModuleCenterModuleController
  • JanolawModuleCenterModule
  • JanolawModuleCenterModuleController
  • JsConfigurationController
  • JSEngineConfiguration
  • JsonHttpControllerResponse
  • JsTranslationsController
  • KeyValueCollection
  • KlarnaModuleCenterModuleController
  • LanguageCode
  • LanguageHelper
  • LanguageProvider
  • LawsController
  • LegacyProductImageProcessing
  • LettrModuleCenterModule
  • LettrModuleCenterModuleController
  • LiveSearchController
  • MagnalisterModuleCenterModule
  • MagnalisterModuleCenterModuleController
  • MailbeezModuleCenterModule
  • MailbeezModuleCenterModuleController
  • MailerAdapter
  • MaxFileSizeController
  • Md5Strategy
  • MediafinanzModuleCenterModule
  • MediafinanzModuleCenterModuleController
  • ModuleCenterController
  • ModuleCenterModuleCollection
  • ModuleTitleProvider
  • NewAttributesController
  • NewsletterLinkModuleCenterModule
  • NewsletterLinkModuleCenterModuleController
  • NonEmptyStringType
  • OrderActions
  • OrderAddonValueStorage
  • OrderAddressBlock
  • OrderFactory
  • OrderItem
  • OrderItemAddonValueStorage
  • OrderItemAttribute
  • OrderItemAttributeCollection
  • OrderItemAttributeFactory
  • OrderItemAttributeRepository
  • OrderItemAttributeRepositoryDeleter
  • OrderItemAttributeRepositoryFactory
  • OrderItemAttributeRepositoryReader
  • OrderItemAttributeRepositoryWriter
  • OrderItemCollection
  • OrderItemDownloadInformation
  • OrderItemDownloadInformationCollection
  • OrderItemFactory
  • OrderItemProperty
  • OrderItemPropertyFactory
  • OrderItemPropertyRepository
  • OrderItemPropertyRepositoryDeleter
  • OrderItemPropertyRepositoryReader
  • OrderItemPropertyRepositoryWriter
  • OrderItemRepository
  • OrderItemRepositoryDeleter
  • OrderItemRepositoryReader
  • OrderItemRepositoryWriter
  • OrderJsonSerializer
  • OrderListGenerator
  • OrderListItem
  • OrderListItemCollection
  • OrderListItemJsonSerializer
  • OrderObjectService
  • OrderPaymentType
  • OrderReadService
  • OrderRepository
  • OrderRepositoryDeleter
  • OrderRepositoryReader
  • OrderRepositoryWriter
  • OrdersApiV2Controller
  • OrderServiceFactory
  • OrderServiceSettings
  • OrderShippingType
  • OrdersHistoryApiV2Controller
  • OrdersItemsApiV2Controller
  • OrdersItemsAttributesApiV2Controller
  • OrdersModalsAjaxController
  • OrdersOverviewAjaxController
  • OrdersOverviewColumns
  • OrdersOverviewController
  • OrdersOverviewTooltips
  • OrderStatus
  • OrderStatusCollection
  • OrderStatusDeleter
  • OrderStatusesApiV2Controller
  • OrderStatusFactory
  • OrderStatusHistoryListItem
  • OrderStatusHistoryListItemCollection
  • OrderStatusHistoryStorage
  • OrderStatusReader
  • OrderStatusRepository
  • OrderStatusService
  • OrderStatusServiceFactory
  • OrderStatusStyles
  • OrderStatusWriter
  • OrdersTotalsApiV2Controller
  • OrderTooltipController
  • OrderTotal
  • OrderTotalCollection
  • OrderTotalFactory
  • OrderTotalRepository
  • OrderTotalRepositoryDeleter
  • OrderTotalRepositoryReader
  • OrderTotalRepositoryWriter
  • OrderTrackingInformationCollection
  • OrderWriteService
  • PackedDownloadController
  • ParcelShopFinder
  • ParcelshopfinderController
  • ParcelShopFinderLogger
  • ParcelshopfinderModuleCenterModule
  • ParcelshopfinderModuleCenterModuleController
  • PasswordEncryptionSettings
  • PasswordHashStrategy
  • PathType
  • PaymentTitleProvider
  • PayOneModuleCenterModuleController
  • PayPalConfigurationController
  • PayPalController
  • PaypalNGModuleCenterModuleController
  • PostfinderModuleCenterModule
  • PostfinderModuleCenterModuleController
  • Precheck
  • ProductAddonValueStorage
  • ProductAttribute
  • ProductAttributeCollection
  • ProductAttributeFactory
  • ProductAttributeObjectService
  • ProductAttributeRepository
  • ProductAttributeRepositoryDeleter
  • ProductAttributeRepositoryReader
  • ProductAttributeRepositoryWriter
  • ProductAttributeService
  • ProductAttributeServiceFactory
  • ProductAttributesModuleCenterModule
  • ProductAttributesModuleCenterModuleController
  • ProductCategoryLinker
  • ProductFactory
  • ProductImage
  • ProductImageCollection
  • ProductImageContainer
  • ProductImageContainerRepository
  • ProductImageFileStorage
  • ProductImagesApiV2Controller
  • ProductJsonSerializer
  • ProductListItem
  • ProductListItemCollection
  • ProductListItemJsonSerializer
  • ProductListProvider
  • ProductListProviderFactory
  • ProductObjectService
  • ProductPermissionSetter
  • ProductQuestionController
  • ProductReadService
  • ProductRepository
  • ProductRepositoryDeleter
  • ProductRepositoryReader
  • ProductRepositoryWriter
  • ProductsApiV2Controller
  • ProductServiceFactory
  • ProductSettings
  • ProductSettingsRepository
  • ProductSettingsRepositoryReader
  • ProductSettingsRepositoryWriter
  • ProductsLinksApiV2Controller
  • ProductWriteService
  • ProtectedShopsModuleCenterModule
  • ProtectedShopsModuleCenterModuleController
  • QuickEditDocuments
  • QuickEditOverviewAjaxController
  • QuickEditOverviewColumns
  • QuickEditOverviewController
  • QuickEditOverviewTooltips
  • QuickEditProductGraduatedPricesReader
  • QuickEditProductGraduatedPricesRepository
  • QuickEditProductListItem
  • QuickEditProductPropertiesAjaxController
  • QuickEditProductPropertiesListItem
  • QuickEditProductPropertiesReader
  • QuickEditProductPropertiesRepository
  • QuickEditProductPropertiesWriter
  • QuickEditProductSpecialPriceListItem
  • QuickEditProductSpecialPricesReader
  • QuickEditProductSpecialPricesRepository
  • QuickEditProductSpecialPricesWriter
  • QuickEditPropertiesOverviewColumns
  • QuickEditPropertiesTooltips
  • QuickEditService
  • QuickEditServiceFactory
  • QuickEditSpecialPricesAjaxController
  • QuickEditSpecialPricesOverviewColumns
  • QuickEditSpecialPriceTooltips
  • RedirectHttpControllerResponse
  • SessionTimeoutAjaxController
  • SharedShoppingCartConfigurationController
  • SharedShoppingCartController
  • SharedShoppingCartDeleter
  • SharedShoppingCartModuleCenterModule
  • SharedShoppingCartModuleCenterModuleController
  • SharedShoppingCartReader
  • SharedShoppingCartRepository
  • SharedShoppingCartService
  • SharedShoppingCartSettings
  • SharedShoppingCartWriter
  • ShipcloudController
  • ShipcloudModuleCenterModule
  • ShipcloudModuleCenterModuleController
  • ShippingTitleProvider
  • ShopInformationApiV2Controller
  • ShopKeyController
  • Slide
  • SlideCollection
  • SlideImage
  • SlideImageArea
  • SlideImageAreaCollection
  • SlideImageAreaRepository
  • SlideImageAreaRepositoryDeleter
  • SlideImageAreaRepositoryReader
  • SlideImageAreaRepositoryWriter
  • SlideImageCollection
  • SlideImageFileStorage
  • SlideImageRepository
  • SlideImageRepositoryDeleter
  • SlideImageRepositoryReader
  • SlideImageRepositoryWriter
  • Slider
  • SliderAssignmentRepository
  • SliderCollection
  • SlideRepository
  • SlideRepositoryDeleter
  • SlideRepositoryReader
  • SlideRepositoryWriter
  • SliderJsonSerializer
  • SliderReadService
  • SliderRepository
  • SliderRepositoryDeleter
  • SliderRepositoryReader
  • SliderRepositoryWriter
  • SlidersDetailsAjaxController
  • SlidersDetailsController
  • SliderServiceFactory
  • SlidersOverviewAjaxController
  • SlidersOverviewController
  • SliderWriteService
  • StaticCrossCuttingLoader
  • StaticGXCoreLoader
  • StatisticsService
  • StoredCategory
  • StoredOrderItem
  • StoredOrderItemAttribute
  • StoredOrderItemAttributeCollection
  • StoredOrderItemCollection
  • StoredOrderItemProperty
  • StoredOrderTotal
  • StoredOrderTotalCollection
  • StoredProduct
  • StoredProductAttribute
  • StoredProductAttributeCollection
  • StringCollection
  • StringHelper
  • StringType
  • StyleEdit3AuthenticationController
  • TaxClassesApiV2Controller
  • TaxRatesApiV2Controller
  • TaxZonesApiV2Controller
  • TemplateConfigurationController
  • TrustedShopsModuleCenterModule
  • TrustedShopsModuleCenterModuleController
  • UnknownCustomerCountry
  • UploadedFile
  • UrlRewrite
  • UrlRewriteCollection
  • UrlRewriteStorage
  • UserConfigurationController
  • UserConfigurationReader
  • UserConfigurationService
  • UserConfigurationWriter
  • UsernamePasswordCredentials
  • VatNumberValidator
  • VersionInfoController
  • VersionInfoDatabaseItem
  • VersionInfoDatabaseReader
  • VersionInfoFileItem
  • VersionInfoFileReader
  • VersionInfoItemFactory
  • VersionInfoRepository
  • VersionInfoService
  • VersionInfoServiceFactory
  • WishListController
  • WritableDirectory
  • WritableFile
  • YategoModuleCenterModule
  • YategoModuleCenterModuleController
  • YoochooseModuleCenterModule
  • YoochooseModuleCenterModuleController
  • ZoneJsonSerializer
  • ZonesApiV2Controller

Interfaces

  • AddonValueContainerInterface
  • AddonValueServiceInterface
  • AddonValueStorageFactoryInterface
  • AddressBlockInterface
  • AddressBookServiceInterface
  • AddressClassInterface
  • AddressFormatProviderInterface
  • AdminStatusOnlyInterface
  • AssetCollectionInterface
  • AssetInterface
  • AttachmentCollectionInterface
  • AttachmentNameInterface
  • AttachmentPathInterface
  • AttachmentsHandlerInterface
  • AuthCredentialsInterface
  • AuthFactoryInterface
  • AuthServiceInterface
  • AuthSettingsInterface
  • AuthStrategyInterface
  • CacheTokenHelperInterface
  • CategoryFactoryInterface
  • CategoryInterface
  • CategoryListProviderFactoryInterface
  • CategoryListProviderInterface
  • CategoryObjectServiceInterface
  • CategoryReadServiceInterface
  • CategoryRepositoryDeleterInterface
  • CategoryRepositoryInterface
  • CategoryRepositoryReaderInterface
  • CategoryRepositoryWriterInterface
  • CategoryServiceSettingsInterface
  • CategorySettingsInterface
  • CategorySettingsRepositoryInterface
  • CategorySettingsRepositoryReaderInterface
  • CategorySettingsRepositoryWriterInterface
  • CategoryWriteServiceInterface
  • ClassFinderInterface
  • ClassFinderSettingsInterface
  • ContactCollectionInterface
  • ContactNameInterface
  • ContactTypeInterface
  • ContentNavigationCollectionInterface
  • ContentViewInterface
  • CountryServiceInterface
  • CrossCuttingLoaderInterface
  • CrossCuttingObjectInterface
  • CustomerAccountInputValidatorInterface
  • CustomerAdditionalAddressInfoInterface
  • CustomerAddressDeleterInterface
  • CustomerAddressInputValidatorInterface
  • CustomerAddressInterface
  • CustomerAddressReaderInterface
  • CustomerAddressRepositoryInterface
  • CustomerAddressWriterInterface
  • CustomerB2BStatusInterface
  • CustomerCallNumberInterface
  • CustomerCityInterface
  • CustomerCompanyInterface
  • CustomerCountryInterface
  • CustomerCountryIso2Interface
  • CustomerCountryIso3Interface
  • CustomerCountryNameInterface
  • CustomerCountryReaderInterface
  • CustomerCountryRepositoryInterface
  • CustomerCountryZoneInterface
  • CustomerCountryZoneIsoCodeInterface
  • CustomerCountryZoneNameInterface
  • CustomerCountryZoneReaderInterface
  • CustomerCountryZoneRepositoryInterface
  • CustomerDeleterInterface
  • CustomerEmailInterface
  • CustomerFirstnameInterface
  • CustomerGenderInterface
  • CustomerHouseNumberInterface
  • CustomerInputValidatorInterface
  • CustomerInputValidatorSettingsInterface
  • CustomerInterface
  • CustomerLastnameInterface
  • CustomerNumberInterface
  • CustomerPasswordInterface
  • CustomerPostcodeInterface
  • CustomerReaderInterface
  • CustomerReadServiceInterface
  • CustomerRegistrationInputValidatorServiceInterface
  • CustomerRepositoryInterface
  • CustomerServiceInterface
  • CustomerServiceSettingsInterface
  • CustomerStatusHelperInterface
  • CustomerStatusProviderInterface
  • CustomerStreetInterface
  • CustomerSuburbInterface
  • CustomerVatNumberInterface
  • CustomerWriterInterface
  • CustomerWriteServiceInterface
  • EmailAddressInterface
  • EmailAttachmentInterface
  • EmailCollectionInterface
  • EmailContactInterface
  • EmailContentInterface
  • EmailDeleterInterface
  • EmailFactoryInterface
  • EmailInterface
  • EmailReaderInterface
  • EmailRepositoryInterface
  • EmailServiceInterface
  • EmailSubjectInterface
  • EmailWriterInterface
  • FilesystemHelperInterface
  • GXCoreLoaderInterface
  • GXCoreLoaderSettingsInterface
  • HttpContextInterface
  • HttpContextReaderInterface
  • HttpControllerResponseInterface
  • HttpDispatcherInterface
  • HttpResponseProcessorInterface
  • HttpServiceFactoryInterface
  • HttpServiceInterface
  • HttpViewControllerFactoryInterface
  • HttpViewControllerInterface
  • HttpViewControllerRegistryInterface
  • IdInterface
  • InfoBoxFactoryInterface
  • InfoBoxMessageInterface
  • InfoBoxRepositoryDeleterInterface
  • InfoBoxRepositoryInterface
  • InfoBoxRepositoryReaderInterface
  • InfoBoxRepositoryWriterInterface
  • InfoBoxServiceInterface
  • InvoiceArchiveReadServiceInterface
  • InvoiceArchiveWriteServiceInterface
  • InvoiceFileEntitlerInterface
  • InvoiceListGeneratorInterface
  • InvoiceRepositoryInterface
  • InvoiceServiceSettingsInterface
  • LanguageHelperInterface
  • LanguageProviderInterface
  • MailerAdapterInterface
  • ModuleCenterModuleCollectionInterface
  • ModuleCenterModuleInterface
  • OrderFactoryInterface
  • OrderInterface
  • OrderItemAttributeFactoryInterface
  • OrderItemAttributeInterface
  • OrderItemAttributeRepositoryDeleterInterface
  • OrderItemAttributeRepositoryFactoryInterface
  • OrderItemAttributeRepositoryInterface
  • OrderItemAttributeRepositoryReaderInterface
  • OrderItemAttributeRepositoryWriterInterface
  • OrderItemFactoryInterface
  • OrderItemInterface
  • OrderItemPropertyFactoryInterface
  • OrderItemPropertyRepositoryDeleterInterface
  • OrderItemPropertyRepositoryReaderInterface
  • OrderItemPropertyRepositoryWriterInterface
  • OrderItemRepositoryDeleterInterface
  • OrderItemRepositoryInterface
  • OrderItemRepositoryReaderInterface
  • OrderItemRepositoryWriterInterface
  • OrderListGeneratorInterface
  • OrderObjectServiceInterface
  • OrderPaymentTypeInterface
  • OrderReadServiceInterface
  • OrderRepositoryDeleterInterface
  • OrderRepositoryInterface
  • OrderRepositoryReaderInterface
  • OrderRepositoryWriterInterface
  • OrderServiceSettingsInterface
  • OrderShippingTypeInterface
  • OrderStatusDeleterInterface
  • OrderStatusFactoryInterface
  • OrderStatusHistoryReaderInterface
  • OrderStatusHistoryWriterInterface
  • OrderStatusInterface
  • OrderStatusReaderInterface
  • OrderStatusRepositoryInterface
  • OrderStatusServiceFactoryInterface
  • OrderStatusServiceInterface
  • OrderStatusWriterInterface
  • OrderTotalFactoryInterface
  • OrderTotalInterface
  • OrderTotalRepositoryDeleterInterface
  • OrderTotalRepositoryInterface
  • OrderTotalRepositoryReaderInterface
  • OrderTotalRepositoryWriterInterface
  • OrderWriteServiceInterface
  • ProductAttributeFactoryInterface
  • ProductAttributeInterface
  • ProductAttributeObjectServiceInterface
  • ProductAttributeRepositoryDeleterInterface
  • ProductAttributeRepositoryInterface
  • ProductAttributeRepositoryReaderInterface
  • ProductAttributeRepositoryWriterInterface
  • ProductAttributeServiceInterface
  • ProductCategoryLinkerInterface
  • ProductFactoryInterface
  • ProductImageContainerInterface
  • ProductImageContainerRepositoryInterface
  • ProductImageInterface
  • ProductImagePathsSettingsInterface
  • ProductImageProcessingInterface
  • ProductInterface
  • ProductListProviderFactoryInterface
  • ProductListProviderInterface
  • ProductObjectServiceInterface
  • ProductPermissionSetterInterface
  • ProductReadServiceInterface
  • ProductRepositoryDeleterInterface
  • ProductRepositoryInterface
  • ProductRepositoryReaderInterface
  • ProductRepositoryWriterInterface
  • ProductSettingsInterface
  • ProductSettingsRepositoryInterface
  • ProductSettingsRepositoryReaderInterface
  • ProductSettingsRepositoryWriterInterface
  • ProductWriteServiceInterface
  • QuickEditDocumentsInterface
  • QuickEditOverviewColumnsInterface
  • QuickEditOverviewTooltipsInterface
  • QuickEditProductGraduatedPricesReaderInterface
  • QuickEditProductGraduatedPricesRepositoryInterface
  • QuickEditProductPropertiesReaderInterface
  • QuickEditProductPropertiesRepositoryInterface
  • QuickEditProductPropertiesWriterInterface
  • QuickEditProductSpecialPricesReaderInterface
  • QuickEditProductSpecialPricesRepositoryInterface
  • QuickEditProductSpecialPricesWriterInterface
  • QuickEditPropertiesOverviewColumnsInterface
  • QuickEditPropertiesTooltipsInterface
  • QuickEditServiceFactoryInterface
  • QuickEditServiceInterface
  • QuickEditSpecialPricesOverviewColumnsInterface
  • QuickEditSpecialPriceTooltipsInterface
  • SerializerInterface
  • SharedShoppingCartDeleterInterface
  • SharedShoppingCartReaderInterface
  • SharedShoppingCartRepositoryInterface
  • SharedShoppingCartServiceInterface
  • SharedShoppingCartSettingsInterface
  • SharedShoppingCartWriterInterface
  • SlideImageAreaInterface
  • SlideImageAreaRepositoryDeleterInterface
  • SlideImageAreaRepositoryInterface
  • SlideImageAreaRepositoryReaderInterface
  • SlideImageAreaRepositoryWriterInterface
  • SlideImageInterface
  • SlideImagePathsSettingsInterface
  • SlideImageRepositoryDeleterInterface
  • SlideImageRepositoryInterface
  • SlideImageRepositoryReaderInterface
  • SlideImageRepositoryWriterInterface
  • SlideInterface
  • SliderAssignmentRepositoryInterface
  • SlideRepositoryDeleterInterface
  • SlideRepositoryInterface
  • SlideRepositoryReaderInterface
  • SlideRepositoryWriterInterface
  • SliderInterface
  • SliderReadServiceInterface
  • SliderRepositoryDeleterInterface
  • SliderRepositoryInterface
  • SliderRepositoryReaderInterface
  • SliderRepositoryWriterInterface
  • SliderWriteServiceInterface
  • StatisticsServiceInterface
  • StoredCategoryInterface
  • StoredOrderItemAttributeInterface
  • StoredOrderItemInterface
  • StoredOrderTotalInterface
  • StoredProductAttributeInterface
  • StoredProductInterface
  • StringHelperInterface
  • UrlKeywordsRepairerInterface
  • UserConfigurationReaderInterface
  • UserConfigurationServiceInterface
  • UserConfigurationWriterInterface
  • VatNumberValidatorInterface
  • VersionInfoItemInterface

Exceptions

  • AjaxException
  • AttachmentNotFoundException
  • FileNotFoundException
  • GeschaeftskundenversandProductException
  • GeschaeftskundenversandShipmentException
  • GeschaeftskundenversandShipmentInvalidExportTypeException
  • GeschaeftskundenversandShipmentInvalidTermsOfTradeException
  • GeschaeftskundenversandSoapAdapterCigCredentialsMissingException
  • GeschaeftskundenversandSoapAdapterException
  • GeschaeftskundenversandSoapAdapterServiceUnavailableException
  • HttpApiV2Exception
  • InvalidCustomerDataException
  • InvalidEkpFormatException
  • InvalidGKVAttendanceFormatException
  • InvalidGKVProductTypeException
  • MissingControllerNameException
  • OrderStatusIdExistsException
  • OrderStatusIdNotExistsException
  • OrderStatusNotFoundException
  • UnknownEnvironmentException
  1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  64  65  66  67  68  69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88  89  90  91  92  93  94  95  96  97  98  99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 
<?php

/* --------------------------------------------------------------
    GeschaeftskundenversandController.inc.php 2017-04-06
    Gambio GmbH
    http://www.gambio.de
    Copyright (c) 2017 Gambio GmbH
    Released under the GNU General Public License (Version 2)
    [http://www.gnu.org/licenses/gpl-2.0.html]
    --------------------------------------------------------------
*/

/**
 * Class GeschaeftskundenversandController
 * 
 * @extends    AdminHttpViewController
 * @category   System
 * @package    AdminHttpViewControllers
 */
class GeschaeftskundenversandController extends AdminHttpViewController
{
    /**
     * @var LanguageTextManager
     */
    protected $languageTextManager;
    
    /**
     * @var GeschaeftskundenversandConfigurationStorage
     */
    protected $configuration;
    
    /**
     * @var GeschaeftskundenversandLogger
     */
    protected $logger;
    
    
    /**
     * Override "proceed" method of parent and use it for initialization.
     *
     * @param HttpContextInterface $httpContext
     */
    public function proceed(HttpContextInterface $httpContext)
    {
        $this->logger = MainFactory::create('GeschaeftskundenversandLogger');
        $this->contentView->set_template_dir(DIR_FS_ADMIN . 'html/content/');
        $this->languageTextManager = MainFactory::create('LanguageTextManager', 'module_center_module',
                                                         $_SESSION['languages_id']);
        $this->configuration       = MainFactory::create('GeschaeftskundenversandConfigurationStorage');
        
        parent::proceed($httpContext);
    }
    
    
    public function actionPrepareLabel()
    {
        require_once DIR_FS_ADMIN . 'includes/classes/order.php';
        $orders_id = (int)$this->_getQueryParameter('oID');
        $order     = new order($orders_id);
        
        $productNames = [];
        foreach(GeschaeftskundenversandProduct::getValidTypes() as $productType)
        {
            $productNames[$productType] = $this->languageTextManager->get_text('gkv_product_' . $productType);
        }
        
        if(empty($order->delivery['house_number']))
        {
            $splitStreet = $this->splitStreet($order->delivery['street_address']);
            $street      = $splitStreet['street'];
            $houseNumber = $splitStreet['house_no'];
        }
        else
        {
            $street      = $order->delivery['street_address'];
            $houseNumber = $order->delivery['house_number'];
        }
        
        $packstationNumber = stripos($street, 'packstation') !== false
            ? $houseNumber
            : '';
        $postfilialNumber  = stripos($street, 'postfiliale') !== false
            ? $houseNumber
            : '';
        $parcelshopNumber  = stripos($street, 'parcelshop') !== false
            ? $houseNumber
            : '';
        $parcelshopNumber  = empty($parcelshopNumber) && stripos($street, 'paketshop') !== false
            ? $houseNumber
            : '';
        if($order->delivery['country_iso_code_2'] == $this->configuration->get('shipper/origincountry'))
        {
            if(empty($postfilialNumber) && !empty($parcelshopNumber))
            {
                $postfilialNumber = $parcelshopNumber;
            }
            $parcelshopNumber = '';
        }
        
        $postnumberMatches = [];
        if(preg_match('/^(?P<name>.+)\s*\/\s*(?P<postnumber>\d+)\s*$/', $order->delivery['name'], $postnumberMatches)
           === 1
        )
        {
            $name       = $postnumberMatches['name'];
            $postnumber = $postnumberMatches['postnumber'];
        }
        else
        {
            $postnumber = '';
            $name       = $order->delivery['name'];
            if(preg_match('/.*(packstation|parcelshop|dhl paketshop|postfiliale).*/i',
                          $order->delivery['street_address']) === 1
            )
            {
                if(is_numeric($order->delivery['additional_address_info']))
                {
                    $postnumber = $order->delivery['additional_address_info'];
                }
                else if(preg_match('/^postnummer (\d{6,10})/i', $order->delivery['additional_address_info'],
                                   $postnumberMatches) === 1
                )
                {
                    $postnumber = $postnumberMatches[1];
                }
            }
        }
        
        $isExport = $order->delivery['country_iso_code_2'] !== $this->configuration->get('shipper/origincountry');
        $products = $this->configuration->getProducts();
        foreach($products as $productsIdx => $product)
        {
            if($isExport && $product->getTargetArea() !== 'domestic')
            {
                $productsDefault = $productsIdx;
                break;
            }
            if(!isExport && $product->getTargetArea() === 'domestic')
            {
                $productsDefault = $productsIdx;
                break;
            }
        }
        
        $formdata = [
            'pageToken'            => $_SESSION['coo_page_token']->generate_token(),
            'countries'            => $this->getCountries(),
            'shipments'            => $this->getShipments($orders_id),
            'configuration'        => $this->configuration->get_all(),
            'action_create_label'  => xtc_href_link('admin.php', 'do=Geschaeftskundenversand/CreateLabel'),
            'action_delete_label'  => xtc_href_link('admin.php', 'do=Geschaeftskundenversand/DeleteLabel'),
            'products'             => $products,
            'products_default'     => $productsDefault,
            'product_names'        => $productNames,
            'order'                => $order,
            'orders_id'            => $orders_id,
            'delivery'             => $order->delivery,
            'delivery_name'        => $name,
            'delivery_postnumber'  => $postnumber,
            'delivery_packstation' => $packstationNumber,
            'delivery_postfiliale' => $postfilialNumber,
            'delivery_parcelshop'  => $parcelshopNumber,
            'delivery_street'      => $street,
            'delivery_house_no'    => $houseNumber,
            'shipping_weight'      => number_format($this->computeShipmentWeight($orders_id, $order), 3, '.', ''),
            'customer_reference'   => $orders_id,
            'shipment_date'        => date('Y-m-d'),
            'is_export'            => $isExport,
            'is_cod'               => $order->info['payment_method'] === 'cod',
            'transportConditions'  => $this->getTransportConditions($orders_id) !== 'declined',
            'label_target'         => $this->configuration->get('open_in_new_tab') == 1
                ? '_blank'
                : '',
        ];
        
        $html   = $this->_render('geschaeftskundenversand_form_single.html', $formdata);
        $assets = MainFactory::create('AssetCollection');
        $assets->add(MainFactory::create('Asset', DIR_WS_CATALOG
                                                  . 'admin/html/assets/styles/modules/geschaeftskundenversand.min.css'));
        $assets->add(MainFactory::create('Asset', DIR_WS_CATALOG
                                                  . 'admin/html/assets/javascript/modules/geschaeftskundenversand/geschaeftskundenversand-form.min.js'));
        
        return MainFactory::create('AdminPageHttpControllerResponse',
                                   $this->languageTextManager->get_text('gkv_head_prepare_label'), $html, $assets);
    }
    
    
    protected function getTransportConditions($orderIdString)
    {
        try
        {
            $orderId           = new IdType($orderIdString);
            $orderReadService  = StaticGXCoreLoader::getService('OrderRead');
            $order             = $orderReadService->getOrderById($orderId);
            $addonValueService = StaticGXCoreLoader::getService('AddonValue');
            $addonValueService->loadAddonValues($order);
            $transportConditions = $order->getAddonValue(new StringType('transportConditions'));
        }
        catch(Exception $e)
        {
            $transportConditions = 'declined';
        }
        
        return $transportConditions;
    }
    
    
    protected function getCountries()
    {
        $db        = StaticGXCoreLoader::getDatabaseQueryBuilder();
        $countries = $db->get_where('countries', ['status' => '1'])->result_array();
        
        // print_r($countries); die();
        return $countries;
    }
    
    
    protected function insertBankDataPlaceholders($configuredText, $orders_id)
    {
        $replacements = ['%orders_id%' => (int)$orders_id];
        $outputText   = strtr($configuredText, $replacements);
        
        return $outputText;
    }
    
    
    public function actionCreateLabel()
    {
        $this->_validatePageToken();
        $postData = $this->_getPostDataCollection()->getArray();
        
        $product = Mainfactory::create('GeschaeftskundenversandProduct',
                                       $this->configuration->get('products/' . (int)$postData['product_index']
                                                                 . '/type'),
                                       $this->configuration->get('products/' . (int)$postData['product_index']
                                                                 . '/attendance'),
                                       $this->configuration->get('products/' . (int)$postData['product_index']
                                                                 . '/alias'));
        
        $note1            = $this->insertBankDataPlaceholders($this->configuration->get('bankdata/note1'),
                                                              $postData['orders_id']);
        $note2            = $this->insertBankDataPlaceholders($this->configuration->get('bankdata/note2'),
                                                              $postData['orders_id']);
        $accountreference = $this->insertBankDataPlaceholders($this->configuration->get('bankdata/accountreference'),
                                                              $postData['orders_id']);
        
        $shipment = Mainfactory::create('GeschaeftskundenversandShipment', $this->configuration->get('ekp'));
        $shipment->setBankData($this->configuration->get('bankdata/accountowner'),
                               $this->configuration->get('bankdata/bankname'),
                               $this->configuration->get('bankdata/iban'), $note1, $note2,
                               $this->configuration->get('bankdata/bic'), $accountreference);
        $shipment->setShipperName($postData['shipper/name1'], $postData['shipper/name2'], $postData['shipper/name3']);
        $shipment->setShipperAddress($postData['shipper/streetname'], $postData['shipper/streetnumber'],
                                     $postData['shipper/addressaddition'], $postData['shipper/zip'],
                                     $postData['shipper/city'], $postData['shipper/origincountry']);
        $shipment->setShipperCommunication($postData['shipper/phone'], $postData['shipper/email'],
                                           $postData['shipper/name1']);
        $shipment->setReturnReceiverName($postData['returnreceiver/name1'], $postData['returnreceiver/name2'],
                                         $postData['returnreceiver/name3']);
        $shipment->setReturnReceiverAddress($postData['returnreceiver/streetname'],
                                            $postData['returnreceiver/streetnumber'],
                                            $postData['returnreceiver/addressaddition'],
                                            $postData['returnreceiver/zip'], $postData['returnreceiver/city'],
                                            $postData['returnreceiver/origincountry']);
        $shipment->setReturnReceiverCommunication($postData['returnreceiver/phone'], $postData['returnreceiver/email'],
                                                  $postData['returnreceiver/name1']);
        
        $shipment->setReceiverName($postData['receiver/name1']);
        if($postData['receiver_type'] == 'address')
        {
            $shipment->setReceiverAddress($postData['receiver_address/streetname'],
                                          $postData['receiver_address/streetnumber'],
                                          $postData['receiver_address/addressaddition'],
                                          $postData['receiver_address/zip'], $postData['receiver_address/city'],
                                          $postData['receiver_address/origincountry']);
        }
        if($postData['receiver_type'] == 'packstation')
        {
            $shipment->setReceiverPackstation($postData['receiver_packstation/packstationnumber'],
                                              $postData['receiver_packstation/zip'],
                                              $postData['receiver_packstation/city'],
                                              $postData['receiver_packstation/origincountry'],
                                              $postData['receiver_packstation/postnumber']);
        }
        if($postData['receiver_type'] == 'postfiliale')
        {
            $shipment->setReceiverPostfiliale($postData['receiver_postfiliale/postfilialnumber'],
                                              $postData['receiver_postfiliale/zip'],
                                              $postData['receiver_postfiliale/city'],
                                              $postData['receiver_postfiliale/origincountry'],
                                              $postData['receiver_postfiliale/postnumber']);
        }
        if($postData['receiver_type'] == 'parcelshop')
        {
            $shipment->setReceiverParcelshop($postData['receiver_parcelshop/parcelshopnumber'],
                                             $postData['receiver_parcelshop/zip'],
                                             $postData['receiver_parcelshop/city'],
                                             $postData['receiver_parcelshop/origincountry'],
                                             $postData['receiver_parcelshop/streetname'],
                                             $postData['receiver_parcelshop/streetnumber']);
        }
        $shipment->setReceiverCommunication($postData['receiver/phone'], $postData['receiver/email'],
                                            $postData['receiver/name1']);
        $shipment->setNotification($postData['notification']);
        $shipment->setProduct($product);
        $shipment->setWeight($postData['shipping_weight']);
        $shipment->setShipmentDate($postData['shipment_date']);
        $shipment->setCustomerReference($postData['customer_reference']);
        $shipment->setAllServices($postData);
        if($product->getTargetArea() !== 'domestic' && $postData['exportdoc/exporttype'] !== 'NONE')
        {
            $shipment->setExportDocument($postData['exportdoc/exporttype'], $postData['exportdoc/placeofcommital'],
                                         $postData['exportdoc/additionalfee'], $postData['exportdoc/invoicenumber'],
                                         $postData['exportdoc/termsoftrade'], $postData['exportdoc/permitnumber'],
                                         $postData['exportdoc/attestationnumber'],
                isset($postData['exportdoc/withelectronicexportntfctn']));
            $numPositions = count($postData['exportpos']['description']);
            // N.B. $posIdx == 0 would be the (empty) template row
            for($posIdx = 1; $posIdx < $numPositions; $posIdx++)
            {
                $shipment->addExportDocPosition($postData['exportpos']['description'][$posIdx],
                                                $postData['exportpos']['countrycodeorigin'][$posIdx],
                                                $postData['exportpos']['customstariffnumber'][$posIdx],
                                                $postData['exportpos']['amount'][$posIdx],
                                                $postData['exportpos']['netweightkg'][$posIdx],
                                                $postData['exportpos']['customsvalue'][$posIdx]);
            }
        }
        $shipment->setPrintOnlyIfCodeable(!empty($postData['only_if_codeable']));
        $shipment->setLabelResponseType('URL');
        
        $shipmentParams = $shipment->toArray();
        $this->logger->noticeDebug(print_r($shipmentParams, true));
        try
        {
            $gkvSoapAdapter = Mainfactory::create('GeschaeftskundenversandSoapAdapter', $this->configuration);
            $sc             = $gkvSoapAdapter->getSoapClient();
            
            $response = $sc->createShipmentOrder($shipmentParams);
            $this->logger->noticeDebug(sprintf("CreateShipmentOrder response:\n%s\n", print_r($response, true)));
            //$output = [];
            //$output[] = sprintf('Status: %s - %s - %s', $response->Status->statusCode, $response->Status->statusText, $response->Status->statusMessage);
            if($response->Status->statusCode == 0)
            {
                //$output[] = sprintf('ShipmentNumber: %s', $response->CreationState->LabelData->shipmentNumber);
                //$output[] = sprintf('<a href="%s">Label</a>', $response->CreationState->LabelData->labelUrl);
                //$GLOBALS['messageStack']->add_session(sprintf('<pre class="result">%s</pre>', implode('<br>', $output)), 'info');
                $this->storeCreateShipmentResponse($postData['orders_id'], $response);
                $GLOBALS['messageStack']->add_session(sprintf('%s (%s - %s (%s/%s))',
                                                              $this->languageTextManager->get_text('gkv_label_created'),
                                                              (string)$response->CreationState->LabelData->shipmentNumber,
                                                              (string)$response->Status->statusMessage,
                                                              (string)$response->Status->statusCode,
                                                              (string)$response->Status->statusText), 'info');
                $this->logger->notice(sprintf('Shipment %s created, label URL: %s',
                                              $response->CreationState->LabelData->shipmentNumber,
                                              $response->CreationState->LabelData->labelUrl));
                
                $parcelServiceId = $this->configuration->get('parcel_service_id');
                if($parcelServiceId > 0)
                {
                    $parcelServiceReader      = MainFactory::create('ParcelServiceReader');
                    $parcelTrackingCodeWriter = MainFactory::create('ParcelTrackingCodeWriter');
                    $parcelTrackingCodeWriter->insertTrackingCode((int)$postData['orders_id'],
                                                                  (string)$response->CreationState->LabelData->shipmentNumber,
                                                                  $parcelServiceId, $parcelServiceReader);
                }
                
                $order_status_id = $this->configuration->get('order_status_after_label');
                $notifyCustomer  = $this->configuration->get('notify_customer');
                if($order_status_id > 0)
                {
                    $order_status_comment = $this->languageTextManager->get_text('gkv_order_status_comment') . ' '
                                            . (string)$response->CreationState->LabelData->shipmentNumber;
                    $this->setOrderStatus($postData['orders_id'], $order_status_id, $order_status_comment,
                                          (bool)$notifyCustomer);
                }
            }
            else
            {
                $GLOBALS['messageStack']->add_session(sprintf('%s - %s (%s)',
                                                              $this->languageTextManager->get_text('gkv_error_creating_label'),
                                                              (string)$response->Status->statusMessage,
                                                              (string)$response->Status->statusCode), 'error');
                # $GLOBALS['messageStack']->add_session(sprintf('<pre>%s</pre>', htmlspecialchars(print_r($response, true))), 'error');
            }
        }
        catch(SoapFault $sf)
        {
            $GLOBALS['messageStack']->add_session(sprintf('%s - %s',
                                                          $this->languageTextManager->get_text('gkv_error_creating_label'),
                                                          $sf->getMessage()), 'error');
            $this->logger->notice(sprintf("ERROR/SF creating label:\n%s\nRequest:\n%s\nResponse:\n%s\n",
                                          print_r($sf, true), $this->prettyXML($sc->__getLastRequest()),
                                          $this->prettyXML($sc->__getLastResponse())));
        }
        catch(GeschaeftskundenversandSoapAdapterServiceUnavailableException $e)
        {
            $lastRequest  = isset($sc)
                ? $this->prettyXML($sc->__getLastRequest())
                : '-- no request --';
            $lastResponse = isset($sc)
                ? $this->prettyXML($sc->__getLastResponse())
                : '-- no response --';
            
            $GLOBALS['messageStack']->add_session(sprintf('%s - %s',
                                                          $this->languageTextManager->get_text('gkv_error_creating_label'),
                                                          $e->getMessage()), 'error');
            $this->logger->notice(sprintf("ERROR creating label:\n%s\nRequest:\n%s\nResponse:\n%s\n", $e->getMessage(),
                                          $lastRequest, $lastResponse));
        }
        
        // $GLOBALS['messageStack']->add_session(sprintf('<pre>%s</pre>', htmlspecialchars(print_r($postData, true))), 'info');
        $redirectUrl = xtc_href_link('admin.php',
                                     'do=Geschaeftskundenversand/PrepareLabel&oID=' . (int)$postData['orders_id']);
        
        return MainFactory::create('RedirectHttpControllerResponse', $redirectUrl);
    }
    
    
    protected function storeCreateShipmentResponse($orders_id, $response)
    {
        $db = StaticGXCoreLoader::getDatabaseQueryBuilder();
        $db->insert('gkv_shipments', [
            'orders_id'      => $orders_id,
            'shipmentnumber' => (string)$response->CreationState->LabelData->shipmentNumber,
            'labelurl'       => (string)$response->CreationState->LabelData->labelUrl,
            'returnlabelurl' => (string)$response->CreationState->LabelData->returnLabelUrl,
            'exportlabelurl' => (string)$response->CreationState->LabelData->exportLabelUrl,
            'codlabelurl'    => (string)$response->CreationState->LabelData->codLabelUrl,
        ]);
    }
    
    
    protected function getShipments($orders_id)
    {
        $db        = StaticGXCoreLoader::getDatabaseQueryBuilder();
        $shipments = $db->order_by('last_modified', 'DESC')
                        ->get_where('gkv_shipments', ['orders_id' => (int)$orders_id])
                        ->result_array();
        
        return $shipments;
    }
    
    
    protected function deleteShipment($shipmentnumber)
    {
        $db = StaticGXCoreLoader::getDatabaseQueryBuilder();
        $db->delete('gkv_shipments', ['shipmentnumber' => $shipmentnumber]);
        $db->delete('orders_parcel_tracking_codes', ['tracking_code' => $shipmentnumber]);
    }
    
    
    public function actionDeleteLabel()
    {
        $this->_validatePageToken();
        $postData = $this->_getPostDataCollection()->getArray();
        
        $gkvSoapAdapter = Mainfactory::create('GeschaeftskundenversandSoapAdapter', $this->configuration);
        $sc             = $gkvSoapAdapter->getSoapClient();
        try
        {
            $params = [
                'Version'        => [
                    'majorRelease' => (string)GeschaeftskundenversandConfigurationStorage::MAJOR_VERSION,
                    'minorRelease' => (string)GeschaeftskundenversandConfigurationStorage::MINOR_VERSION,
                ],
                'shipmentNumber' => $postData['shipmentnumber'],
            ];
            $this->logger->notice(sprintf('deleting shipment %s', $postData['shipmentnumber']));
            $response = $sc->deleteShipmentOrder($params);
            if($response->Status->statusCode == 0)
            {
                $GLOBALS['messageStack']->add_session($this->languageTextManager->get_text('gkv_label_deleted'),
                                                      'info');
                $this->deleteShipment($postData['shipmentnumber']);
                $this->logger->notice(sprintf("Shipment %s deleted %s/%s/%s", $postData['shipmentnumber'],
                                              $response->Status->statusCode, $response->Status->statusText,
                                              $response->Status->statusMessage));
                
                $order_status_id = $this->configuration->get('order_status_after_label');
                $notifyCustomer  = $this->configuration->get('notify_customer');
                if($order_status_id > 0)
                {
                    $order_status_comment = $this->languageTextManager->get_text('gkv_order_status_comment_cancelled')
                                            . ' ' . $postData['shipmentnumber'];
                    $this->setOrderStatus($postData['orders_id'], $order_status_id, $order_status_comment,
                                          (bool)$notifyCustomer);
                }
            }
            else
            {
                $this->logger->notice("ERROR deleting shipment:\n" . print_r($response, true));
                $errorMessage = $this->languageTextManager->get_text('gkv_cannot_delete_label');
                $errorMessage .= sprintf(' (%s/%s/%s)', $response->Status->statusCode, $response->Status->statusText,
                                         $response->Status->statusMessage);
                $GLOBALS['messageStack']->add_session($errorMessage, 'error');
            }
            // $GLOBALS['messageStack']->add_session(sprintf('<pre>%s</pre>', htmlspecialchars(print_r($response, true))), 'info');
        }
        catch(Exception $sf)
        {
            $errorMessage = $this->languageTextManager->get_text('gkv_cannot_delete_label');
            $errorMessage .= '<br>' . $sf->getMessage();
            $GLOBALS['messageStack']->add_session($errorMessage, 'error');
            $this->logger->notice(sprintf("ERROR/SF deleting shipment:\n%s\nRequest:\n%s\nResponse:\n%s\n",
                                          print_r($sf, true), $this->prettyXML($sc->__getLastRequest()),
                                          $this->prettyXML($sc->__getLastResponse())));
        }
        
        // $GLOBALS['messageStack']->add_session(sprintf('<pre>%s</pre>', htmlspecialchars(print_r($postData, true))), 'info');
        $redirectUrl = xtc_href_link('admin.php',
                                     'do=Geschaeftskundenversand/PrepareLabel&oID=' . (int)$postData['orders_id']);
        
        return MainFactory::create('RedirectHttpControllerResponse', $redirectUrl);
    }
    
    /* ================================================================================================================================= */
    
    /**
     * Heuristically splits up a street address into its component street name and house number
     *
     * @param  string
     *
     * @return array with keys 'street' and 'house_no'
     */
    protected function splitStreet($street_address)
    {
        $street_address = trim($street_address);
        $splitStreet    = [
            'street'   => $street_address,
            'house_no' => '',
        ];
        $matches        = [];
        if(preg_match('_^(\d.*?)\s(.+)_', $street_address, $matches) === 1)
        {
            $splitStreet['street']   = $matches[2];
            $splitStreet['house_no'] = $matches[1];
        }
        else if(preg_match('_(.+?)\s?(\d.*)_', $street_address, $matches) === 1)
        {
            $splitStreet['street']   = $matches[1];
            $splitStreet['house_no'] = $matches[2];
        }
        
        return $splitStreet;
    }
    
    
    protected function computeShipmentWeight($orders_id, $order = null)
    {
        if($order === null)
        {
            $order = new order($orders_id);
        }
        $db         = StaticGXCoreLoader::getDatabaseQueryBuilder();
        $dhl_weight = (double)SHIPPING_BOX_WEIGHT;
        foreach($order->products as $product)
        {
            $weight_row               = $db->select('products_weight')
                                           ->where('products_id', $product['id'])
                                           ->get('products')
                                           ->row();
            $weight_attributes_result = $db->where('orders_id', $orders_id)
                                           ->where('orders_products_id', $product['opid'])
                                           ->get('orders_products_attributes')
                                           ->result_array();
            $attributes_weight        = 0;
            foreach($weight_attributes_result as $weight_attribute)
            {
                $weight_model = xtc_get_attributes_model($product['id'], $weight_attribute->products_options_values,
                                                         $weight_attribute->products_options,
                                                         $order->info['languages_id']);
                if($weight_model != '')
                {
                    $weight_attribute_weight = $db->select('options_values_weight, weight_prefix')
                                                  ->where('attributes_model', $weight_model)
                                                  ->get('products_attributes')
                                                  ->row();
                    if($weight_attribute_weight->weight_prefix == '-')
                    {
                        $attributes_weight -= $weight_attribute_weight->options_values_weight;
                    }
                    else
                    {
                        $attributes_weight += $weight_attribute_weight->options_values_weight;
                    }
                }
            }
            $dhl_weight += ($weight_row->products_weight + $attributes_weight) * $product['qty'];
        }
        $dhl_weight = max(0.1, $dhl_weight);
        
        return $dhl_weight;
    }
    
    
    protected function prettyXML($xml)
    {
        if(empty($xml))
        {
            return '-- NO CONTENT --';
        }
        $doc                     = new DOMDocument();
        $doc->preserveWhiteSpace = false;
        $doc->formatOutput       = true;
        $doc->loadXML($xml);
        
        return $doc->saveXML();
    }
    
    
    /**
     * set order status and (optionally) notify customer by email
     *
     * @param         int orders_id
     * @param         int orders_status_id
     * @param string  $order_status_comment
     * @param boolean $notifyCustomer
     */
    protected function setOrderStatus($orders_id, $order_status_id, $order_status_comment = '', $notifyCustomer = false)
    {
        $db = StaticGXCoreLoader::getDatabaseQueryBuilder();
        $this->logger->notice(sprintf('changing orders status of order %s to %s', $orders_id, $order_status_id));
        $db->where('orders_id', $orders_id);
        $db->update('orders', ['orders_status' => $order_status_id]);
        
        $orders_status_history_entry = [
            'orders_id'         => $orders_id,
            'orders_status_id'  => $order_status_id,
            'date_added'        => date('Y-m-d H:i:s'),
            'customer_notified' => $notifyCustomer === true
                ? '1'
                : '0',
            'comments'          => $order_status_comment,
        ];
        $db->insert('orders_status_history', $orders_status_history_entry);
        if($notifyCustomer === true)
        {
            $this->logger->notice(sprintf('sending email notification regarding status change of order %s',
                                          $orders_id));
            $this->notifyCustomer($orders_id, $order_status_id, $order_status_comment);
        }
    }
    
    
    /**
     * notify customer of a change in order status
     *
     * This is mostly copypasted from orders.php and MUST be refactored ASAP!
     */
    protected function notifyCustomer($orders_id, $orders_status_id, $order_status_comment)
    {
        require_once DIR_FS_INC . 'xtc_php_mail.inc.php';
        require_once DIR_WS_CLASSES . 'order.php';
        $order       = new order((int)$orders_id);
        $lang_query  = sprintf('select languages_id from %s where directory = \'%s\'', TABLE_LANGUAGES,
                               $order->info['language']);
        $lang_result = xtc_db_query($lang_query);
        while($lang_row = xtc_db_fetch_array($lang_result))
        {
            $lang = empty($lang_row['languages_id'])
                ? $_SESSION['languages_id']
                : $lang_row['languages_id'];
        }
        $orders_status_array  = [];
        $orders_status_query  = sprintf('select orders_status_id, orders_status_name from %s where language_id = \'%s\'',
                                        TABLE_ORDERS_STATUS, $lang);
        $orders_status_result = xtc_db_query($orders_status_query);
        while($orders_status_row = xtc_db_fetch_array($orders_status_result))
        {
            $orders_status_array[$orders_status_row['orders_status_id']] = $orders_status_row['orders_status_name'];
        }
        
        $smarty = new Smarty;
        // assign language to template for caching
        $smarty->assign('language', $_SESSION['language']);
        $smarty->caching      = false;
        $smarty->template_dir = DIR_FS_CATALOG . 'templates';
        $smarty->compile_dir  = DIR_FS_CATALOG . 'templates_c';
        $smarty->config_dir   = DIR_FS_CATALOG . 'lang';
        $smarty->assign('tpl_path', 'templates/' . CURRENT_TEMPLATE . '/');
        $smarty->assign('logo_path', HTTP_SERVER . DIR_WS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/img/');
        $smarty->assign('NAME', $order->customer['name']);
        $smarty->assign('GENDER', $order->customer['gender']);
        $smarty->assign('ORDER_NR', $orders_id);
        $smarty->assign('ORDER_LINK',
                        xtc_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $orders_id, 'SSL'));
        $smarty->assign('ORDER_DATE', xtc_date_long($order->info['date_purchased']));
        $smarty->assign('ORDER_STATUS', $orders_status_array[$orders_status_id]);
        if(defined('EMAIL_SIGNATURE'))
        {
            $smarty->assign('EMAIL_SIGNATURE_HTML', nl2br(EMAIL_SIGNATURE));
            $smarty->assign('EMAIL_SIGNATURE_TEXT', EMAIL_SIGNATURE);
        }
        
        // START Parcel Tracking Code
        /** @var ParcelTrackingCode $coo_parcel_tracking_code_item */
        $coo_parcel_tracking_code_item = MainFactory::create_object('ParcelTrackingCode');
        /** @var ParcelTrackingCodeReader $coo_parcel_tracking_code_reader */
        $coo_parcel_tracking_code_reader = MainFactory::create_object('ParcelTrackingCodeReader');
        $t_parcel_tracking_codes_array   = $coo_parcel_tracking_code_reader->getTackingCodeItemsByOrderId($coo_parcel_tracking_code_item,
                                                                                                          $orders_id);
        $smarty->assign('PARCEL_TRACKING_CODES_ARRAY', $t_parcel_tracking_codes_array);
        $smarty->assign('PARCEL_TRACKING_CODES', 'true');
        // END Parcel Tracking Code
        
        $smarty->assign('NOTIFY_COMMENTS', nl2br($order_status_comment));
        $html_mail = fetch_email_template($smarty, 'change_order_mail', 'html');
        $smarty->assign('NOTIFY_COMMENTS', $order_status_comment);
        $txt_mail = fetch_email_template($smarty, 'change_order_mail', 'txt');
        
        if($_SESSION['language'] == 'german')
        {
            $subject = 'Ihre Bestellung ' . $orders_id . ', ' . xtc_date_long($order->info['date_purchased']) . ', '
                       . $order->customer['name'];
        }
        else
        {
            $subject = 'Your order ' . $orders_id . ', ' . xtc_date_long($order->info['date_purchased']) . ', '
                       . $order->customer['name'];
        }
        
        xtc_php_mail(EMAIL_BILLING_ADDRESS, EMAIL_BILLING_NAME, $order->customer['email_address'],
                     $order->customer['name'], '', EMAIL_BILLING_REPLY_ADDRESS, EMAIL_BILLING_REPLY_ADDRESS_NAME, '',
                     '', $subject, $html_mail, $txt_mail);
    }
    
    
}

API documentation generated by ApiGen