Budgets
Introduction
Support your marketing- and sales activities with the "budget"-extension for Magento2.x. Build product- and customer-related budgets which are applied either manually or automatically or use budgets as an (internal) payment solution.
Module
extension-name: enobis/module-budget
- Latest stable version- version: 1.11.4 
- Install & Update- First you need to add our private repo to your composer.json of your magento installation: - composer config repositories.enobis-your-reponame composer https://satis.enobis.de/customers/your-reponame/ - Important: All repos are secured by an ip-protection or an user-authentication. Access Credentials are provided by us! - To install the CHILIconnector-extension use composer via ssh: - composer require enobis/extension-name - To update the CHILIconnector-extension use composer via ssh: - composer update enobis/extension-name - Afterwards you have to complete your Magento2.x installation by - php bin/magento setup:upgrade 
 php bin/magento setup:di:compile
 php bin/magento setup:static-content:deploy
 php bin/magento cache:clean
 php bin/magento indexer:reindex
- Roadmap- support for budget handling from related accounts
 
- Changelog- 1.11.4 - bugfix
- 1.11.3 - bugfix - (support for table prefixes)
- 1.11.2 - optimization - allow_include_shipping column to the budget import sample files
- 1.11.1 - optimization - Magento 2.4.3-p2 compatible email handling
- 1.11.0 - feature - compatibility with Amasty advanced persmissions
- 1.10.1 - 1.10.5 bugfixes - several bugfixes regarding missing translations, missing support for table prefixes etc.
- 1.10.0 feature - add budget correct transfer functionality in customer account in frontend
- 1.9.0 feature - add advanced login support to budget customer import functionality, add primary class to transfer button on budget view page, Add use_for_payment column to example import files
 fix: wrong css class for current value column in related budget list on budget view page
 fix for budget transfers only between a parent budget and his related children budgets
- 1.8.0 feature - add related budget import functionality in backend
- 1.7.1 bugfix - fix for budget transfers only between a parent budget and his related children budgets
- 1.7.0 feature - feature to transfer budget amounts between related budgets
- 1.6.0 feature - automatic budget replenishment (daily, weekly, monthly, yearly) via cron
- 1.5.1 - 1.5.9 several bugfixes and optimizations - possibility to show "before and after" values in checkout, show budget widget only if budgets are available, optimizations of configuration scopes etc.
- 1.5.0 feature - support for automatic and manual budgets in checkout incl. budgets step in checkout
- 1.4.0 feature - support for budget import via csv-file
- 1.3.0 feature - support for an automatic budget creation after customer registration
- 1.2.0 optimization - general optimization of related budgets and budget request-functionality
- 1.1.0 feature - budget as payment method incl. related budgets and budget request-functionality
- 1.0.0 Initial Release
 
- Prerequisites- Our extensions are not available via the magento-marketplace or packagist.org! The extensions are only available via a (private) repository! - In order to get access, a valid license-agreement is required! - If you have no access to our repositories, please contact us! 
- Addons- The following modules are available as addons: - enobis/module-quota - restricted product quantities per customer / customer group
 
