enobis/module-cost-center v1.9.1

Cost-Center Extension

Introduction

The "Costcenter"-Extension implements two offline-payment methods (costcenter & costcenter2) for Magento2.

Features

Frontend

Adds two new payment methods to the storefront. The two payment methods are highly customizable and can be used for different purposes.

Available, customizable input fields in storefront:

  • Costcenter (available as textinput or dropdown select)
  • Project
  • Debtor

Each of these additional inputs, could be

  • enabled/ disabled
  • required/ optional
  • with/ without validation

Each of these input options can have

  • a label
  • a placeholder
  • a comment

Backend

The dropdown selectbox lists existing, preconfigured costcenters. Costcenters can be managed from the Magento Backend. The selectbox lists either systemwide or userspecific costcenters.

Cost Centers can be managed from the backend of Magento2.x. Please go to "Customers->Manage Cost Centers" to manage your available list of cost centers.

A cost center is defined by

  • Name
  • code
  • Relation to Website

Please note: The cost center list must be activated in the payment configuration!

In order to show only selected (with the customer related) cost centers, they must be configured at the customer.

Restricted Payment Access

The access to the costcenter payment method can be restricted by either

  • a matching cutomer attribute value
  • a matching customer role (Important: Only available to users of the "Customer_Role"-Extension)

Validation rules

There are predefined validation rules available for the inputfields.

  • No validation
  • letters-with-basic-punc
  • letters-only
  • no-whitespace
  • integer
  • validate-no-utf8mb4-characters
  • email2
  • url2
  • validate-alphanum-with-spaces
  • validate-email
  • validate-url
  • validate-not-negative-number
  • validate-zero-or-greater
  • validate-greater-than-zero
  • validate-number
  • validate-alpha
  • validate-code
  • validate-alphanum
  • max-words (Value)
  • min-words (Value)
  • stripped-min-length (Value)
  • pattern (Value) (RegExp)

Configuration

(Stores->Configuration->Sales->Payment Methods->Costcenter & Costcenter2)

