# Features — snell-freestock-5.6 (Freestock Requisition)

Evidence date: 2026-10-02. Source: `main` at `812337f` (2025-06-13).

Status words: **Current** means present on `main` and reachable from a page or include that a page loads. **Dormant** means present but unused, commented out, or hidden. **Superseded copy** means an older file kept beside the live one.

## Current

### Login shell

`index.php` redirects to `login.php`. Login layout shows the Snell logo, the title Freestock Requisition, a message area, and a Login button. No credential fields.

Evidence: `index.php`, `login.php`, `include/layout.login.inc.php`, `include/layout.header.inc.php`.

### Internet Explorer block

On the login page only, IE 6–11 sets an error and skips `LogginUser`.

Evidence: `login.php`.

### Authorisation list

Menu label "Authorisation List". Filters and a sortable table of requisitions with a rounded total footer.

Evidence: `requisition.php`, `include/requisition.cls.php` `getFilters`, `getList`.

### New and edit requisition

Menu "New Requisition". Form for request type, Marketing/Sales expense, region, bill-to, ship-to, search, detail, contact name, contact number, delivery or collect, and product lines.

Header shows pink-slip number, status, and mailto links for Man / Alt / Exc from `vieRequsitionManager`.

Evidence: `requisitionForm.php`, `Requisition::Save`.

### Product lines

Add Item clones a hidden row. Brand comes from `mstBrand`. Product and prices come from `dwdProduct` through `ajax.functions.php`. Remove Item deletes `fsrItem` by id. The remove link is hidden when `$permissionEditRadio` is `display:none`.

Evidence: `requisitionForm.php` `jsAddItem`, `jsReloadProducts`; `Requisition::RemoveItem`.

### Submit, approve, decline

Buttons on the form. Submit and Approve enqueue `sysCronJob`. Decline and the hidden Cancel action update status and mark cron rows Removed.

Evidence: `requisitionForm.php` switch; `Requisition::Submit`, `Approve`, `Decline`, `Cancel`.

### User administration

List, status filter, New, edit form, Make Inactive. Menu link only when `blnSpecial = 1`.

Evidence: `user.php`, `include/user.cls.php`, `include/layout.menu.inc.php`.

### Logout

Menu "Logout: {user name}" posts `Action=Logout` and shows a logged-out label.

Evidence: `logout.php`.

### Usage log

Successful login inserts `mstUsageLog`.

Evidence: `LogginUser` in `include/system.functions.inc.php`.

### XML account and product lookup

| `type` | Query |
|---|---|
| `ajaxSearchShipToAccountXML` | Active `dwdCustomer` in the region whose number or name matches the search, plus the current customer |
| `ajaxLoadRegionBillToAccountsXML` | Active promotional customers in the region, plus the current customer |
| `ajaxLoadRegionShipToAccountsXML` | Active customers in the region, plus the current customer |
| `ajaxReloadProductsXML` | Active `dwdProduct` rows for the brand (`'` stripped). The second argument passed from the form is ignored |

Response is XML wrapped by `parseXmlRow` (`urlencode` on values). `&` is rewritten to `&amp;` before output. A comment in the file mentions `SearchArticles` and `mod.note.php`. Neither exists in this tree.

Evidence: `ajax.functions.php`.

## Recently changed (git, June 2025)

Bitbucket history before 2025-06-05 does not exist. Older behaviour is only in comments and in the superseded files.

| Date | Commit | What changed |
|---|---|---|
| 2025-06-06 | `963515c` | User list gained an active filter, an Active column, and "Make Inactive" instead of a hard delete path. Requisition filter session access and parts of `requisitionForm.php` and `system.inc.php` were edited in the same commit |
| 2025-06-06 | `b196a4c` | Inactive-user function fix in `user.cls.php` and `user.php` |
| 2025-06-13 | `812337f` | Filter session keys put back on `$_SESSION[PAGES]->Page[$_SERVER[SCRIPT_NAME]]` after an object-property attempt in `963515c` |

`iniFilters()` in `system.functions.inc.php` still writes filters with quoted keys (`$_SESSION["PAGES"]->Page[$scriptName]->Filters`). The requisition class reads them without quotes (`$_SESSION[PAGES]->Page[$_SERVER[SCRIPT_NAME]]`). In PHP those are the same key. Provenance: **Implemented**.

## Dormant

### adLDAP

`login.php` and the email-link branch of `requisitionForm.php` `require_once` `ldap/adLDAP.php`. The constructor call is commented out. No page reads AD groups.

Evidence: `login.php`, `ldap/adLDAP.php`.

### Cancel requisition button

`Requisition::Cancel` is wired to `Action` "Cancel Requisition". The button style includes `display: none`.

Evidence: `requisitionForm.php` line comment "20150208 - hiding the cancel button".

### `checkLogin`

IP-to-session comparison. No caller.

Evidence: `include/system.functions.inc.php`.

### Cookie `ckyFSR`

`$koekkie` and `$intCookieTime` are set. The cookie read in `checkLogin` is commented out.

### `User::getList_old`

Previous user grid without the active filter and without the alt-manager column. `user.php` calls `getList()`.

### `test.php`

Diagnostic page: counts `sysQuery`, prints URL-encoding samples for "CAFÉ", and posts a hard-coded region `KZN` to the ship-to AJAX helper. It uses the login layout, so it does not require `$_SESSION[USER]`. Not a test suite.

### Commented SMTP settings

`test.php` and `system.inc.php` contain commented `ini_set("SMTP", ...)` lines, including addresses `192.168.100.1` and `196.31.219.114`. No live mail function uses them.

### Delivery date and physical address

A new unsaved requisition object sets `dtDelivereyDate` (spelled that way) and `txtPhysicalAddress` to empty strings. The form HTML has no inputs for them. `blnDelivery` does have Delivery / Collect radios. Whether those two columns still exist on `fsrRequisition` is **Unknown** (the form never posts them; `sqlObject` only updates posted fields that match real columns).

### Invoice number and alt-manager email timestamp

Selected in the list query (`strInvoiceNumber`) or explicitly unset before save (`strInvoiceNumber`, `dtEmailSentToAltManager`). No form control writes them.

## Superseded copies (still in `main`)

| File | Notes |
|---|---|
| `requisitionFormold.php` | Older form. Not linked from the menu |
| `include/requisition.cls.20210503.php` | Snapshot dated in the filename. Live class is `include/requisition.cls.php` |
| `include/user.clsold.php` | Older user class |
| `include/database/sql_object.clsold.php` | Older SQL helper. Live class is `sql_object.cls.php` |

`layout.login.inc.php` contains a commented RGBC logo block. `include/images/rgbc_logo.jpg` is still in the tree. The header favicon and banner use `include/images/snell_logo.jpg`.

## Planned

No TODO, roadmap, or issue list in the repository describes unfinished features. **Unknown / Requires Confirmation** whether any work is planned outside this tree.

## Removed

Git does not show a feature being deleted after the 2025-06-05 import. Comments record behaviour that was turned off in place (cancel button, contact required checks, adLDAP constructor) rather than removed from history.

## Not in this repository

- Cron processor for `FSR_NewRequisition` and `FSR_RequisitionApproved`.
- A screen that sets status `Completed` or captures an invoice number.
- Sonar project files named in the onboarding scan (`sonar-project.properties`, `sonarqube_scan.bat`).