- Support- If you need help with one of our extensions, please get in touch with us by sending an email to support@enobis.de. 
Features-Overview
Budget management from Magento backend
Manage your budgets from the backend of Magento. Create different kinds of budgets like "optional budgets", "automatic budgets" and "budgets as a payment method", apply budgets to customers and products or replenish budgets automatically.
Budget transactions
Budget transactions are can be from the backend or frontend. Every transaction is stored in the budget transaction history. Different transactions are available for different business purposes like "start transaction", "order transaction" or "adjustment transaction".
Storefront integration
Customers can use their budgets in different ways (depending on the budgets configuration and kind of budget). Budgets are available in an extra step in the checkout and can be used either manually or automatically. Or they are configured as a (online) payment method and can be selected like other payment methods.
Automatic budget creation and replenishment
Budgets can be created automatically after a new customer registration and can be replenished automatically on a certain period of time, like every month, year etc.
- Storefront Integration- The "budget"-extension is integrated into several areas of the Magento storefront. - Shopping Cart- Charged budgets will be displayed in the item row of the cart. Please note: Budgets which are for payment won't be shown here. Optional budgets (like optional budgets or budgets configured as payment) are displayed in the "budgets"-step in the checkout (see below). - Checkout- Budgets can be displayed in an extra step in the checkout. This extra step displays the available budgets of an user. If budgets are optional, the user can/must select the budget(s) first, before they will be charged and displayed here. If its' an "automatic" budget, the budget is already activated (and can't be deactivated for use) and will be charged automatically. - In addition, the an overview of the charged budgets is displayed in the "order summary". - My Account -> My Orders- Charged budgets are displayed in the order details too. - My Account -> My Budgets- The "My budget" list shows the budgets of a customer in the customer account. - You can access more details from every budget too. - My Budgets - transfer budgets amounts between related budgets- Related budgets can transfer budget amounts between them. But only parent budget can transfer them to their related children budgets. To transfer amounts just click on the button "Create Transfer". The next dialogue will show you options for the transfer. - This budget transaction will be saved like every other transaction in the budget history. It's transaction-code is "transfer". - My Budgets"-Widget- The "my budgets"-widget displays all available budgets of the customer on several pages in the storefront. 
- Backend Integration- The "budget"-extension is integrated into several areas of the Magento backend too. - Backend -> Order- The charged budgets are displayed in the order details. They are displayed in the order item row and additionally in the order-totals too. In this case the order-item is paid by the budget "Default" and additionally the "shipping & handling"-costs are charged too. - Email -> Order-Confirmation- The order confirmation email displays the budget information in the totals area too. 
- Backend "Budget Management" - Create budget categories and budget groups- Every budget needs at least one budget category and one budget group. While budget groups only serve the internal budget organization, budget categories are essential for the entire billing/payment process. Important: Budgets are charged by matching budget categories! - Example: Some marketing products are linked to a budget category "marketing", while other are linked to a budget category "giveaways". There are two budgets which are linked to each of the budget categories too. One customer (A) will get a relation to the budget "marketing" and the other customer (B) will get a relation to the budget "giveaways". Customer A can use his budget "marketing" to pay the "marketing related products" while he must pay the other products normally. Otherwise the Customer "B" takes advantage of the budget "giveaways". - Managing Categories- Managing Groups
- Backend "Budget Management" - Create budgets- Budgets can be created manually or by import. - Manual budget creation- To create budget from the backend, please go to "customers->manage budgets" and use the "add budget"-functionality to create a new budget. - Now you can configure the budget in detail. Important information e.g.: - name (name of budget (think about unique name - used for backend processing)
- is active (yes, no)
- type (optional, automatic) - an optional budget is a budget which will be used by the customer manually. Automatic budgets are applied automatically.
- valid from, valid to - date: Enables the budget for that period of time.
- budget category: Budgets are charged by matching budget categories
- factor: 1 is default. Possibility to use a factor for budget transactions. If you use e.g. 0.5 only 50% of the cart value will be applied to the budget. Important: Only usefull if you are not using budgets as payment (see below), since you won't be able to checkout.
- priority: 0 is default. Priority of appling the cart values to the according budgets. Important: Budgets with low priority will be charged earlier! This is important if there are two or more budgets which may be charged at the same time, e.g. two budgets with the same budget-category or two budgets which will be charged for shipping costs. With the priority you can decide which budget will be charged first! Important: If the priority is the same, the budget with the lower budget amount will be charged first!
- used for payment: Budget will be available in budget-list in the budget-payment in the checkout. Important: If activated, the budget-type must be "optional"!
- automatic correct qty: If enabled, the budget acts like a limit and the cart quantities will be adjusted to the maximum possible amount automatically. Important: If activated, the budget-type must be "automatic"!
- free quantity: amount of pieces for free of charge
- fill intervall: (daily, weekly, monthly, disable) possiblity to replenish the budget in a given intervall to the fill amount
- fill amount: budget amount for automatic budget replenishment
 - Create customer to budget relation- To use budgets in the storefront they must be linked to customers. You can create relations from the customer record in the backend. You can link several budgets to one customer, or use the same budget for several different customers. Please note: If you link one budget to several customers, the customer "who buys first - wins". - Automatic budget creation by import- If you like to create budgets automatically, please go to "customers->manage budgets" and use the "budget import"-functionality. Based on your uploaded data, new budgets will be created automatically. You can find a template for the budget-import in the folder "etc\import-examples" of your module. 
- Backend "Budget Management" - Create budgets records- Create budget records manually- Every transaction of a budget will be stored in a budget record. Different transactions are stored in different records of the budget history. To create a new budget entry you need to define - Entry code (see below) - Each budget entry (transaction) needs an entry code
- Entry type (plus / minus) - Each transaction value can be saved as a positive or negative value
- Value - Value of transaction
- Order increment id (optional) - order increment id as reference for transaction
- Note (optional) - optional note for transaction
 - Possible entry codes for transaction are: - start (identifies the initial transaction of the budget e.g. budget will be created)
- closing (identifies the last transaction of the budget e.g. budget will be closed)
- adjustment (identifies different transaction (plus/minus) ) e.g. manual adjustment of a budget from the backend
- transfer (reserved for budget transaction between two budgets after a budget request)
- order (reserved for budgets transaction within an order)
- payment (reserved for a budgets transaction for a budget which is used as a payment)
- refund (reserved for a budgets transaction which is a result of an order cancellation)
- bonus code
- deactivation
- request (reserved for requesting budgets amounts at the connected budget (supervisor budget))
- refill (reserved for automatic replenishment)
 - Each transaction will be stored as a record in the budget history. - Create budget records automatically- The budget-extension offers the possibility to replenish budges in a certain period of time automatically. The budgets will be replenished to the configured "fill" amount at the end of the selected period of time. Possible options are: daily, weekly, monthly or "none". - The refill function creates a budget entry as the difference between your actual and the specified fill quantity. 
- Budgets as Payment Method- Budgets can be configured as payment too. Available budgets are displayed in the dropdown of the "budget"-payment method in the checkout. The "budget"-payment needs at least one active budget - if not available, the budget-payment method isn't displayed. If the budget is sufficient, the cart amount will be charged to the budget. If it's not sufficient, a checkout is not possbile and a message "Budget is not sufficient" is displayed. - Payment-Method "Budget"- Payment "Budget Request"- If a "payment" budget does not have a sufficient budget value, a budget request can then be created. Budgets requests will be possible from a separate payment method called "budget request". In the dropdown of "budget request"-payment method all available budgets you can request your budget are listed. To request a value, the budget must have a relation to a parent budget. The parent budget will be requested then. Please note: The relation must be done from the parent to the child budget! To inform a budget holder, the budget must be assigned to a customer record too. 
Configuration in detail
- Stores->Configuration->Enobis->Budgets->Checkout- Option - Type - Description - Scope - Yes, No (Default) - If enabled, a separate checkout step will be activated. All available budgets (of the customer) are listed here. - System->Website - Display Current Value - Dropdown - Dropdown with two options - current value (shows only the current value of the budget)
- before/ after (shows the current value and the value after ordering the products)
 
 - System->Website - Include Shipping Costs - Yes, No (Default) - Possibility that shipping costs will be "paid" buy the budget also - System->Website - Multiple Select - List of all customer groups. Possibility to select customer group, which shipping costs are included in the budgets. - System->Website 
- current value (shows only the current value of the budget)
- Stores->Configuration->Enobis->Budgets->Budget as Payment- Option - Type - Description - Scope - Consider Budget Categories - Yes, No (Default) - By default a budget configured as payment covers all products items of the cart without considering the budget categories. If activated the payment budget covers only product item of matching budget categories. Important: This adds the possibility that the user is not able to pay the whole cart by the budget, because it's covering all cart items! - System->Website 
- Stores->Configuration->Enobis->Budgets->Budget Request Info Email- Option - Type - Description - Scope - Enabled - Yes, No (Default) - Possiblity to enable/ disable the "my documents" feature - System->Storeview - Budget Request Info Email Sender - Dropdown - list of possible email senders (from email settings) - System->Storeview - Dropdown - list of possible email templates (Template for budget request (email from customer to supervisor) - System->Storeview - Dropdown - list of possible email templates (Template for budget release templates (email supervisor to customer) - System->Storeview - Dropdown - Status after order confirmation Please note: Cancelling the order through the supervisor sets the order automatically into the "canceled"-status. - System->Website 
- Stores->Configuration->Enobis->Budgets->Fill Budgets- Enables an automatic replenishment of budgets in a given period of time. - Option - Type - Description - Scope - Enabled - Yes, No (Default) - Possiblity to enable/ disable the automatic replishment feature for budgets. - Important: - This feature must be activated here and for every budget! - Make sure the magento cron jobs are setup and running properly. Learn more about magento cron jobs. - System->Global - Value - Default budget value for automatic budget replenishment - System->Global 
- Stores->Configuration->Enobis->Budgets->Automatic Budget Creation- Option - Type - Description - Scope - Enabled - Yes, No (Default) - Possiblity to enable/ disable the "automatic budget creation"-feature - System->Storeview - Events - Multiple Select - List of possible events (Magento Events) [Default: Customer registration], after which a budget is created and associated with a customer account. - System->Storeview - Dropdown - List of possible budgets which is used as a template for the automatic budget creation. Name and value will be copied! - System->Storeview 
Configuration in detail
- Stores->Configuration->Enobis->Budgets->Checkout- Option - Type - Description - Scope - Yes, No (Default) - If enabled, a separate checkout step will be activated. All available budgets (of the customer) are listed here. - System->Website - Display Current Value - Dropdown - Dropdown with two options - current value (shows only the current value of the budget)
- before/ after (shows the current value and the value after ordering the products)
 
 - System->Website - Include Shipping Costs - Yes, No (Default) - Possibility that shipping costs will be "paid" by the budget also - System->Website - Multiple Select - List of all customer groups. Possibility to select customer group, which shipping costs are included in the budgets. - System->Website 
- current value (shows only the current value of the budget)
Budget Import
It's possible to import budget data into the Magento2.x-System. Example import files are located at "vendor/enobis/module-budget/etc/import-examples". Please use these files and replace the examples with your data. To import the data, please go to "Customers->Manage Budgets->Budget Import".
- budget_with_customer.csv - Use to create budgets and relation(s) to customers (Each row creates one budget)- Option - Type - Description - Value - customer_website_id - Integer - Website of customer - 1 - customer_email - string - email of existing customer - roni_cost@example.com - name - String - Name of budget (internal use) - Marketing 2022 - frontend_name - String - Name of budget in storefront - MK 2022 - allow_include_shipping - bool - can shipping costs be "paid" by the budget also - 1,0 - is_active - bool - budget is active or inactive - 1,0 - type - string - budget_auto 
 budget_optional- budget_auto - group_id - integer - Id of budget group - 1 - start_date - date - start date for budget - 2019-01-01 - end_date - date - end date for budget - 2019-12-31 - factor - Factor - 0.5 - priority - Integer - Priority - 1 - automatic_correct_qty - Bool - Automatic correction on or off - 1 - info - String - Infotext (internal use) - String - firstname - String - Firstname (internal use) - String - lastname - String - Lastname (internal use) - String - company - String - Company (internal use) - String - street - String - Street (internal use) - String - city - String - City (internal use) - String - country_id - String - Isocode of country - DE - region_id - String - Isocode of region - Berlin - postcode - String - Postcode (internal use) - String - telephone - String - Telephone (internal use) - String - fax - String - Fax (internal use) - String - entry_code - String - Entry code for "entry value" transaction. Valid codes are: - start (identifies the initial transaction of the budget e.g. budget will be created)
- closing (identifies the last transaction of the budget e.g. budget will be closed)
- adjustment (identifies different transaction (plus/minus) ) e.g. manual adjustment of a budget from the backend
- transfer (reserved for budget transaction between two budgets after a budget request)
- order (reserved for budgets transaction within an order)
- payment (reserved for a budgets transaction for a budget which is used as a payment)
- refund (reserved for a budgets transaction which is a result of an order cancellation)
- bonus code
- deactivation
- request (reserved for requesting budgets amounts at the connected budget (supervisor budget))
- refill (reserved for automatic replenishment)
 - String - entry_value - value - value of transaction - value - fill_interval - @ToDo - @ToDo - @ToDo - fill_amount - @ToDo - @ToDo - @ToDo - use_for_payment - Bool - 1,0 - budget_categories - Integer - Id of Budget Category 
 (for multiple ids comma separated and enclosed in double quotes e.g. "1,2,3")- 1 
- budget_related.csv - to create relations between budgets (Important: budgets must exist, before you can create relations between them)- Option - Type - Description - Value - parent_budget_name - String - name of parent budget (from) - budgetname1 - child_budget_name - String - name of child budget (to) - budgetname2