Budget transactions

When preparing financial forecasts, based on the double-entry method, transactions are entered in the Budget table. Indicate origin and destination accounts for each one. The program has the information necessary to prepare Balance Sheets and Income statements, that will however relate to the future and not the past.

When one is planning with Excel, the Income statement is set up first, then the revenues and costs are listed. Generally, the liquidity and investment plan is prepared only later and on separate sheets.
When making forecasts with the double-entry method, we proceed instead as if we were keeping an accounting for the future. All the transactions that are expected to occur will be listed. The program will then automatically prepare the Balance Sheet and Profit and Loss account for the indicated period or periods.

Structuring of budget transactions

For the preparation of a financial plan, we generally proceed by listing the different elements in the following order:

  • Capital injections.
  • Third party capital injections.
  • Setting up expenses.
  • Investments.
    In furniture, equipment.
  • Recurring fixed costs.
    Rent, staff, social security charges, energy, subscriptions.
  • Recurring revenues.
  • Variable revenues
    The turnover which is typically seasonal.
  • Variable costs.
    Commissions, costs of the goods sold and others, which are related to the expected volume of revenues.
  • Year-end transactions.
    Depreciation, taxes, interest on loans, dividends.

By the time you enter sales and variable costs, you will already have the cost and capital structure. It will be possible to know instantly, whether the expected turnover will allow the company to generate sufficient profits and liquidity to guarantee its sustainability over time.

Amount and Formula column

As a rule, to prepare a budget, simply use the Amount column.
For more elaborate estimates, there is the possibility of indicating quantities, unit prices, or a formula. The program will automatically calculate the value in the Amount column.

Updating forecasts

With the double-entry method, thanks to the possibility of indicating each operation in detail, it becomes easier to update and improve the forecast. Initially, estimates of different costs or investments will be entered. As you get closer to the operational phase and there will be more precise data, just replace the existing ones. Even when the activity has started and exact elements are known, the forecast can be updated easily. Precise and reliable indications on profitability and liquidity are thus available.

Dates and repetitions in financial forecast transactions

The Data column

The value contained in the Data column is the one that will validate the forecast.

  • If there is no date, the transaction will be taken into account at the beginning of the planning.
    If you require a forecast indicating a period, the amounts will be taken into account in the balance value at the beginning of the period.
    Due to the fact that it does not fall within the period, no amount will be displayed in the Total column.
  • Dates in the accounting period set in the file properties.
    These are the ones commonly used. The total amount will be indicated in the Total column, taking into account repetitive movements, within the accounting period.
  • Dates prior to the period.
    You can enter movements that precede the forecast period. However, you must be careful that they do not conflict with the opening balances entered in the account table.
    Due to the fact that it is not within the period, no amount will be displayed in the Total column.
  • Dates after the period.
    If you make forecasts over several years, they allow you to indicate transactions for the years to come.
    Due to the fact that it is not within the period, no amount will be displayed in the Total column.

The End date

This is used in combination with repetition, to indicate the last date beyond which there is to be no repeat.

  • Must generally be left empty.
    If you enter a date when it is not necessary (for example the end of the accounting period) the forecasts for the following years will not include this operation.
  • For leasing transactions.
    Indicate the date on which the payment of the last installment will be made as the end date.
  • For loan repayment.
    Indicate the last expected payment date.
  • For changes in the amount at set deadlines.
    In the case, for instance, that the amount of a recurring transaction is adapted at certain deadlines (salary increase).
    • Create a transaction row with repeat "M" and End date as per the last payment before the increase.
      Create transaction rows with Data when the increase begins.
    • If the increase follows a precise and regular automation, this can also be programmed with formulas.

Repetitions

