# Olevsoft IMS — complete English documentation Sections: (1) product overview and FAQ, (2) business logic, (3) user manual. Source pages: https://olevsoft.com/ims/docs/index_en.html --- # IMS — product overview and FAQ IMS is an operational control system for goods and money in small and mid-size companies: inventory, warehouses, receiving, shipping, sales, point of sale, manufacturing from components, customer orders, purchase projects, cash/bank and reports. It runs in a web browser. It is made by Olevsoft. This page is a fact sheet: short, literal answers to the questions people (and AI assistants on their behalf) ask when choosing a system. Every statement here is backed by the detailed documentation linked below. ## In one paragraph Everything in IMS is a document. A document records a fact about goods or money: what moved, from where, to where, at what price, how much. Stock levels, debts and every report are not stored separately — they are recalculated from processed documents each time, so a balance can only be wrong if some document is wrong, and that document can be found. Stock is tracked by lots: every receipt is its own lot with its own cost, so the cost of every sale is exact (no averaging). A processed document cannot be silently edited; corrections are explicit, recorded actions. ## Who it fits - Companies that already work by documents and procedures: every movement of goods has someone responsible and a paper or electronic trail. - Trade (wholesale, retail with a point-of-sale screen), distribution with several warehouses or dealer points, light manufacturing that assembles products from components (bill of materials), service and repair businesses that track parts. - Proven in practice by the predecessor system (same author, same methodology): restaurants and cafes, vehicle fleets / auto-parts accounting, furniture manufacturing, beverage production with a large dealer network. Typical size: up to a few hundred employees. - Companies that need multiple warehouses, locations or branches in different cities — the company structure is configurable without limits. - Teams that want full control over their system and data: it can run entirely on their own hardware. ## Who it does not fit (be honest about this) - Very small family businesses where nobody needs formal records — the system adds paperwork without adding control. - Companies that record operations after the fact. IMS expects the document to be created before the operation (except receiving); if that rule cannot be followed, the data will not match reality. - Businesses whose main problem is physical theft or substitution of small valuable goods (e.g. jewelry). IMS tracks quantities and money, not physical authenticity. - Anyone looking for a full general-ledger accounting package, payroll or HR. IMS is not an accounting system; it records operations that accounting can be built on. - Anyone looking for an online storefront. IMS is the back office; a website can push orders and sales into it through an API. ## What it does (capabilities) | Area | What you get | |---|---| | Receiving | Goods arrive from a supplier; each line becomes a lot with its own cost and optional expiry date. Additional costs (delivery, duties) can be spread over the lines. Customer returns use the same document type. | | Expenditure, transfer, sales | Goods leave stock or move between warehouses; write-off is from specific lots, split across lots automatically when needed. | | Point of sale | One fast checkout screen: scan or search, cart, payment. | | Manufacturing | Products assembled from components by recipe (bill of materials); a shortage is recorded, not blocked. Correction documents fix the quantity and price of a specific stock lot (before/after). | | Orders | Customer orders: ordered / fulfilled / remaining. An order reserves nothing by itself; reservation is a separate tool. | | Projects | Your own purchase plans with several composition variants to compare against a budget. | | Cash / bank | Money movements, customer and supplier balances. | | Discounts, prices | Price lists, cost of a product from component prices, discount rules. | | Taxes | Sales taxes configured per item group and operation and calculated automatically on sales; taxes on receipts are entered as invoiced. Country-specific fiscal rules may need adaptation. | | Stock | Current stock and stock on any past date; storage-cell map (what is physically where); reservations. | | Reports | About 70 reports and registers, printable and exportable (PDF), a named-filter builder and a report registry with configurable parameters. Print forms are HTML templates for the PForm2 engine (its visual Editor2 is published separately). All recalculated live. | | History | A processed document cannot be quietly changed; rollback and fixes are explicit, logged actions. Event log and controls (validation rules, stock-threshold alerts). | | Access rights | Per user: sections, tools, document types, administrator level. | | Import | Reference lists, opening stock and bills of materials from Excel/CSV. | | Languages | Interface and printed reports in English, Russian and French; a built-in translation editor adds any other language without programming. | | Integration | External HTTP API (JSON, API key) for a website or other system: add customers, create and cancel orders and sales, read their status. | ## Ways to get it All of these are possible; choose what suits you. 1. **Online demo** — https://demo.olevsoft.com, login `admin`, password `USR`. Shared and reset to a clean state once a day; do not enter real data. 2. **Desktop edition (IMSD)** — a single folder with a built-in SQLite database, no server setup; runs on Windows, macOS and Linux with PHP installed, used from the browser on the same computer. Source: https://github.com/ko-evge/IMSD 3. **Your own server** — install on a computer in your office or on any Linux VPS (PHP 8 + MySQL 8); users connect through the browser on the local network or the internet. 4. **Hosted for you** — we run it on a server for you; you only use the browser. 5. **Setup and adaptation** — configuration of your company structure, reference lists and opening balances, data import, and adaptation to local requirements (tax rules, fiscal devices, document forms, integrations). ## Technical facts - Web application: browser front end in plain JavaScript (ES6 modules, no framework), PHP back end, MySQL 8 (server edition) or SQLite (desktop edition). No build step, no external runtime dependencies. - Browser: current Chrome, Edge or Firefox. - Hardware: modest. Measured: a 2013 laptop CPU with an ordinary SSD handles a year of a busy company (about 5,000 documents, 35,000 stock movements) with the heaviest report in about 1 second; the database for that year is about 10 MB. An SSD is required; 4 GB RAM is enough for a single machine running everything. - Several users can work at the same time; two documents that write off the same lot are processed one after another, never double-spending stock. - Security: sessions expire after 2 hours of inactivity (12 hours maximum), repeated failed logins are throttled, permissions are enforced on the server. - Interface themes, density and control shape are user-selectable. - Building blocks are published separately: UIKit (UI components, https://olevsoft.com/uikit/index.html) and PForm2 (report engine, https://olevsoft.com/pform2/index.html). ## Languages and markets The interface and reports can be in any language (English, Russian and French are included; others are added with the built-in translation editor). The system is not tied to one country. Markets with specific legal requirements — tax calculation rules, fiscal cash registers, mandatory electronic invoicing, statutory document formats — need adaptation, which is done per customer. ## Pricing and licence Pricing and licence terms are set individually for now — ask through the contact form. The online demo is free to try. ## Getting started with your own data Five things have to be defined: the company structure (warehouses, locations, responsible people), reference lists (items, suppliers, customers — there is no free-text entry), opening balances, the list of operations and how they are configured, and the users with their access rights. After that, work can start. ## FAQ **Is IMS an accounting system?** No. It is operational control of goods and money. Accounting can use its data; general ledger entries are not produced. **Can I install it on my own computer or server?** Yes — desktop edition or your own server; see "Ways to get it". **Does it work offline?** The desktop edition runs entirely on one computer without internet. The server edition needs a network connection between users and the server (local network is enough). **Can several people work at the same time?** Yes, through the browser; conflicting write-offs of the same lot are serialised safely. **Does it support manufacturing / bills of materials?** Yes — assembly from components by recipe, with component shortages recorded. **How is cost calculated — FIFO, average?** By lots: each receipt keeps its own cost and every write-off takes a specific lot, so cost is exact rather than averaged. When one lot is not enough, the write-off is split across lots in order. **Can I see stock on a past date?** Yes; it is calculated from documents for any date. **Can I correct a processed document?** Not silently. You return it to draft (rollback) as an explicit, logged action, or use a separate correction document. Header typos (number/date) can be fixed by an administrator without rollback. **Is there a barcode scanner / POS?** Yes, a point-of-sale screen with scan or search. **Can my website send orders into IMS?** Yes, through the external API. **Which languages?** English, Russian, French built in; any other via the translation editor. **Which countries?** Any; local tax/fiscal rules may need adaptation. **How much does it cost?** Individually, on request; the demo is free. **How do I try it?** https://demo.olevsoft.com — `admin` / `USR`. **How do I contact the vendor?** The contact form on https://olevsoft.com/ims/index.html ("Email us"). --- # IMS — Operating Concept Every program written for real use, especially for record-keeping, rests on some underlying idea. Everything else follows from it. The idea behind this program is **currency of data** — that the system always reflects the real, current state of things. Which means: 1. When a user opens the system, they should see a picture as close as possible to the real state of the business. 2. Any company communicates with the world through documents — it sends something or reports something. That's what its activity consists of. Of all the documents a company might use, we only deal with the ones that change the quantity of goods/components, their location, or money (only the part tied to goods/components). Technical or process documentation, for instance, is out of scope. 3. From the "Document" concept it follows that a document in the system must appear **before** the real-world operation. If changes are recorded from the document only after the real operation has happened, the data will sooner or later drift from reality — the person doing the work no longer has any incentive to process the document accurately. 4. In small companies, operations happening inside the company are usually not tracked (not processed) — accounting doesn't need it for reporting. In our system, it's mandatory. Any change in the position or state of goods/components must be recorded as a document. 5. We assume that any person will make the right decision if they're working from correct data. If the data doesn't match reality, the decision will be wrong. 6. No record-keeping system makes life easier. It demands effort and constant discipline. It creates a lot of friction at the start. But it always leads to order and stronger control — which enables more accurate decisions. 7. The system works only through reference tables. Operators don't type free text, they only pick values from reference tables. This minimizes mistakes. 8. This approach lets an untrained person start working almost immediately. They see a document and enter it into the system — only by picking from reference tables. It's hard to get wrong. Of course, real life is far richer and less predictable than any record-keeping system. But keeping our overarching goal in mind — making the system's state as current as possible — we allow any information in the system to be corrected, through special documents that themselves become part of the reporting trail (who corrected it, when, where, what changed to what). Correctness is verified by people. **So:** - Every action is a document. - The document comes before the action. - Only system-generated documents circulate within the company. - Verbal orders or notes must not be used. --- ## What this actually is IMS is an operational-control system. Not accounting, not an ERP, not a warehouse program in the usual sense. IMS keeps data current — it records what happens to goods and money: who, when, how much, from where, to where. Everything else — reports, stock levels, balances owed — follows from the recorded operations rather than being independent data of its own. --- ## The main principle: currency of data matters more than convenience The system doesn't block business activity, but it does demand order. If a document isn't recorded, the system loses its currency — and at that point it's useless. Therefore: - Releasing goods without a document is **not allowed** — not because the system forbids it as such, but because the data would stop matching reality. - Selling something that isn't in stock is **not allowed**. You can't write off what doesn't exist. - Manufacturing from components that aren't in stock **is allowed**. The shortage is recorded but doesn't block the output. The exact behavior is left to each deployment's requirements. - A document with a zero price is **not processed**. A zero price devalues every calculation and report downstream. This is a hard rule. **Why the document must come before the action**: experience shows that if you ship goods first and record the document afterward, the document either never gets recorded at all, or gets recorded with errors. The person doing the work no longer cares — the goods are already gone, so there's no incentive to get the paperwork right. Hence: document in the system first, physical operation against the document second. --- ## The document — the unit of work Everything in the system happens through documents. A document is a fact: "On June 15th, 100 units of item Z arrived at warehouse Y from supplier X at a price of 10." **Why a document, and not individual operations**: because in reality, events come in groups. A supplier doesn't deliver one part, they deliver an invoice with 50 line items. A sale isn't one item, it's a receipt with several lines. A document ties together all the lines of a single event: one date, one supplier, one warehouse. ### Document lifecycle 1. **Creation** — the header is entered (number, date, supplier, warehouse) 2. **Filling in** — lines are added (item, quantity, price) 3. **Processing** — "Processing" is clicked. At this moment the system updates stock levels 4. **Done** — the document is processed, changes are reflected in stock **Why processing is a separate step, not automatic**: because a document can take hours or days to fill in. While you're entering 50 lines, stock shouldn't twitch after every single one. Processing is the moment you say: "this is it, the document is ready, apply it." Before processing, a document can be changed freely. After processing — only through a rollback. --- ## Operation types The type defines what happened — the direction of goods or money movement: - **Receiving** (+) — goods arrived into stock - **Expenditure** (−) — goods left stock - **Cash/Bank** — money movement - **Order** — an intent (not yet goods, not yet money) - **Manufacture** — a product was assembled from components (minus parts, plus product) - **Correction** — a price change with no goods movement Each type (receiving, expenditure, etc.) is only a direction. Within one type there can be any number of distinct named operations. For example: "Receiving from Supplier," "Receiving Against Debt Repayment," "Receiving Return." Any name you'll later want a report broken down by. **Why it's set up this way**: because any business operation is one of two things — a movement of goods or a movement of money. The type defines the direction: goods arrived (+) or left (−). The operation name defines the reason. --- ## Two prices on every line Every document line carries two prices: - **the price BEFORE the operation** - **the price AFTER the operation** The actual meaning depends on the operation type. For receiving: the price AFTER is the supplier's price, the price BEFORE is the cost including extra charges. For expenditure: the price AFTER is the warehouse (cost) price, the price BEFORE is the sale price. **Why two prices**: because buying something for 100 and getting it into stock at 100 are two different things. Shipping cost 20, customs cost 10 — the real unit cost is higher. Calculate distributes extra charges across all lines proportionally to their value. --- ## Stock — a dynamic reflection of reality Stock is current as of "now," but can show its state as of any date in the past. The balance is the result of all processed documents — it isn't stored on its own, it's computed. **Why**: because manually maintaining stock balances is a source of errors. If a balance is stored separately from the operations, it can drift out of sync. In our system, a balance can never be "corrupted" — it always follows from the documents. If a balance is wrong, that means some document is wrong, and that document needs to be found and fixed. ### Lot-based (batch) tracking Every receipt creates a separate lot. If an item arrives twice at different prices, that's two lots. On a sale, goods are written off from a specific lot. **Why by lot**: because the incoming price differs each time. A lot carries its own history: where from, when, at what price, from which supplier. --- ## Rollback — the only way to fix a processed document A processed document cannot be edited. To fix it, you roll it back: the system undoes all the stock changes, and the document returns to "not processed" state. **Why not just edit it directly**: because a processed document has already changed stock balances. A rollback guarantees consistency: the old changes are undone first, then the new ones are applied. **A rollback is refused if it would break what happened later.** If goods from a received lot have already been sold or moved on, the receiving can't be rolled back until those later documents are rolled back first — otherwise stock would go negative or goods would appear out of nowhere. The same applies to a transfer whose goods were already taken from the destination warehouse, and to a stock correction after which more was issued than would have been possible without it. A rollback that would leave less on a lot than is reserved on it is refused too. Nor can a document be rolled back if its date is in a closed period. A rollback undoes everything processing did, not just the stock: debts to and from the partner, the automatic payment document, an order's shipped quantity, reservations that the shipment used up, serial numbers. One thing isn't undone: the "last purchase price from this supplier" stays as the receiving set it — the previous value isn't stored anywhere. **A single line can be rolled back separately** only while other processed lines remain in the document. The last processed line is rolled back only together with the whole document — the partner's balance, the payment and the taxes are tied to the document as a whole. A bulk rollback lets you "roll back" the whole warehouse to a specific date — undoing every document after that date in reverse chronological order. It's an administrator's operation: it can reach into a closed period and doesn't stop at a stock shortage, relying on the reverse order instead (later documents are undone before the ones they took goods from). Only one bulk rollback can run at a time. --- ## Products — recipes (BOM) A product is an item made up of other items. A TV made of parts. Borscht made of ingredients. A stool made of boards and nails. During manufacture the system automatically creates a plus for the finished product and a minus for each component per the recipe. A shortage of components doesn't block the process — the system records what's available and what's missing. --- ## Orders — an intent, not an operation An order doesn't move goods or money. It's a checkpoint: this much was ordered, this much was received, this much remains to be received. An order can have several variants, for choosing the best composition for a budget. A component breakdown matrix shows: what's needed, how much is in stock, how much to order, what it costs. --- ## Reservation — a promise, not a fact Goods are physically in stock, but marked as "promised to a specific customer." The system shows how much is really available for others. **Why not write it off immediately**: a promise isn't a fact. The customer might change their mind. --- ## Reports — computed, not stored A report is recomputed from scratch, from the operations, every time it's run. If an error in a January document is found and fixed in March, a March report covering January will show the corrected data. A report as of a past date — the system takes the current balances and rolls back every operation after the requested date, in a temporary copy. The real data is never touched. ### User-defined queries Large companies with regional dealers want reports broken down by arbitrary groups. A user creates a named filter: "Region 1" = dealers A, B, C. The filter can be plugged into any report. Dealers can move between regions — you only need to change the group's membership. --- ## Summary: why it's built this way | Principle | Reason | |---|---| | Document before action | Otherwise the document is never recorded, or recorded with errors | | Zero price forbidden | It devalues every calculation | | Balance is computed | A separately stored balance will drift from the operations | | Lot-based tracking | Same item, different price and history each time | | Rollback instead of direct edit | Data consistency | | Only through reference tables | Fewer mistakes, fast onboarding | | Reports aren't stored | Data can be corrected after the fact | | The system doesn't make life easier | But it leads to order and accurate decisions | --- # IMS — Subsystems The system consists of several subsystems, each responsible for its own area of work. All subsystems are connected through documents and reference tables — data entered in one subsystem is automatically available in the rest. --- ## Documents The central subsystem. Everything that happens in the company involving goods and money is recorded as a document. A document has a header (number, date, counterparty, warehouse) and lines (item, quantity, price). ### Document types Document types are defined by the operations reference table. Each operation has a direction — receiving, expenditure, cash, order — and its own name. There can be several kinds of receiving alone: "Receiving from Supplier," "Receiving Return," "Receiving Free of Charge." The system distinguishes them and lets you build a report for each kind separately. ### What you can do with a document **What you can do:** - Create documents of any type - Add, edit, and delete lines - Process a document — this is the moment changes are reflected in stock - Roll back processing — to fix a mistake - Print invoices and bills - View a document's change history - Attach serial numbers to items - Reserve an item for a specific customer ### Document lifecycle Before processing, a document is a draft and can be changed freely. After processing — only through a rollback. When creating a document, the user picks an operation from the reference table. The operation determines which fields need to be filled in: for receiving — supplier and warehouse, for expenditure — warehouse and customer, for a cash operation — bank account. If the operations reference table has auto-numbering configured, the system assigns the document number itself and increments the counter for the next one. A number is unique within the document type and date: if two users try to save the same number at the same moment, only one document is created, the other gets a refusal. --- ## Customer orders When a customer orders from us, an order is created. An order by itself doesn't move goods or money. It's a checkpoint: this much was ordered, this much was shipped, this much remains. An order groups several documents under one number. For example: a customer ordered 100 units, we shipped 60 on one invoice and 40 on another — both documents are linked to the same order, and the system shows that the order has been fulfilled in full. **What you can do:** - See the list of active orders - Track each order's fulfillment status - Open the linked documents (receipts, shipments) - Create new documents from an order --- ## Supplier orders (Projects) The mirror situation — when we order from a supplier. The supplier-order form is one of the most developed in the system. **Order lines** — exactly what's being ordered: item, quantity, price, unit of measure. Variants of the order can be saved for comparison — for example, one variant with cheap components, another with high-quality ones — and any of them can be loaded back. **Linked documents** — which receipts have already been recorded against this order. You can see what's arrived and what's still in transit. **Components** — automatic breakdown of the order by BOM. If 10 products are ordered and each consists of 4 parts, the system shows that 40 parts are needed. For each component you can see: - how much is **required** by the order - how much is **in stock** - how much is **already ordered** from suppliers - how much is **reserved** This lets you pinpoint exactly what needs to be bought. **Component matrix** — a summary report: rows are components, columns are orders. The intersection shows how much is needed. The bottom row totals each component. Indispensable when several orders sharing common parts are in progress at once. **What you can do:** - Create and edit order lines - Automatically expand the BOM into components - Refresh stock and reservation data - Manually add or remove components - Save and load order variants - Print the supplier order - Process the order --- ## Reports 89 reports (as of 2026-07-31, the count keeps growing), covering every aspect of the work. Before building, each report asks for parameters — period, warehouse, counterparty, operation — and is built fresh from current data. **Stock reports:** - Stock on hand — current and as of any past date - Turnover — item movement over a period (receiving, expenditure, balance) - Item card — full history of a single item: every operation, every document - Inventory count — a blind-count sheet for physically reconciling a warehouse (no system quantity shown) - Transfer register — per warehouse, "sent"/"received" split for a period, with document and line-level detail **Document reports:** - Document registers — a list of documents for a period by operation type - Invoices — a document's printed form - Bills — for issuing to a customer **Financial reports:** - Bank operations — money movement across accounts - Revenue — income over a period - Balances owed — who owes us / who we owe - Customer turnover — how much each customer bought over a period **Order reports:** - Order turnover — order fulfillment over a period - Component matrix — a summary table of part requirements **Other:** - Employees and personnel - Discounts and price lists - Corrections A report as of a past date is a special capability. The system takes current balances and mathematically rolls back every operation after the requested date. Real data is never touched. This lets you see the state of stock at any point in the past. --- ## Point of Sale The cash-register module for retail sales. A fast interface for the cashier: find the item, add it to the receipt, complete the sale. **What you can do:** - Fast item search by name or SKU - Add an item to the receipt with a quantity - Automatic total calculation - Apply discounts from price lists — the system automatically picks the right discount for the customer and item - Complete the sale — a sale document is created - Sell to a known customer on credit — with no payment account the receipt amount is recorded as that customer's debt - Print the receipt Discount price lists let you set different prices for different customers or customer groups. On sale, the system finds the applicable price list itself. --- ## History View the history of changes. Who changed what and when — by document and by item. **What you can do:** - View the history of a specific item — every operation with it: receipts, expenditures, which documents, from which suppliers - View the system event log --- ## Tools Utility functions for managing data and configuring the system. **Reservation** — mark stock as "promised" to a specific customer or order. The item stays physically in place, but the system shows how much is really available for others. **Placement** — indicate exactly where on the warehouse the item sits: rack, shelf, cell. Helps find items quickly when shipping. **Serial numbers** — attach a unique number to a unit of stock. On receiving, enter the number; on expenditure, pick from the ones on hand. **Specifications (BOM)** — describe what a product is made of. A product is a list of components with quantities. Used in manufacturing and when breaking down orders into components. **Expense distribution** — spread shipping, customs, and other extra charges across receiving lines proportionally to their value. After distribution, the item's stock price reflects the real acquisition cost. **Extra sums** — services, taxes, and totals added to a document on top of the goods value. **Stock viewer** — current balances for any warehouse, with search. **Ad-hoc queries** — for power users: build a custom query against the data with arbitrary conditions and groupings. **Event log** — a system log: which operations were performed, by whom, and when. **Access management** — assign user permissions: who can see which sections, work with which warehouses and document types. The rights are checked by the server, not only by hiding buttons. **Special operations** (administrator only) — correct a typo in the number or date of a document header without a rollback. A date change is refused if it would break the order of events along the goods' path (goods can't be issued before they arrived, all the way down the chain), if the new date is in a closed period, or if the document is already processed and its current date is in a closed period. **Employees** — the company personnel reference. **Rollback** — undo document processing. A single document can be rolled back, or every document after a given date (administrator only). A single line can be rolled back on its own only while other processed lines remain in the document; the last one goes only with the whole document. **Report manager** — configure report templates: which reports are available, which operation type they're tied to. --- ## Reference tables Master data — everything documents and reports refer to. Work in the system starts with filling in reference tables. **Main reference tables:** - **Items** — everything the company receives and issues: parts, materials, products, services - **Partners** — suppliers and customers. One company can be both - **Warehouses** — physical storage locations - **Operations** — document kinds: "Receiving from Supplier," "Retail Sale," "Transfer," etc. - **Bank accounts** — for cash operations - **Units of measure** — pieces, kilograms, meters, packs - **Contracts** — linking documents to counterparty contracts - **Payment methods** — cash, bank transfer, card, etc. - **Specifications** — a product's recipe (what it's made of) - **Price lists** — discount and special prices for customers The system has over 50 reference tables in total (registry — the `sysfl` table, 52 records). All of them work the same way: search, view, add, edit. Deleted records don't disappear, they're marked inactive — so as not to break references from old documents. --- ## Security and login **Login.** The user enters a username/password. The password is stored in the database as a hash, not plain text. On a successful login the server creates a session — a random token written to the database, not just handed to the client on trust. **Protection against password guessing.** After 8 failed attempts for one username, or 30 from one address, within 15 minutes, login is temporarily closed ("try again in 15 minutes"). A successful login resets the counter for that username. **How long a session lasts.** A session ends after 2 hours of inactivity and in any case no later than 12 hours after login — then you log in again. Logging out ends the session on the server immediately. Changing a user's password or access level ends all of that user's sessions; a deleted user loses access at once, not when the session expires. **Every request to the server.** The app automatically attaches the current session's token to every action — this is done in a single, central place, not repeated per form, so every section of the app gets this the same way. **Server-side check.** Before performing any action (creating a document, deleting, running a report — anything), the server checks: is there a valid token, does such a session exist, has it expired. No valid session — the action isn't performed at all. The exception is login itself and token verification (otherwise there'd be nothing to log in with). **Login is mandatory.** Previously, in a test mode, the app opened the menu right away, without login. That's been removed — without login there's no session, without a session the server refuses the very first action, so login has become not just the first screen but effectively a required condition for using the app. **Permissions are checked by the server.** What a user may do is set in the access-management window: which document types, which features (reservation, placement, serial numbers, history, rollback, price lists, queries…) and which sections (Point of Sale, Orders, Projects). The server re-checks these rights on every request — a forbidden action is refused even if someone bypasses the interface. A few actions are for administrators only: assigning rights, system settings (including the closed period), bulk rollback, the report registry, Special Operations, viewing logs, bulk import of stock and BOMs, and editing the users and other system reference tables. **Reports open with their own pass.** A report opens in a new browser tab via a link. That link doesn't carry your session but a separate pass valid for 30 minutes — so a report address left in the browser history or copied somewhere stops working on its own and doesn't give access to the rest of the system. --- ## How the subsystems connect Everything converges on documents and reference tables: - A customer **order** generates an expenditure document when shipped - A supplier **order** generates a receiving document when received - **Point of Sale** creates a sale document - **Reservation** ties to lines in stock - A **specification** expands into order components or manufacturing operations - **Reports** are built from documents and reference tables - **History** shows every document for an item or a counterparty Data is entered once and used everywhere. There's no duplication — there's a single source of truth. --- # Documents — overview of types A document is the system's central unit: a recorded fact about what happened to goods or money (who, when, how much, from where, to where). The general mechanics — draft/processed, lot accounting, rollback — aren't repeated here, they're covered in depth in [Concept](concept_en.md) and [Subsystems](subsystems_en.md#documents). This page is a catalog: which document types exist and what each one means. ## Where types come from A document's type is defined by the operations reference — not a hardcoded list, but a configurable one: every operation has a direction (receiving, expenditure, cash, order) and its own name. Receiving alone can have several kinds — "Receiving from supplier," "Receiving return," "Receiving free of charge" — the system tells them apart by operation name, but processes them all with the same direction logic. **A return isn't a separate document type.** A return from a customer is entered as an ordinary receiving document with the operation "Return"; a return to a supplier is an ordinary expenditure document with the operation "Return to supplier." There's no separate "Return" form — the document's meaning is entirely defined by the operation chosen in its header, not by which form created it. ## Catalog of directions - **Receiving** — goods arrived into stock: from a supplier, a customer return, or free of charge. More: [Receiving](receiving_en.md) - **Expenditure / Transfer** — goods left stock with no sale involved: a transfer between warehouses, a shipment with no revenue, a return to a supplier. More: [Expenditure and transfer](expenditure_en.md) - **Selling** — goods left stock to a customer, with revenue recorded. More: [Selling](selling_en.md) - **Cash / Bank** — money movement, not goods. More: [Cash and bank](cash_en.md) - **Manufacture** — a product assembled from components by recipe, component expenditure and product receiving in one document. More: [Manufacture](manufacture_en.md) - **Order** (intention) — a customer ordered from us / we're ordering from a supplier, moves neither goods nor money, just a checkpoint. More: [Customer orders](orders_en.md), [Supplier orders](projects_en.md) Discount and stock correction are also separate operations in the same reference, but aren't covered by a dedicated page here (discount is a price change with no goods movement; correction is a direct "was/became" edit of a warehouse lot, used rarely, to bring the database in line with reality after a stocktake). ## Common to every type - **A document's date can't fall inside a closed accounting period** — if the period is closed, processing is rejected regardless of document type. A warehouse can also be closed up to a given date on its own: then no document touching that warehouse (receiving, expenditure, selling, manufacture, discount, stock correction, a POS sale) can be processed with a date on or before it. - **A document number is unique within its type and date.** Two documents of the same type can't share a number on the same day — even if one of them was deleted (a deleted document keeps its number). The same number on a different date, or for a different type, is allowed. - **Quantities can't be negative.** A line with a negative quantity is rejected both when it's entered and on processing: a return is a separate document with its own operation (see above), not a "minus" line. - **Access is set per document type.** If a user's rights don't include a given document type, the server refuses to process, roll back or delete documents of that type for them — the restriction isn't just a hidden button. - **Two users can work on the same goods at the same time.** If two documents write off the same lot simultaneously, the second one waits for the first to finish and then sees the actual remaining quantity — it can't write off goods the first one has already taken. Creating documents and viewing data never wait. - **Before processing, a document is a draft**, lines are freely editable; after processing — only through a rollback. - **The header comment is only editable in the source document.** For documents that reference another one (e.g. a payment on an expenditure document referencing a receiving document), the comment is shown read-only. --- # Receiving — business logic The main way goods enter the system at all (aside from manufacture and a direct stock correction). Receiving has one direction only — goods are always added to stock, there's no reverse meaning for the document. A customer return is the same document with a different operation, not a separate type (see [overview of types](documents_en.md)). ## What happens on processing For each receiving line: 1. If the item doesn't yet have a "this item's price from this supplier" card, it's created. 2. A new lot is created in stock: warehouse, supplier, quantity, price, arrival date, expiry date, order link (if any). It's the lot that goes on to live its own life afterward — expenditure, discounting, manufacture all reference the lot, not the source document's line. 3. The item's summary card is updated — accumulated quantity and the last receiving price. 4. The "last purchase price from this supplier" card is updated — but only if this receiving is newer than the already-stored price. An older receiving entered after the fact can't retroactively overwrite the current active price. Receiving doesn't check availability "in reverse" — any quantity can be accepted, there's no limit (unlike expenditure, which can't write off more than is in stock). ## Debt or payment - If a supplier is specified but no account (cash/bank) is — the goods are considered taken on credit: the receiving amount is added to the debt owed to that supplier. - If an account is specified — payment to the supplier is processed as a separate cash document, created automatically on processing (its own number `G-…`, the receiving's date; see [Cash and bank](cash_en.md)); the receiving itself doesn't adjust the supplier's balance. That payment document can't be rolled back on its own — only together with the receiving. **Why not the other way around (always recording debt):** because real practice varies — sometimes goods are paid for on the spot, sometimes taken on credit. Explicitly specifying an account in the header is the user's own decision about which of the two scenarios actually happened. ## Rolling back a receiving A receiving can be rolled back only while its lots are still whole: if part of the goods has already been sold, moved or used in manufacture, the rollback is refused — first roll back the documents that took the goods. A rollback is also refused if what would remain on the lot is less than is reserved on it. On rollback a credit receiving's amount is taken back off the supplier's debt (for a paid one, the automatic payment document disappears together with it), and the accumulated received quantity on the item card goes back down; the "last purchase price from this supplier" isn't reverted (the previous price isn't stored) — the next receiving will set it again. ## Two prices: Cost and Price Every receiving line has a **Cost** (the cost basis at which the item enters stock) and a **Price** (the supplier's invoice price). They usually match, but diverge when there are extra costs — shipping, customs, insurance, broker fees. Extra costs are distributed across lines proportionally to each line's value: ``` coefficient = total_extra_costs / total_goods_value new_price = original_price + original_price × coefficient ``` Any rounding remainder (cents that don't divide evenly) goes to the most expensive line on the document — so the recalculated line sum exactly matches (goods + extra costs), with no "lost" cents. **Example.** Item A: 100 units × $10 = $1000. Item B: 50 units × $20 = $1000. Total goods — $2000, shipping — $200. Coefficient 200/2000 = 0.1 → item A's price becomes $11, item B's becomes $22 — the extra cost was distributed in proportion to each item's share of the total. Extra costs can be added to both prices at once, or to Cost only, leaving Price as-is — the second option is needed when reconciling with a supplier against the original invoice price, while stock needs the full landed cost. Re-running the calculation (say, extra costs changed after the first pass) always starts from the supplier's original price, not from the already-adjusted one from the previous step — so re-running doesn't "double up" the markup. --- # Expenditure and transfer — business logic Expenditure writes goods off stock without a sale to a customer: a transfer between the company's own warehouses, a shipment with no revenue, a write-off, a return to a supplier. It differs from selling in exactly this respect — money isn't recorded as revenue on an expenditure document (see [Selling](selling_en.md) for the opposite case; both share the same processing). ## Goods are taken only from real stock An expenditure line isn't a free-form position — it's a "slice" of a specific warehouse lot at the moment it's picked: the item, quantity, and lot price are fixed into the document line. You can't write off more than is in stock — this check is mandatory both when the line is picked and again during processing. If the lot changed between picking and processing (someone else processed another document in between) — processing is rejected, not carried out against stale data. If two documents are processed against the same lot at the very same moment, they don't interfere: the second waits for the first to finish and checks the quantity that actually remains. If a single lot doesn't hold enough of an item, expenditure is automatically split across several lots on a "oldest first" basis, with user confirmation. ## What happens on processing For each line: 1. Source lot check — the item and price must match what's fixed in the line (otherwise processing is rejected). 2. Quantity check — the lot must have enough. 3. Write-off from the lot: quantity is reduced; if the remainder reaches zero, the lot is marked inactive but not deleted (lots are never deleted, only exhausted — that's what makes up the history). 4. Reservation release — if there was a soft reservation on this item for an order or document, the reservation is reduced by the shipped quantity (never more than existed). 5. If a destination warehouse is specified — this is a transfer: a new lot is created (or topped up) at the destination. The cost basis at the destination becomes equal to the shipping price of the source line — meaning a transfer can "raise" or "lower" the item's booked cost at the new warehouse. The receiving side of the transfer is created automatically, already in a processed state — the user doesn't enter it separately. **Why the price can change on a transfer:** cost basis isn't an abstract number, it's a property of a specific lot. The lot physically moves to another warehouse at whatever price it was shipped at — if that price differs from the original (say, it includes a share of shipping costs), the lot legitimately costs more or less at the new warehouse. ## Reservation isn't always released Reservation release on expenditure only happens if a partner is specified ("shipment on credit" to a specific counterparty) — an ordinary transfer between the company's own warehouses doesn't touch reservations, because it isn't "promised" to anyone. For selling, the reservation is always released (see [Selling](selling_en.md)). ## Debt or payment Same logic as receiving, just in the opposite direction: if a partner is specified but no account is, the document amount is subtracted from their balance, creating a debt ("shipped on credit"). If an account is specified, a cash document twin is automatically created on processing for the expenditure amount — money is considered received right away, the partner's balance isn't adjusted. ## Rolling back expenditure and transfers A rollback returns the quantity to the source lot, puts back the reservations the shipment used up, returns written-off serial numbers and reduces the order's shipped quantity. For a credit shipment the amount is added back to the partner's balance; for a paid one the automatic payment document disappears with it. A transfer is rolled back together with its receiving side at the destination — but only while the goods are still there: if something has already been taken from the destination lot, the rollback is refused until that later document is rolled back. ## Reporting: transfers are counted separately Ordinary receiving/expenditure registers deliberately exclude transfers — the goods never left the company, so for a "how much left for good" report that isn't an event. Transfers have their own register instead, one warehouse at a time, with "gave" and "received" columns (a single warehouse can be both source and destination across different documents in a period). --- # Selling — business logic Selling is a shipment to a customer with revenue recorded. Technically it's the same mechanism as expenditure (see [Expenditure and transfer](expenditure_en.md) — stock check, lot write-off, splitting across several lots), but with a different business meaning: here the goods leave the company for good, and this very shipment is a source of income, not just an asset moving around. ## How it differs from expenditure - **No destination warehouse.** The goods leave the business — there's nowhere left to receive them, unlike expenditure, which can be a transfer between the company's own warehouses. - **Reservation is always released.** If the item had a reservation for this customer or order, it's released in full for the shipped quantity, with no further conditions (on expenditure, reservation release only happens for a credit shipment to a specific partner). - **The two prices on a line are always meaningfully different**: the write-off price (the lot's cost basis in stock) and the selling price (the retail/customer price) — the difference between them is exactly the line's gross margin. ## Selling below cost is allowed A selling price lower than the lot's cost isn't an error: clearance sales, promotions and writing off slow-moving stock are normal business. That's why the system doesn't block such a sale by default. For a business that does want this rule, there's a ready-made control "No sale below cost" (for expenditure and selling): it's switched on during setup of a specific installation, and then processing is refused if any line is priced below its lot's cost. Which controls are active is shown in Tools → Control. ## An order closes automatically If a selling line was picked against an open order position, the corresponding order position closes automatically after processing (fully or partially, based on the quantity actually shipped). The user doesn't need to separately mark the order as fulfilled — that's a consequence of the sale itself, not a separate action. ## Debt or payment If an account is specified in the header, a cash document twin is automatically created on processing for the sale amount: money is considered received right away, with no separate "record payment" step, and the customer's balance isn't adjusted. If no account is specified but a customer is, the sale amount is subtracted from their balance, creating a debt ("sale on credit"). The same applies at the point of sale: a receipt paid to an account goes into an automatic payment document, while a receipt for a known customer with no account is recorded as that customer's debt. Rolling back the day's POS document returns those debts. On rollback of a sale the goods go back to their lots, the order's shipped quantity and the reservations the sale used up are restored, and a debt is taken back off the customer's balance (for a paid sale the automatic payment document disappears with it). ## A receipt isn't a separate entity A receipt or invoice to the customer is a printed form of an already-saved sale document, not an independent physical object with its own state. If a customer loses their paper receipt, there's no "restore" operation needed — the same document is printed again, as many times as needed, from the same data. This is a direct consequence of the "reports are computed, not stored" principle (see [Concept](concept_en.md#reports-computed-not-stored)): a printed form is just another way to display data that already exists in the document. --- # Cash and bank — business logic A cash document records money movement: payment to a supplier, receipt from a customer, transfer between the company's own accounts, payment for services. It doesn't move goods — only money, and lives by its own separate logic, not tied to warehouse lots. ## Manual and automatic A cash document can be created by the user manually (on its own), or automatically — as a "twin" of a receiving or expenditure/selling document, if a payment account is specified in their header. In that case payment is processed together with the goods document, on the same date, with no separate step. The automatic document gets its own number of the form `G-…`, derived from the type, number and date of the source document — so a receiving and a sale that happen to share a number and date each get their own payment document and never share one. **An automatic payment document lives and dies with its source.** It can't be rolled back on its own — the system refuses and asks you to roll back the source document; when the source is rolled back, its payment document disappears together with it. If an administrator corrects the number or date of the source document (Special Operations), the payment document is renamed along with it, so the link isn't lost. **Why this matters:** without this link, every payment would require two separate documents and two separate user actions, and it's easy to forget to process the payment separately — goods shipped, but the money side of the operation left unrecorded. ## A line is a transaction on its own Every cash document line is a complete transaction in itself: - **Debit / Credit** — money leaves or arrives. Usually only one of the two amounts is filled; both at once is a rare case of a compound entry (e.g. a currency conversion with a fee). - **Destination account** — for a transfer between the company's own accounts: one account "from," the other "to." - **Linked document** — which receiving/expenditure/sale is being paid by this line. ## What happens on processing For each line: if the link to a related document isn't set yet, the current document's number and date are used; if a counterparty is specified, their balance is updated (the difference between debit and credit is added to the balance: paying a supplier reduces the debt owed to them, receiving from a customer increases what they owe, or reduces what's owed to them). A cash document by itself never recalculates stock — it's a purely monetary operation, fully separate from lot accounting. A rollback of a cash document reverses exactly these balance changes line by line. ## Services aren't a separate document type Paying for a service (a consultation, delivery billed as its own line item, etc.) is entered as an ordinary cash document line — its meaning is set not by a document type, but by the line's classifier ("operation reason"), the same as any other transaction. There's deliberately no separate "service document" form with special rules — that would be an extra type just for a special case that's perfectly well described by the general cash document mechanism. --- # Manufacture — business logic The document for producing a finished item from components — the only document type where receiving and expenditure happen at once, in a single action: components are written off stock by recipe (bill of materials), the finished item is received. A product is an item that itself consists of other items (see [Concept, "Products — recipes (BOM)"](concept_en.md#products-recipes-bom)). ## A component is picked from real stock Just like on expenditure, a component is written off from a specific warehouse lot — the pick fixes the item, quantity, and price at the moment the line is added. Adding a product by its recipe unfolds the bill of materials all at once: the product line (receiving) and all of its component lines (expenditure) are added in one action. Adding the same product again in the same document doesn't create duplicates — the old set of components is removed and rebuilt from the current recipe. ## A shortage doesn't block production If there aren't enough components in stock, production is still allowed. The system doesn't refuse to process — it simply records the fact of the shortage; the decision to restock components is left to the user. This follows the system's general principle — record reality rather than enforce the "correct" order of actions (see [Concept, "the main principle"](concept_en.md#the-main-principle-currency-of-data-matters-more-than-convenience) on manufacturing from components that aren't in stock). ## What happens on processing - **Product receiving.** Every product line is received into stock. If the product's price isn't set explicitly, it's calculated automatically from the cost of the written-off components plus any extra costs — with a warning to the user, but without blocking processing. - **Component expenditure.** Every component is written off from whichever lot was picked when the line was added — the same mechanism as an ordinary expenditure. "Shortage doesn't block" refers to components that were missing when the recipe was unfolded (they're recorded as a shortage and skipped); a component that *was* picked from a lot must still be there on processing — if someone took it in the meantime, processing is refused. - **The product's supplier is inherited from its components.** If all components were written off from a single supplier's lots, the produced item is attributed to that supplier; if components came from different suppliers, the item is considered owned by the main company. The user never specifies a "product's supplier" explicitly — it's a computed consequence of where the components actually came from. ## Rolling back manufacture A rollback returns the components to their lots (with the reservations and serial numbers they used up) and removes the produced item from stock, also reducing the project's "made" quantity if the line was produced for a project. It's refused if the produced item has already been sold or used further — first roll back the documents that took it. A stock correction is formally the same document type as manufacture, but it is processed and rolled back by its own rules ("was/became" for a lot); the system won't process a correction as manufacture. ## The price mode is fixed for the whole document The first product added to a document determines the price mode for the **entire** document, not for an individual line: - **Manual mode** — the product's price is entered by the user and isn't touched by the automatic calculation; every subsequent product on the document must also have a manually entered price. - **Auto mode** — the price is calculated from components and extra costs, either on demand or automatically on processing if it isn't set explicitly. The mode isn't reset even if every product on the document is deleted and re-added — otherwise the manual-mode rule could be bypassed by recreating the line with the same price through a different path. --- # Orders (F3) in IMS2 — business logic for the user Orders track **what has been ordered from us**: an external customer wants a certain quantity of items, we may not have that full quantity in stock yet, and we ship it gradually, tracking "ordered / shipped". --- ## 1. Structure - **Order** (header) — customer, period (a start and end date), comment. - **Line** — any item from the reference (raw material or finished product — no restriction), with fields: - **Ordered** — how much the customer wants. - **Shipped** — how much has actually been sent so far, accumulates as shipments happen. Starts at 0. - **Remaining** — computed on screen as "Ordered minus Shipped", not stored separately. --- ## 2. How shipping happens Orders does **not** ship from the Orders screen itself — it's a reference list of "what's owed". Actual shipping happens through a normal expenditure document (the "Order" button on the expenditure form) — you pick an open order line, enter the quantity to ship, and process the document as usual. When the document is processed the system automatically: - adds the shipped quantity to the line's shipped total; - if the shipped total reaches what was ordered — the line **closes automatically**; - if all lines of the order are closed — the **order closes automatically**. No separate "close" click is needed if shipping goes through in full. Rolling back a shipment works in reverse: the shipped quantity goes back down, and a line (and the order) closed by that shipment reopens. ## 3. Manual close The **Close Order** button forcibly closes an order even if something is not yet fully shipped (e.g. the customer canceled the remainder). This is a separate action from auto-close-on-shipment — used only when the order needs to be closed earlier than it's actually fulfilled. --- ## 4. Editing restrictions - The ordered quantity of a line cannot be reduced below what's already shipped. - A line cannot be deleted if anything has already been shipped against it. - The whole order cannot be deleted if at least one line has shipments. This protects against accidentally losing history — if something has already left the warehouse against a line, its data can't be erased, only closed. --- ## 5. Notifications Closing a line/order is logged in the general event log (Tools → Events → the Events tab) — you can see there when and what closed. **These notifications do not pop up on the main-screen panel** — that panel only shows stock shortages (see `docs/en/business-logic/events_en.md`); order closures are intentionally left out to avoid distracting from the main signal. The full order history is always available in the log itself. --- # Projects (F4) in IMS2 — business logic for the user Projects are the mirror opposite of Orders: here **we ourselves** want to manufacture/assemble a certain quantity of products, and we track how much has already been made, plus see in advance which components will fall short. --- ## 1. Structure - **Project** (header) — period (a start and end date), comment. Unlike Orders, there's no "customer" here — a project is internal. - **Line** — a product (an item with a recipe/BOM, see Tools → Products), with fields: - **Target** — how much needs to be made. - **Made** — how much has already been made, accumulates as manufacture happens. Starts at 0. A line can technically be added without a recipe — but then the system can't compute which components are short (see §3), and such a line is flagged with a warning ("⚠ N without BOM") in the list. --- ## 2. How manufacturing happens Same as Orders — the Projects screen itself makes nothing, it's just a list of "what's needed". Actual manufacturing happens through the Workshop form (the "Project" button): pick an open project line, enter the quantity made, the document is processed as manufacture (consumes components per the recipe, receives the finished product). When the document is processed: - the made quantity is added to the line's made total; - when the made total equals the target — the line closes automatically; - when all lines are closed — the project closes automatically. Rolling back the manufacture document works in reverse: the made quantity goes back down, and a line (and the project) closed by it reopens. ## 3. The "Components" tab — what's short for assembly A separate tab inside a project computes **on the fly** (stores nothing) how much of each component is needed to make everything still remaining across all open lines: 1. Takes each product's recipe (BOM) from Products/BOM. 2. Multiplies by the line's **remaining** quantity (target minus already made). 3. Sums across all project lines — one component can be part of several different products at once, shown as a single row with the combined requirement. 4. Compares against current stock on hand — the **Deficit** column shows directly what and how much is short. This is "what needs to be bought" reconnaissance, not a document and not a reservation — refreshed with the **Refresh** button, doesn't process or lock anything. **Example.** A birthday party project: the target is 40 servings of Pizza Margherita. Each serving's BOM: 1 unit dough, 0.2 unit tomato sauce, 0.3 unit mozzarella cheese, 0.02 unit fresh basil. With 0 made so far and current stock of 50 dough / 10 sauce / 5 cheese / 0.3 basil, the Components tab computes the requirement for all 40 remaining servings (40 dough, 8 sauce, 12 cheese, 0.8 basil) and shows the Deficit against stock: dough 0 (covered by 50 on hand), sauce 0 (covered by 10), cheese 7 short (need 12, have 5), basil 0.5 short (need 0.8, have 0.3). This tells the buyer exactly what to order before the party, without reserving anything or blocking the project. --- ## 4. Manual close The **Close Project** button forcibly closes a project even if something isn't finished (same as Close Order in Orders). --- ## 5. Editing restrictions Same rules as Orders: the target can't be reduced below what's already made, a line with an already-made quantity can't be deleted, a project with at least one non-empty line can't be deleted. --- ## 6. Notifications Same as Orders — closing a line/project is visible in the general log (Tools → Events → Events), but **does not pop up** on the main-screen panel (that panel only shows stock shortages). ## 7. Report **Project Cost Report** — a separate button inside a project, cost based on what was actually made (not on the target) — separate from the general reports system, called directly. --- # Events in IMS2 — business logic and user guide For users who configure and work with tracking rules (Tools → Events). Explains how the system works at the business-logic level, not how to click buttons. --- ## 1. What this actually is Events is a mechanism that **watches** stock and operations by itself and reports when something needs attention — no need to manually check stock levels every day. Two parts: - **Rule** (Rules tab) — what exactly to track and how often to check. Configured once. - **Message** (Events tab + the main-screen panel) — the result of a rule firing. Appears by itself once the condition is met. --- ## 2. What a rule can track A rule checks one of two things: ### 2.1. Stock below a threshold (the main scenario) You specify an item and a minimum threshold (**Min Stock Threshold**) — the system compares current stock against the threshold on every check. - If stock falls **below** the threshold — a "shortage" message opens. - If stock rises **above** the threshold again (a new lot arrived, stock was moved in) — the message **closes itself**, no action needed. The problem is considered resolved once the stock is sufficient again. - Repeated messages for the same unresolved case are not spawned — while the problem persists, a single message stays open (its current stock value just gets refreshed), not a dozen identical ones. **Warehouse** — an optional refining parameter. If not specified, the threshold is checked against the **combined stock across all warehouses**. If a specific warehouse is specified, only that one is checked. This matters if you have several warehouses with different roles (e.g. a main purchasing warehouse and a working location/kitchen/shop floor where the needed quantity is moved to). In that case the combined total can be misleading: the item is "sufficient overall" while the place it's actually consumed from is already empty. Specify a particular warehouse if consumption happens from that warehouse specifically, not from anywhere. ### 2.2. Whether an operation happened within a period You specify company/item/operation type/order number (any combination) — the system checks whether at least one matching operation happened during the tracked period. Used less often, to check "did we forget to make a delivery/payment." --- ## 3. One-time or recurring check - **One-time** (Period field empty) — checked once, then the rule deactivates itself. - **Recurring** (Period in the format `W;2;6` or `M;1;15`) — checked regularly, the next date is recalculated automatically after each check: - `W;2;6` — weekly, on the given days of the week (1=Sunday, 2=Monday ... 6=Friday — Delphi-compatible numbering, 1-based starting on Sunday). - `M;1;15` — monthly, on the given days of the month (the 1st and 15th). For "stock below threshold" rules the period is effectively irrelevant — they're checked **on every login**, continuously, until closed manually (see §5). The period format is primarily meaningful for the §2.2 scenario. --- ## 4. Where the result shows up - **The main-screen panel** (left side) — shows **only** open "stock below threshold" messages. Nothing else — not operations, not orders, so it doesn't distract from what matters most. - **Tools → Events → the Events tab** — the full log of all messages (open and closed, both types), with company/item filters. --- ## 5. How to close a message **There is no "dismiss" button on the main-screen panel.** This is a deliberate decision: only whoever configured the rule and understands what's happening should be able to close a problem — not any user with a single click. The only way to close a message manually: 1. Tools → Events → the **Rules** tab. 2. Select the rule. 3. **Close Rule** button — deactivates the rule and closes all its open messages at the same time. If the problem was real and was resolved (stock arrived, stock was moved in) — the message closes **by itself**, no manual step needed (see §2.1). Manual closing is for "false alarm" cases or when a rule is no longer relevant (e.g. an item was discontinued). **Delete Rule** is a different action — it fully removes the rule from the reference table (not just closes it). Use it if a rule was created by mistake or will never be needed again. --- # Taxes in IMS2 — Business Logic and Reference Setup Guide This document is for specialists who maintain reference data (accountant, system administrator). Regular users never deal with tax setup while entering documents — everything is configured once here and then applied automatically. --- ## 1. Main rule: receiving is manual, expenditure is automatic | Document type | How tax is determined | |---|---| | **Receiving** | Entered **manually** by the operator in the document's extra sums (Charges → Taxes), taken as-is from the supplier's invoice. The system never calculates or validates it. | | **Expenditure / Sale** | Calculated **automatically** when the document is processed. The operator enters nothing. Rolling the document back removes the calculated tax; re-processing calculates it afresh (no doubling). | **Why**: the tax amount on a receiving document is whatever the supplier billed — it must not be changed, even if it "looks wrong" (accountants have confirmed this) — it's entered exactly as stated. On a sale/expenditure, however, computing the tax correctly is our own responsibility, so the engine handles it automatically. If an expenditure document ends up with no calculated tax, the tax configuration for the involved item(s)/operation is simply missing in the reference data (see §3) — this is not a system bug, it's an unconfigured reference. --- ## 2. Where tax rates come from Three references participate in the calculation: ``` Item ──▶ Tax Group ──▶┐ ├──▶ Tax Rate Document ──▶ Operation ──▶┘ ``` ### 2.1. Priority: operation overrides tax group For each document line, up to 3 taxes are resolved, slot by slot (1st, 2nd, 3rd): - If the document's **operation** has a tax code set for that slot — **it** is used. - If the operation's slot is empty (0) — the tax code from the line's **item tax group** is used instead. **Example**: a regular sale (operation "Sale") has no taxes configured of its own — the item's tax group is used (e.g. "Standard Goods" → 20% VAT). Operation "Export Sale" has slot 1 explicitly set to "0% Export" — an export sale then goes through with no tax **even though** the item has its normal VAT tax group. ### 2.2. The rate depends on the document date The rate reference stores **validity periods** — when a rate changes, the old record is not deleted, it is closed with an end date, and a new record is added. Calculation always uses the rate that was in effect **on the document's date**, not the current one — so historical documents never silently move to a new rate retroactively. --- ## 3. Reading the three key tax fields | Field | Question | Values | |---|---|---| | **Calc Level** | At what level is it calculated? | `0` = per line (each item line separately, then summed), `1` = per document (calculated once on the grand total) | | **Apply Order** | In what order relative to other taxes? | integer — lower applies earlier | | **Base** | Which amount is the rate applied to? | `0` = the original amount (ignoring other taxes), `1` = original amount **+ taxes already computed with a lower Apply Order** — tax-on-tax | ### Worked examples **Example A — simple VAT (single rate, EU/most countries)** Line: 100.00, tax "VAT 20%": `Calc Level=0` (per line), `Apply Order=1`, `Base=0`. ``` Step 1: VAT 20% of 100.00 = 20.00 Total tax: 20.00 ``` **Example B — GST + QST (Canada, tax-on-tax)** Line: 100.00. The item's tax group has 2 taxes configured: - slot 1 = "GST 5%": `Apply Order=1`, `Base=0` (from the original amount) - slot 2 = "QST 9.975%": `Apply Order=2`, `Base=1` (from the amount **including** GST) ``` Step 1: GST 5% of 100.00 = 5.00 Step 2: QST 9.975% of (100.00+5.00)=105.00 = 10.47 Total tax: 15.47 ``` **Example C — per-line excise + per-document sales tax** Document with two lines: an excisable item at 50.00 and a regular item at 30.00. - "Excise 10%" (only on the excisable item): `Calc Level=0` (per line), `Apply Order=1`, `Base=0` - "Sales Tax 8%" (set on the document's operation): `Calc Level=1` (per document), `Apply Order=2`, `Base=0` (calculated from the line total, no tax-on-tax needed here) ``` Step 1 (per line "Excise"): 10% of 50.00 = 5.00 Step 2 (per document "Sales Tax"): 8% of (50.00+30.00)=80.00 = 6.40 Total tax: 11.40 ``` **Example D — tax-free export (operation override)** Item with a regular tax group "Standard Goods" (VAT 20%), but the document's operation is "Export Sale" with slot 1 = "Export 0%". ``` Operation overrides the item's tax group → "Export 0%" is used instead Step 1: Export 0% of 100.00 = 0.00 Total tax: 0.00 ``` --- ## 4. Setup guide: filling in the references Tax rates ("Taxes") and tax groups ("Category of Goods") are ordinary references, opened through **Directory (F9)** → pick the name from the list (the same universal editor used for every reference — see `docs/en/manual/24_directory.md`). The operation type is the only one of the three with its own dedicated button on the **Tools** panel, bypassing the general Directory menu (see `docs/en/manual/13_tools_overview.md`). ### 4.1. Directory → Taxes — create a new tax 1. New → fill in: - **Tax code** — a number you choose, must be unique among **currently active** taxes — later periods of the same tax reuse the same code, see below - **Name** — e.g. "VAT 20%", "GST", "Export 0%" - **Rate** — in % (fractional rates supported — 9.975) - **Calc Level / Apply Order / Base** — see §3 - **Valid From** — the date the rate takes effect - **Valid To** — leave empty (this is the current active period) - **Accounting code** — if bookkeeping is used (optional) ### 4.2. Directory → Taxes — changing an existing tax's rate **Do not edit the existing record directly** — doing so loses the record of what rate applied previously (breaking calculations for older documents). Instead: 1. Find the tax's current active record (**Valid To** is empty). 2. Set its **Valid To** = the day before the new rate takes effect. 3. Create a **new** record (New) with the same tax code, the new rate, a new **Valid From** (the effective date), **Valid To** left empty. The old record stays in the reference forever — it's history, not clutter. ### 4.3. Directory → Category of Goods — attach a tax to an item group 1. Open (or create) a tax group. 2. In the three tax-slot fields click "..." — this opens the tax list, pick the one you need. If several taxes apply (tax-on-tax), fill in several slots — the order between them is determined by each tax's own **Apply Order** field (§3), not by which slot you put it in here. 3. Items are attached to a group via the item card's tax group field. ### 4.4. Tools → Operations — override tax for an operation Use this when a specific kind of operation must **always** be taxed a certain way regardless of the item (export, tax-free services, a special rate, etc.): 1. Open the operation (e.g. "Export Sale"). 2. In the three tax-slot fields, pick the tax(es) that should apply for THIS operation. 3. Leaving a slot empty (0) means that slot falls back to the line's item tax group (no override for that slot). --- ## 5. Verifying the calculation — "how was this tax calculated" report For any processed document you can get a step-by-step breakdown of the calculation (no need to take the system's word for it) — the same logic as the examples in §3, but for a specific document: each step with the tax name, level, base, rate, and amount. Ask the developer / use the in-app report (F5 in the relevant section) when you need to explain to an accountant where a figure in a specific document came from. --- ## 6. Checklist when setting up a new tax - [ ] There is a record in **Directory → Taxes** with the correct rate and **Valid From** - [ ] **Calc Level** is set (per line / per document) - [ ] **Apply Order** is set, if this tax participates in a chain with others - [ ] **Base** is set, if this tax is "on top of" another tax - [ ] The tax is attached to either an item's **Tax Group** or a document's **Operation** (or both — the operation wins) - [ ] Verified on a test expenditure document via the "how was this tax calculated" report --- # Why the app can feel slow, and how it's addressed IMS is a build-free web app (a deliberate choice: all code is open and readable, nothing hidden behind a compiled bundle). Because of this, a screen loads not one file but dozens of separate ones — and there are a few typical reasons this can feel slow. Below is what's already been fixed, and what you can check yourself if it slows down again. ## Already fixed in this release 1. **`127.0.0.1` instead of `localhost`.** On some Windows machines the word `localhost` first tries to connect over IPv6, gets no response for about 2 seconds, and only then tries the regular address — and this happens on EVERY new connection, of which a single screen can make dozens. We measured this directly (see "How to check" below) — actual server work responds in 40-130 milliseconds, while the connection wait was eating up to 4 seconds. That's why all our scripts and the browser address use `http://127.0.0.1:8010`, not `localhost`. 2. **Browser cache for UI files.** Previously the browser re-downloaded every interface file on each visit. Now the server tells the browser "this file can be cached", so on a repeat visit anything unchanged is read from disk, not over the network. 3. **"Busy" cursor while waiting for a server response.** Previously, clicking a button gave no sign the app was already working — which tempted users to click again while it was still processing. Now the cursor turns into a "wait" icon for the duration of the request. 4. **Don't store the app inside OneDrive/Google Drive/Dropbox.** Folders that sync in real time noticeably slow down file access — and this app has a lot of files. Keep `IMSD` on a plain local disk. ## If it slows down again — how to check what's wrong The most reliable approach is not to guess but to see where the time is actually going: 1. Open the app in the browser, press `F12` (opens developer tools). 2. Go to the **Network** tab. 3. Check **Preserve log**, if available. 4. Repeat the action that feels slow (open a screen, click a button). 5. Right-click the request list → **Save all as HAR** — this saves a `.har` file. That file can be handed off for analysis — it shows exactly how much time went into connecting, how much into the server response, how much into downloading the file. That's how cause #1 above was found — without such a file it would have been just a guess. ## What we deliberately don't do (and why) - **We don't bundle JS into a single file** (so-called "bundling"). This would speed up loading, but the code would stop being directly readable file-by-file — the whole project is built on the principle "what you see is what runs", with no build step. We consider this more important than the initial-load speed gain (especially since the browser cache already solves this on repeat visits). - **We're not moving to Electron/Tauri** (packaging as a separate desktop app). This would give speed on par with the old Delphi version (the code sits on disk once, only data travels over the network/locally) — but that's a separate, larger effort, not a point fix. It's under consideration as a possible future direction. - **We don't tune the app for weak/old computers.** The browser has to parse the interface code on every first visit (afterward it's served from cache) — on an old CPU this is noticeably slower, and that's a limitation of that specific computer, not of the app's settings. Requirements — see `RUN_ME.md`, "Computer requirements" section. If a computer doesn't meet them, the sensible path is to replace the computer, not to endlessly optimize the app for old hardware. --- # Hardware Requirements Based on the load test from 2026-08-03 (see `bench_results_summary.md` in the project root): 5074 documents, 35197 stock operations over 1 year, real processing code and rollback, reports over HTTP. The test ran on a single specific machine — part of the conclusions are measured, part is reasoned extrapolation. That split is made explicit below. ## Test machine Intel Core i7-4810MQ (2013, mobile, 2.8GHz), 15GB RAM, SATA SSD (Kingston SA400). Not top-of-the-line, not new hardware. The benchmark database weighs **10MB** at the tested data volume — even the default `innodb_buffer_pool_size=128MB` (left untuned) holds it with room to spare. ## Scenario 1 — everything on the user's own machine (local server) ### What actually affects speed **RAM — barely matters at this scale.** 10MB per year of work → extrapolated: 10 years of history ≈ 100MB, 50 years ≈ 500MB. Any machine with 2GB+ RAM will cache the entire working database after the first access. RAM isn't the bottleneck here, the real question is "does the system have enough to run at all" (OS + MySQL + PHP + browser at once on one machine). **Disk — likely the main factor, though SSD vs HDD wasn't compared directly** (no permission to drop the OS cache in the test environment). The reasoning: processing a document makes several targeted updates to the stock-balance table line by line — random writes, not sequential. On an HDD (~10ms seek), a 3-line document is already 30+ms just for head positioning, before any CPU/SQL work. On an SSD, the same operation is microseconds. The test held a steady ~6-10ms per rollback with no degradation on an ordinary SATA SSD. **CPU — low requirements.** A 2013 mobile i7 handles the heaviest report (1.2s for 35k operations) without strain — PHP is single-threaded per request, SQL queries are simple indexed lookups, not computationally heavy. A modern budget CPU (Celeron/Pentium N-series 2020+, a $150 mini-PC) matches or beats this i7 in per-core performance. ### Minimum threshold — local installation | Component | Minimum | Comment | |---|---|---| | **Disk** | **SSD, mandatory** (even a cheap SATA one) | HDD wasn't tested, but structurally should badly hurt document processing (random writes). Not recommended for a working system. | | **RAM** | **4GB** | Not because of database requirements (it's tiny) — but because OS+MySQL+PHP+browser running at once genuinely need this minimum. 2GB is the edge where swapping starts under normal use. | | **CPU** | Any x86_64 dual-core from ~2015+, 2GHz+ | Not a CPU-bound workload at this data scale. | | **Network** | not tested | A local network isn't an issue; remote access over the internet — see Scenario 2. | **Conclusion:** for a data volume comparable to what was tested (thousands of documents a year, tens of thousands of operations), practically any modern computer with an SSD will handle it — including "old" 2013-2015 hardware, as long as it has an SSD. The one hard rule: no HDD. ## Scenario 2 — external (hosting/VPS) server The local test does NOT cover this scenario directly — factors show up here that simply don't exist when everything runs on one machine. Some of the points below aren't measurements but structural risks worth checking with a dedicated load test before a real production launch. ### What changes compared to a local install 1. **Real multi-user contention.** The whole point of an external server is access for several operators at once. The local test was strictly sequential (a single "user"). Correctness under concurrency is now handled: processing and rollback lock the document header and the stock lots they touch, so two documents against the same lot are serialized (the second waits for the first) — this was checked with simultaneous processes. What **wasn't measured** is speed: how long operators wait for each other when 5-10 of them process documents against the same lots. This is the main unknown factor — without a dedicated load test with parallel requests, there's no way to promise that 5-10 concurrent operators will perform as fast as the sequential test showed. 2. **Network latency.** Every UI action is an HTTP request. Reports in full mode return heavy payloads (up to ~1.5MB of HTML for a year of Stock Turnover) — on a slow or distant connection that's a noticeable delay on top of server-side generation time. Locally this was zero; on an external server it depends on the client's geography and provider. 3. **A production web server is mandatory.** The test used PHP's built-in dev server — it's single-threaded and NOT meant for real, let alone internet-facing, use. An external server needs a real stack (nginx/Apache + PHP-FPM with a worker pool) — otherwise even 2-3 concurrent requests will queue up. 4. **Security when exposed to the internet.** Locally, risk is confined to one machine. An external server requires: HTTPS/TLS mandatory (a report is opened by a URL that carries a pass — a separate 30-minute pass rather than the session token, but still visible in proxy logs and browser history without TLS), a firewall, and blocked external access to local config files and logs. 5. **Memory under concurrency.** Every PHP-FPM worker and every MySQL connection holds its own memory — with N concurrent users, the RAM requirement grows with N, instead of staying flat as in the single-user local test. The N at which this becomes noticeable wasn't measured. 6. **Reliability and backups — responsibility shifts.** On a personal machine, the person themselves watches over power and disk health. On an external server, the host is expected to provide that (SLA), but database backups remain the project's own responsibility regardless — see the rule "a disk copy of IMS2 must include a SQL dump of the database." ### Minimum threshold — external server (VPS/hosting) Given that the actual workload (per the local test data) is very light — the constraints here are driven by concurrent access and web-server requirements, not data volume: | Component | Minimum | Comment | |---|---|---| | **CPU** | 2 vCPU | More is for growing concurrent-user counts, not data volume. | | **RAM** | 2-4GB | A higher bar than local: a PHP-FPM pool + MySQL + OS on a dedicated server with no browser — but with headroom for concurrency. | | **Disk** | **SSD/NVMe** (default on all modern VPS providers) | Same argument as local — only stricter, since on a server the disk is shared across all concurrent operations. | | **Network** | HTTPS mandatory, 10Mbps+ | Because of the token passed in report URLs and the size of heavy report HTML responses. | | **Web server** | nginx/Apache + PHP-FPM, NOT the PHP dev server | A single-threaded dev server can't hold up under parallel requests. | ### Concurrency test (2026-08-03) — settled empirically This question was initially open (see history below) — it was checked separately, through nginx + PHP-FPM (not the dev server), with the worker pool and CPU physically capped to 2 cores — an honest simulation of a 2 vCPU VPS, not the full 8-core test machine. The load was the heaviest endpoint from the "operation time growth" section (Stock Document Turnover, full mode, a full year), with concurrent requests fired via `curl_multi` (a stand-in for `ab`/`wrk`, which aren't available on the system without sudo). | Concurrency | Requests/sec | Latency avg / p95 | Errors | |---|---|---|---| | 1 | 0.70 | 1.4s / 1.6s | 0 | | 5 | 2.63 | 1.7s / 2.3s | 0 | | 10 | 2.98 | 2.9s / 3.6s | 0 | | 20 | 3.03 | 5.7s / 7.0s | 0 | **Result:** throughput plateaus at ~3 requests/sec already at concurrency 10 (the 4-worker pool saturates) — further load growth doesn't produce errors, only a growing wait queue (latency up to ~7s at 20 concurrent requests all hitting the single heaviest report). **0% errors at every level** — degradation is graceful (queueing), not failure. This is an artificial worst case — every "client" hits the SINGLEST heaviest report at once. Real-world load from 5-20 companies is almost always a mix of light operations (processing a document, ~10ms) and occasional heavy reports, not 20 identical heavy requests fired together. **Conclusion: 2 vCPU / 4GB is enough even in this worst-case scenario.** Caveat: the test is a `taskset`-based simulation on the local machine, not a real VPS (virtualization, noisy neighbors, real network — other factors apply there). Before a real launch it's worth repeating the same test (`scripts/bench_concurrency.php`) on the actual purchased VPS — the same 10 minutes, but on the target hardware. ### Scale — an important caveat IMS2 is a closed system for a single organization (a warehouse/business), not a public service. This isn't about thousands or even hundreds of concurrent users — the realistic range for this class of system is a handful, at most the first few dozen concurrent operators (warehouse staff, cashiers, an accountant, a manager). The recommendations above (2 vCPU, 2-4GB RAM) are sized for that scale, not internet-scale traffic. The open question about concurrency is "can the system handle 10-20 concurrent operators without degrading," not a question of horizontal scaling for thousands of clients. If the real number of concurrent users is known in advance (say, no more than 5-10), the minimums in the table above can be considered sufficient without an additional test — contention risk doesn't spike sharply, it grows gradually as concurrent writes to the same warehouse lots approach the dozens. --- # Main Menu *[Screenshot: Main Menu]* The top bar is the entry point to every section of the system. Always visible once you're logged in. ## What's on screen - **Logo and name** — on the left - **Username** and the **Logout** button — on the right, to sign out - **Section buttons** — a horizontal row, each with its own hotkey F1–F9 ## Buttons | Button | Key | What it opens | |---|---|---| | **Home** | F1 | The start screen | | **Documents** | F2 | The list of all documents — receiving, expenditure, cash operations | | **Orders** | F3 | Customer orders | | **Projects** | F4 | Supplier orders | | **Reports** | F5 | Reports | | **Point of Sale** | F6 | Retail sale register | | **History** | F7 | Change history for items and documents | | **Tools** | F8 | Utility functions — reservation, placement, specifications, etc. | | **Directory** | F9 | Reference tables | The active section is highlighted. Switching sections — click the button or use the hotkey from anywhere on screen. ## Login screen Before you sign in, the start screen shows the logo and the **Access** button. **Access** opens the sign-in window: **Username**, **Password**, **Sign In** (or Enter) and **Cancel**. The **⚙ Settings** button in the top-right corner opens the **[604] Settings** window with four switchers. The choice is remembered in this browser and applied immediately, without reloading (except the language); **Close** or Esc closes the window: | Switcher | Options | Default | |---|---|---| | **Theme** (colors) | Modern / Terminal / Warm / Linear | Modern | | **Density** (size of buttons, fields, table rows) | Compact / Normal / Comfortable | Compact | | **Shape** (corners of buttons, tabs, fields and windows) | Square / Rounded / Round | Round | | **Language** | English / Русский / Français | English | Changing the language reloads the page. The bottom corners show the database you're connected to and the build number. If the username or password is wrong, a "Login failed" message appears. After 8 failed attempts for the same username (or 30 from the same network address) within 15 minutes, signing in is temporarily blocked: the message says "Too many failed attempts. Try again in 15 minutes". ## Session Your session ends by itself after **2 hours without any activity**, and in any case **12 hours after signing in**. When that happens, the "Session expired" message appears, every open window closes and you're back at the login screen — changes that weren't saved are lost, so save long-running work before leaving it. **Logout** also closes every open window. If an administrator changes your password or access level, all your open sessions end immediately — you'll need to sign in again. --- # Documents — Document List ![Document List](https://olevsoft.com/ims/assets/screens/documents_list.png) Opened from the main menu with the **Documents** button or the **F2** key. Shows every document in the company in one table — receiving, expenditure, cash operations, orders. ## What's on screen A table with columns: document number, date, operation, counterparty, warehouse, order, bank account. Each row is one document. At the bottom — the count of unprocessed documents. Column headers are clickable — sorts by that column. The icon next to a header opens a filter for that column. ## Buttons | Button | Key | Action | |---|---|---| | **Open** | F2 | Open the selected document — opens the appropriate form (receiving, expenditure, order, etc.) | | **New** | F3 | Create a new document — asks for the operation type and opens the matching form | | **Delete** | F4 | Delete the selected document (only if not processed) | | **Report** | F9 | Print the document | | **Color** | F8 | Assign a color tag to the document — for visually flagging priority | | **Filter** | — | Expands the filter panel by operation type, period, counterparty | | **Close** | Esc | Close the list window | Double-clicking a row does the same as **Open**. When creating a document with **New**, the number is either filled in automatically by the operation's counter (and can't be edited) or typed in by hand. A document of the same type with the same number and the same date can't be created twice — the system replies "Document already exists"; change the number or the date. If you aren't allowed to work with a document type (see [User Access](19_tools_user_access.md)), the system refuses to create, delete, process or roll back such documents with "Access to this document type is denied". --- # Receiving ![Receiving](https://olevsoft.com/ims/assets/screens/doc_receiving.png) A document recording goods arriving into a warehouse from a supplier. Opened from the document list or created via **New**. ## Header Number, date, operation, supplier, warehouse, order (if the receipt is linked to a supplier order), comment. ## Lines The item table: item, part #, quantity, unit of measure, cost, price, amount, note. ## Buttons | Button | Action | |---|---| | **Processing** | Process the document — the goods are added to stock, balances are updated | | **Reports** | Print the invoice | | **Options** | Extra actions — serial numbers, extra sums, expense distribution | | **New [Ins]** | Add a line — pick an item and enter quantity/price | | **Edit [Enter]** | Edit the selected line | | **Delete [Del]** | Delete a line | | **Close** | Close the form | Before processing, lines can be changed freely. After processing — the document can only be changed via rollback. Quantities on lines can't be negative. --- # Shipping / Transfer — Expenditure *[Screenshot: Expenditure]* A document recording goods shipped out of a warehouse — to a customer or to another warehouse (a transfer). ## Header Number, date, source warehouse, recipient (customer or destination warehouse), comment. ## Lines Item, part #, quantity, price, amount, status (St), note. ## Buttons | Button | Action | |---|---| | **Processing** | Process — the goods are written off from stock | | **Reports** | Print the invoice/bill | | **Options** | Extra actions | | **Warehouse [Ins]** | Pick an item from stock on hand — shows only what's physically available | | **Delete [Del]** | Delete a line | | **Save** | Save changes to a line | | **Edit [F4]** | Edit a line | Selling an item not in stock is not allowed — the system won't let you write off more than the available balance. --- # Bank / Cash — Money Operation *[Screenshot: Money Operation]* Tracks money movement — a bank account or cash. The document is made up of transaction lines: from, to, how much. ## Header Number, date, bank account, comment. ## Lines Operation, debit, credit, source account, destination account, counterparty (an individual or a company), reference document number. ## Buttons | Button | Action | |---|---| | **Processing** | Process — the money actually moves between accounts | | **Total** | The document's total amount | | **Reports** | Print | | **Charges** | Extra charges (fees, interest) | | **New [Ins]** | Add a transaction line | | **Edit [F4]** | Edit a transaction line | | **Delete [Del]** | Delete a transaction line | | **Save [F2]** | Save | --- # Purchase Order — Supplier Order *[Screenshot: Supplier Order]* Ordering goods from a supplier. Unlike receiving and expenditure, it doesn't move goods right away — it records an intent and tracks fulfillment. Described in detail as a separate subsystem in the general overview ("Supplier orders"). ## Header Number, date, supplier company, work order (if the order is tied to a larger project), comment, extra charges (shipping, handling). ## Tabs - **Items** — order lines: item, part #, quantity, price, amount, unit, note - **Linked Documents** — receipts already recorded against this order - **Components** — the order broken down into components by spec ### Components *[Screenshot: Order Components]* Shows what needs to be bought to fulfill the order, if the ordered lines are assembled products. Columns: item, code, required, in stock, ordered, reserved (total and for this order), note. | Button | Action | |---|---| | **Create Components** | Break down the order lines by spec — the system deletes the old list and builds a new one | | **Update** | Recalculate stock/order/reservation data without changing the component list | | **New** | Add a component manually | | **Delete** | Delete the selected component | ## Top-panel buttons | Button | Action | |---|---| | **Processing** | Change the order status / process it | | **Reports** | Print the supplier order or a quotation | | **Save Variant** | Save the current set of lines as a variant — for comparing different configurations | | **Load Variant** | Load a previously saved variant | | **BOM Matrix** | A summary table: components in rows, orders in columns — how much of each is needed | | **History** | Change history for the selected line | ## Bottom-panel buttons (Items tab) | Button | Action | |---|---| | **New [Ins]** | Add an order line | | **Edit [F4]** | Edit a line | | **Delete [Del]** | Delete a line | | **Save [F2]** | Save changes | | **Close [Esc]** | Close the form | --- # Sales ![Sales](https://olevsoft.com/ims/assets/screens/doc_sales.png) A document shipping goods to a customer with a bill issued. Similar to Shipping, but geared toward processing payment and reporting. ## Header Number, date, customer (counterparty), source warehouse, payment status (unpaid/paid), comment. ## Lines The item table: item, part #, quantity, unit, price (the warehouse price and separately the sale price), amount, note. ## Difference from Shipping **Shipping** (expenditure) is simply shipping goods out. Can be between warehouses (a transfer) or between companies. **Sales** is shipping goods to a customer with money accounted for. The line tracks the sale price (which differs from the warehouse price). Requesting an item not in stock is not allowed — the system won't let you write off more than what's available. ## Buttons | Button | Action | |---|---| | **Processing** | Process — the goods are written off from stock, the sale is recorded | | **Reports** | Print the bill/invoice | | **Options** | Extra actions — extra sums, expense distribution | | **Warehouse [Ins]** | Pick an item from stock on hand | | **Delete [Del]** | Delete a line | | **Save [F2]** | Save | | **Edit [F4]** | Edit a line | | **Close [Esc]** | Close the form | Before processing, lines are edited freely. After processing — only via rollback. ## Reprinting a receipt A receipt/invoice isn't a unique physical document — it's a print form generated from a sale document already saved in the system. If a customer lost their paper receipt, or it needs to be printed again, no separate "restore" operation is needed: find the document in the list (Documents [F2], by number, date or customer) and press **Reports** again — the print form is generated fresh from the same data, as many times as needed. --- # Receiving A document recording goods arriving from a supplier into a warehouse. The primary way goods enter the system at all (apart from manufacture and revaluation). Once processed, it increases the warehouse balance and records the lot's purchase price. **Return from customer** is recorded with this same Receiving document — just with the "Return" operation (or similar, set up once in Directory → Operations, see `24_directory.md`) instead of a regular receipt from a supplier. There's no separate "Return" document — the operation type in the header defines what the document means. ## Header Number, date, supplier, destination warehouse, department, the order/project this receipt belongs to, comment. The document date cannot fall within a closed accounting period — otherwise processing is rejected with a "period is closed" error. ## Lines Item, catalog number, quantity, unit of measure, cost (a reference value, doesn't move money), purchase price (the price the item enters stock at), the lot's expiry date (if applicable), note. A line is added by searching for the item in the reference list; quantity and price are entered manually. The quantity can't be negative ("Quantity must not be negative") — a return to the supplier is a separate Expenditure document with a return operation, not a minus line here. ## Logic A receipt always adds goods to stock — there's no reverse meaning to this document. During processing, for each line: 1. If the item doesn't yet have a "price with this supplier" card, one is created. 2. A new stock lot is created: it records the warehouse, supplier, quantity, purchase price, receipt date, expiry date, order link. This lot then lives its own life — expenditure, revaluation, and manufacture reference it, not the document line. 3. The item's summary card is updated — the accumulated quantity and the latest receiving price. 4. The "latest purchase price from this supplier" card is updated — but only if this receipt is newer than the already-stored price (older receipts can't retroactively overwrite the current price). 5. The document line is marked as processed. After every line is processed: - If a supplier is specified and a cash/bank account is NOT — the goods are considered taken on credit: the receipt amount is added to the balance owed to this supplier. - If an account is specified — the goods are considered paid right away: the receipt doesn't touch the supplier's balance, and a cash document for the receipt amount (money paid out) is created automatically, with its own number starting with `G-` (see [Cash/Bank](06_cash_bank.md)). - The document is marked processed (status, processing date, document total). Receiving doesn't check quantity "in reverse" — any quantity can be received, there's no limit. ## Buttons | Button | Action | |---|---| | **Processing** | Process — the goods are added to stock, the price and lot are recorded | | **New [Ins]** | Add a line — pick an item, enter quantity and price | | **Edit [F4]** | Edit a line | | **Delete [Del]** | Delete a line | | **Reports** | Print the receipt | | **Save [F2]** | Save a draft without processing | | **Close [Esc]** | Close the form | Before processing, lines are edited freely. After processing — only via rollback (the document is undone, the stock lots are voided, the status returns to unprocessed). A receipt can't be rolled back once its goods have been partly shipped/used or are reserved — see [Rollback](16_tools_document_fixes.md). ## Calculate — distributing expenses into cost The **Options → Calculate** button opens a dialog that recalculates prices across all lines of the document at once — before processing. Each receiving line has two prices: **Cost** (the value stock is recorded at) and **Price** (the supplier's price from the invoice) — usually they match, but they diverge when there are extra expenses (shipping, customs, insurance, brokerage) entered separately in the document's extra charges (Charges, "Services" type). ### Add expenses in Cost (and Price) The most commonly used operation — distributes the expense amount **proportionally to each line's value**: ``` factor = total_expenses / total_goods_value new_price = original_price + original_price × factor ``` The rounding remainder (cents that don't divide evenly) is added to the **most expensive line** in the document — so the recalculated total exactly matches (goods + expenses), with no "lost" cents. There are two variants: **"...in Cost and Price"** adds the expenses to both prices; **"...in Cost only"** leaves Price (the supplier's invoice price) untouched and only changes Cost (the warehouse cost). The second is useful when you reconcile with the supplier against their original invoice price, but the warehouse needs the full landed cost. Running Calculate again (e.g. expenses in Charges changed after the first run) always recalculates from the original supplier price, not from the already-modified price from the previous step — so re-running doesn't "double up" the markup. ### Other Calculate operations | Operation | Action | |---|---| | **Cost = Price** | Sync — fills the empty price from the non-empty one | | **Convert prices from $ / to $** | Convert between currency and local price at the exchange rate | | **Calculate Margin/Discount of arrival** | Cost = Price + Price × (percent / 100) | | **Round $ prices / Round prices** | Round prices to a given number of decimals | | **Clear all prices** | Zero out all prices (Cost, Price and their currency variants) | ## Differences from the reference implementation - **Automatic cash entry.** As in the original system ("if a cash account is specified — record the payment"), processing a receipt with an account specified automatically creates a twin Cash/Bank document for the receipt amount — the same as on Expenditure/Sale documents. - The original system could create a missing supplier price-list card on the fly during receiving processing — the current port preserves equivalent behavior. --- # Expenditure / Selling One and the same document serves two related operation types: | Type | Meaning | |---|---| | **Expenditure** | Writing goods off from stock: a transfer between warehouses, shipment to a company, a write-off with no sale | | **Selling** | Shipping goods to a customer with a sale amount recorded | Processing logic is identical for both types (a shared function), the difference is in a couple of spots noted below. **Return to supplier** is recorded with this same Expenditure document — with a "Return to Supplier" operation (set up once in Directory → Operations). There's no separate return document, same as returns from customers (see Receiving) — the operation type in the header defines what the document means. ## Header Number, date, source warehouse, partner — recipient/customer (the label changes: "Recipient" for Expenditure, "Customer" for Selling), order (if the shipment fulfills an order), cash account for payment (optional), comment (read-only on this form — edited on the receipt). For **Expenditure** the destination warehouse is additionally shown — if specified, the document works as a warehouse-to-warehouse transfer (see below). **Selling** doesn't show a destination warehouse — a sale writes goods off the company entirely, there's no "receiving" onto another warehouse. ## Lines An item is picked **only from actual stock on hand** — the `Warehouse` button opens a list of lots for the source warehouse, with filters (search by name/part #, a "Full" mode showing the whole warehouse). Free entry of "an item that isn't there" is not allowed — you can't write off more than what's in stock (the quantity check is mandatory both on the client and during processing). The quantity can't be negative either ("Quantity must not be negative") — goods coming back from a customer are recorded with a Receiving document with a return operation. The `Order` button — shipping against an open order line: the list is restricted to items the order is waiting on, and after processing it automatically closes (fully/partially) the matching order line. Each line stores: item, part #, quantity, the write-off price (the lot's warehouse price, must match the lot's current cost) and the sale/transfer price (for Expenditure usually equal to the cost, for Selling — the retail price). A line is tied to a specific stock lot — it's not a free entry, but a "slice" of a specific stock balance at the moment it was picked. You can't change the quantity/price of an already-picked line — only delete it and pick again (the `Edit` button is deliberately absent from this form). If a single lot doesn't have enough quantity for an item, an automatic breakdown across several lots is available (oldest-first) — with user confirmation. ## Processing logic Clicking `Processing` performs the following (for each open line in the document): 1. **Period check** — the document date must be after the period-close date, otherwise "PERIOD IS CLOSED FOR JOB". 2. **Source-lot check**: the item/part # and the lot's price must match the values recorded on the document line — if someone changed the lot between when the line was picked and processing, the document won't process ("PROCESSING STOPPED. INVALID DATA"). 3. **Quantity check** — the lot must have enough stock, otherwise "NOT ENOUGH QUANTITY". 4. **Write-off from the source lot**: quantity is reduced by the written-off amount; if the balance reaches zero, the lot is marked inactive; the stock's last-operation date is updated; if the item had a soft reservation, the lot's reservation is reduced too. 5. **Releasing a reservation for the order/document** — done **always for Selling** and **only for Expenditure with a partner specified** ("sale on credit") — a plain warehouse-to-warehouse transfer doesn't touch reservations. A reservation tied to the same order or the same document is released, up to the shipped quantity; if the reservation is larger than what was shipped, it's reduced, not removed. 6. **Warehouse-to-warehouse transfer** (Expenditure only, if a destination warehouse is specified): a new lot is created (or topped up) at the destination warehouse — **the cost at the new warehouse becomes equal to the shipping price** of the source line, i.e. a transfer can "raise" or "lower" the carrying price at the destination warehouse. A mirroring receiving line is created at the same time — the receiving side of the transfer, already in a processed state. 7. **Write-off from a storage location** — if the lot had a specific storage spot recorded, the balance at that spot is reduced too (can't go negative). 8. **Document total** — quantity × price is summed across all lines (with the operation sign taken into account); plus the document's extra sums (services/taxes/total) are added — giving the full amount due. ## Differences: Expenditure vs. Selling | | Expenditure | Selling | |---|---|---| | Destination warehouse | Present (optional) — a transfer between warehouses | Absent — goods leave the company | | Releasing a reservation | Only if a partner is specified (credit shipment) | Always | | Typical scenario | Transfer, write-off, a shipment to a company with no revenue | A shipment to a customer with revenue recorded | Both types share the same processing, so all of steps 1–5, 7–8 above work identically. **Transfer reporting**: the regular Receiving/Shipping registers deliberately **exclude** transfers (the goods never left the company) — transfers have a dedicated **Transfer Register** (Reports → Registers → Transfer Register), one warehouse at a time, with "Sent"/"Received" columns (a single warehouse can be both source and destination across different documents in the period). ## Payment: automatic cash-entry creation If a cash account is specified in the header, a twin cash document is automatically created during processing (same date, its own number starting with `G-`, see [Cash/Bank](06_cash_bank.md)) for the document's total — the money is considered received right away, with no separate "record payment" step. In this case the counterparty's balance **is not adjusted** — since payment is recorded immediately, no debt is created. If a cash account **isn't** specified, but a partner is — the document's amount is subtracted from the counterparty's balance — a balance owed is created ("sale on credit"). ## Known differences from the original Delphi implementation - **Discount cards**: in the original, a sale with a discount card specified accumulated usage statistics per item (the base price, the discount, the total). In the current IMS2 implementation this accumulation is **not ported** — the sale is processed, but discount-card usage statistics aren't kept. - Ledger entries (accounting entries) from the original are not ported — in IMS2, accounting is deferred. --- # Manufacture *[Screenshot: Manufacture]* A document producing a finished product from components. The system creates a receipt of the finished product and an expenditure of the components per the recipe (bill of materials) in a single document. ## Header Number, date, warehouse, Work Order/Project (optional — links to the Projects/F4 section), comment. ## Lines One document holds two kinds of lines: - **Consume ( − )** — a component written off from stock, picked from actual stock on hand (a specific lot with price/quantity). Lines with serial numbers are marked in red — for these, picking the S/N is mandatory when consuming. - **Produce ( + )** — the finished product received into stock. Shown in a separate, always-visible "Products" panel to the right of the component table (not hidden, unlike the equivalent panel in an expenditure document). Color coding for component lines: expenditure lines are shown with a pale yellow background. ## Buttons | Button | Action | |---|---| | **Add Product** | Manufacture a product per its recipe (bill of materials) — a "+" line (the product) and all its "-" components are added at once. Clicking the same product again in this document doesn't create duplicates — the product's old components are deleted and rebuilt | | **Project** | Link the output to a project plan line (Projects/F4) — instead of expanding a recipe, separate from it | | **− Consume** | Manually write off a component from stock (not tied to a specific product's recipe) — picked from stock on hand | | **Calculate** | Compute the product(s)' cost = sum of consumed components + extra charges (Charges), distributed proportionally across all "+" lines in the document | | **Delete** | Delete a line (for a component shared across several products, all its occurrences are deleted at once; only while the line is unprocessed) | | **Edit** | Change a line's quantity/price | | **Processing** | Process the document — receive the product, write off the components | | **Reports** | Print the document | | **Close [Esc]** | Close the form | ## Document pricing mode The first product added to the document fixes the pricing mode for the **whole** document (not per line): - **Manual mode** — the product's price is entered by the user when adding it, and "Calculate" doesn't touch it; every subsequent product in the document must also have a manually entered price. - **Auto mode** — the product(s)' price is computed via "Calculate" (components + Charges) or automatically during processing if no price was set. The mode doesn't reset automatically even if every product in the document is deleted and re-added — otherwise the manual-mode "lock" could be bypassed by recreating the line. ## Processing logic When the document is processed: - **Plus:** each product line is received into stock (quantity × 1). If the product's price isn't set, it's computed automatically from the components' cost + Charges, with a warning to the user (not a block). - **Minus:** each component is written off from the lot that was picked when the line was added. - The finished product's supplier/ownership is determined from the lots the components were drawn from: if all components come from one supplier, the product inherits it; if from several, it's considered owned by the main company. If there aren't enough components in stock, manufacturing is **still allowed**. The system doesn't block output on a shortage; the decision on sourcing more components is left to the user. --- # Correction *[Screenshot: Correction]* A document that directly adjusts a stock lot — bringing the database in line with physical reality: an item was found physically, a discrepancy was found after an inventory count/recount, etc. Uses the same document type as Manufacture, but with separate logic and a separate form; no recipe, no products — just "before / after." ## Header Number, date, warehouse, comment. ## Lines The line model (an "after" version follows the document field convention): | Field | Meaning | |---|---| | Quantity BEFORE | A snapshot of stock — taken when the line is added and refreshed at the moment of processing | | Quantity AFTER | Entered by the user, the target state | | Price BEFORE | A snapshot | | Price AFTER | Entered by the user, **cannot be zero** | | Lot | The specific stock lot being corrected; a special value if the stock line doesn't exist yet | A line is added two different ways — with different mechanics: - **Warehouse** — a plain pick of an existing lot (a list of actual stock on hand). The "before" value is taken from the picked lot automatically; the user only enters the "after" (quantity and price). - **Add** — like on a receiving document: searching an item across the whole reference list + entering quantity/price the normal way. "Before" is always zero — the stock line doesn't exist yet; the new line is created with "own company" as the supplier (no real supplier). A stock line cannot be deleted — only brought to a zero "after" quantity (equivalent to writing it off to zero). The Delete button in this form only deletes an unprocessed draft document line, not the stock lot itself. ## Buttons | Button | Action | |---|---| | **Warehouse** | Pick an existing stock lot to correct | | **Add** | Create a new stock line (the item wasn't in stock before) | | **Delete** | Delete an unprocessed draft document line | | **Edit** | Change the "after" quantity/price | | **Processing** | Process — apply the new quantity/price to stock | | **Reports** | Print | | **Close [Esc]** | Close the form | ## Processing logic A correction **directly rewrites the stock lot** — unlike Manufacture, there's no separate receipt/expenditure here, just bringing a lot to a new state: - If the line points to an existing lot, its quantity and price are changed to the "after" values. If the "after" quantity reaches zero, the lot is marked exhausted but not deleted. - If the line didn't exist before, a new lot is created with the "after" quantity/price, owned by the main company. The reference to the created lot is stored on the document line — needed for a later rollback. - Processing is unavailable if the accounting period is closed, or if the warehouse is closed for work up to the document date ("WAREHOUSE IS CLOSED FOR JOB"). - At the moment of processing, the "before" quantity and price are re-read from the lot — if the lot was shipped from after the line was added, the document records the actual state it corrected. The "before/after" history isn't rewritten afterwards: the "before" values on the document line remain as a historical snapshot at the moment the correction was processed. A rollback is refused if, after the correction, more was shipped from the lot than it would have had without the correction ("NOT ENOUGH STOCK TO ROLLBACK"). ## Manufacture and Correction in lists In the document list and reports, Manufacture and Correction appear as the same document type; the operation name tells them apart. --- # Discount — Warehouse Revaluation *[Screenshot: Discount]* **Important:** despite the name "Discount," this document **has nothing to do with customer discounts**. It's a **stock-lot revaluation** document: it changes the carrying price (cost) of a specific stock lot — a markdown (a price decrease, e.g. for damage/obsolescence) or a markup (a price increase). Customer discounts/special offers are not implemented as a separate document type in IMS2 (the per-customer discount mechanism isn't universal). ## Header Number, date, warehouse, comment. The partner/counterparty and a destination warehouse aren't shown on this form — a revaluation isn't tied to a customer or to moving between warehouses (the warehouse stays the same, only the price changes). ## Lines An item is picked **only from actual stock on hand, as a whole lot** — the `Warehouse` button opens a list of lots (the same stock-picking dialog used in Expenditure/Selling); the chosen quantity must match the lot's entire balance (you can't revalue "part" of a lot — a lot either changes price entirely, or isn't included). Columns: item, part #, quantity, **New price**, **Old price** (the lot's old/warehouse price at the moment it was picked, for reference only). Serial numbers aren't requested when picking — a revaluation doesn't concern them. A line is a snapshot of a specific lot; there's deliberately no `Edit` — if you made a mistake, delete the line and pick the lot again. ## Processing logic For each open line: 1. **Period check** — same as Expenditure/Selling. 2. **Source-lot check**: the item/part # and the lot's current price must match what was recorded on the line. 3. **Quantity check** — unlike Expenditure/Selling, here you're required to take the **entire** lot (a discrepancy larger than 0.001, or an inactive lot, causes a "NECESSARY TO CHOOSE ALL QUANTITY" error). 4. **Write off the source lot to zero** — the lot is marked inactive. 5. **Create a new lot** with the same item, the same warehouse, the same quantity, but the **new price**. The expiry date is inherited from the source lot — a revaluation doesn't change the expiry date, only the price. 6. **The lot logically "leaves at the old price and arrives at the new one"** — but, unlike a warehouse-to-warehouse transfer in Expenditure, this does **not** create a second (mirroring) `ms_opr` line. The same document line is switched to the new lot (`nm_zps`/`nm_zpp` on that same row) and closed — the revaluation happens in one step, with no separate expenditure/receiving pair. 7. Reservations and storage locations aren't touched by a revaluation — the item physically moves nowhere, only its recorded price changes. 8. The document total is the sum of the lines plus extra sums, same as Expenditure/Selling. No cash entry or counterparty balance is created — a revaluation isn't tied to a customer's money. ## Mass Revaluation Besides picking a lot line-by-line via the `Warehouse` button, the form offers `Mass Revaluation` — an extended search-and-bulk-apply tool: 1. **Find** — search criteria across the warehouse: item name/code, item group, supplier, expiry "before…". Returns a list of matching stock lots. 2. **Preview** — the revaluation parameter: a percentage markdown/markup or a direct new price. Recomputes the new price for each found line **without contacting the server** — the user sees the result before applying anything. 3. **Delete** (in the search results) — remove a specific found line from the list (not from the DB) — manual refinement of the results. 4. **Apply to All Found** — creates a document line for each lot in the result with the computed new price. Requires `Preview` to have been clicked explicitly (without that step the button refuses — the old behavior of silently falling back to -10% has been removed, the revaluation parameter must be visible to the user before applying it). A zero price after Preview is also blocked as a likely input error. This is an enhancement over the original Delphi implementation — there, line-by-line picking from stock was the only way to create a revaluation line. ## Printed form The report prints, per line: quantity, **Old price** (the price before), **New price** (the price after), **Value change** (quantity × the price difference) — positive for a markup, negative for a markdown (accounting sign: a markup increases inventory value, a markdown decreases it). The document total is the sum of the value change across all lines, not the sum of quantity/price as in an earlier (incorrect) version of the report. ## Buttons | Button | Action | |---|---| | **Processing** | Process — write off the lot at the old price, create it at the new one | | **Warehouse [Ins]** | Pick a stock lot in full for revaluation | | **Mass Revaluation** | Find lots by criteria and apply a %/direct price in bulk | | **Delete [Del]** | Delete a document line | | **Clear** | Delete all document lines | | **Reports** | Print the revaluation document | | **Close [Esc]** | Close the form | Before processing, lines can be freely added/removed. After processing — only via rollback. --- # Cash/Bank A document recording money movement: paying a supplier, receiving from a customer, transferring between your own accounts, paying for services, etc. Doesn't move goods — money only. Can exist on its own (entered manually by the user) or be created automatically as a "twin" when a Receiving, Expenditure/Sale or Point of Sale document is processed with an account specified (in which case payment is recorded right along with the goods document, with no separate step). An automatic twin gets its own number starting with `G-` (for example `G-1a2b3c4d`) and the date of the goods document; the goods document's own number is shown on its line as the linked document. A twin can't be rolled back on its own — it's reversed together with its goods document (see [Rollback](16_tools_document_fixes.md)). ## Header Number, date, the account/cash register the document belongs to, the linked goods document (number/date), comment. As with other documents, the date cannot fall within a closed accounting period. ## Lines Each line is a separate transaction: - **Description** — the purpose of the payment. - **Debit / Credit** — money leaving or money arriving. A line usually fills in only one of the two amounts; both at once is the rare case of a compound entry (e.g. conversion/a fee). - **Destination account** — for a transfer between your own accounts: one account is FROM, the other is TO. - **Counterparty** — an individual or a company the transaction is tied to. - **Linked document** — the number and date of the document this line pays for (e.g. a receipt's number). - **Order/project**, if the payment relates to a specific order. - **Operation reason** — an optional field: sale, purchase, service payment, etc. Not a separate document type, just a classifier for the line (see Service below). ## Logic During processing, for each open line: 1. The line is tied to the document (number, date, account, order), if the link to the underlying document isn't already set — the current document's number/date is used. 2. The line is marked processed. 3. If a company counterparty is specified — its balance is updated: the difference between debit and credit is added to the balance. A payment to a supplier (debit) reduces what's owed to them; a receipt from a customer (credit) increases what they owe us (or reduces what we owe them, depending on the sign). Once every line is processed, the document is marked processed. A cash document by itself doesn't move goods or recalculate stock — it's a purely money-related operation. ### Service — retired as a separate type The original system had a separate "service" document — a form for paying for services with its own extra sums and a two-sided invoice. In IMS2 this is deliberately NOT split out as a separate document type: paying for a service is recorded as an ordinary Cash/Bank line, and its meaning ("this is a service payment") is set through the "operation reason" field, like any other transaction classification. ## Buttons | Button | Action | |---|---| | **Processing** | Process — lines are tied to the document, counterparty balances are updated | | **New [Ins]** | Add a line — accounts, debit/credit amounts, counterparty, reason | | **Edit [F4]** | Edit a line | | **Delete [Del]** | Delete a line | | **Reports** | Print (a cash voucher / bank statement) | | **Save [F2]** | Save a draft without processing | | **Close [Esc]** | Close the form | The status bar shows total Debit, total Credit, and Net (Credit − Debit). ## Differences from the reference implementation - Cash/Bank documents can now be created not just manually but also automatically — as a twin of Receiving, Expenditure/Sale or a Point of Sale sale when an account is specified: the system creates a cash document with the same date, its own `G-…` number and a payment line on its own. - The money direction on a line is encoded only through the debit/credit pair — a separate plus/minus flag, which on other document types shows whether goods are added or removed, is not used or read by reports for cash lines. --- # Order — Supplier Order An intent document: "we want to buy these items from a supplier, in this quantity, at this price." An order by itself **doesn't move stock or spend money** — it only records an intent and serves as a tag grouping related documents under one number. Processing an order (the Processing button) only clears the "draft" flag — it creates no stock entries. The actual goods movement is done by a subsequent Receiving document, into which goods are entered manually (or, in a future enhancement, via a link to the order). The order and the receipt are linked by the common Work Order number, which the Linked Documents tab is built on. > The operations reference table historically had two subtypes of this > document: a bill to a customer, and a supplier order. Both are hidden > today (marked as unused — "no clear use case"). IMS2 actually implements > only one scenario — a supplier order (procurement); the historical > "customer bill" branch is not used in the current system. ## Header Document number, date, supplier company, Work Order (the common number related documents are grouped under), comment, Shipping and Handling — expected shipping/handling costs not yet included in the line prices. ## Items tab — order lines Each line: item (searchable by name/catalog number), catalog number, quantity, price, amount (quantity × price), unit of measure, comment. A separate pack quantity is stored — units per supplier package, not to be confused with the actually-received quantity. Lines can be added/edited/deleted freely while the document is unprocessed. ## Linked Documents tab A list of all documents whose Work Order number matches this order (processed only, not the order itself) — shows how many receipts have been made against the order, whether any expenditures happened against it. View-only, no edit buttons. ## Components tab — recipe breakdown Shows the list of ordered components for the Work Order: item, catalog number, required, in stock, already ordered, reserved, comment. - **Create Components** — rebuild the component list from the order lines (Items), expanding the recipe (bill of materials) for products that have one; items without a recipe are included as-is. The old component list is deleted and rebuilt. - **Update** — recompute the accumulated figures (stock on hand, reserved, etc.) for the existing component list. - **New** — add a component manually (search the item reference list + enter the required quantity). - **Delete** — remove a component from the list. This is the shortage-calculation mechanism for a product/project: how much is needed, how much is in stock, how much is already ordered and reserved — the user makes a purchasing decision from this data. ## Top-panel buttons (document actions) | Button | Action | |---|---| | **Processing** | Process the order — clears the draft status, creates no stock/money entries | | **Reports** | Print the order / a quotation | | **Save Variant** | Save the current set of lines as a variant for comparison (e.g. different offers from different suppliers) | | **Load Variant** | Load a previously saved variant — replaces the current lines | | **Cost Report** | Open the cost report (recipe matrix): needed / in stock / to buy | | **History** | Change history for the selected line | `Save Variant`/`Load Variant`/`Cost Report` are new IMS2 capabilities, absent from the original Delphi form. ## Bottom-panel buttons | Button | Action | |---|---| | **New (Ins)** | Add an order line | | **Delete (Del)** | Delete a line | | **Edit (F4)** | Edit a line | | **Save (F2)** | Confirmation (order lines are saved immediately on add/edit) | | **Clear** | Delete all lines in the document | | **Close (Esc)** | Close the form | New/Delete/Edit/Save/Clear belong to the Items tab and are hidden on the Linked Documents / Components tabs (which have their own buttons: Create Components, Update, New, Delete). ## Processing logic Processing an order is the simplest of all document types: 1. Checks that the document is indeed a supplier order and isn't already processed. 2. All order lines get their draft status cleared, also pulling the cash account, Work Order number and operation code from the header. 3. The document header gets its draft status cleared, a processing date, and a user. No stock movement or ledger entries happen — unlike the historical processing of a customer bill, which in Delphi additionally computed accounting entries. Today, since the "bill" subtype is hidden, that branch is irrelevant. ## Differences from the reference implementation - **Auto-creating a supplier order from a project's component shortage** — in Delphi there was a "create supplier order" button right from the shortage list: the user picked the missing components, picked a supplier, and the system created an order document with one line per selected component (quantity = required, price from the supplier's price list if unambiguous, otherwise a price-selection prompt). IMS2 has no such automation: the Components tab only shows the shortage (Create Components/Update), it doesn't create a new order — the user creates the document and transfers the lines manually. - **The reference form in Delphi is significantly broader** — it served as both a supplier-order form and a project/work-order form, with tabs for Quotations (offers from different suppliers: date/price/lead time), Notes (free-form notes), Labour (labor cost: employee/hours/rate), plus Mark (flag a line), Open (open a linked receipt), Reservation (reserve for the order) buttons and Status/Edit/Quotation/Work Order menu items. IMS2 implements only Items, Linked Documents, and Components from this set — the rest was not ported. - **The two historical subtypes of this document** (customer bill and supplier order) were, in the source, two different user scenarios with different processing forms (the bill computed ledger entries, the order didn't). Today both subtypes are hidden in the reference table, and IMS2 uses a single unified processing routine that posts nothing to any account. - **Locking a processed document** — on other document forms, the grid becomes non-editable after processing; this behavior wasn't separately verified for the order form while documenting it — it falls under the general backlog item on locking processed documents for all document forms. --- # Orders — Customer Orders (F3) ![Order list](https://olevsoft.com/ims/assets/screens/orders_list.png) A reference-style subsystem, **not a direct-action document** — by itself it doesn't move stock or spend money. An order records "we were ordered from" (customer, period, a list of lines with requested quantities), and the actual shipping against the order happens from an expenditure/sale document (the **Order** button in the expenditure dialog) — there you pick an open order line, then a lot in stock. When the document is processed, the order's remaining quantity decreases automatically. > Not to be confused with a supplier order (the **Order** document, > accessible via Documents/F2 → New) — there, we place the > order; here, we're ordered from. The symmetry: Orders (F3) = "we were > ordered from," Projects (F4) = "we order." ## Order list | Column | What it shows | |---|---| | **Order #** | Order number (arbitrary, entered manually) | | **Customer** | Customer | | **Start / End** | Planned start/end dates | | **Status** | Open / Closed | | **Requested** | Total requested quantity across all lines | | **Shipped** | Total actually shipped | | **Comment** | Comment | Closed orders (`Closed`) are shown in gray italic — visually distinct from open ones, but not hidden from the list. ### List buttons | Button | Key | Action | |---|---|---| | **New** | Ins | New order — number, customer, start/end dates, comment | | **Open** | Enter | Open the order — lines, statuses, shipping (double-clicking a row does the same) | | **Delete** | Del | Delete the whole order | | **Reports** | — | The **Orders Reference** report — across all orders at once | | **Close** | Esc | Close the window | ## New order *[Screenshot: New order]* | Field | Required | Notes | |---|---|---| | **Order #** | yes | Arbitrary text/number | | **Customer** | yes | Searched from the partners reference table | | **Start** | no | Defaults to today | | **End** | no | Planned end date | | **Comment** | no | | ## Order card (Open) *[Screenshot: Order card]* A table of order lines: item, code, requested, shipped, remaining, status (`Open`/`Closed` — closes automatically when a line is fully shipped). At the bottom — a summary: line count, total requested/shipped. | Button | Action | |---|---| | **New** | Add a line — item + requested quantity + comment | | **Delete** | Delete the selected line | | **Print** | Print this order's report directly (same report as Reports) | | **Reports** | Choose a report for this order (Order Reference) | | **Close Order** | Close the order manually, regardless of remaining line quantities — the order disappears from the open list. This action can't be undone through the UI | | **Close** | Esc — just closes the window, doesn't affect the order's status | > **Close Order** isn't just called "Close" so it's not confused with > closing the window itself — a deliberate choice when designing the > dialog. --- # Projects — Supplier Orders (F4) *[Screenshot: Project list]* Projects are the mirror opposite of Orders (F3): there, we're ordered from; here, **we ourselves** want to manufacture/assemble a certain quantity of products. Projects by itself makes nothing — it's only a checkpoint of "how much is needed / how much is already made." Actual manufacturing always happens through a normal Workshop production document. ## A running example: buying for a birthday party Below is one running example instead of scattered ones, so you can see how a project actually helps plan a purchase. **Situation.** A birthday party for 40 guests needs to be catered, and Pizza Margherita was chosen. Pizza isn't a stocked item, it's a product with its own recipe (Tools → Products): dough, tomato sauce, mozzarella cheese, basil. Some ingredients are already in the kitchen, some need to be bought — but it's not obvious in advance exactly what and how much will be short for all 40 pizzas at once. ## 1. Project list | Column | What it shows | |---|---| | **Project #** | The project's number/code (short, up to 15 characters — there's a separate Comment field for a description) | | **Start / End** | Planned start/end dates | | **Status** | Open / Closed | | **Target** | Total target quantity across all lines | | **Made** | Total made | | **Comment** | The project's comment/description | ### List buttons | Button | Key | Action | |---|---|---| | **New** | Ins | New project | | **Open** | Enter | Open the project — lines, components (double-clicking a row does the same) | | **Delete** | Del | Delete the whole project | | **Report** | — | Project Cost Report — cost based on what was actually made | | **Close** | Esc | Close the window | ## 2. New project *[Screenshot: New project]* **Project #** is a short code, not a description (in the database it's a limited field, 15 characters) — in the example, simply `PARTY-40`. The full description of what the project is goes into **Comment**: "Birthday party catering — 40x Pizza Margherita." | Field | Required | Notes | |---|---|---| | **Project #** | yes | A short code | | **Start** | yes | Defaults to today | | **End** | no | Planned end date | | **Comment** | no | The project's full description | ## 3. Project card — the Products tab *[Screenshot: Empty project card]* A project has two tabs inside it. **Products** — exactly what and how much needs to be made. The **New** button adds a line: search for a product by name (the **Product** field — this searches specifically for a product, i.e. an item with its own recipe in Products/BOM) and a target quantity. *[Screenshot: Adding a line]* Entered "Pizza Margherita," target quantity 40 (how many pizzas are needed for the party). *[Screenshot: Line added]* Once saved, the line shows: **Target** 40, **Made** 0, **Remaining** 40, **Status** Open. As manufacturing happens (see §5), Made will grow and Remaining will shrink. ## 4. The Components (needed) tab — what's short *[Screenshot: Components tab]* The most useful part for planning a purchase. It stores nothing — computes **on the fly**, via the **Refresh** button: 1. Takes each product's recipe (composition) from every open line in the project (Products/BOM). 2. Multiplies by the line's **remaining** quantity (target minus already made — if some pizzas are already baked, their components don't need to be recomputed). 3. Sums across all lines — if the same component is needed for several products at once, it shows up as a single row with the combined requirement. 4. Compares against the current stock on hand. For the 40-guest pizza example, this looks like: | Component | Needed | In Stock | Deficit | |---|---|---|---| | Fresh Basil | 0.8 | 0.3 | **0.5** | | Mozzarella Cheese | 12 | 5 | **7** | | Pizza Dough | 40 | 50 | 0 | | Tomato Sauce | 8 | 10 | 0 | There's enough dough and sauce with room to spare (0 in the Deficit column) — no need to buy more. But cheese is short by 7 kg, basil by 0.5 kg: rows with a deficit are highlighted in red so it's immediately clear what to buy. This is "what needs to be bought" reconnaissance, not a document and not a reservation — it processes and locks nothing by itself, refreshed with the **Refresh** button at any time (e.g. after something has already been bought and received). ## 5. How manufacturing happens The Projects screen itself makes nothing — it's just a list of "what's needed." Actual manufacturing happens through the Workshop form, the **Project** button in the manufacture dialog): pick an open project line, enter the quantity made, the document is processed as a normal manufacture — consumes components per the recipe, receives the finished product. When the document is processed the system automatically: - adds the made quantity to the line's **Made**; - if **Made** reaches **Target** — the line closes automatically; - if all lines are closed — the whole project closes automatically. ## 6. Manual close and restrictions **Close Project** forcibly closes a project even if something isn't finished (e.g. part of the party was canceled). This is a separate action from auto-close-on-manufacture. Editing restrictions (protecting against loss of history): - a line's target quantity can't be reduced below what's already made; - a line can't be deleted if anything has already been made against it; - the whole project can't be deleted if at least one line has a made quantity. ## 7. Report **Project Cost Report** (the **Report** button) — a separate report inside the project: the actual cost based on the quantity already made (not the target) — how much it actually cost to feed the guests, based on the components actually bought and consumed. --- # Reports (F5) ![Reports section](https://olevsoft.com/ims/assets/screens/reports_main.png) The single entry point to every printed form and chart in the system. Reports are organized into seven tabs — by task type, not alphabetically: the grouping is somewhat approximate (some reports could fit two categories at once), whatever didn't clearly fit anywhere else stayed in the **General** tab. ## Tabs | Tab | What's inside | |---|---| | **Documents** | Printing a single already-created document (you need to find the document first — the **Find document…** button) | | **Registers** | Lists of operations over a period, sliced various ways (by document, by item, by counterparty, etc.) | | **Stock** | A snapshot of the current state — stock on hand as of now/as of a date | | **Turnover** | Opening balance + movement over a period + closing balance | | **General** | Miscellaneous items that didn't fit other categories | | **Inquiries** | Quick reference lookups (prices, items) | | **Charts** | Interactive charts — trends, period comparisons (see cash_flow_chart, sales_by_month, stock_levels_chart, top10_chart) | The hint under a tab's title briefly explains its purpose — short tab names (like "Turnover") aren't always self-explanatory on their own. ## Working with a report 1. Pick a tab. 2. For the **Documents** tab — click **Find document…** first and find the document you need (by number/date/counterparty); other tabs load their report list immediately when the section opens. 3. Pick a report from the list (double-click, or the **Select** button below the list). 4. If the report has parameters (period, warehouse, grouping, etc.), a parameter dialog opens. If it has no parameters, the report prints right away. 5. The report opens in a new browser tab as an HTML page, ready to print (Ctrl+P) or save as PDF via the browser. The report tab gets its own short-lived permission to read the data — about 30 minutes, independent of your main session. Printing or saving the already-opened page works any time; but if you reload the tab (or open its address again) later, it shows "Not authenticated" — just open the report again from the Reports section. If the browser blocks pop-up windows, allow them for this site, otherwise the report tab can't open. | Button | Action | |---|---| | **Find document…** | (Documents tab only) — find the document to print a report for | | **Select** | Open the selected report (same as double-clicking the row) | | **Close** | Close the reports section | --- # Point of Sale (F6) ![Point of Sale](https://olevsoft.com/ims/assets/screens/pos_main.png) A "single screen" retail-sale interface — item search, adding to a receipt, payment, printing the receipt — without going through a full expenditure document. Each sale is recorded as a separate receipt (Receipt #) with continuous numbering. ## Before you start Three required fields need to be set in the header — without them the **Sell** button stays disabled: | Field | Purpose | |---|---| | **Warehouse** | The warehouse goods are written off from | | **Price List** | The price list prices are taken from | | **Discount** | A discount (optional) — applies to the whole receipt | | **Account** | The account/cash register money goes into | ## Finding and adding an item 1. Enter a code, barcode, or part of an item's name in the search field, click **Search** (or press Enter). 2. Search results appear in the left-hand table (Item / Code / Qty in stock / Price). 3. Pick a row, set **Qty** (quantity) and adjust **Price** if needed, click **Add ↓** — the item moves into the cart on the right. 4. **Clear** next to the search results clears the found list; a separate **Clear** next to the cart clears the whole receipt. ## Cart The right-hand table — items in the current receipt (Item / Code / Qty / Price / Amount). The header shows the receipt number (**Cart — Receipt #N**). The cart's **Delete** button removes the selected line. The total amount — **Total** — is at the bottom. ## Completing a sale | Button | Key | Action | |---|---|---| | **Sell** | F1 | Process the sale — a confirmation with a breakdown (lines/subtotal/tax/total) appears; after confirming, a "Sale complete" dialog opens with a **Print Receipt** button (prints the receipt, see the `pos_receipt` form) | | **Report** | F5 | A sales report for the shift/period (Sales Register) — period, mode (totals only / brief / detailed), a **Print** button | | **Close** | — | Close the register | After a sale, the cart and receipt number reset for a new receipt; the warehouse/price list/account stay selected — the next sale starts right away. --- # History (F7) ![History](https://olevsoft.com/ims/assets/screens/history_main.png) A quick answer to two typical customer-support questions — without building a full report with parameters and a period: 1. "Have we paid you everything? How much do we still owe?" — the **By Company** tab. 2. "Who supplied us this component?" / "Who have we sold it to?" — the **By Item** tab. Both lookups use a single input field at the top; the result appears immediately after picking from the list (no "Find" button, no parameter dialog). > The old Delphi system had no such section at all — this is a new > feature, added for real support scenarios, not a port. ## By Company 1. Start typing the counterparty's name in the search field (or press space to show the whole list). 2. Pick a counterparty — their **current balance** appears below the field: - *"They owe us: N"* — the customer owes us; - *"We owe them: N"* — we owe the customer (a prepayment/overpayment); - *"Balance: 0.00 (even)"* — settled. 3. Below — a table of documents with this counterparty (date, number, operation type, amount). The balance is the same live field the Debt Report shows; here it's available without generating a report, for an on-the-fly conversation with a customer. ## By Item 1. Start typing the item's name (or press space to show the whole list). 2. Pick an item — a table of its operations: date, document number, operation type, +/− (receiving/expenditure), quantity, price, counterparty, warehouse. Lets you quickly find which supplier a specific component was last bought from, or who a specific item is most often sold to. | Element | Action | |---|---| | **Close** | Close the History section | --- # Tools (F8) ![Tools panel](https://olevsoft.com/ims/assets/screens/tools_main.png) The shared panel of utility functions — 28 buttons in alphabetical order (the order in the code is historical, by addition date, but alphabetical is easier to scan visually). Hovering a button shows a short explanation under the panel of what it does — the same text also appears in the browser's tooltip on hover. Some buttons are only available to administrators (access level ≥9) — they simply aren't shown to a regular user: **Change Date, Control, Import, Log Viewer, Name of Goods, Query, Special Operations, System, Translations, Users, User Access**. Any other button can also be hidden for a specific user in [User Access](19_tools_user_access.md). These restrictions are enforced by the server as well, not just by hiding buttons: a forbidden action is refused with "Access denied" or "Admin access required". **Change Currency** and **Report Designer** are shown to everyone, but only an administrator can save changes in them ("saving only" in the table below); the same goes for **Mass Rollback** inside Rollback. ## Full list | Button | Admin-only | What it does | |---|---|---| | **Inventory** / **Stock** | | Both open the same stock-on-hand screen — see [21_tools_warehouse_stock.md](21_tools_warehouse_stock.md) | | **Reserve** | | Reserving stock for a customer/order — currently a stub ("Available by request only"), a full tool is built only against a specific customer request | | **Location** | | The warehouse cell map — see [14_tools_location.md](14_tools_location.md) | | **Name of Goods** | ✓ | The master item list — a general reference table, see [Directory (F9)](24_directory.md) | | **Price List** | | Price lists by item — see [15_tools_products_pricing.md](15_tools_products_pricing.md) | | **Change Currency** | saving only | The exchange rate (local/USD); anyone can view it, only an administrator can save it — see [17_tools_admin_settings.md](17_tools_admin_settings.md) | | **Rollback** | | Rolling back a processed document — see [16_tools_document_fixes.md](16_tools_document_fixes.md) | | **Special Operations** | ✓ | A targeted fix to a document's number/date without a rollback — see [16_tools_document_fixes.md](16_tools_document_fixes.md) | | **Change Date** | ✓ | Closing a period — documents before that date can't be edited/deleted — see [17_tools_admin_settings.md](17_tools_admin_settings.md) | | **Operations, Contracts, Description, Users, Companies, Warehouses, Departments** | Users only | Plain reference tables — shared interface, see [Directory (F9)](24_directory.md) | | **Products** | | Product specifications (BOM) — see [15_tools_products_pricing.md](15_tools_products_pricing.md) | | **Discount** | | Discount rules — see [15_tools_products_pricing.md](15_tools_products_pricing.md) | | **Control** | ✓ | Document validation rules (e.g. "can't sell below cost") — see [17_tools_admin_settings.md](17_tools_admin_settings.md) | | **Query** | ✓ | A builder for saved filters used in reports — see [18_tools_query_builder.md](18_tools_query_builder.md) | | **User Access** | ✓ | User permissions by menu/module/document type — see [19_tools_user_access.md](19_tools_user_access.md) | | **System** | ✓ | General company settings — see [17_tools_admin_settings.md](17_tools_admin_settings.md) | | **Events** | | Auto-notification rules (e.g. a low-stock threshold) + a log of what fired — see [20_tools_event_log.md](20_tools_event_log.md) | | **Import** | ✓ | Bulk data import from Excel/CSV — opens in a new browser tab, like reports | | **Report Designer** | saving only | The registry of printed reports and their parameters (which reports exist and what they ask for) — see [22_tools_report_designer.md](22_tools_report_designer.md) | | **Translations** | ✓ | Editing UI translations (RU/FR) for existing keys — see [23_tools_translations.md](23_tools_translations.md) | | **Log Viewer** | ✓ | The background log of user actions and errors, by day of month: Actions / Errors, text search, "Failed only" — for finding out after the fact what was done and what went wrong | The plain reference tables (Name of Goods, Operations, Contracts, Description, Users, Companies, Warehouses, Departments) all open the same universal list editor (search / add / edit / soft-delete) — the same interface every Directory (F9) reference table uses, so it's documented in detail once there instead of being repeated for each button. --- # Tools → Location — Warehouse Cell Map *[Screenshot: Location]* Manages the physical grid of storage cells (rack/shelf/bin) — what's stored where. Not to be confused with stock quantities (that's tracked by stock on hand) — this is only the map: which cells exist and which item sits in which one. In practice, the cell grid is stable and rarely changes. ## Screen 1. Pick a warehouse from the **Warehouse** dropdown at the top — the cell table refreshes for that warehouse. 2. Search by cell code or item — the **Search…** field. 3. Table: **Cell** (cell code), **Item** (what's stored there), **Part #**. Empty cells are shown in gray text. | Button | Action | |---|---| | **New Cell** | Create a new cell — enter a code (e.g. `A-01-02`) | | **Assign Item** | Attach an item to the selected cell (opens the items reference table) | | **Clear** | Clear the contents of the selected cell (the cell itself remains) | | **Delete Cell** | Delete the cell entirely | | **Close** | Close the window | All actions require a cell to be selected in the table first (except **New Cell**, which only needs a warehouse selected). --- # Tools → Products, Price List, Discount Three tools for managing products and pricing — combined on one page since they're logically linked (a product's cost is built from its components' prices, the sale price comes from a price list, a discount applies on top of that). ## Products — Product Specifications (BOM) *[Screenshot: Products]* A list of products (finished goods assembled from components) with their sale price and computed cost. | Button | Action | |---|---| | **New** | Create a new product (search/pick a product item from the reference table) | | **Open** | Open the spec (component list) of the selected product | | **Delete** | Delete the product along with all its components | | **Report** | The **Products Register** report — no period needed, just a mode (totals only / brief / detailed with components) | | **Close** | Close the window | ### Inside a product (Open) — component editor The component table: **Component**, **Part #**, **Qty** (quantity per recipe), **Unit Price**, **Cost** (line cost). The **Options** menu: | Menu item | Action | |---|---| | **Add Item** | Add a component (search the items reference table) | | **Delete Selected** | Remove the selected component from the recipe | | **Batch Size** | Set how many units/servings the recipe is scaled for (if not for a single unit) | | **Calculate Cost** | Recompute the product's cost from the components' current prices | | **Print** | Print the spec (product_bom) | ## Price List — Price Lists *[Screenshot: Price List]* A list of named price lists (can be tied to a specific customer). Columns: **Name**, **Client**, **Date**, **Lines** (line count). | Button | Action | |---|---| | **New** | Create a price list (name) | | **Open** | Open the price list's contents (item → price) | | **Delete** | Delete the whole price list | | **Close** | Close the window | ### Inside a price list — the Options menu | Menu item | Action | |---|---| | **Add Item** | Add an item with a price | | **Copy from Warehouse** | Fill the price list from current warehouse prices | | **Copy from Price List** | Copy lines from another price list | | **Adjust Prices** | Bulk-adjust prices (e.g. +10%) | | **Delete Selected** | Remove a line from the price list | | **Print (by name)** / **Print (by category)** | Print the price list sorted by name or by item group | ## Discount — Discounts *[Screenshot: Discount]* A list of named discount rules: **Name**, effective period (**From**/**To**, both optional), **Percent**. | Button | Action | |---|---| | **New** | Create a discount — name, period (optional), percent | | **Delete** | Delete a discount | | **Close** | Close the window | A discount is applied at the register (Point of Sale) or on a sale document — picking a discount from this list at the point of sale. --- # Tools → Rollback, Special Operations Two tools for fixing already-processed documents after the fact — different scales of intervention. Combined on one page since both work with the same document list for a period and both are a last resort, not an everyday action. ## Rollback — Document Rollback *[Screenshot: Rollback]* Fully rolls back a processed document: returns stock/cash to the state "before the document," as if it had never been processed. The reverse of `Processing`. 1. Set a period (**From**/**To**), click **Filter**. 2. On the left — the document list for the period (number, date, operation type, counterparty, warehouse, status: `open`/`processed`). Pick a document — its lines appear on the right. 3. You can roll back the whole document, or just one line. A single line can be rolled back only while the document still has other processed lines. The last processed line can only be undone by rolling back the whole document (the message "Last processed line: roll back the whole document") — only a full rollback also reverses the counterparty's balance, the payment and the taxes of the document. The automatic cash document created when a goods document was paid immediately (its number starts with `G-`, see [Cash/Bank](06_cash_bank.md)) can't be rolled back on its own — roll back the source receiving/expenditure/sale document, and the cash document is reversed together with it. A rollback is refused, and nothing changes, if: - the document date is in a closed period (see Change Date); - the goods received by the document have already been partly shipped or used — not enough stock is left to take back ("NOT ENOUGH STOCK TO ROLLBACK"); - the stock to be taken back is reserved — release the reservation first; - the user isn't allowed to work with this document type (see [User Access](19_tools_user_access.md)) — "Access to this document type is denied". | Button | Action | |---|---| | **Rollback Document** | Roll back the whole document — every line | | **Rollback Line** | Roll back only the selected line (a partial rollback) | | **Mass Rollback** | Roll back EVERY processed document for the period at once, in reverse chronological order. Period checks are skipped for this — intended for a full state restore. Administrators only — for other users it's refused with "Admin access required" | | **Close** | Close the window | > Mass Rollback is an irreversible bulk action; it asks for explicit > confirmation showing the document count and period. ## Special Operations — Targeted Document Fix *[Screenshot: Special Operations]* Direct editing of a document header's number/date **without a rollback** — only for typos made at creation time. The operation type is not editable here — shown for reference only. The button is available to administrators only. 1. Set a period, **Filter** — the same document list as in Rollback. 2. Pick a document — the current number and date are filled into the form below. 3. Enter new values, **Apply**. The edit is blocked if the new date would break the chronology of lots across the whole goods-movement chain (receiving → expenditure → repeat manufacture, etc.) or fall within an already-closed period (see Change Date). The date of a processed document that already lies in a closed period can't be changed either. If the document was paid immediately (an account was specified), its automatic cash document (`G-…`) is moved to the new number/date together with it. | Field/Button | Notes | |---|---| | **Document #** | The new document number | | **Date** | The new date | | **Operation (read-only)** | The operation type — reference only, not editable | | **Apply** | Apply the fix | | **Close** | Close the window | --- # Tools → Change Currency, Change Date, System, Control Four small administrative dialogs — company-wide settings, not per document. Three of the four (Change Date, System, Control) are admin-only. ## Change Currency — Exchange Rate *[Screenshot: Change Currency]* A single field — the local currency's rate against USD, used when converting amounts. The button is visible to everyone, but only an administrator can save a new rate — for other users saving is refused with "Admin access required". ## Change Date — Closing a Period *[Screenshot: Change Date]* Blocks editing/deleting every document up to and including the selected date. Used once a period has been reconciled and closed for changes (e.g. end of month/quarter). > The period-close date is also checked by Special > Operations — a document can't be moved into an already-closed period. ## System — General Company Settings *[Screenshot: System Settings]* | Field | Purpose | |---|---| | **Company Code** | The company's own code in the partners reference table | | **Exchange Rate** | The currency rate (same value as Change Currency) | | **Close Period Date** | The period-close date (same value as Change Date) | | **Default Sale Operation** | The operation code the register (Point of Sale) sets by default on a sale | ## Control — Document Validation Rules *[Screenshot: Control]* A view-only (read-only) list of rules checked **before** a document is processed, which can block it (e.g. "can't sell below cost" — available, but switched off by default: selling below cost is a normal operation). This is an extension point for customer-specific business rules — new rules are added by the developer for a particular customer; this screen only shows which are currently active. | Column | Meaning | |---|---| | **Doc Type** | The document type the rule applies to | | **Rule** | The rule's name | | **Function** | The name of the checking function in code | | **Active** | Whether the rule is currently enabled | --- # Tools → Query Builder *[Screenshot: Query Builder]* A builder for named filters that can then be applied to reports (the "Query" parameter in a report's parameter dialog — narrows the data set by companies/warehouses/items/operations/groups using several conditions at once, rather than just a specific report's standard parameters). ## Saved Queries tab A list of already-saved filters: **Query Name**, **Description** (a human-readable description of the condition, generated automatically). Double-click, or the **Load** button, loads a filter onto the Build Query tab for viewing/editing. ## Build Query tab Each filter is built from one or more fields out of a fixed set: **Companies**, **Warehouses**, **Items**, **Operations**, **Groups**. Each field has an add-value button (opens a search against the matching reference table); multiple values can be picked at once (an "OR" condition within one field, "AND" between different fields). At the bottom — a count of matching documents, updated as conditions are added. | Button | Action | |---|---| | **New** | Start a new filter from scratch | | **Load** | Load the selected saved filter for editing | | **Delete** | Delete a saved filter | | **Save Query** | Save the current filter under a name | | **Close** | Close the window | --- # Tools → User Access *[Screenshot: User Access]* Per-user access permissions — what a specific employee is allowed to see/do in the system. Separate from **Users** (Tools → Users) — that's where the accounts themselves are created (login/password/role); this is where fine-grained permissions for an already-existing user are set. ## Usage 1. Pick a user from the **User** dropdown — groups of checkboxes with the current permissions appear below. 2. Permissions are split into five sections: | Section | What it controls | |---|---| | **Menu** | Access to main-menu sections (F1–F9) | | **Modules** | Access to individual system modules/features | | **Doc Types** | Which document types (Receiving, Expenditure, Cash/Bank, Orders, Selling, Workshop, Discount) the user can create/see | | **Features** | Individual capabilities within modules | | **Tools** | Which buttons on the Tools (F8) panel are available to the user | 3. Check/uncheck boxes, **Save**. | Button | Action | |---|---| | **Save** | Save the selected user's permissions | | **Select All** | Check every box at once | | **Clear All** | Uncheck every box at once | | **Close** | Close the window | By default (if there's no explicit record for a user), access is allowed; explicit restrictions need to be set manually. The permissions are checked by the server, not just by hiding menu items and buttons: if a user tries a forbidden action anyway, it's refused with "Access denied" (for a document type — "Access to this document type is denied"). Administrator-only operations (Mass Rollback, Special Operations, system settings, imports, the log and so on) are refused for other users with "Admin access required". The server applies changed permissions immediately; the user's menus and buttons are rearranged at their next sign-in. When an administrator changes a user's password or access level (in Tools → Users), every open session of that user ends at once — the user has to sign in again. --- # Tools → Events (Event Log) *[Screenshot: Event Log]* Automatic-notification rules (e.g. "an item's stock fell below a threshold") and a log of events that already fired. Two sections on separate tabs. ## Events tab — the log A list of fired events: date, item, company, operation type, order number, expected/actual value, status (⏳ Open / ✅ Done). | Element | Action | |---|---| | **Check Now** | Check every active rule right now (don't wait for the scheduled run) | | **Filter ▾** | All / Open only / By Company / By Item — narrow the event list | ## Rules tab — rules A list of configured notification rules: company, item, warehouse, operation, threshold, check period, next check date, effective period (start/end), whether it's active. | Button | Action | |---|---| | **Add Rule** | Create a new rule: company/item/warehouse/operation (all optional — searched via the reference table), a quantity threshold, a check period in the format `W;2;6` (weekly on Mon+Fri) or `M;1;15` (monthly on the 1st and 15th), start/end dates | | **Close Rule** | Close (deactivate) the selected rule | | **Delete Rule** | Delete the rule entirely | | **Close** | Close the window | The period format `W;N;D1,D2` — by day of the week (numbered the Delphi way: 1=Sunday…7=Saturday, so in the example above `W;2;6` means Monday+Friday, not 2 and 6 in the usual ISO numbering); `M;N;D1,D2` — by day of the month. An empty period field means the rule is one-time (checked once). --- # Tools → Inventory / Stock (Warehouse Stock) *[Screenshot: Warehouse Stock]* A single screen for current stock on hand across all warehouses — the **Inventory** and **Stock** buttons on the Tools panel both open it (two entry points into the same tool under two familiar names). ## Usage 1. Pick a warehouse (or **All Warehouses**) and/or type part of an item's name in the search field, click **Search** (or F5). 2. Table: **Item**, **Part #**, **Qty**, **Price** (warehouse cost), **Value** (Qty × Price), **Warehouse**, **Supplier**, **Location** (cell, if set via Tools → Location). 3. At the bottom — a summary: line count, total quantity, total value on hand. | Button | Action | |---|---| | **History** | Open the operation history for the selected item (the same screen as History (F7) → By Item) | | **Close** | Close the window | This is a static "as of now" snapshot — for stock as of an arbitrary past date, use the **Stock on Date**/**Stock Summary** reports (Reports → Stock). --- # Tools → Report Designer (Report Manager) *[Screenshot: Report Designer]* The registry of every printed report in the system — not a visual layout builder (report templates are HTML files, edited directly in code), but metadata management: which reports exist, which document type they're tied to, where their file lives, what parameters they have. ## Report list Columns: **Code** (internal report code), **Type** (Register / Report / Inquiry / Document), **Name**, **Doc Type** (which document type it belongs to, if it's a per-document report), **Path** (the path to the report's PHP file). The list is paginated. | Button | Action | |---|---| | **Add** | Register a new report — code, name (EN/RU), type, file path, document type | | **Edit** | Change the selected report's metadata | | **Params** | Configure the report's parameters — which fields show in the parameter dialog (period, warehouse, mode, etc.), their type and options | | **Delete** | Remove the report from the registry (the report file itself isn't deleted) | | **Close** | Close the window | This registry is exactly what determines which reports the user sees in the Reports (F5) section — a new report file with no entry here won't appear in any list. Anyone with access to this tool can view the registry, but adding, editing, deleting reports and changing their parameters is reserved for administrators — for other users the save is refused with "Admin access required". --- # Tools → Translations *[Screenshot: Translations]* Editing UI and printed-report translations into Russian and French — for keys that already exist. This screen **does not add or remove** keys: new base (English) keys appear automatically when new text in the code is wrapped for translation — this screen only edits translation quality. ## Usage 1. Search by the base (English) key — the **Search base key…** field. 2. Table: **Base Key (English)**, **Russian**, **French**. The list is paginated (over 1000 keys as of when this was documented). 3. Pick a row — editing fields appear below. 4. Change the translation, **Save**. | Field | Notes | |---|---| | **Base Key (read-only)** | The English key — not editable here | | **Russian** | The Russian translation | | **French** | The French translation | | **Save** | Save the translation changes | | **Close** | Close the window | Changes apply immediately across the whole UI and every printed report that uses this key (after the page is refreshed). --- # Directory — Reference Tables (F9) *[Screenshot: Directory menu]* The single access point to every reference table in the system — items, partners, warehouses, operations, categories, etc. Clicking **Directory [F9]** opens a dropdown list of 51+ reference tables (the list comes from the system's registry of reference tables and is loaded once at login; only tables in that registry can be opened). Picking a reference table opens it in the universal editor — the interface is identical for absolutely every reference table, no matter what it actually stores. ## The universal reference-table editor *[Screenshot: Reference table example]* Any reference table opens as a searchable table: - **Search** — filters by name, updates as you type. The counter on the right (e.g. `50/971`) shows "how many rows are shown / how many were found in total" — the table loads in chunks, not all at once. - The list shows the main name column; deleted records (see below) are shown in gray, struck through, but don't disappear from the list. | Button | Action | |---|---| | **New** | Create a new record — opens a form with all the reference table's fields | | **Edit** | Edit the selected record | | **Delete** | Flag the record as deleted (or restore it, if already deleted) — see below | | **Close** | Close the window | A few service tables — users, system settings, the report list, document-numbering counters, interface translations and internal data tables — can be changed only by an administrator; for other users saving is refused with "Admin access required". ### The record form (New / Edit) *[Screenshot: Edit form]* Form fields are generated automatically from the database table's structure — labels and field type (`(TEXT)`, `(NUMBER)`, `(DATE)`, etc.) are shown right on the form. Required fields are marked with a red asterisk. The exact same screen is also used when picking a reference value from within a document (e.g. picking a supplier on a receipt) — there, instead of **New/Edit/Delete**, the bottom shows **New/Select**, so a missing record can be created on the spot while filling in the document, without interrupting the work. ### Soft delete The **Delete** button doesn't physically erase anything — it sets a service "deleted" flag. A deleted record: - disappears from search when picking a value inside a document (it can no longer be picked for a new operation); - stays visible in the reference table itself (grayed out, struck through) — this doesn't harm the history of already-created documents referencing it; - can be restored — clicking **Delete** again on such a record clears the flag. Physically deleting records from reference tables isn't available through the UI — a deliberate decision, since reference tables are used as foreign keys across every operation, and deleting them retroactively would break history.