Contracts module in ERPLY Books


In ERPLY Books, we have a module which allows you to manage purchase and sale contracts. Purchase and sales contracts give you an overview of the quantities of purchases and sales. Under the customers’ contracts you can also add the contracts that have a monthly fee and later you can create a periodical invoice for them. 



Adding a Contracts module


You can add this module under the “SALES” or “PURCHASES” with a certain rule. To do so, search “Global Attributes” from the dashboard and add a new rule:

In the name cell write: GLOBAL_USE_CONTRACTS

In the Value cell write: true

Save the changes and refresh the page. Now you can see “Sales contract” and “Contracts” under the “Sales” module and under the “Purchases” module you can see “Purchase contract” and “Contracts”

After opening a new purchase contract, we can see that it looks quite the same as the invoice document. You can add contract information there (article, description, price, quantities et.c). You can also add a contract file here later. 

If you are creating a new contract, we have an additional option named “Type”:



Under the “Type” option you can select the contract’s statusyou can postpone the contracted products. When creating a new contract, you can mark on the contract when the expected delivery date is and select “Sales contract expected”, for example. 



You can also add many other options to track your contracts (for example how much of the contract quantities are already delivered, how much is en route etc.). If you want this option in your contracts module, please contact us

Once the contract is created, you have three options by clicking on “Create connection”.

  1. Create invoice
  2. Sales Waybill 
  3. Sales contract



You can also create an invoice from an existing contract under the “Contracts” module. You have to select the invoice with a checkmark, press on the “More” button and then click “Create Invoice” or just do a right click on the contract and select “Create Invoice”



In ERPLY Books it is possible to create contracts based on price offers and orders. For that you need to open the price offer or order and click on the “Create contract” button. 



Contract as a new project


If you want a new contract to be automatically added as a new project (dimension), you have to add a new rule for it to work. With new projects you can add costs and incomes for every contract to see the contract’s profitability.

To add that rule, find Global Attributes in the dashboard search box and add a new row:


AltValue4: add “true” here if you want to use project groups

AltValue3: project group ID for sales contracts

AltValue5: project group ID for purchases contracts

If you don’t want to differentiate sales and purchases contracts, then add the same group ID.

After adding this rule, you can select the transaction to which sales or purchase invoice this is connected: 




Differentiating the status of contracts


In the contract module it is possible to differentiate contracts by color. Let’s open the contracts module (Purchase -> Contracts), for example, and select the needed period.

We can see rows in three different colors:



  • The green color indicates that the contract is locked, the contract is filled.
  • The yellow color marks the contracts that are filled to 95% of the contract. These yellow rows help you decide if you want to lock this contract or not. The software does not lock the contract automatically after filling to 95% and the user has to do this manually or wait for the contract to be filled 100%.

If you want to mark the contract as filled, open the sales or purchase contract and select the document status as “Locked” in the the left-hand menu bar.



  • The red color indicates contracts that are not filled.


If you want to differentiate contracts statuses with different colors, you have to add the following rule to Global Attributes


Value: contract

AltValue: STATUS_LOCKED=green-row|0.95=yellow-row

AltValue2: red-row

If these options are added, all contract statuses are shown by different colors.

An additional thing you can add to the contracts module is the cell that shows the quantities of the contract. 

Quantity 1: this shows the quantity that is on the contract, the final quantity

Quantity 2: this shows the quantity that is already filled with sales or purchases




Reports to track contracts quantities


If you want to see the calculation of the quantities, open “Settings -> Configuration” and enable rule number 20. 

If the organization has sales contracts with certain quantities, it means that there must be purchase contracts with the same amount to fill all quantities. To check the balance between sales and purchase contracts you can create corresponding reports in the Report Generator which show you gaps between sales contracts and purchase contracts by certain products, for example.

You can compile a report such as the following: 

  • Tables: Invoices, Invoices (Rows), Purchase and Sales articles
  • Output: Purchase and Sales Articles.Code, Purchase and Sales Articles.Name, Invoices (Rows).Qty
  • Show in Groups: Purchase and Sales Articles.Code

Add parameters as shown on the picture below: 


This report shows sales and purchase contract quantities by purchase and sales articles codes and names which allows you to compare the amount of filled contracts.

