# Inventory Scanner - User Guide

This guide explains how to use the Inventory Scanner in everyday language.

**Current stable app version: 1.4.0.** Person in Charge can be selected from saved profiles or added as a new person. Profiles are saved in this browser and remain when inventory records are cleared. This version requires three matching barcode reads of the same type within 1.8 seconds before saving a scan. The default repeat Scan Delay is 1.5 seconds; previously saved delay preferences are kept. It increments quantity only when the barcode, barcode type, person in charge, and stock action match; a different type, person, or action gets a separate row. Each accepted scan uses the current Person in Charge and Action fields, even if you change them while the camera is running. The Delete control is first in the table and appears only while Edit mode is active. The row-number column uses a compact default width. Rows per page defaults to 30 and accepts whole numbers from 10 to 100. Unused saved profiles can be removed; profiles referenced by records are protected. Undo restores a profile if it restores a record that references it. The version is shown at the bottom right of the page footer.

## Before you start

- Open the app in a modern web browser.
- The app needs camera permission to scan barcodes. If asked, choose **Allow**.
- The page must be hosted on a secure website (**HTTPS**) or on `localhost`. Opening the HTML file directly may not allow camera access.
- Keep an internet connection available so the barcode scanner can load.

Your records, settings, and person profiles are saved in this browser on this device. Clearing inventory does not remove person profiles. Data is not automatically copied to another device or browser. Export your records regularly if you need a separate backup.

## Add items by scanning

1. In **Person in Charge**, choose a previously saved name. To add someone, choose **Add a person...**, enter their name, and select **Use this name**. The new name is saved for future visits on this browser. To remove an unused saved profile, choose it and select the **X** beside the list, then confirm. The X is hidden while adding a name and disabled if any records use the selected profile. A person must be selected before scanning can start.
2. Choose an **Action**:
   - **Stock Take** - count or check the items you have.
   - **Stock In** - record items being added.
   - **Stock Out** - record items being taken out.
3. Open **Settings** with the gear button in the top-right corner to change **Scan Delay**. It starts at 1.5 seconds. You can set it to 1 second or more in half-second steps. This delay starts after a successful scan and does not slow down the first scan; a different barcode can be scanned immediately.
4. Select **Start Scan** and point the camera at a barcode.
5. Fit the whole barcode inside the on-screen guide. A successful scan is confirmed with a message and, if your device supports them, a sound and vibration.
6. Select **Cancel Scan** when you are finished.

The barcode has to be inside the guide to be read. The camera must decode the same barcode in the same format three times within 1.8 seconds before the app accepts it; reads that do not match are ignored. With the current 200 ms decode interval, this confirmation typically adds about 0.4 seconds after the first clear decode under ideal conditions. The scanner searches the formats supported by ZXing, including common retail, shipping, and 2D formats, and supports Code 39 extended characters. It rejects certain invalid numeric codes. Recognition depends on camera quality, focus, lighting, and barcode condition.

### While scanning

- **Auto-Stop**: Turn this on before scanning if you want the camera to stop after the first successful scan. Leave it off to keep scanning. The Scan Delay prevents the same barcode from being counted again immediately, but does not block a different barcode. Rescanning the same barcode takes at least the selected delay plus confirmation time.
- **Torch**: If your camera supports a light, use this control to turn it on or off.
- **Zoom**: If your camera supports zoom, use the slider to bring the barcode closer.

Torch and zoom controls only appear when the active camera reports that it supports them. The preview is also slightly magnified automatically.

### How scan counts are grouped

Scans with the same barcode, barcode type, person, and action are grouped into one row. Each matching repeat scan adds one to that row's quantity. If the type, person, or action is different, the scan creates a separate row. Each row keeps the type and time from its first entry.

The person and action are read from the fields when each scan is accepted. You can change either while the camera is running; subsequent accepted scans use the updated values.

## Read and find your records

Each row shows:

- **Barcode** - the scanned code.
- **Type** - the kind of barcode the scanner read.
- **Quantity** - how many times that barcode was scanned.
- **Action** - Stock Take, Stock In, or Stock Out.
- **Person** - who was in charge.
- **Time** - when the row was first created.
- **Delete** - removes that row.

The totals below the table include all records, even while a search is filtering the table:

