The Inventory sheet gives you a consolidated, per-product view of everything in your warehouse — combining goods-receipt lots from MySQL with open purchase order quantities into a single refreshable grid. Because each invoice deducts stock directly from theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/arsinousltd-sudo/Arsinous-V8-Sales/llms.txt
Use this file to discover all available pages before exploring further.
irs_items table at the lot level, the Inventory sheet always reflects your actual on-hand quantities the moment you refresh it. You can sort by ID or name, and filter out products with no stock to focus on what matters right now.
Data Sources
The Inventory sheet draws from two MySQL tables:irs_items is the goods receipt table — each row represents a batch (lot) of a product received into stock. pos_items is the purchase order items table — each row represents a quantity of a product on an open purchase order. Both tables must be populated in MySQL; Arsinous V8 Sales reads them but does not provide a UI for creating goods receipts or purchase orders directly.| Table | Key fields | Role in Inventory |
|---|---|---|
irs_items | product_id, lot, exp_date, in_stock, cost, final_cost | Provides on-hand stock per lot |
pos_items | product_id, quantity | Provides ordered (on PO) quantity |
products | id, name, cat | Provides product name and category |
The Inventory Sheet Layout
After a refresh, the sheet has two header rows followed by one data row per product.| Column | Field | Description |
|---|---|---|
| A | ✔ | Checkbox (data validation applied to A3:A) |
| B | id | Product ID |
| C | name | Product name |
| D | cat | Category |
| E | quantity | Total in-stock quantity across all lots |
| F | ordered (PO) | Total quantity on open purchase orders |
| G | expiry dates | All lots formatted as "<lot> <exp_date> (<in_stock>)", newline-separated |
| H | cost | Cost values per lot, newline-separated |
| I | final_cost | Final cost values per lot, newline-separated |
"Inventory" in column A, "updated:" label in column F, and the refresh timestamp in column G (written as ["Inventory","","","","","updated:", new Date(),"",""]). Row 2 is the column header row. Data rows start at row 3, which is also where checkbox validation (A3:A) is applied.
Refreshing the Inventory
Trigger a refresh in any of these ways:- Arsinous menu → Update Current Tab while the Inventory sheet is active
- Sidebar → Refresh Inventory button
- Programmatically by calling
updateInventory()— this is also called automatically after every invoice save or delete
How updateInventory Works
Parameters
When
true, products with no in-stock lots and no open purchase orders are excluded from the output. The preference is stored in user properties via readProperties() / updateProperty() and persists between sessions.Column index (0-based within the output array) to sort by. Use
1 to sort by product id, 2 to sort by name. Stored in user properties as orderCol.Expiry Date Display Format
When a product has multiple lots in stock, theexpiry dates column shows one line per lot, formatted as:
Return Value
updateInventory returns JSON.stringify({ message: "Updated." }) after writing the sheet. This lets callers (such as the sidebar) confirm that the operation completed successfully.
Editing a Product from Inventory
You don’t need to switch to the Products sheet to edit a product’s catalog details. Select any row in the Inventory sheet and choose Arsinous menu → Edit Product. TheeditProduct() function works from both the Products and Inventory sheets — it reads the active sheet’s header row to build the key map and opens the same 600 × 600 px product edit modal.
User Preferences Storage
ThehideEmpty and sortCol settings are persisted in Google Apps Script user properties so they survive sheet refreshes and browser sessions. They are read at the start of every updateInventory() call when no explicit arguments are passed, and can be updated through the sidebar controls.