For recurring expenses or income, the repetition code is recommended (refer to Documentation on the columns).

  • When calculating the forecast, the program creates copies of the operation and progressively increases the date, taking into account the indicated frequency.
  • If there is no end date, the program will generate internal copies of the records for the entire period of the forecast indicated at the time of the report when calculating the forecast.
    • If the start date is January, the frequency is monthly
      • If the forecast period is the year, it will generate rows from February, 1 original row and 11 automatic rows, for a total of 12.
      • If the forecast period is 10 years, it will generate rows starting from February, 1 original row and 119 automatic lines (11 the first year + 12 * 9 for the following ones), for a total of 120 lines.
  • If you want the program to automatically calculate forecasts for subsequent years.
    • For recurring operations, indicate the relative repetition code.
    • For transactions that occur only once a year (for example depreciation at the end of the year), indicate the repetition code "Y", so that the depreciation is also calculated in the following years.
    • Don't use the repetition only if the operation will not occur in the following year.

Total column of the Budget table

The Total column is calculated automatically and represents the sum of the amounts of the current row and the repetition amounts that fall within the accounting period. The Total column is empty if the transactions have an earlier date or extend beyond the accounting period.

Schedule with precise date and monthly logic

Forecast movements are entered in the Budget table indicating the date on which these are expected to occur.

However, it is not always possible to predict all revenues and expenses with a daily precision. When making a forecast it is therefore useful, in some cases, to use approximations, generally reasoning on a monthly basis. In any case, it is useful to always follow a specific logic so that reliable liquidity forecasts can also be obtained in the short term:

  • Punctual operations (capital payment, investments) are indicated with the date on which they are expected to occur.
    If there is no precise date, it is useful to indicate them on the 15th day of the month in which they are expected to occur. 
  • Recurring charges that have a precise payment date are to be set with the expected payment date and the relative repetition code:
    • Bank charges, interest, amortization are to be indicated at the end of the month, quarter or year that they will take place.
    • Rentals on the due expected date of payment.
    • Salaries and social security charges
      • For the calculation and monthly payment on the day that wages are paid.
      • For thirteenths, bonuses or whatever at the moment they are paid.
      • Payments for advances and adjustments of social security charges on the expected payment date.
    • Payments and VAT adjustments on the typical payment due day.
  • Revenue Forecasting.
    The preparation of the forecasts depends on the type of activity.
    If you do not know the exact day, but you will know that it will happen in a certain month, it is recommended to indicate the 15th of the month
    • Punctual revenue.
      They are to be indicated on the date on which it is expected to take place or mid-month.
    • Recurring revenue.
      To be indicated on the date of entry or mid-month.
    • In many cases a monthly forecast is well suited. The revenue can be indicated on the 15th of the month.
      • If the revenues are recurring, the revenue can be entered with the monthly repetition. Using formulas you can predict growth.
      • If there are seasonal differences, it is helpful to have a sales forecast row for each month.
    • Forecast of projects or major works.
      If there is a calendar with receipts, a transaction row is to be indicated for each expected entry. It can be approximated by indicating the 15th of the month.
    • Forecast for customers.
      For a consultant or commercial advisor, who works both with budgets and projects, it can prove very useful to set up a detailed revenue forecast for each client, with the expected payment dates. This forecast will also be very useful to check if the customer has actually paid.
  • Variable costs.
    • Constant expenses linked to the turnover (a restaurant for example ), are indicated with the same date as the turnover. With a formula you can also calculate as a percentage value of the turnover.
    • Costs can also be linked to other elements, such as the number of employees, rented premises or other.

Forecasting with the cash principle

Planning for small business and cash activities (such as shops, restaurants) it is useful to proceed with the cash principle, then indicate the revenues with the date on which they will be collected and the costs when paid.

For important operations, such as the purchase of a machine whose payment is deferred over time, it is however useful to insert forecast movements with precise details:

  • Purchase of machinery (asset registration with suppliers) with date of purchase.
  • Payment of the machinery, with the date(s) on which payment is expected.

Forecasts with the accrual method

