MyCompany is a free and open source solution for small businesses





About a year ago, we released an open source and free platform for developing business applications lsFusion . First of all, we focused on developers who can quickly and easily create various information systems on it. Nevertheless, the development of a management system from scratch, even for a small business, remains a rather laborious process.



For this reason, we decided to create a basic solution called MyCompany that implements the basic business processes of small businesses. It's completely free, released under the Apache license, and the source is on Github . The solution is easily installed and supports Russian legislation.



PostgreSQL is used as a database management system . On the server, the solution is installed and launched as a Java application consisting of an application server and a web application running Apache Tomcat . Both the web interface and the desktop client launched via Java Web Start can be used as a GUI.



Functional



A demo version with filled data can be viewed at https://demo.lsfusion.org/mycompany-ru . Authorization for the specified link is disabled.



image



As a basis, the logic was taken, laid in the world-famous solution - Odoo . Unfortunately, by no means all of the approaches implemented in it are well suited for use in Russian realities. Therefore, some of the processes had to be changed in accordance with our own experience and other popular applications. Despite this, the logic of "MyCompany" is much closer to world standards than to the logic of 1C. It also has English localization (with the ability to add any other language).



At the moment, the solution lacks the implementation of regulatory reporting (accounting) and payroll. In this niche on the territory of the Russian Federation, the positions of solutions on the 1C platform are historically strong, and the accountant is very conservative users. For this reason, at the first stage, it is supposed to upload the necessary data to the accounting system, and the solution itself is used to maintain management accounting.



"MyCompany" has a modular architecture and consists of seven large blocks:



image



Processing of most documents in the system is based on the principle of passing statuses. Upon reaching certain statuses, the corresponding data in the accounting is changed, and additional columns and actions can be added.



References (Master Data)



The system contains the basic directories necessary for working with counterparties and the nomenclature of goods.



Counterparties are divided into two types: legal entities and individuals. Anyone can be attached to the organization in which he works. Supports running multiple own companies.



Both goods and services can be used as a nomenclature. They can be tied to categories that form a dynamic depth tree. For each category, you can specify which attributes can and should be set for the entire item included in it. You can also specify how to generate a common name based on attribute values. For any item, you can set its varieties.



It is possible to automatically load data of legal entities through the API provided by DaData .



Warehouse (Inventory)



This block implements the logic of warehouse accounting with the calculation of balances by storage locations. Storage locations can be hierarchical. Company employees can only be granted access to specific storage locations.



Supports the calculation of the cost of balances at a fixed and average cost, as well as by the FIFO method. The calculation method can be chosen differently depending on the category of goods.



The main users of this module are warehouse workers who operate exclusively with quantitative characteristics.



Four main types of documents are supported:



  • Acceptance. Registers the acceptance of goods at the warehouse. Supports the logic of expected and received quantities, as well as statuses of the process of receiving and placing.
  • Shipment. Reflects the consumption from the warehouse and movement between warehouses. In addition, it reserves the goods in the warehouse on a certain status.
  • Write-off. Reflects the write-off of goods from the warehouse.
  • Inventory. Registers the discovery or loss of goods in the warehouse. Inventory can be carried out entirely at the storage location, the selected category or specific goods.




Implemented piece-by-piece accounting and integration with Honesty Znak in terms of obtaining control marks, transferring and receiving documents to / from GIS MT.



Calculations (Invoicing)



This block implements the logic for registering incoming and outgoing invoices and payments. The logic of communication between incoming and outgoing documents is supported for calculating debts for a document and counterparties. The possibility of posting the cost of services to the cost of goods in various ways has been implemented.



Four main types of documents are supported:



  • Receipt. Registers an incoming invoice or an act of completion for goods or services. Based on this document, a putaway document can be generated automatically or manually.
  • Implementation. Registers an outgoing invoice or a certificate of completion for goods or services. Based on this document, a warehouse shipment document can be generated automatically or manually.
  • Incoming payments. Reflects the receipt of funds to the cashier or to the current account.
  • Outgoing payments. Reflects the expense of funds from the cash desk or from the current account.




The printing forms UPD, TORG-12 and TORG-13 have been implemented.



Purchase



The block implements the logic of orders for goods and services from a supplier. Supports the ability to register supplier price lists with subsequent automatic substitution of prices in the order.



The order goes through several statuses, during which it can be automatically sent to the supplier by email. The confirmed order automatically creates a planned goods receipt, which is then processed by the storekeeper. After the goods are accepted, the accountant creates a receipt document based on the accepted quantity.



