# Features — sawis (SAWIS Online)

Evidence date: 2026-10-04.

Source: `dev_2020` at `069966f` (2026-09-14). Page scripts live at the repository root. Domain classes live in `includes/`. Member-facing twins use the `my.` prefix.

Status meanings:

- **Current** — script and class exist on this tip and are wired as a page.
- **Completed** — a dated comment or `NewKnowledgeBase.md` note describes a change that is in this tip.
- **In development** — a remote branch name exists and was not proven to be merged. The branch was not diffed.
- **Deprecated / unused in the running path** — file or code path present, but not selected by the current boot or UI.

There is no feature flag file. “Planned” items are branch names only.

## Identity and access

| Feature | Status | Where |
|---|---|---|
| Email and password login via SAWIS API `loginUser` | Current | `index.php` |
| Hash re-entry for Admin Dev and Sawis Admin | Current | `index.php`, `login.token.php` |
| Password reset through API `setPassword` | Current | `resetPassword.php` |
| Load registration draft when member status is `1.0 - New` | Current | `index.php` |
| IP block insert after repeated login failures | Current | `index.php`, `ip.block.php`, `includes/ip.block.cls.php` |
| Security groups and per-entity view/save/delete/special | Current | `security.group.php`, `_framework/_nemo.menu.cls.php` |
| User administration | Current | `user.php`, `includes/user.cls.php` |
| Member-scoped user administration (Superuser / Member User dropdown) | Current | `my.user.php` |
| User roles page | Current | `user.roles.php` |
| Switch member or user, username prefixed `pp.` | Current | `home.php` |
| Switch company | Current | `switch.company.php` |
| Cellar access list | Current | `cellar.access.php` |
| Pilot group gate (`blnAllowStockMovement`) | Current | `system.php`, `pilot.group.php` |
| Sawis View Only hides mutate buttons | Current | Comments and button flags on `member.php`, `member.pending.php`, `ws.php`, `single.vineyard.php`, `member.relationship.pending.php` |
| Under-construction logout | Current | `system.php`, `server.error.php` |
| Database sync lock (60 second wait) | Current | `system.php` |
| Navigation logging and analytics dashboard | Current | `system.php` `Global_LogUserNavigation`, `user.navigation.analytics.report.php` |
| Usage log page | Current | `usage.log.php` |

## Membership, farms, vineyards

| Feature | Status | Where |
|---|---|---|
| Member registration wizard (new, link, change of ownership) | Current | `registration.member.php`, `includes/member.registration.cls.php` |
| Membership types CELPVT, CELPRD, CELWSL, WSLPRD, WSLDIS, BOTCEL, JUICEL, MFRCON, WSLEXP, WSL000, JUI000, EXP000, CERPVT, FRM000 | Current | Same class, English labels |
| Member profile and member maintenance | Current | `member.php`, `member.profile.php`, `my.profile.php` |
| Pending member approval | Current | `member.pending.php` |
| Member lookup | Current | `member.lookup.php` |
| Member types catalogue | Current | `member.type.php` |
| Business and member relationships, including pending and access | Current | `business.relationship.php`, `member.relationship.php`, `member.relationship.pending.php`, `member.relationship.access.php`, `member.relationship.gael.php` |
| Linked members | Current | `linked.members.php`, `my.linked.members.php` |
| Farm registration and farm maintenance | Current | `registration.farm.php`, `farm.php`, `my.farms.php` |
| Pending farm, subdivision, transfer | Current | `farm.pending.php`, `farm.pending.subdivision.php`, `farm.pending.transfer.php` |
| Vineyard blocks, direct block edit, subdivision | Current | `block.php`, `block.direct.php`, `subdivision.blocks.php`, `registration.blocks.php`, `my.block.php` |
| Block year rollover and SAWIS 1 PDF | Completed (comments 2017) | `includes/block.cls.php`, `documents/SAWIS_1_Reports/` |
| Single vineyard and pending approval | Current | `single.vineyard.php`, `single.vineyard.pending.php`, `registration.SingleVineyard.php`, `my.single.vineyard.php` |
| Cultivar, rootstock, trellising, irrigation catalogues | Current | `cultivar.php`, `rootstock.php`, `trellising.php`, `irrigation.php` |
| Title and title deed | Current | `title.php`, `title.deed.php` |
| Region maintenance (two class variants) | Current | `region.hdp.php`, `region.jd.php`, `includes/region.cls.hdp.php`, `includes/region.cls.jd.php` |
| Geo and location | Current | `geo.php`, `location.php` |
| Farm map via Stellenbosch sungis | Current | `my.farms.php`, `forsilicon.html` |
| Documents attached to members and farms | Current | `document.php`, `includes/document.cls.php` |