In this case, the insertion of the operations takes into account when the payment will be made.

  • Cash transactions.
    They are obviously registered normally.
  • Transactions expected to be settled in the near future.
    For simplicity, the operations that fall within the forecast month or the one immediately following, it can be useful to use the cash principle.
  • Deferred payments.
    If the dates are not known with precision, you can use the 15th of the month.
    • Transactions with precise payment terms.
      • One movement indicates the purchase date with the counterpart in the supplier account.
      • One of the other movements indicates payment on the scheduled dates.
  • Deferred collections.
    • With precise payment terms, as is the case with a project:
      • A movement indicates the billing date and the customer account with the counterpart.
      • One of the other movements indicates payment on the scheduled dates.
    • Late payment.
      This is the case when a part of the revenues is collected in the short term, a percentage is collected later. It can be done like this:
      • Enter the revenue as cash collection.
      • With the same date, a movement is created that moves a part of the collection to the customer account.
      • At a later date, the cash collection is indicated with the client account of the counterpart.
  • Use of variables for deferred collections and payments( see Example use of variables)
    When the same value must be reused at the time of payment, it can prove very useful to use the formula column and variables.
    • In the billing transaction, the amount is assigned to a variable.
    • In the payment movement, the variable is inserted so that the amount is automatically taken over.
    • Variables can also be used to define the percentage of the amount that will be deferred, for example.

 

Esempi di movimenti di previsione finanziaria

I movimenti di pianificazione si inseriscono come delle normali registrazioni, con la data descrizione, importo, conto dare e avere.

In più si usa però il campo ripetizione, che consente di inserire le operazioni ricorrenti con una riga sola.

Qui di seguito sono elencati diversi esempi ripresi dal modello seguente a cui si rimanda per ulteriori spiegazioni.

Normali registrazioni di previsioni

Si tratta di registrazioni di previsione che sono come delle normali registrazioni.

L'esempio qui indicato è riferita all'inizio dell'attività, quindi operazioni che non si ripetono.

Registrazioni ripetitive mensili

Qui di seguito degli esempi di registrazione con ripetizione mensile, codice "M". La colonna Totale indica l'importo complessivo per l'anno.

Le prime due registrazioni si riferiscono all'affitto, che da febbraio a giugno è di 1'000 mensile, mentre da luglio è di 1'200.

C'é anche una data 2025, che è l'importo che si dovrà versare per il riscatto del leasing. In questa riga non vi è nulla nella colonna Totale, perché il movimento non rientra nelle date del periodo contabile definito nelle proprietà file.

Per le spese amministrative conteggiate dalla banca si è usato il codice ripetizione "ME" Fine mese (Month End). Per le registrazioni successive non sarà usato il giorno 28, ma l'ultimo giorno del mese, quindi marzo 31, aprile 30.

Fine trimestre

Qui indichiamo alcune registrazioni tipiche che si ripetono a fine trimestre. Inseriamo la ripetizione 3ME, che significa ripeti ogni 3 mesi, con data fine del mese.

Fine Anno

A fine anno ci sono delle operazioni. Qui usiamo il Ripeti "Y" in modo che queste operazioni saranno eseguite anche per gli anni successivi.

Previsione ricavi e acquisti merce

La previsione dei ricavi è specifica a ogni attività. In questo caso la previsione dei ricavi e degli acquisti viene indicata mese per mese, con un importo specifico. 

A partire da marzo è indicata la ripetizione "Y" annuale, così che queste operazioni saranno ripetute negli anni successivi.

Ricavi anno successivo

I mesi di gennaio e febbraio nel primo anno di attività non erano considerati significativi per gli anni successivi, quindi non avevano una ripetizione.
Per i primi due mesi del secondo anno dobbiamo impostare le vendite. Mettiamo anche la ripetizione "Y" annuale così verranno ripetute l'anno successivo. 

 

 

Forecasting with quantity and price

The Quantity, Unit and Unit Price columns of the Quotes table allow you to prepare forecasts faster.

The value of the Amount column is calculated by the program by multiplying the Quantity by the Unit Price (under the condition that Formula column is empty).

The Quantity, Unit Price columns are set as visible in the Formula View.

Tabella Preventivo con colonne Quantità, Prezzo Unitario e Formula

Advantages of using the Quantity and Prices columns

