The snippets

erpag snippets

1. Introduction

The most common questions our users ask themselves when they open any document list in ERPAG are:
  • What should I do now?
  • Where the business stopped?
  • To which documents I should pay extra attention to?
  • Which documents should I pack?
  • Which documents should I ship?
  • Which sales orders I should invoice?
  • Who should I contact today?
  • Etc.
It's hard to give a universal answer. The sole answer depends on the specifics of each business and the roles the operator has. In order to reach the wanted answer, the operator had to go through a few manual steps each time. Those steps mainly include filtering and searching data based on the specific criteria. The data list was there, the operator just had to find what interests him. That can be time-consuming if it's done day-in-day-out.

Some developers would say: How can we know which data you need? Which data you consider important, while others you find trivial?

However, ERPAG developers have a different approach. We analyzed the user's behavior, conducted surveys, and found the point agreement of operators' needs. What everyone needed was from ERPAG to pull out the core of each list, eg. key point indicators (KPI). The view should be instant and clear with simple action if there is a need for more information.

A good example comes from one of our users which said: "When I go to CRM, in the Quotation list, I want to see who do I need to contact today, who should I contact in the next few days, and who did I miss to contact." Until now, operators had to filter the Quotation list to today's date, and then to filter out the status to be 'in process', and so on for every information each day.

The solution we came up with and implemented is called THE SNIPPETS.

2. Snippet types

snippets type

If there are snippets for any list, they will appear above the table. There are two types of snippets: filter and sum.
  • Filter type
filter snippet

On the right slide, we have a funnel icon (filter), while on the right side we have a total number of documents from the list (document number is in the document lists, the item number is in the product and services list, etc.) that meet the condition.

If there is no data that meets the given condition, the snippet is transparent with gray text.

empty data snippet

On this snippet, you can click on, and the list will be filtered out by the given snippet condition. When a snippet is "turned on", it's background is black, while the text is white.

turned on snippet

This is how the list from our example will look when we "turn on" the filter snippet:

quotation filter snippet

Ie. in our list we will just see the document(s) where the follow-up date is today.

Snippets support multiple filters, so you can turn on multiple filters at once.

We will create an example in which we will turn on 2 snippets on the sales order list.

sales order missed deadline snippet

By clicking on the "Deadline missed", we will update the list and snippets with it.

sales orders ready for packing

The next click is on "Ready for packing", and we will see all the documents we could pack, but we missed the deadline.

sales orders snippets
  • SUM type
The primary function of this snippet is to show the summed up value. On the left side, we have the SUM symbol (Greek symbol Sigma) and value.

sum type snippet

In most cases, there is no option to filter it by clicking on it.

This value (like the number value in the filter type) is dynamic, so if you turn on the filter snippets, the value will automatically be summed up according to the new parameters.

The value will also be summed up if we filter it directly from the list.

filtering from the list

filtering from the list

In this example, we filtered the "Retail" warehouse, and our filter and sum snippets automatically updated.

3. Setup

As we mentioned, each business model has specific needs and each operator has specific roles, so we enabled the operators to select which snippets they want to track.

enabling snippets

If there are snippets on the list, they are set up through the MORE > SNIPPETS option.
  • On/Off
If "checked", the snippet will show. If you don't want to have any snippets on your list, just turn them all off.

manage snippets

It is best to adjust the snippets according to the resolution of your screen, in order to prevent scrolling around. The maximum number of snippets is 8.
  • Color
snippet color

The developers usually assign the color according to the traffic light principle (Red-Yellow-Green), but we decided that the operators should have the ability to select the background color of the snippets, according to their liking. For example, someone might want the "Deadline today" to be red-colored, in order to draw more attention.
  • Position - left/right
Sums and values are usually displayed aligned to the right side, because numbers are usually aligned to the right for easier reading. With this option, we enabled the operators to select whether they want the snippet to be aligned from left to right, or vice versa.
  • Sequence order
The sequence order is adjusted via drag and drop technique by mouse, or by clicking on the arrows.

snippet order

Note that with the right alignment, the order is reversed.

2019. ERPAG Inc.

How to calculate commission on sales?

sales commission

1. Introduction

The practical need of every business is to measure sales and to further motivate and/or reward successful ones. The most common way for a company is to calculate commission for its salesmen or lobbyists.

