📜 ⬆️ ⬇️

How we created a universal business management system

Foreword

For those who are faced with the organization of the company from more than a couple of offices and a dozen employees, it is no secret that ready-made solutions for controlling business create a huge amount of headache for both sysadmins and owners.

Whether it’s 1C, Bitrix, Megaplan or even more, stand-alone solutions - they require installing specific software, establishing remote access to the server via VPN or other solutions, do not work with poor communication channels - which are often found in shopping centers or remote offices, and certainly require the remarkable skill of workers to access from home or on a business trip.
')
Separately, we can say about performance: for me, as a developer of high-loaded database systems, it has always been strange to generate reports not in seconds, but in dozens of minutes, holding documents in 1C minutes, and generally new versions of the same systems constantly requiring updates, with fabulous requirements to servers. It was obvious that such simple operations as calculating residuals in stock for the entire period of operation from a million documents, even in MySQL, will take seconds ...

Statement of a question

In general, when I was faced with the task of supplying an accounting system to 5 remote stores, a warehouse and an office, the options for ready-made solutions looked rather pale. After thinking about training sellers (good sellers, but not computer users) - for the first time they saw the mouse how to use 1C and endless trips to configure the network, it became clear that this is not our option ...

I wanted the following:
• Completely remote use from any operating system, from a tablet, a smartphone
• Undemanding quality of communication channel
• Friendly interface and usability
• Speed ​​- any reports and documents within a second
• Ability to embed advanced analytics

It is clear that one of the solutions, in order not to reinvent the wheel from scratch, was to make an online system based on our servers, working on the simplest mechanisms and structures. The infinite tables describing the nomenclature also seemed redundant - a dozen fields with a name plate for each parameter still work perfectly.

Development

There was enough power on the servers, so for three evenings on the first bootstrap, PHP and MySQL, a prototype was created that could keep the nomenclature, count the remains in warehouses and had the simplest documents of the primary accounting with printed forms.

Of course, the most interesting thing was in the process of carrying out the documents - the whole accounting department is based on it. Since, with the exception of cosmetic differences, any document transfers goods from the source warehouse to the warehouse of the receiver (in some cases it is not quite a warehouse, but the data structure does not change), it was enough to create a structure convenient for recalculating and storing such unit movements.

For the uninitiated, in short, the holding of documents is a process in which it is checked whether there is the necessary quantity of goods or services in the relevant warehouse, and actually deducts the goods or services from one and credits it to another. In the process, it would be good to check the reserves of the goods in order not to accidentally write off the reserved prices, the correctness of prices, the rights of users to these operations, the client's credit limit, etc. ... When it is formulated in this way and there is a good data structure, then there remains only a matter of technology.
Another related task is how to calculate the state of the warehouses at an arbitrary point in time. After sitting above the pictures of intermediate indexes, I just figured out how many operations will be needed to count everything from scratch each time? - and voila, three database queries solve this problem. In fact, it is cheaper every time to count all the goods and warehouses again than to store endless indexes that regularly become obsolete and still do not meet the requirements of relevance ...

So every time we carry out a document, we simply take all the remnants of the goods specified in the document, consider them from scratch, and if everything is OK, then we do the write-off operation. As is clear, a sample of the usual amount of 10-20 products from a properly structured table, even from hundreds of thousands of rows, is a matter of a second. Until now, even on high load applications, this works fine.

Later, we taught the system to take into account in this batch process (when and how this product was delivered, in order to accurately calculate the margin per transaction, and not the average for the hospital), different types of prices and additional information such as GTE.

All these reflections, by the way, killed in me all the latest faith in solutions like 1C. If the database is arranged at least just "appropriately", then all data on the company can be counted in seconds. I emphasize EVERYTHING, and immediately at the same time. What this monster does when reposting documents or generating reports is not at all clear. Even a very slow PHP script, without php-cgi, is a simple MySQL without optimization for a specific database and loaded by other projects under the string cheated warehouse residuals from scratch, without intermediate data for 3 years of work within fractions of a second.

The same task, on 1C, on the same firm, for the same 3 years took 15-20 minutes, although there were only a few thousand documents in the database with 5-10 goods in each ...
30 thousand records in 15 minutes ... Someone, probably, it seems fast.

Implementation

The implementation process turned out to be simple, and after learning how to use mail.ru, it went unnoticed. Even the sellers of the age, for a week, could already cheerfully watch the remnants of the warehouses, arrange sales, monitor the compliance of the goods with the actual availability. The first month revealed quite a lot of needs: the necessary reports were completed, the documents were greatly expanded, they introduced many differences in access rights.
Most importantly, any reports were generated in a split second, and sitting in a subway in another city or driving a car I opened a report from a 3.5 ”smartphone (yes, at that time it was a normal screen) and saw all the numbers on the business that interested me.

The result was a system that was completely on our servers, had backup once every two hours, advanced access control and logging. The system was accessible through any browser from an iPhone, a smartphone or a tablet for Android, it worked under Opera, Firefox, Chrome in the same way. In almost unchanged form, she worked for several years.

We could open access to selected warehouses to our individual counterparties and dealers, receive all necessary accounting reports on the fly, the stores had a fairly cheap 3G Internet, and the chief accountant downloaded the data with one click to his version 1C for his work.

image

Partners

Pretty quickly, our partners and acquaintances began to pick up the idea, but before the first major commercial introduction it was a long time. The chance to truly test the system for reliability on critical tasks presented itself in the face of a large company selling parts, which has a large number of branches in different cities and a complex range of hundreds of thousands of related positions. There was no way to imagine ready solutions in this area, therefore all activities were conducted on self-written solutions that were far from ideal. There were no reports as a class at all, the database was very confusing ...

Skipping the lyrics, it took less than 3 months to transfer all the branches to our system, along with training, data import, access rights and adjustment of the business model. Years were spent on developing solutions that did not produce results, months on implementing with us, and developing analytics specific for the specific tasks of the company.

image

Under the requests of partners, we built in first the CRM module, and a bit later the formulation and control of tasks with delegation. For management work - analysis and logistics planning with cost control; for management - budget planning, and powerful analytical reports, which manually took weeks to complete.

At the moment, 300 thousand items in warehouses, a nomenclature directory of more than 100 thousand items, in relation to catalogs and prices, hundreds of new documents per day do not represent for us difficulties in processing.

Now the system is located at bmsys.org - there you can also read about the list of features and modules currently running.

Source: https://habr.com/ru/post/259541/


All Articles