The quantity and price columns are useful for making predictions based on quantities. For example:

  • In the Unit column you can indicate what the price refers to.
  • The Quantity column indicates the number of seats served daily.
  • The Price column indicates the estimated revenue for each cover.
  • The Amount column will be calculated automatically based on the values indicated.

With this approach offers several advantages:

  • All elements of the planning can be precisely detailed in the Budget.
  • We remember the quantities and prices used to make the estimate.
  • Changing the schedule is very simple, you can change the element you want only.
  • How the profit varies, can be seen with a change in the quantities sold or in the price.
    Break-even analysis.

 

Javascript formulas in the Budget table

Javascript formulas in the Budget table

The Formula column allows you to enter calculation formulas. The estimate amounts can thus be calculated on the basis of other values of the same budgeting.

  • Indicate the cost of goods based as a percentage of sales.
  • Increase your sales budget based as a percentage of growth.
  • At the end of the year, calculate the depreciation based on the value of the investments made.
  • Quarterly, calculate interest on the bank account based on actual usage (days / 365).
  • Monthly, calculate interest on the bank account based on actual usage (days / 365).

If you enter a value in the Formula column, the Amount column is calculated by the program based on that formula.

The following functions can be used in the Formula column of the Budget table.

Example files

For examples of the formulas, refer to the following explanations:

Tabella Budget con formule in Javascript


  •  

Calculation formulas in Javascript

  • The formula must be expressed in the Javascript language (not to be confused with the Java language).
  • If there is a formula (or any text), the value in the Amount column is set according to the formula result.
  • You can use all the functions of the Javascript language, plus the APIs provided by Banana.

Decimal separator

In JavaScript only the point "." is used as a decimal separator
If you use a different separator, the one used for numbers in the local format, the number is likely to be truncated.

Calculation sequence and lack of future values

For more information on the calculation sequence, see Planning Logic.

  • The rows are sorted by date and arranged starting from the lowest.
  • If there are rows with the same date, the order is that of insertion.
  • When a row is resolved and the following rows have not yet been processed, with the formulas you will only have access to the data up to that moment.

Amount = result of the last instruction

In Javascript the semicolon ";" is used to separate expressions.
If the Javascript formula contains multiple expressions separated by ";" the value of the Amount column will be the result of the last executed expression.

  • 10*3 //30 will be returned
  • If there is a sequence of several operations separated by a semicolon ";", the last operation will be resumed.
    10*3;7; //7 will be returned
  • If there is a return, the value is resumed after the return.
    return 10; // 10 will be returned.

Variables

Javascript variables are the most powerful elements of programming, as they allow you to access the computer memory with a name, save and access those values.
Variables do not exist in Excel formulas, but are similar to the name of the cells, with the difference that the name can be freely assigned.

Variabili nella pianificazione finanziaria

The variable is created by indicating a name and indicating with the equal sign.

You can define and use variables directly within the rows. By entering the variable name in the formula, the saved value is taken over.

The price variable is created here and the  value 10 is assigned.

var price = 10;

or simply

price = 10;

below we create a total variable to which the price value multiplied by 5 is attributed.

total = price * 5;

The value of the variable can be reassigned.

price = 20;

Objects

Javascipt objects are variables that allow you to save multiple values, each indicated with a property.
The prices object is created below, indicating the curly brackets. To access and save the values, instead use the square brackets or indicate in the name of the property after the name of the object.

prices = {}
prices['car'] = 10;
prices.car = 10;
prices['computer'] = 20;
prices.computer = 20;

Array

Javascript Arrays are created using square brackets and also to access them. 
The first element of the array has index 0.

costs = [1,2,3];
costs[0]=3;
result = prices['car'] - costs[0];

 

Automatic variables

  • budgetCurrent
    It is a table that contains the budget rows after the repetitions creation.
    These are used to record values in conjunction with the JRepeatNumber.
  • DEBUG  is a variable that can be "true" or "false".
    If "true", in the messages, all the results of the formulas are being displayed.
  • row
    Is a Javascript object that refers to the current row.
    • The values of the cells can be retrieved with the value function ("columnNameXml").
      row.value("date") returns to the date of the transaction.
    • row.value ("JRepeatNumber") returns the progressive of the repetition.
      The first repetition is 0.