For simplicity, the most common form is flat rate commission (eg, on each sales order 5% of its value is charged). It is simple but it leaves many questions, and some of which are:
  • Is this applicable to all types of businesses?
  • How is the customer return calculated?
  • Should all commercialists have the same commission?
  • If the margin is different, should the same percentage always be calculated?
  • What if more people are participating in sales?
  • If the buyer is granted a discount, does the commission need to be reduced?
  • A higher sales order amount to account for a higher percentage?
  • The calculation should be done only when the goods are delivered?
  • Etc …
Since the simple way cannot meet the needs, there are different types of commission calculation (straight, tiered, gross, placement fees, gates, share of margin, etc.). The more time passes, the more complex the calculations become.

For us as software developers to implementing all these methods is a big challenge. Not only because of their complexity but that the methods are evolving. Depending on the market conditions, companies change their calculations. Each change takes time as well as new hours of development, which requires additional costs, especially for SMBs.
  • What is the solution?
The solution is to enable each company to independently set up the calculation.
  • Why?
No one can understand and set up a calculation other than the company itself.
  • How? When a visitor has no programming experience or access to the programmer's code?
ERPAG has integrated Google Blocky ( ), a visual programming language ( VPL ) that allows users more unprecedented customization.

erpag blockly

In this text, we will do an example of commission calculation.

2. Custom fields