- **Total Items** is the number of rows in the table.
- **Total Quantity** is the sum of the quantities in those rows.
- The breakdown groups quantities by person and action, with each person on a separate line, for example `YAP - Stock Take: 2, Stock In: 3`.

- **Search**: Type a word or number to find matching records. Search checks the barcode, type, quantity, action, person, and time. Use the **X** button to clear the search.
- **Sort**: Select a sortable column heading, such as Barcode or Quantity, to sort by that column. Select it again to reverse the order.
- **Columns**: Open **Settings** with the gear button in the top-right corner to show or hide any table column except Delete. Drag a column heading's right-hand divider to resize it, or focus the divider and use the left/right arrow keys. Column visibility and widths are saved in this browser.
- **Pagination**: Open **Settings** and enter a whole-number **Rows per page** value from 10 to 100. Previous/Next controls appear only when the matching results exceed that number. Search and sorting apply across all matches; totals continue to include every record.
- **Small screens**: The table may need horizontal scrolling. Hide columns or resize them to make it easier to read.

## Edit, undo, and remove records

### Edit quantities or actions

1. Select **Edit**. The button changes to **Done Editing**.
2. Change a row's **Quantity** or choose a different **Action**.
3. Select **Done Editing** to leave edit mode.

Quantity must be a whole number of at least 1. If you change an action to one that already has a row for the same barcode and person, the app combines the quantities into that existing row.

Manual quantity and action changes are recorded in the edit log, which is included in exports when it contains changes. Deleting a row is not added to this log.

### Delete a row

Select **Edit** to reveal the Delete column, which is first in the table. Select the **X** beside the row you want to remove. If other rows remain, you can use **Undo** to restore the deletion. If you delete the last row, undo is no longer available.

### Undo

Select **Undo** to reverse the most recent scan, edit, or deletion. If undoing a deletion restores a record whose profile was removed, that profile is restored too. Undo can go back through up to 50 recent actions during the current page session. Undo history is lost when you reload or close the page.

### Clear everything

Select **Clear** to remove all records. A confirmation dialog matching the app's theme appears before anything is removed. Clearing also removes the edit log and undo history, and cannot be undone. Export anything you want to keep before clearing.

## Export or share your records

Export buttons are available when the table has records.

- **Export to Excel** creates an `.xlsx` file with a **Records** sheet. If there are manual edits, it also includes an **Edit Log** sheet.
- **Export to CSV** creates a records file. If there are manual edits, it creates a second file for the edit log.
- Record exports contain Barcode, Type, Quantity, Action, Person, and Time. The edit log shows what field changed, its old and new values, who made the change, and when.

After choosing an export format:

- Select **Download** to save the file or files to your device.
- Select **Share or save to cloud** to open your device's sharing menu, if your browser supports sharing files. Choose an available app or destination there. The app does not upload directly to a cloud service.
- Select **Cancel** to close the export window without downloading or sharing.

File sharing depends on your device and browser. If sharing is not available, download the files and attach them manually. On Android, Chrome may not share Excel files from a website; download the Excel file and share it from your Files app instead. Sharing generally needs the site to be open directly in a browser over HTTPS, not inside another app.

**CSV tip:** Spreadsheet apps may remove leading zeroes from barcodes or show long barcodes in scientific notation. When importing a CSV into a spreadsheet, set the Barcode column to **Text**.

## Settings and saved data

Select the gear button in the top-right corner to change Scan Delay, choose Rows per page, or choose which table columns to show. The page-size preference is saved in this browser. The Settings window also has links to open the README and this User Guide in separate tabs.

The person name, selected action, scan delay, records, and edit log are saved automatically in the browser. The app does not sync data between devices. Clearing the browser's site data may remove saved records, so export important information for safekeeping.

## If something is not working

- **The camera will not start:** Allow camera access in the browser, close other apps that may be using the camera, and check that the page is on HTTPS or `localhost`.
- **The barcode will not scan:** Put the whole barcode inside the on-screen guide, improve the lighting, hold the camera steady, and make sure the barcode is not damaged. Try the torch or zoom if those controls are available.
- **There is no torch or zoom control:** The current camera or browser does not report support for that feature.
- **Scanning or Excel export will not load:** Check your internet connection and reload the page.
- **Saved records are missing:** Check that you are using the same browser and device as before. The app saves records locally and does not sync them.