Budget Functions

In addition to the budget API defined in the accounting class API, there are specific functions.

budgetExchangeDifference (account, [date, exchangeRate])

This formula recalls the Banana.document.budgetExchangeDifference function.

BudgetGetPeriod(tDate, period)

This function is used in combination with the use of repetition.
When repetitions are indicated, it is advisable to refer to a calculation period and not to a precise date.

  • Parameter tDate.
    The date to which the calculation of the period refers. Usually the date of the recording line.
  • Period parameter.
    Abbreviations
    • For the current month
      • "MC" current month
      • "QC" current trimester
      • "YC" current year.
    • For previous month
      • "MP" previous month
      • "QP" previous quarter
      • "YP" previous year.
    • In the Experimental version (starting from version 9.1) can also be used
      • "DC" current day
      • "DP" previous day
      • "WC" current week
      • "WP" previous week
      • "BC" current bi-monthly (2 months)
      • "BP" previous bi-monthly
      • "SC" current half-year
      • "SP" previous shalf-year
    •  
  •  Returned values.
    An object composed of two dates
    • startDate
    • endDate
// example
t = BudgetGetPeriod ('2015-01-01', 'MP') returns
t.startDate // 2014-12-01
t.endDate // 2014-12-31

Specific budget functions

The following are similar to those available with Banana.document, but can be used without indicating the object Banana.document.

To be taken into account:

  • Instead of the startDate parameter, you can use one of the abbreviations "MC", "MP", explained in the budgetGetPeriod.
  • If you use an abbreviation, the function calculates the start and end date of the period, based on the date of the current registration.
  • It makes sense to use the end date only if it is earlier than the row date.
    If it is equal or higher, it has no effect because the values after the current row are not yet available, because they have not been processed.
  • If the registration row date is April 15th:
    • budgetBalance("1000","MP") the balance of the 1000 account returns at the end of March.
    • budgetBalance("1000","MC") returns the balance at the current time is the same as budgetBalance("1000").
    • budgetTotal("1000","QP") returns total of the movement for the previous quarter.
    • budgetTotal("1000","QC") returns the total of the movement for the previous quarter, up to the current date.
budgetBalance(account, startDate, endDate, extraParam)

The balance up to the current row.

budgetBalance('1000', 'MP'); //returns the balance of 1000 at the end of the previous month
budgetOpening(account, startDate, endDate, extraParam)

The balance at the beginning of the period.

budgetTotal(account, startDate, endDate, extraParam)

The difference between the debit and the credit movement of the period.

budgetTotal('1000', 'MC'); //returns the total movement of the 1000 account for the current month
budgetInterest( account, interest, startDate, endDate, extraParam)

Calculates the interest on an account, for the period indicated (at the maximum the current date)
If you use it to calculate interest on an account at the end-of-period, the row where the formula is shown should always be the last one for this date.

  • account parameter
    This is the account number on whose movements interest will be calculated
  • interest parameter,
    Indicates the interest rate in percent.
    • Positive (2.5, 4, 10) calculates the interest on the account's debit movement
    • Negative (-2.5, -4, -10) calculates the interest on the account's credit movement.
credit(amount)
  • If the amount parameter is negative returns the amount as a positive
    credit(-100) // returns 100

  • If the amount parameter is positive, returns 0 (zero)
    credit(100) // returns 0

This function is useful in conjunction with the other budgetBalance functions to work only on the balances you need.
If you want to calculate the percentage on sales, using this function is easier.
credit(budgetTotal('1000')) // enter the value only if it is a negative.

debit(amount)
  • If the amount parameter is positive, returns the amount
    debit(100) // returns 100

  • If the amount parameter is negative, returns 0 (zero)
    debit(-100) // returns 0

Useful if you have to make calculations using only the debit amount and avoid using the credit amount

include