Custom fields are a very useful option in customization (for more details check out this link:

Due to data integrity, enrollment is limited to custom fields only. So we will open up new fields to store the results.

Opening a new custom filed is done by activating the "add new" option in the "custom fields" panel when entering a sales order (new or edit mode of an existing one).

sales order custom fields

In our example we will create a custom field, that is a type: List.

custom field type list

Where we will enter a list of our sales representatives:

custom field sales representatives

And we will create an additional "commission" field, that has an "Amount" type (numeric). "Read-only" status can be turned on in order to forbid the operators to change the values.

custom field amount type

Note: Opened Custom fields can be dragged-and-dropped to any position in the document. In our example, we will place it in the "document header" section.

custom fields repostitioning

3. Creating the Blockly Script

This option is located in Administration > Integrations > Blockly Scripts

erpag blockly scripts

Upon activating the "Create" button, we will choose "Sales Order".

create blockly script

When entering a document, the Blockly toolbar also has ERPAG variables (highlighted in red) in addition to the standard options (highlighted in green).

blockly toolbar

Programming is done like stacking with the mouse (drag & drop technique). You can find more information on Google for Education ( ).

4. Creating the script

It is necessary that for the sales specialist "Nikola Tesla" we calculate the commission of 5% and added 2% on amounts over $1000 when the invoice is generated from the sales order.

Since the script will be executed at every recording of any sales order, we have to set the condition that the calculation is valid only for “Nikola Tesla".

erpag blockly

What we recommend is that when comparing text data you should always include "UPPER CASE", because operators do not care if data is case sensitive or not.

What we put inside the "IF" block will be executed if the data from the custom field called "sales specialist" equals "NIKOLA TESLA".

erpag blockly script

In the example from the picture custom field named "Commission" will have 5% of the sales order value.

In order to only be accounted for when the invoice is generated, we need to add another condition.

erpag blockly script

And we still have to do an extra 2% if the invoices are over $1000.

erpag blockly script

And in such a simple way, we did a complex calculation without having to hire professional developers.

5. Activating the script

To prevent unfinished scripts from running, each script is paused when it is saved.

erpag blockly script

All blocks are colored in gray when the script is paused. Script activation is via the “Run” option.

The active script has the status "Running", it can be stopped by activating the "Pause" option.

erpag blockly script start pause

6. Results in Sales Order

To see the results we will create a Sales Order, where we will mark the corresponding "sales specialist".

sales order in erpag

Before the invoice, the commission value will be 0 and it will not be displayed (custom fields that are empty or value is 0 are not being displayed).

invoice sales order

When we "invoice" the sales order, the value of the "commission" custom field will be populated.

sales order commission

7. Manipulations with Scripts

This script is done for one sales specialist, for others, you can insert in the same script or form a new one. ERPAG has no specific limit on how many scripts you can have per document type.

When in edit mode you can use copy/paste options to copy.

copy paste blockly script

We will activate "copy" in "Nikola's commission" and we will paste it into a new Script and refine it a bit.

erpag blockly script

On the script list, we can see which ones are currently active.

erpag blockly script list

If we have more than one script for the same document, the priority for executing will be its number.

8. Conclusion

Forming the scripts may seem unclear at first glance, especially to someone who has not had prior experience. The biggest benefit you get is the ability to customize the system on your own.

Visual programming languages ​​(such as Google Blockly) are already a part of the elementary school's educational program today. Therefore mastering this tool will not pose as a big challenge.

2019. ERPAG Inc.


Email tracking function in ERPAG

Email tracking is a method for monitoring the delivery of email messages to the intended recipient. Most tracking technologies use some form of digitally time-stamped record to reveal the exact time and date that an email was received or opened.

Email tracking is useful when the sender wants to know if the intended recipient actually received the email and opened them. However, due to the nature of the technology, email tracking cannot be considered an absolutely accurate indicator that a message was opened or read by the recipient for several reasons. Not all email applications or services support read receipts, and users can generally disable the functionality if they so wish. Those that do support it are not necessarily compatible with or capable of recognizing requests from a different email service or application. 

Therefore, the emailing function in ERPAG enables you to track all sent emails and record whether the recipient opened/read the email.

In order to turn on the above-mentioned function, first, we need to choose the time period when will the system run the email check.

Activate the Localization option, under the Administration menu:

administration localization

check email status time period

From the drop-down menu select the time period when will the system check the email status. In case you select the 'disable' option, ERPAG won't track record of sent emails, nor it will run the email status check.

Now you can create a new, or open an existing Sales Order or Purchase Order. When you create a document, email it from the system.

email document from ERPAG

Enter the email body, alter the subject, and send it to your business associate.

send email from ERPAG

After you successfully sent an email, ERPAG records the date and time data, document type and number that was emailed and the email address of the recipient as well.

At the moment when the recipient opens the email, ERPAG receives that information and creates a new data record with the date and time of a change.

By reactivating (opening the document again), EMAIL panel appears with a complete data record, as shown in the picture below:

email data record

The more detailed information about each individual email (TIMELINE) can be received by activating the info button in the Status column.

email timeline in ERPAG

ERPAG Inc, 2019.

QuickBooks Online (QBO) and Invoice before packing

stacked parcels

1. Introduction

One of our clients asked us: "What happens with Quickbooks integration with Sales Orders which are invoiced before packing?".

Our answer was: "You have to keep an eye on Cost of Goods Sold (COGS)".

For someone who is not an accountant, this looks confusing. In this blog, we will represent a detailed case scenario.

2. Invoice before packing

Packing items in ERPAG is a moment when the items are "taken" from the stock. In case you don't have sufficient quantity in stock, you won't be able to pack the items.

The usual chronological order of documents is:

  1. Purchase order
  2. Goods Received Note
  3. Supplier Invoice
  4. Payment to supplier
  1. Work order
  2. Load Materials
  3. Work operations
  4. Deliver Finished Goods
  1. Sales order
  2. Packing list
  3. Shipment
  4. Invoice
  5. Payment from customer
Of course, nothing is ideal in practice, so we always have some deviations. One example is an Advance payment.

For practical reasons, ERPAG allows us to generate an Invoice before packing the items.

In our case, we generated an Invoice on October 22nd.

invoiced sales order

The reasons are different - from closing the advance payment to the customer's wish to have an invoice before the items are delivered to him.

In our example, we did an Invoice before we even got the goods for the customer from our supplier.

3. Procurement

The next day, through the fulfillment option, we generated a Purchase order for the missing quantity.


And we received items to our stock:

receive purchase order

After that, we "got" a supplier invoice:

purchase order supplier invoice

4. Packing previously invoiced Sales Order

After we received the items, we have sufficient quantity in our stock, in order to pack the Sales Order:

generate packing list

And this is how the synchronization list looks like:

qbo synchronization list

5. Quickbooks Online results

On the COGS account, we have an adequate value:

COGS in quickbooks online

This is the recommended workflow.

6. What would happen if we synchronize the Sales Order, that is not packed?

sales order

We can achieve a similar effect if we sync only the "Sales Order".

synchronize sales order to quickbooks

The COGS in QBO will be 0.

qbo cogs account

That's because we don't have adequate data in QBO to calculate this value.

After we sync the PO to QBO

synchronize purchase order to quickbooks online

The result will be corrected:

We got the same result, like we followed the recommended workflow and packed the sales order first.


In some cases when doing Invoice before pack (eg when we don't have enough stock), Cost of Goods Sold (COGS) may be incorrect.

It is advised that you pay more attention to such documents and consult your accountant.

2019. ERPAG Inc