## Cellar operations

| Feature | Status | Where |
|---|---|---|
| BG1 harvest declaration, IPW, wine descriptor | Current | `BG1.php` |
| Harvest loads, WS-driven cultivar autofill | Current | `loads.php`, `my.loads.php`, `ajaxfunctions.php` |
| Tank register, movable tanks, inspector surplus | Current | `tanks.php`, `my.tanks.php`, `includes/tanks.cls.php` |
| Tank types | Current | `tank.type.php` |
| Stock movement and output-tank picker | Current | `stock.movement.php`, `ajax.TankRegister.php` |
| Press register | Current | `press.register.php` |
| Loss list with full-set difference total | Current | `loss.php`, `my.loss.php` |
| Blend sandbox and “my” manage screen | Current | `blend.sandbox.php`, `blend.sandbox.manage.php`, `my.blend.sandbox.manage.php`, `ajax.BlendSandbox.php` |
| Blend master | Current | `blend.master.php`, `doBlend.php`, `BlendMasterQuery.txt` |
| WS numbers and WS transactions | Current | `ws.php`, `ws.notice.php`, `ws.transactions.php`, `member.ws.php`, `my.ws.php` |
| WSB numbers and WSB transactions | Current | `wsb.numbers.php`, `wsb.transactions.php` |
| WSB traceability diagram (dendrogram or list) plus mapper lookup | Current | `wsb.number.traceability.php`, `get.and.store.wsb.number.traceability.data.php`, `dendrogram.php` |
| Wine type and content allocation (SARS documents) | Current | `wine.type.php`, `wine.type.content.allocation.php`, `my.wine.type.content.allocation.php` |
| Bottling applications and special WSB check | Current | `bottling.applications.php`, `my.bottling.applications.php` |
| Duties and duties Excel export | Current | `duties.php`, `my.duties.php`, `js/jsDuties.js` |
| Wine transfers and inspector audit | Current | `wine.transfers.php`, `my.wine.transfers.php` |
| Bulk exports | Current | `bulk.exports.php` |
| Industrial content | Current | `industrial.content.php` |
| Activity report | Current | `activity.php` |
| Revert movement | Current | `revert.movement.php` |
| Warning codes | Current | `warning.codes.php` |
| Process logic rules with approve step | Current | `process.logic.rules.php` |
| Manual processes | Current | `manual.processes.php` |
| Stocktake report | Current | `stocktake.report.php` |

## Reports

| Report | Who sees it on `report.php` | Class / include |
|---|---|---|
| Harvest Report | Admin (group 1 or 2) | `includes/rpt.harvest.rpt.php` |
| Fortification Report | Admin and member | `includes/rpt.fortification.rpt.php` |
| Tank Walkthrough List | Admin and member | `includes/rpt.tank.walkthrough.list.rpt.php` |
| Sawis 10 | Admin | `includes/rpt.sawis.ten.rpt.php` |
| Sawis 5 | Admin | `includes/rpt.sawis.five.rpt.php` |
| Tonnage per Farm | Admin (member copy is commented out) | `includes/rpt.tonnage.per.farm.rpt.php` |
| Block Totals | Admin (member copy is commented out) | `includes/rpt.block.totals.rpt.php`, also `rpt.block.totals.per.farm.rpt.php`, `rpt.block.totals.per.region.rpt.php` |
| WS WSB Transactions | Admin and member | `includes/rpt.ws.wsb.transactions.rpt.php` |
| Cellar Stock Per Farm | Admin | `includes/rpt.cellar.stock.per.farm.cls.php` |
| Cellar Stock Per Cultivar | Admin | `includes/rpt.cellar.stock.per.cultivar.cls.php` |
| Tonnage per Hectare | Commented out | `includes/rpt.tonnage.per.hectare.rpt.php` |
| Litres per Tonne | Commented out | `includes/rpt.litres.per.tonne.rpt.php` |
| Content per wine type | Standalone page, admin gate | `rpt.content.per.wine.type.php` |
| Content per WS number | Standalone page, admin gate | `rpt.content.per.ws.number.php` |
| Checklist report | Standalone page | `checklist.report.php` |
| Block report | Standalone page | `block.report.php` |
| User navigation analytics | Standalone page | `user.navigation.analytics.report.php` |

## Communications and help

| Feature | Status | Where |
|---|---|---|
| Email log | Current | `email.php` |
| Email templates | Current | `email.template.php` |
| Read-online and read-receipt pixels | Current | `email.read.online.php`, `email.read.receipt.php` |
| FAQ maintenance and public console | Current | `faq.php`, `faq.console.php`, `faq.console.public.php` |
| FAQ console old class kept beside the new one | Deprecated file | `includes/faq.console.cls.old.php`, `faq.console.old.php` |
| Tickets | Current | `ticket.php`, `my.ticket.php` |
| Messages | Current | `message.php` |
| Settings screen | Current | `settings.php` |
| Vendors | Current | `vendor.php` |
| SMTP test script | Current as a script; not a product screen | `smtp.test.php` |