Includes and executes a Javascript file, with the possibility to create its own functions and variables that can be recalled in the script.

  • include "file:test.js" 
    Executes the contents of the indicated file. The name refers to the file on which one is working.
  • include "documents:test.js" 
    Executes the contents of the text document contained in the documents table.
    This has to be a file of the "text/javascript" type.

Functions for multi-currency accounting

They can also be used for accounting without multi-currency, in this case the account is always in basic currency.

budgetBalanceCurrency(account, startDate, endDate, extraParam)

The balance in the account currency up to the current line.

budgetOpeningCurrency(account, startDate, endDate, extraParam)

The balance in the account currency at the beginning of the period.

budgetTotalCurrency(account, startDate, endDate, extraParam)


User defined functions

The user can define personal function with the JavaScript language, and recall them in the formulas.
It is possible to define functions:

  • Directly in a formula
  • In a JavaScript coded attachment; this attachment must have as row id the "_budget.js" name
  • In a text of the Documents table, that needs to be included with the Include command
function Taxcalculation(profit)
{
   var percentage = 10;
   if (profit > 50000)
      percentage = 10;
   else if (profit > 100000)
      percentage =20;
   return profit * percentage / 100;
}

 

 

Examples of the use of formulas in financial forecasts

Below you will find some examples of how to use formulas to automate financial forecasts.
Please refer to the specific documentations:

formulas

Parameters

When planning, it can be useful to define variables that can and will be used later.
It is useful to create a parameter section with a posting date of January 1st, or another date that corresponds to the first day of the Budget. The parameter variables will then be used in the following rows.

// 30%
costOfGoodsSold = 0.3 
// 5%
interestRateDebit = 0.05
// 2%
interestRateCredit = 0.02
// 10 %
latePaymentPercentage = 0.1

This way, all parameters that can be set are displayed instantly. When a parameter is changed, the forecast is recalculated.

Repetitions or values per month

By using the repeat column, you can plan for the whole year on one recording row.

If however, the activity has seasonal variations, it is recommended to use a forecast by month. For each month, a row is created with the sales amount for the month.
If you wish to make forecasts automatic for several years, it is useful to insert the repetition "Y" in this row, so that the row of the year is also used for the next one.

Prices and sales quantities

When making a sales plan it will be easier to enter values using the quantity and price column. For example, a restaurant can enter the number of covers served per day, week or month and the program automatically calculates the amount. By changing the number of covers or the price, the impact on liquidity and on the result for the year is instantly displayed.

Use of formulas with variables for growth

Use formulas, which are expressed in the Javascript language:

  • The variable must be defined before being used, hence the line, in which it is defined, must be a date preceding the the line in which it is used.
  • Thousands separators in numbers can't be used.
  • The decimal separator is always the "." (Full stop)
  • The names are different for uppercase / lowercase.

You can assign a value to a variable (this name can be freely chosen) and enter the variable name in the following lines to resume the value.
By changing the value assigned to the variable, all the lines, in which the variable is used, are automatically modified.

As an example, you may set the expected sales amount,  proceeding with the following months, by using a formula to increase the amount.

  • Create a "S" (sales) variable , by entering the following text in the Formula column.
    Sales=1000
    The value 1000.00 will be inserted in the amount column
  • In the following lines use the variable by simply inserting the variable name in the formula:
    Sales
    The value 1000.00 will be inserted in the amount column
  • You can add 10% to the amount (multiplying by 1.1)
    Sales*1.1
    The value 1100.00 will be inserted in the amount column (The value of the Sales variable does not change)
  • You can increase the value of S
    Sales=Sales+200
    The value 1200.00 will be inserted in the amount column (The value of the Sales variable will change)
  • If the variable is used in the following line, there will be the new calculation
    Sales
    The value 1200.00 will be inserted in the amount column

You can also define a variable to define the percentage of growth.

  • Percentage=1.1
  • Amount=200
  • In formulas you can use the variable name instead of the number
    • Sales*Percentage
    • Sales=Sales+Amount

Variables and repetitions