Option Type Description Scope
Enabled Yes, No(Default) Enables Payment Method System->Website
Title String Title of Payment Method in Checkout System->Storeview
New Order Status Dropdown Avaiable Orderstatus System->Website
Payment from Applicable Countries Dropdown All allowed countriesSpecific countries System->Website
Payment from Specific Countries MultipleSelect Available Countries System->Website
Restrict payment method Dropdown NoYes on customer attributeYes on customer role System->Website
Allowed Attribute Dropdown Avaiable Customer Attributes of System System->Website
Allowed Attribute Values MultipleSelect Avaiable AttributeValues (Important: Available values available after saving the store configuration System->Website
Display Costcenter Yes, No(Default) Shows costcenter input field in checkout System->Website
Cost Center Required Yes, No(Default) required or optional input System->Website
Cost Center Validation Yes, No(Default) Validates input System->Website
Use Dropdown for Cost Center Yes, No(Default) Shows dropdown select instead of input field in checkout System->Website
Costcenter show Label Yes, No(Default) Shows label in checkout System->Website
Costcenter Label String Label for Costcenter System->Website
Cost Center Placeholder String Placeholder for input field System->Website
Cost Center Comment String Comment for input field System->Website
Display Project Yes, No(Default) Show project input field in checkout System->Website
Project Required Yes, No(Default) required or optional input System->Website
Project Validation Yes, No(Default) Validates input System->Website
Project show Label Yes, No(Default) Shows label in checkout System->Website
Project Label String Label for Costcenter System->Website
Project Placeholder String Placeholder for input field System->Website
Project Comment String Comment for input field System->Website
Display Debtor number Yes, No(Default) Show project input field in checkout System->Website
Debtor number Required Yes, No(Default) required or optional input System->Website
Debtor number Validation Yes, No(Default) Validates input System->Website
Debtor number show Label Yes, No(Default) Shows label in checkout System->Website
Debtor number Label String Label for Costcenter System->Website
Debtor number Placeholder String Placeholder for input field System->Website
Debtor number Comment String Comment for input field System->Website
Minimum Order Total Int Minimum total of cart System->Website
Maximum Order Total Inr Maximum total of cart System->Website
Sortorder Int Sortorder for Payment System->Website
Enabled Zero Subtotal Checkout Yes(Default), No If disabled, Costcenter-Payment is forced even Subzero-Total-Payment is active System->Website

Addons

There are no addons available!

Support

If you need help using the extension, please get in touch with us by sending an email to support@enobis.de.

Changelog

1.9.1 (2026-04-09)

  • 2026-04-09 Logging removed from the module (3a2c6ed)

  • 2026-04-09 Version: 1.9.1 (3d81385)

    • Logging removed from the module

1.9.0 (2026-03-19)

  • 2026-03-19 Tweak code (5f6bbd0)

    Allow PHP 8.3 Drop PHP 7.4 support

  • 2026-03-19 Version 1.9.0 (2db3ea8)

    Allow PHP 8.3

    #14375

1.8.3 (2025-07-09)

  • 2025-07-09 Fix backend order edit problems (b4be979)

  • 2025-07-09 Version 1.8.3 (36a1993)

    Add functions for backend order editing

1.8.2 (2025-05-20)

  • 2025-05-20 - Cost center 2 can run independently of cost center 1 (c6e4e3a)

  • 2025-05-20 Version: 1.8.2 (34fef82)

    Bugfix:

    • Cost center 2 can run independently of cost center 1

1.8.1 (2025-05-12)

  • 2025-05-12 - Error fixed if attributes are not yet set (c7da157)

  • 2025-05-12 Version: 1.8.1 (fd76f58)

    Bugfix:

    • Error fixed if attributes are not yet set

1.8.0 (2025-05-09)

  • 2025-05-07 - Authorisations integrated on the basis of roles (06f32e0)

  • 2025-05-09 - Paymantmethod can now be restricted to mapping a customer attribute (fd5a911)

  • 2025-05-09 Tweak code (b86b9bf)

  • 2025-05-09 Version: 1.8.0 (53e3420)

    Feature:

    • Paymant method can now be restricted to mapping a customer attribute
    • Authorisations integrated on the basis of roles

1.7.8 (2025-01-29)

  • 2025-01-29 PHP 8.2 support added (596e364)

  • 2025-01-29 Introduce .gitattributes to exclude development files (7212049)

  • 2025-01-29 Update README.md (db83c76)

  • 2025-01-29 Merge branch 'fixes' into dev (6724cbe)

  • 2025-01-29 Version 1.7.8 (cf9cd72)

    PHP 8.2 support added

1.7.7 (2024-06-13)

  • 2024-06-13 - Cost Center variables added to the sales mails (fc8698a)

    • Cost Center variables added to the vendor mails of our Enobis_Vendor module
  • 2024-06-13 Tweak code (7b5dad3)

  • 2024-06-13 Version: 1.7.7 (dff594e)

    Optimization:

    • Cost Center variables added to the sales mails
    • Cost Center variables added to the vendor mails of our Enobis_Vendor module

1.7.6 (2024-06-05)

  • 2024-06-05 - Configuration of the field label names (bc91c54)

    • Configuration of the display of field label names
  • 2024-06-05 Tweak code (5f1dbfd)

  • 2024-06-05 Version: 1.7.6 (05c6cbb)

    Optimization:

    • Configuration of the field label names
    • Configuration of the display of field label names

1.7.5 (2024-01-16)

  • 2024-01-16 magento2 2.4.6 compatibility (c6af041)

  • 2024-01-16 version 1.7.5 (e4a0bdc)

    magento2 2.4.6 compatibility

1.7.4 (2024-01-16)

  • 2024-01-16 fix magento2 2.4.x bug "Invalid parameter number: number of bound variables occured" when saving costcenter via backend (55a956e)

  • 2024-01-16 version 1.7.4 (055d290)

    fix magento2 2.4.x bug "Invalid parameter number: number of bound variables occured" when saving costcenter via backend

1.7.3 (2023-10-23)

  • 2023-10-23 add en_IE translation (based on en_US) (8a4521e)

  • 2023-10-23 version 1.7.3 (90626c2)

    add en_IE translation (based on en_US)

1.7.2 (2023-05-10)

  • 2023-05-10 small fix for case sensitive import form block class generatition (2a1bed5)

  • 2023-05-10 version 1.7.2 (e440198)

    small fix for case sensitive import form block class generatition

1.7.1 (2023-05-09)

  • 2023-05-09 add import to backend cost center grid (c7d885b)

    import sample file added (etc/import-examples/costcenter.csv)

  • 2023-05-09 version 1.7.1 (30ca90e)

    add import to backend cost center grid import sample file added (etc/import-examples/costcenter.csv)

1.7.0 (2023-02-15)

  • 2023-02-15 - PHP 8.x compatibility, avoid passing null values to string functions, (checked with rector) (9447ab9)

  • 2023-02-15 Ticket #13245 - Eventshop (zone2) Checkout anpassen (8a0b6bd)

  • 2023-02-15 - PHPStan (104843d)

  • 2023-02-15 PHP-CS-Fixer (15b52a1)

  • 2023-02-15 Version: 1.7.0 (3a335ca)

    Feature:

    • Add Debtor number

1.6.1 (2022-12-16)

  • 2022-12-16 PHP 8.x compatibility (di compile error) (096f4cc)

    should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used

  • 2022-12-16 version 1.6.1 (1228523)

    PHP 8.x compatibility (di compile error) should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used

1.6.0 (2022-09-07)

  • 2022-09-07 Version 1.6.0 (151deee)

    Cost centers can be limited to customer groups if no explicit customer assignments are made.

1.5.1 (2022-04-06)

  • 2022-04-06 1.5.1 Possibility to define the Costcenter matching attribute for the customer import. (e.g. code, name) (3045029)

1.5.0 (2022-03-07)

  • 2022-03-04 add costcenter2 payment method (5d7d75a)

  • 2022-03-07 fix: requests for /rest/default/V1/carts/mine/set-payment-information while selecting cost center payments in checkout return 400 Bad Request response (23af02f)

  • 2022-03-07 php cs fixer (50709cd)

  • 2022-03-07 Merge branch 'feature/payment-method-cost-center2' into dev (661b570)

  • 2022-03-07 Version 1.5.0 (45f55e6)

    add costcenter2 payment method

1.4.1 (2022-02-25)

  • 2022-02-25 Version 1.4.1 (2f2a4ff)

    fix: default magento import customer with specified cost center fields (cost_center or cost_center_default) does not work

1.4.0 (2021-10-28)

  • 2021-10-27 add "assign cost center" and "assign default cost center" mass action to customer grid (9115e0a)

    introduce delete mass action for cost center grid

  • 2021-10-28 phpcs fixes (1491fbd)

  • 2021-10-28 Merge branch 'feature/assign-cost-center-massaction' (e95825f)

  • 2021-10-28 Version 1.4.0 (c400163)

    improve mass actions add "assign cost center" and "assign default cost center" mass action to customer grid introduce delete mass action for cost center grid

1.3.5 (2021-04-18)

  • 2021-04-18 1.3.5 sortierung website erzeugt fehler da nachgeladen -> sortable false (7b47e7f)

1.3.4 (2021-04-15)

  • 2021-04-15 1.3.4 validierung cost center website (d7ef78f)

1.3.3 (2020-11-17)

  • 2020-11-17 Version: 1.3.3 (f067448)

    Bugfix:

    • Internet Explorer 11 kompatible

1.3.2 (2020-11-10)

  • 2020-11-10 Version: 1.3.2 (3ce0212)

    Optimization:

    • Erlaubt bei einem Warenkorbwert von 0 diese Zahlart

1.3.1 (2020-10-29)

  • 2020-10-29 Version: 1.3.1 (b836dec)

    Optimization:

    • RegEx Validation hinzugefügt
    • Validationn mit optionalen Wert Bugfix:
    • Ausblenden der Felder in der Bestellhistorie wenn diese nicht angezeigt werden sollen
    • Richtigen Kommentar anzeigen

1.3.0 (2020-10-27)

  • 2020-10-27 Version: 1.3.0 (f5ebd38)

    Feature:

    • Deaktivierung von Cost Center
    • Validierungsklassenauswahl an Cost Center
    • Pflichtfeld Definition von Cost Center
    • Placeholder für Cost Center
    • Comment für Cost Center
    • Deaktivierung von Project
    • Validierungsklassenauswahl an Project
    • Pflichtfeld Definition von Project
    • Placeholder für Project
    • Comment für Project

1.2.10 (2020-10-13)

  • 2020-10-13 Version 1.2.10 - bugfix in costcenter.phtml (12371cd)

1.2.9 (2020-10-13)

  • 2020-10-13 Project-Feld ins Backend(Edit Order) aufgenommen (4f74c5b)

    Signed-off-by: Karl Büdding karl.buedding@enobis.de

1.2.8 (2020-09-01)

  • 2020-09-01 1.2.8 Add cost_center and project to rest api (23df26e)

1.2.7.2 (2020-03-11)

1.2.7.1 (2020-02-20)

  • 2020-02-20 fix: fatal error when saving customers in backend (217e72c)

  • 2020-02-20 Version 1.2.7.1 (4448082)

    fix: fatal error when saving customers in backend

1.2.7 (2020-02-19)

  • 2020-02-19 fix: selected customer cost centers cannot be removed (ed3e793)

  • 2020-02-19 remove php requirements (7bbed25)

  • 2020-02-19 simplify magento-module dependencies (24f5561)

  • 2020-02-19 Version 1.2.7 (b9c6e29)

    simplify magento-module dependencies remove php requirements fix: selected customer cost centers cannot be removed

1.2.6 (2019-10-23)

1.2.5 (2019-02-25)

  • 2019-02-25 Konfiguration ob alle Kostenstellen angezeigt werden, wenn dem Benutzer keine zugewiesen ist. (a0dbfd8)

1.2.4 (2019-02-22)

  • 2019-02-22 Erweiterung für „Checkout mit mehreren Adressen“ (704c739)

1.2.3 (2019-02-20)

  • 2019-02-20 Groß- und Kleinschreibung (d358712)

1.2.2 (2019-02-18)

  • 2019-02-18 Beim Anlegen eines Benutzers übers Backend wird kein Array übergeben (1aeb5dc)

1.2.1 (2019-02-14)

  • 2019-02-14 add methods required by interface (a3ece96)

  • 2019-02-14 Fatal Error bei DI-Kompilierung #10592 (bbf076e)

  • 2019-02-14 Version bump (fa11ea2)

  • 2019-02-14 Version 1.2.1 (9dba04a)

    Fatal Error bei DI-Kompilierung #10592

1.2.0 (2019-02-13)

  • 2019-01-31 install "cost_center"-table + payment columns (d18785d)

  • 2019-01-31 di.xml changes for backend (9228a31)

  • 2019-01-31 add "Manage Cost Centers" to backend menu (647ee2e)

  • 2019-01-31 backend index listing + cost_center form (96e84ae)

  • 2019-02-05 change namespace enobis_cost_center to cost_center (e8525cd)

  • 2019-02-05 fix label and html title according navigation (660f858)

  • 2019-02-05 fix labels (f5d055c)

  • 2019-02-05 fix actions as last column (a05a878)

  • 2019-02-05 fix backend acl (6d2fd9f)

  • 2019-02-05 fix labels in form (64cbcb1)

  • 2019-02-05 add var comment (9884703)

  • 2019-02-05 show full cost center name when editing in backend (b90f730)

  • 2019-02-05 change text messages (d12dbac)

  • 2019-02-05 fix name (2db5302)

  • 2019-02-05 Add created_at and updated_at column (a54b4ad)

  • 2019-02-05 add validation before save (7b3e612)

  • 2019-02-05 add reset button (379c1d3)

  • 2019-02-05 add todos (e9cd37a)

  • 2019-02-05 change table to cost_center_entity and primary column to entity_id (6f76b28)

  • 2019-02-05 add cost_center attribute to customer (27bed6d)

  • 2019-02-05 add ui-select to customer cost_center-attribute (50e732f)

  • 2019-02-06 add todo (f105588)

  • 2019-02-06 Configuration to select cost center from dropdown (2dd6773)

  • 2019-02-06 provide payment method config in checkout (6a6037d)

  • 2019-02-11 Merge branch 'dev' into add-adminhtml-area-and-customer-attributes-#10549 (3241f48)

  • 2019-02-11 set grid-flags for customer attribute to false to prevent customer grid indexer to fail (1cd13ec)

  • 2019-02-11 provide customer cost centers to checkout (0c5d497)

  • 2019-02-11 cache tag (bac0409)

  • 2019-02-11 fix sort order (1bc4783)

  • 2019-02-11 provide cost center dropdown info to checkout (8663012)

  • 2019-02-11 add cost center dropdown logic to method form (ebd97fd)

  • 2019-02-11 add some space between form and button (e84f4d6)

  • 2019-02-11 process cost_center_id + cost_center_name + cost_center_code (35d3499)

  • 2019-02-11 add customer "cost_center_default"-attribute (6dec392)

  • 2019-02-11 add api data classes (3b6c28d)

  • 2019-02-11 remove todo (d6d164d)

  • 2019-02-11 add cost_center_website-table (0304aaf)

  • 2019-02-11 add websites field to cost_center_form (5f52039)

  • 2019-02-11 add website_ids logic (855075b)

  • 2019-02-11 add sort order to columns (d85e213)

  • 2019-02-11 use interface (aec201c)

  • 2019-02-12 add website column to cost_center_listing (afb5767)

  • 2019-02-12 add customer website filter to source-models (dfd18ee)

  • 2019-02-12 use more specific config path (94f7966)

  • 2019-02-12 make cost_center_default select non multiple (597a529)

  • 2019-02-12 allow reset cost_center_default value (087e8ba)

  • 2019-02-12 allow filterOptions for cost_center_default (47e657e)

  • 2019-02-12 Translations (1c510ef)

  • 2019-02-13 change messages (0d71428)

  • 2019-02-13 change routes (7e636e4)

  • 2019-02-13 revert seperation of model and api-data (1b35480)

  • 2019-02-13 change message (155e20d)

  • 2019-02-13 Translations (8914b73)

  • 2019-02-13 use NONE rather then "Please select" (d23b979)

  • 2019-02-13 Backend-Verwaltung + Kostenstellen-Auswahl am Kunden #10549 (8da93f4)

  • 2019-02-13 Version bump (b726c72)

  • 2019-02-13 Version 1.2.0 (42ae631)

    Backend-Verwaltung + Kostenstellen-Auswahl am Kunden #10549

1.1.0 (2019-02-07)

  • 2019-02-07 add required config for fields (4225bf9)

  • 2019-02-07 add project field to cost center form + required logic (c37985d)

  • 2019-02-07 provide payment method config to checkout (15319d7)

  • 2019-02-07 add project column to tables (d78a7d8)

  • 2019-02-07 convert new payment field to order payment (5380da7)

  • 2019-02-07 show project within payment section of order views (8f903d3)

  • 2019-02-07 Weiteres Feld "project" in Bezahlart und Pflichtfeld-Prüfung einstellbar #10569 (012d5dd)

  • 2019-02-07 Version 1.1.0 (fc22f65)

  • 2019-02-07 Version 1.1.0 (0a3900c)

    Weiteres Feld "project" in Bezahlart und Pflichtfeld-Prüfung einstellbar #10569

  • 2019-02-07 Version 1.1.0 (adf0ae6)

    Translations

1.0.0 (2019-01-30)

  • 2019-01-29 add payment method in configuration (70d77c9)

  • 2019-01-29 setup install schema - add cost_center-column to quote/order payment tables (b7174e3)

  • 2019-01-29 implement payment method in checkout (1c89219)

  • 2019-01-29 handle "cost_center"-field within extension attributes in checkout (1488a1d)

  • 2019-01-29 plugin to add "cost_center" value to "quote_payment"-table (950ff80)

  • 2019-01-29 process/add "cost_center"-value by payment method instance (f34ee86)

  • 2019-01-29 disable "add value"-plugin in favor of handling by payment method instance (a337874)

  • 2019-01-29 convert cost_center data from quote to order (c696d7c)

  • 2019-01-30 add payment info/form blocks for frontend/adminhtml (15e9b64)

  • 2019-01-30 add cost center dummy validation (28d61cc)

  • 2019-01-30 remove comment (733dc7a)

  • 2019-01-30 fix payment method label in configuration (2f07786)

  • 2019-01-30 Translations (f138aa5)

  • 2019-01-30 add description to composer.json (303ee3d)

  • 2019-01-30 Version 1.0.0 (4d1f8af)

  • 2019-01-30 Version 1.0.0 (ef1650f)

    Kostenstellen-Zahlart mit einfacher Eingabebox (regex) #10537

0.0.1 (2019-01-28)

  • 2019-01-28 base files (b45940a)