## Housekeeping and files

| Feature | Status | Where |
|---|---|---|
| Daily user-company-group maintenance | Current | `_cron.daily.php` `maintainUCG` |
| Daily SARS packhouse-number reminder | Current, member notify defaults off | `_cron.daily.php` |
| Tank unlock after 30 minutes | Deprecated (commented out) | `_cron.daily.php` |
| QA git deploy script | Current as a file; exposure **Requires Confirmation** | `deploy.php` |
| Shared pagination (page size 100) | Completed 2025-12-03 | `Sauer_Pagination_Library/` |
| PDF generation | Current | Composer `mpdf/mpdf` ^8.2, vendored `dompdf` and `fpdi` |
| Spreadsheet generation | Current | Vendored `PHPExcel/`, `Excel/` |
| Uploaded documents | Current | `documents/` (`BlendSandboxReports`, `FAQ`, `SAWIS_1_Reports`, `SAWIS_6_Documents`, `Signed_SAWIS_6_Documents`, `TankCalibrationCert`, `Inspector_Audit_Documents` noted in the knowledge log) |
| Profile pictures | Current | `profilepictures/` |
| Custom script error log | Current | `custom.script.error.log.php`, `clear.custom.script.error.php` |
| SonarQube scan | Current | `bitbucket-pipelines.yml`, `sonar-project.properties` (`sonar.projectKey=SAWIS`) |

## Recently changed (notes on this tip)

From `NewKnowledgeBase.md`, newest first. These are developer notes, not a changelog approved by the product owner.

| Date | Change |
|---|---|
| 2026-02-02 | Duties Excel export alignment for four numeric columns (`js/jsDuties.js`) |
| 2026-01-30 | Blend sandbox single-vineyard warning rules |
| 2026-01-29 | Bottling special WSB lookup limited to the same tank |
| 2026-01-27 | `blnInitialFinalLitres` on input tank registers when output is finalised |
| 2026-01-26 | Add Load fills cultivar when a non-single-vineyard WS has one cultivar |
| 2026-01-25 | Navigation analytics reads logs in batches |
| 2026-01-21 | Blend source tank that is also an output stays open; activity report date sort |
| 2026-01-04 to 2026-01-08 | Analytics labels, dashboard default, security-group filter, stock-movement dropdown order, crush status list |
| 2025-12-01 to 2025-12-03 | Movable tank id parsing, shared pagination, safer wine-type SQL quoting |
| 2025-11-27 | Inspector audit uploads accept wine or tank context |

The branch tip itself (2026-09-14) is a merge of `PHP_UPGRADE_8.2_2025_NEW_FEB25` (pull request #1747). PHP 8.2 comments exist in `project.functions.inc.php`. That is a platform change, not a new product feature.

## In development (remote branch names only)

Not inspected. Do not treat as committed scope.

| Branch | Name suggests |
|---|---|
| `feature/20260623-Russel-SendEmailViaSMTP` | Sending mail through SMTP |
| `feature/20260701-Russel-blnInitialFinalLitresChanges` | Further initial/final litre behaviour. A version of the flag is already noted on `dev_2020` |
| `feature/640-my-tanks-list`, `feature/640-my-tanks-list-2` | My Tanks list |
| `feature/ET2023*` | Older 2023 ticket branches. Many tips exist. Merge state **Unknown** |

## Removed or left behind

| Item | Evidence |
|---|---|
| Under-construction redirect inside `index.php` | Condition ends with `&& false` |
| Tank auto-unlock cron | SQL commented out |
| Member copies of tonnage, litres-per-tonne, and block-totals reports | `addReport` calls commented out in `report.php` |
| `includes/tanks.cls.php.old` | Old class file kept next to `tanks.cls.php` |
| `my.profile.php.20180316`, `user.php.20180316` | Dated copies |
| `market.place.disabled.php` and `includes/market.place.cls.php` | Filename says disabled. Class still exists. Whether any menu points at it is **Unknown** (menu is in the database) |
| `system.server.LOCAL.php` | Not selected by `system.php` |
| NuSOAP / unused calculator WSDL | Not part of this repository’s root. The API repo documents a similar leftover. This web repo vendors PDF libraries instead |

## Not a feature of this repository

Login token issue, vendor records, and `createUser` live in `sawis_api`. This application only calls `authenticate`, `loginUser`, and `setPassword`.