Let's say you expect the turnover to rise by 5% every month.

  • Enter two lines where you assign the value to the variable, without putting any account with the start date of the year.
    Sales=1000
    Increment=5
  • Then create a line with the repetition where you enter the accounts and the formula
    Sales=Sales*(1+Increment/100)

Each time the row is repeated the value of the variable S will be increased by 5% and consequently also the amount of the transaction. By simply changing the growth percentage, the forecast will be recalculated.

In a row you can also insert multiple Javascript instructions, by separating them with a semicolon ";"
Sales=1000; P=5

Use of budget formulas

There are functions that allow you to access the balances and movements of the accounts for planning up to the row that is calculated.You can enter a formula that through the budgetTotal function, recovers the value of the sales account "SALES" of the previous month.

credit( budgetTotal("SALES", "MP") )

The budgetTotal function takes account numbers and periods as arguments. An abbreviation can be used instead of the period.

  • MP stands for previous month.
  • QP stands for previous quarter.

Revenues show in Credit, therefore the value returned by the function will be negative and will not be accepted as an amount in the double entry accounting.
Therefore use the credit () function, which uses the negative value and turn it into a positive value.

Variables for monthly sales

Sales may vary for each month. In this case it is useful to use separate registrations for each month with the variable name.

sales_01 = 1000
cost_01 = sales_01 * costOfGoodsSold 
sales_01 = 1100

Deferred payments

If you want a very precise liquidity plan, it is useful to separate the sales, which are paid immediately and those that are deferred.
One approach may be to record all sales as if they were paid cash, assigning the value of the monthly variable to the amount.

sales_01 = 1000

A registration is then entered, which reverses the sales that are deferred, calculating the amount with the formula.

sales_01 * latePaymentPercentage

A payment registration with the same formula will then be inserted for the following month.

Selling costs

There are costs that can be related to sales (cost of goods) or to other costs (social charges, in relation to wages).

Cost calculation with variables

If the sales are defined with variables, the sales costs can also be indicated as a percentage of the sales.

  • You can define variable S for sales and variable C for the percentage of the cost.
    Sales=1000
    Cost=60
  • The formula for the calculation will be:
    Sales*Cost/100

You can also use the same approach to calculate social security charges.
This formula can possibly be entered in a repetitive row.

Sales cost calculation with budget functions

When the costs are related to sales, the budget formula can also be used.

credit( budgetTotal("SALES", "MC") )*60/100

When the costs related to sales, "MC" stands for the current month.
This formula will return the sales value of the current month, turn them into a positive and multiply them by 60 and divide by 100.

The date must be beyond the sales registration dates, obviously.

It may be used it in a repeat row, inserting the month end date. Therefore, the costs of the sale will automatically be calculated based on the sales entered with the transaction.

The formula can be combined with variables.

  • At the beginning of the year define the percentage of costs.
    Cost=60
  • Therefore, the formula C is used.
    credit( budgetTotal("SALES", "MC") )*Cost/100

When you change the contribution percentage or any sale, the schedule will be updated automatically.

Sales commission calculation at the end of the year

At the end of the year,  you calculate the commissions of 5% on the total net sales with this formula:

credit( budgetTotal("SALES", "YC") )*5/100

The bugetTotal function returns the movement of the sales account for the period "YC", current year. With the credit () function, the amount is turned into a positive value and then multiplied by 5 and divided by 100.

If you make forecasts over several years, remember to insert the repetition "Y" in the row, so that the same formula will be also calculated for the previous year. As indicated above instead of entering the 5 directly in the formula, you can assign it with a variable.

  • Commission=5
  • credit( budgetTotal("SALES", "YC") )*Commission/100

If the percentage changes from one year to the next, it is sufficient enter a transaction with the following year date that resets the variable for commissions.

Inflation with variables

If you want to forecast over several years, you can also take inflation into account.

  • At the beginning of the planning, assign a base variable for prices and inflation (2%).
    Base=1;Inflation=2
  • When you use the Sales variable, you multiply it by the inflation rate
    Sales=Sales*Base
  • At the beginning of the following year, with annual repetition, you increase the price base
    Base=Base+Base*Inflation/100