It is also possible to save the base report to simplify the process of seeing the given information the next time. To do this, you need to search for “Parameters for Report Generator Saved Reports” on the home page.



  • Add a new parameter by clicking on the ‘’Add’’ button
  • In the name cell write for example ‘’Performance of contracts’’
  • In the Value cell paste this following information: {“parameters”:[{“rules”:[{“tableName”:”ARTICLE”,”fieldName”:”CODE”,”referenceType”:”NOT_NULL”,”value”:””}],”index”:0},{“rules”:[{“tableName”:”ARTICLE_ROW”,”fieldName”:”DEL_DATETIME”,”referenceType”:”IS_NULL”,”value”:null}],”index”:2},{“rules”:[{“tableName”:”ARTICLE_ROW”,”fieldName”:”TYPE_CODE”,”referenceType”:”IN_OR”,”value”:”ARTICLE_ROW_PURCHASE_CONTRACT_AGREED”},{“tableName”:”ARTICLE_ROW”,”fieldName”:”TYPE_CODE”,”referenceType”:”IN_OR”,”value”:”ARTICLE_ROW_SALES_CONTRACT_AGREED”},{“tableName”:”ARTICLE_ROW”,”fieldName”:”TYPE_CODE”,”referenceType”:”IN_OR”,”value”:”ARTICLE_ROW_BUY|ARTICLE_ROW_PURCHASE_WAYBILL”},{“tableName”:”ARTICLE_ROW”,”fieldName”:”TYPE_CODE”,”referenceType”:”IN_OR”,”value”:”ARTICLE_ROW_SELL|ARTICLE_ROW_WAYBILL”}],”index”:3},{“rules”:[{“tableName”:”DOCUMENT”,”fieldName”:”DOCUMENT_STATUS_TYPE_CODE”,”referenceType”:”NOT_IN”,”value”:”STATUS_UNSUCCESSFUL|STATUS_FAIL”}],”index”:4},{“rules”:[{“tableName”:”ARTICLE”,”fieldName”:”CODE”,”referenceType”:”LENGTH_MORE_THAN”,”value”:”0″}],”index”:5}],”additionalColumns”:”ARTICLE_ROW.QUANTITY=Purchase_Contract_SUM|ARTICLE_ROW.QUANTITY=Sales_Contract_SUM|ARTICLE_ROW.QUANTITY=Purchase_Invoice_SUM|ARTICLE_ROW.QUANTITY=Sales_Invoice_SUM”,”columnPositionAndVisibilty”:[{“dataIndex”:”ARTICLE_CODE”,”column”:0,”text”:”Article.Code”,”width”:150,”hidden”:false},{“dataIndex”:”ARTICLE_NAME”,”column”:1,”text”:”Article.Name”,”width”:150,”hidden”:false},{“dataIndex”:”Purchase_Contract_SUM”,”column”:2,”text”:”Purchase_Contract_SUM”,”width”:150,”hidden”:false},{“dataIndex”:”Sales_Contract_SUM”,”column”:3,”text”:”Sales_Contract_SUM”,”width”:150,”hidden”:false},{“dataIndex”:”Purchase_Invoice_SUM”,”column”:4,”text”:”Purchase_Invoice_SUM”,”width”:150,”hidden”:false},{“dataIndex”:”Sales_Invoice_SUM”,”column”:5,”text”:”Sales_Invoice_SUM”,”width”:150,”hidden”:false},{“dataIndex”:”Contract diff”,”column”:6,”text”:”Contract diff”,”width”:100,”hidden”:false},{“dataIndex”:”Invoice diff”,”column”:7,”text”:”Invoice diff”,”width”:100,”hidden”:false},{“dataIndex”:”Sales diff”,”column”:8,”text”:”Sales diff”,”width”:100,”hidden”:false},{“dataIndex”:”Purchase diff”,”column”:9,”text”:”Purchase diff”,”width”:100,”hidden”:false}],”storeParameters”:””,”formulaColumns”:”Contract diff:*PART=ADD*NUMBER(-1)*MULTIPLY*Sales_Contract_SUM*PART=ADD*Purchase_Contract_SUM|Invoice diff:*PART=ADD*NUMBER(-1)*MULTIPLY*Sales_Invoice_SUM*PART=ADD*Purchase_Invoice_SUM|Sales diff:*PART=ADD*NUMBER(-1)*MULTIPLY*Sales_Contract_SUM*PART=ADD*Sales_Invoice_SUM|Purchase diff:*PART=ADD*NUMBER(-1)*MULTIPLY*Purchase_Contract_SUM*PART=ADD*Purchase_Invoice_SUM”,”outputLayout”:””,”limit”:””,”start”:””,”summaryRowField”:”ARTICLE.CODE”,”groupByOnDBLevel”:true,”groupByFinal”:””,”organisationIds”:””,”tables”:”ARTICLE|ARTICLE_ROW|DOCUMENT”,”output”:”ARTICLE.CODE|ARTICLE.NAME|ARTICLE_ROW.QUANTITY”,”groupBy”:”ARTICLE.CODE”}

NB! When paste into Value cell make sure that the cell is blue.

  • After that press ‘’Save’’ 

Now, to view this report in the future, you can go to “Reports -> Report Generator -> Custom Reports” and the same “Performance of contracts “ report will appear there as a blue button.



By clicking on it, the parameters required for the report will be displayed automatically, and you only need to press the “Search” button.


Hedging without a broker


Thanks to the contractc module, you can do hedging without a broker for your main business activity. The hedging principle is for hedging financial risks that derive from price changes. In order to hedge, you have to find an opposite party who has the same aimto hedge their business risks for any price changes (wants to sell you products on a certain date at a fixed price). If a contract is signed, then the other party must sell you goods on the agreed date at the fixed price. 

Here is an example of hedging:

Someone orders 1,000 cubic meters of birch from you at the price X. The birch price is variable so you want to cover the purchase contracts with sales contracts, too so you need to find vendors who confirm with their signature to bring you 1,000 cubic meters of birch at the price Y. Of course, the price Y needs to be smaller than the price X. Now you have the sales and purchases ensured with contracts. On the one hand, the contracts are covered (the sold contractual quantity is the same as the purchased quantity) but on the other hand, also the hedging without a broker has been done: the risk of price changes is mitigated via the contracts.