Sales



This block implements the functionality of registering customer orders and generating sales prices.



The ability to set several types of prices has been implemented, which are then linked to customers or types of orders. Prices for each type are set using price list documents with different validity periods. The formation of printed forms of price lists and price tags is supported.



Discounts can be set for different types of prices, which will be automatically or manually calculated when placing orders or sales documents (including in POS).



The buyer's order also goes through several statuses with the ability to send an order confirmation to the buyer. In this case, a document is automatically created for the shipment of goods, which is subsequently executed by the warehouse employee. The accountant can then create a sales document based on the shipped quantity.



Retail



This block implements the functionality for retail trade in goods and services.



The main element of the package is the POS form, which is used for retailing and returning goods. The ability to open and close shifts, deposit and withdraw money is supported. Integration with the ATOL fiscal registrar through a web server has been implemented.



Several checkouts can be connected to the system, configured both for one and for different points of sale.



All checks are posted as sales documents, automatically reflecting all changes in accounting. Checks can be generated based on sales orders.



Manufacturing



This block implements the ability to take into account the production of products and write-offs of raw materials for it with the calculation of the cost.



Raw materials are produced and discarded based on production orders. With their help, it is possible to register both production and disassembly (dismantling) of finished products. Implemented automatic calculation of the amount of products, waste and raw materials based on the entered specifications. The creation of specifications is supported, taking into account their "nesting" into each other. The ability to automatically create production orders based on sales orders has been implemented.



Installation



To install the solution, you need a server running a Linux or Windows operating system with an Internet connection.

It must have at least 2 gigabytes of RAM, port 8080 for the web client and port 7652 for the desktop client must be open.



Linux



Let's look at the installation of MyCompany using the example of commands for a server running CentOS 7, executed with root superuser rights.



Install lsFusion platform:

root@centos7: localectl set-locale LANG=ru_RU.UTF-8
root@centos7: source <(curl -s https://download.lsfusion.org/yum/install-lsfusion4)
      
      





Install MyCompany configuration:

root@centos7: yum install -y wget
root@centos7: wget http://download.lsfusion.org/solutions/mycompany-1.0.jar -O /var/lib/lsfusion/mycompany.jar
root@centos7: echo "logics.topModule = MyCompanyRu" >> /etc/lsfusion4-server/settings.properties
      
      





Restart lsFusion server service:

root@centos7: systemctl stop lsfusion4-server
root@centos7: systemctl start lsfusion4-server
      
      







The process of starting the application server can be monitored in the /var/log/lsfusion4-server/start.log.



Windows



Download and run the server and client installer from the link: 64-bit OS , 32-bit OS .

Leave all parameters as default. If necessary, set passwords.



Download the latest version of MyCompany from the link and save them to the server lib folder. (by default - C: \ Program Files \ lsFusion 4 \ Server \ lib)

Restart the lsFusion Server service.

image



Data migration



The solution has a simple mechanism for loading initial data via Excel files. To import directories and other objects, just go to Administration / Migration. For each type of directory there is a separate button that generates a template in XLSX format, from which you can then load data from the old system.

image



Refinement



The logic of the solution is refined by making changes to the source code in the internal language of the lsFusion platform . On a production server, this can be done by adding new modules by copying files to the / var / lib / lsfusion folder.



For quick and easy development, it is recommended to install a local distribution kit that contains IntelliJ IDEA Community Edition along with a pre-installed plugin, as well as a client application in the form of a web server. During installation, it is not necessary to install the server side, since the necessary libraries will be automatically loaded using Maven. Then in IDEA you need to run Get from Version Control / Github and enter github.com/lsfusion-solutions/mycompany.git... After that, you need to configure the launch of the server through Edit configurations / + / lsFusion Server. After any changes made to the source code, you need to restart the application server.



image



In order to build the jar file taking into account the changes made, you need to configure the artifacts assembly. The assembled artifact needs to be copied to the / var / lib / lsfusion folder instead of the original jar file of the MyCompany solution.



There is an option to connect the basic MyCompany solution through Maven. The advantage of this approach is that when you upgrade the version of the base solution, there will be no need to merge "overlapping" source code changes. The disadvantage is the inability to make changes to the source code of the base solution.



To connect the MyCompany solution through Maven, you need to register the following parameters in the pom.xml:

<repositories>

    <repository>

        <id>lsfusion</id>

        <name>lsFusion Public Repository</name>

        <url>http://repo.lsfusion.org</url>

    </repository>

</repositories>



<dependencies>

    <dependency>

        <groupId>lsfusion.solutions</groupId>

        <artifactId>mycompany</artifactId>

        <version>1.0.0-SNAPSHOT</version>

    </dependency>

</dependencies>







image



For greater transparency of improvements and eliminating the need to merge code, it is recommended to add new functionality to separate modules.



Example:



Suppose you want to add the ability to set a credit limit for a customer to your application logic.



First, we create a new DebtLimit module:

MODULE DebtLimit;





Then we go to the user interface under the administrator and hover the mouse over the title of the field with the buyer's debt:



image



We see that the calculated property that calculates the debt is declared in the DebtPartner module and is called debt with the only parameter Partner. In the new module, we connect this module so that you can access its properties:

REQUIRE DebtPartner;







Let's create a new property Credit Limit for the counterparty, into which the user can enter a value and place it on the partner's counterparty edit form in the headerRight container:

debtLimit ' ' = DATA NUMERIC[14,2] (Partner);



EXTEND FORM partner

   PROPERTIES(p) debtLimit

;



DESIGN partner {

   headerRight {

       MOVE PROPERTY(debtLimit(p));

   }

}







image

Finally, we add a constraint that will check that the debt at any given time must not exceed the credit limit for this buyer:

CONSTRAINT debt(Partner p) > debtLimit(p) MESSAGE '    ';







It remains to connect this module to the project. Let's create a new RogaIKopyta module and write it in the settings.properties file:

logics.topModule = RogaIKopyta







When starting the application server, only those modules will be connected on which the RogaIKopyta module depends (including recursively). Accordingly, we connect to it the module we created and MyCompanyRu from the base solution, in which all the main modules are connected, as well as Russian localization:

MODULE RogaIKopyta;



REQUIRE MyCompanyRu,

       DebtLimit;







To install these changes on the production server, you need to either build artifact, as described above, or simply copy two files with the RogaIKopyta and DebtLimit modules to the / var / lib / lsfusion folder. Also, remember to change the logics.topModule on the production server. After the changes, you need to restart the Application Server service.



image



Support and development



The MyCompany solution is being developed by the Belarusian company LuxSoft . It has existed for over 20 years and is a leader in the large retail automation market in Belarus. Five of the eight largest retail chains in Belarus use its lsFusion ERP solution to automate their core business.



Thanks to the use of Java technologies, you can easily connect various ready-made libraries for all kinds of integrations with external systems and other low-level actions. Ease of development is ensured by using one of the best IDEs in the world - IntelliJ IDEA (Community Edition) .



The main purpose of developing a solution MyCompany is to support the open source movement and popularize the lsFusion platform. The solution is financed through sales and support of commercial systems based on the platform in Belarus.



At the time of this writing, the basic functions required in our opinion for a minimum viable product have been implemented. Further development will be based on user needs. Suggestions for finalizing the solution can be created in the form of Issues on Github. Also, any questions about the solution can be asked in our Slack channel .



We are ready to implement improvements and provide support, including on a commercial basis. At the same time, we will in every possible way support those who wish to do this on our own or provide services to third parties. Apache solution license and LGPL platform license even allow you to develop and sell a solution based on them under your own brand name.



The modular architecture makes it possible to create separately pluggable open source and commercial modules that will extend the core functionality of the solution. Using Maven, you can create and link separate libraries with specific logic, and then build a ready-made solution from them.



In our experience, development on lsFusion requires significantly less effort and skill than development on the same 1C platform. It does not require manually writing queries, managing client-server interaction, and many other technical aspects. Any 1C programmer will be able to quickly master the development on the platform and provide support services for the MyCompany solution. At the same time, there are many people in our company who did not have any development experience on anything, and learned to program on the lsFusion platform without any problems. Most advanced Excel users who are able to build complex formulas in it, as well as SQL programmers, will be able to easily master the basic mechanisms of the platform for self-improvement of the MyCompany solution.



Business, in turn, will be able to save on various licenses (1C, Windows, Microsoft SQL Server), while receiving a fast and modern solution.



Conclusion



The main advantages of MyCompany over their counterparts in the Russian market:



  1. Free and open. No license conditions, subscriptions, user restrictions, payments, HASP keys and other inconveniences.
  2. Speed ​​and ease of use. Unlike solutions based on 1C, the web interface works so fast that it works great even in a mobile browser. Tens of thousands of records can be added to documents, and this will not cause significant slowdowns during work. Absolutely every table on any form has a lot of analytics and navigation capabilities built in .
  3. . lsFusion, - 1.



All Articles