Depreciation calculation

Thanks to the formulas, the calculation of depreciation can be automated.
If you change the value of your investments in planning, depreciation will be automatically recalculated. Make sure that the date of the depreciation calculation line has a date superior to that of the investments. Date is generally 31st December .

Depreciation calculation on book value

To calculate the depreciation of the "EQUIPMENT" account, insert a line at the end of the year with the following formula and the debit and credit accounts appropriately set up to register the depreciation.

budgetBalance("EQUIPMENT")*20/100

The budgetBalance function returns the balance to that date. The amortization of 20% is then calculated on this.

Use the debit function, in case you think the asset account can go into credit.

debit(budgetBalance("EQUIPMENT"))*20/100

Calculation of depreciation on the initial value

To calculate the initial value of the investments, it is necessary to use variables to remember the value of the initial investment. 

Equipment=10000

If the depreciation is spread over 5 years, the formula will be inserted in the year-end depreciation line

Equipment=10000/5

The annual repetition "Y" and the end date, which corresponds to the date of the last installment of the amortization, will be inserted in the row to prevent the amortization from running on indefinitely.

For each investment you will have to create a variable and a specific row of depreciation. Numbers can also be entered in variable names.

Equipment1=10000
Equipment2=5000

Interest calculation

The budgetInterest( account, interest, startDate, endDate) function allows you to automatically calculate interest based on the actual use of an account.
The parameters are:

  • Account
    Whose movements are used to calculate interest, in case it will be the bank account or the loan.
  • Interest
    The interest rate in percentage.
    If the value is positive, interest on the debit balances is calculated.
    If the value is negative, interest on the credit balances is calculated..
  • Initial date, which may also be an acronym.
  • End date, which may also be an acronym.
  • The returned value is the interest calculated for 365/365 days.

Interest expense on the bank account

To calculate the interest expense of 5%, insert a line with the end date of the quarter and the repetition "3ME", which contains the formula

budgetInterest( "Bank", -5, "QC")

The interest rate is negative, because "QC" means current quarter. The debit and credit accounts must be the usual ones for recording interest expense. If the interest decreases the bank account balance will also be used in the registration. However, another account can be used if it is paid with another account.

It is important that the "3ME" repeat is used so that the date used will always be the last of the quarter.

To calculate the interest of the month use the abbreviation "MC"

budgetInterest( "Bank", -5, "MC")

Interest on the bank account

For interest income of 2%, use positive interest instead.

budgetInterest( "Bank", 2, "QC")

Interest on fixed-term loan accounts

For fixed-term loans, interest will be calculated and recorded on the specified date.

  • Create an separate account for each loan.
    Use the budgetInterest function indicating exactly the start and end dates .If the date is indicated as text, the notation "yyyy-mm-dd" should be used, then "2022-12-31"
  • Use variables.
    As indicated for depreciation, the loan amount can be assigned to a variable. The interest calculation will be done with a Javascript calculation formula,
    • Define the loan variable
      Loan=1000
    • 5% interest calculation, for 120 days.
      Loan*5/100*120/365.

Profit tax calculation

Profit is the total of the group's profit for the specified period.
To calculate a 10% profit tax, use the following formula.

credit(budgetTotal("Gr=Result","MC"))*10/100

  • Use the the budgetTotal function parameter in the "Gr = Result" group, which indicates that instead of an account it has to calculate the movements for the group.
  • MC, current month, is indicated as the period.
  • The budgetTotal function will return a positive value if there is a loss and negative (credit) if there is a profit.
  • the credit function takes only negative values into account, therefore if there is a loss the tax will be zero.

Payments with deferred or different deadlines

For deferred payments or with different deadlines, you can proceed in two ways:

  • Use variables to which payment amounts are to be assigned.
    Use the variable in question when recording the payment.
  • Create customer or supplier accounts for different credit deadlines.

Other cases

Please tell us about your other requirements, so we can add more examples.