Reallocation of funds

From docs.websky.tech
Revision as of 18:45, 5 August 2020 by I shaletin (talk | contribs) (Principle of operation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Reallocation of funds — is an additional module of the Websky online ticket booking system for B2B agencies.

Purpose of the module

When using a standard scheme of payment from company balance sheet, a single account is allocated to every company, and all expert employees of this subagent and the company manager himself have equal access to it by default. But in this case it is difficult to avoid cases of the account abuse: each employee can dispose of virtually the entire available amount of the account / available overdraft. The Reallocation of funds module allows you to set a limit on a certain amount for a specific user of the company (or a group of users) within one account, thus avoiding such situations. Secondly, this module makes it possible to pay orders from the company's balance to ordinary users of the company (not experts), which is not supported in the standard payment scheme from the balance of the companies.

Module connection

The module is connected additionally by the Websky system administrator. To connect the module, use the Websky project tracker.

Principle of operation

The subagent can distribute the amount of its account set for it by the root agency among its own users so that the users of the subagent can use the 'payment method from the company's balance.'
The subagent allocates for its user/user group a part of the account that was previously given to the subagent by the root agency.
The part of the account that the subagent manager distributes to its users cannot be used to pay for orders by the subagent (subagent manager/expert).

Rules of the Reallocation of funds module:

  • You can distribute the entire amount that is listed on the balance sheet of the company and the available sub-agency’s overdraft.
  • The amount by the selected accounts of all objects cannot exceed the amount of the company's balance + available overdraft of the sub-agency.
  • The user uses his / her own account for payment, or, if his own account is not assigned to him by a subagent, the account of the first object in the hierarchy upwards to which the account is assigned (for example, the account of the group to which this user belongs).
  • The user can make a payment only within the account related to him.

'Attention!' If the account is not distributed to the user, but is assigned to the group to which it belongs, the user uses the group’s shared account.
In particular, it can be the balance of the subagent itself after deducting the distributed part, if the user is included in the root group of the subagent.

  • If no fund reallocation is specified for users or groups of a subagent, then payment from the company's balance will be available 'only to the manager / expert of the subagency'.
  • If at least one reallocation entry is specified for users or subagent groups in the table, payment from the company's balance is allowed for those users for whom reallocation is set and this payment method is activated in the section Finances → Payment Methods → Gateway access settings. The amount available to the user is set during the reallocation.

'Attention!' When using the Funds Reallocation module, the subagent needs to keep track of those users / groups of users whom it allows to pay for orders from the company's balance sheet.
To enable and disable access to payments from the company's balance sheet for a user / group of users, under Finances → Payment Methods → Gateway access settings, adjust the availability of payment methods for different groups and users of the subagent (see Payment Methods in Websky for more details).

Billing strategy

When using the Reallocation of funds module, the deduct own fee of the subagent option (for managers and experts) (the Billing strategy for subagents parameter for subagents in Product control → Aviatickets → Pricing → Settings) is always enabled regardless of the option settings. Thus, with the inclusion of the Reallocation of funds module, the withdrawal of funds from the general account of the subagent is always minus the subagent’s own charge.

The movement of funds in the accounts is carried out according to the following principle:

  • When the user of the subagent pays for the order:
    • payment amount is displayed in full on the user’s order page,
    • when paying with the user's company balance, the entire amount of the order, including fees and charges of the subagent, is withdrawn, and the subagent’s own fee is returned to the account of the subagent,
    • the amount of the order along with the commission, is deducted from the total account of the subagent minus the own charge of the subagent.
      In the History of account transactions (see Company Balance article) two transactions will be displayed - debiting the full amount from the user's balance account, crediting the fee to the subagent's account.
  • When paying for the order by the manager or expert of the subagent:
    • when displaying the order amount on the order page:
      • if the deduct subagent’s own charge option and/or deduct subagent’s commission is active, then on the order page for the manager and expert the amount less the own charge and/or commission of the subagent is displayed.
      • if the deduct subagent’s own charge option and/or deduct subagents’ commission is not enabled, the full amount is displayed on the order page for the manager and expert.
    • When paying with the subagent’s company balance, the order amount is withdrawn minus commissions and charges of the subagent.

Loan payment and refund for orders payed by the distributed account

When you pay for a loan or make a refund, the amount is returned to the account from which the payment was made. If this account has already been deleted, the amount will be returned to the account of the first in the hierarchy above the object in which it is installed.

Subagency funds reallocation

After connecting the module in the administration panel, a section on Reallocation of funds appears, located at Finances → Balances and overdrafts → Reallocation of funds. The section is accessible only to the root agency manager and the subagency manager.

Select the settings application object in the User field. Depending on the selected user, the page displays either the fund distribution table of the selected subagent or a form for allocating funds to the selected user.

Overview of redistributed funds by users of subagency

If a subagency is selected as a user, the page displays:

  • Information on the current state of the sub-agency balance:
    • subagency balance.
    • subagency overdraft.
    • allowable amount to be distributed - The amount available for distribution is calculated in the following way: "Company balance sheet amount" + "Available overdraft" - "amount already distributed to users of the subagent" .
  • A table with all the established balance amounts of the selected subagent and the balance on the subagent balance.

The table contains the following columns:

  • User — list of users / user groups of the subagent for which the account has been allocated. The last user on the list is the subagentry itself.
  • Sum — balance of the company allocated to the user or group.
  • Edit — link to the user account editing page. When you click the link, the user is transfered to the form to edit the account value of this user.
  • Delete — button which allows you to delete a user account record. When deleting, user funds are returned to the sub-agency account.

To sort the entries in the table in ascending / descending order, click on the column header of the table.
Editing/deleting a sub-agency’s own account is unacceptable because it is set by the root agency manager in the Balance account settings section, see “Company Balance” article.


Editing the account of a subagency user

To set an account for a user or group:

  1. Go to the section Editing the user balance of the sub-agency. You can enter the user/group user balance editing page in two ways:
    • Select the object to apply the settings in theUser as user/ user group.
    • If the account for a user / user group has been set up earlier, you can proceed to editing the user's funds from the funds reallocation table (see the previous section).
  2. Set the size of the account provided to the selected user — the value that will be allocated from the subagent’s own funds to this user or group.
    When you specify the value of the account, the amount allowable for distribution decreases.
    • If an amount excceding subagent’s own funds is entered, the current value of this user's account will remain unchanged, and the page will display the following message: The account size has not been changed, because the amount exceeds the maximum value.

The currency of the account is determined by the currency of the subagency’s account, i.e. if the account of the subagency is set in RUB, then the currency of the user/group account is also RUB.
Only positive numbers are allowed as account size, with the fractional part separated by a dot or a comma.


It is also possible to set for the user an account that exceeds the real balance of the subagency company via the setting the amount of distributed accounts can exceed the amount of the subagency’s balance. In this case, the user will be able to pay for the flight only if the sub-agency’s account has enough money to pay for the flight. Otherwise, the user will be prompted to contact the agency. To enable this setting:

  • Go to Finances → Balances and overdrafts → Balance account settings
  • Turn on the Amount of distributed accounts setting may exceed the amount of the sub-agency balance and save the changes.

Paying from the company balance

In order for a subagency user or group of users to have access to a payment method from the company's balance, the company balance payment method must be enabled for these objects under Finances → Payment Methods → Access to Payment Methods. Also make sure that the payment gateway is set up for these users in the Finances → Payment Methods → Gateway control section and that the Payment gateway enabled option is active in the filter settings of this payment method (for more details, see the article Payment Methods in Websky).

After choosing the company balance payment method after booking, when you switch to payment, on the order page, the user will see the status of the company's available balance:

  • «Company Balance»,
  • «Available overdraft»,
  • «Will remain after payment»,
  • «Amount to pay».

To pay for an order with funds from the company balance:

  • The user clicks the Pay button.
  • A message will appear in a pop-up window: "Attention, funds will be written off from your company's balance sheet. Continue?". To pay from the balance of the company, the user must agree.
  • The funds are debited from the balance of the company that is assigned to the user. The order status is Paid.