# Features — pernod_ricard

Evidence date: 2026-10-07.

Source: `master` at `24c1e12` (2020-11-18).

Menu labels are stored in MySQL (`sysMenuLevel1`, `sysMenuLevel2`). This list is the page scripts and the actions those scripts implement. A page can exist in the tree and still be absent from a user's menu.

## Current features

### Site entry

| Feature | Status | Where |
|---|---|---|
| Force HTTPS | Implemented | Root `.htaccess`, `supplier/.htaccess`, `webadmin/.htaccess` |
| Root URL redirects to the supplier host | Implemented | `index.php` sends the browser to `http://www.prsa-supplierportal.co.za/supplier` |

### Supplier portal (`supplier/`)

| Feature | Status | Where |
|---|---|---|
| Email and password login | Implemented | `supplier/login.php` |
| Forgot password | Implemented | Login page posts to `supplier/ajaxfunctions.php`, template "Reset Password" |
| Help desk mailto | Implemented | `mailto:helpdesk@xprocure.com` |
| Terms and conditions when `blnTCAccepted` is 0 | Implemented | `supplier/index.php`. Link to `documents/TC/TCs - PR SA Supplier Portal.pdf` |
| Forced password change when `checkExpiry` returns false | Implemented | `supplier/index.php` with `NemoPassword` |
| Invoice list limited to the signed-in company when `blnSpecial` is 0 | Implemented | `supplier/includes/my.invoice.cls.php` |
| Create and edit own invoices | Implemented | `supplier/my.invoice.php` |
| Upload invoice file and a typed other file (credit note, GR, purchase order, statement, other) | Implemented | `MyInvoice::Save` |
| On-screen invoice checklist | Implemented | `supplier/my.invoice.php` |
| VAT-inclusive amount confirmation | Implemented | `onblur` on `dblInvoiceAmountExcluding` |
| Submit Invoice button | Implemented as a control only | Toolbar on the edit form. No action handler |
| Hide edit and upload when status is `Paid` | Implemented | Status switch in `supplier/my.invoice.php` |
| Soft-delete an unpaid invoice | Implemented | `blnDeleted = 1` |
| Payment list on the invoice | Implemented | `supplier/includes/my.payment.cls.php` |
| Remittance list on the invoice | Implemented | Includes `webadmin/includes/remittance.cls.php` |
| My profile | Implemented | `supplier/my.profile.php` |
| Reports page | Implemented | `supplier/report.php` includes `webadmin/includes/{report}.php` |
| Messages page | Implemented | `supplier/message.php` |
| Excel export of the invoice list | Implemented | `Action=Export` |

`supplier/includes/faq.cls.php` defines an `FAQ` list class. No supplier page includes that class. Provenance: **Implemented** as an unused class in this tree.

### Webadmin (`webadmin/`)

| Feature | Status | Where |
|---|---|---|
| Email and password login | Implemented | `webadmin/login.php` |
| Refuse security group 10 | Implemented | Redirect to the supplier portal |
| Forgot password | Implemented | `webadmin/ajaxfunctions.php`, template "Reset Password" |
| Terms and password form is built, then discarded | Implemented | `webadmin/index.php` fills `$page->Content` when terms are missing or `checkExpiry("User", $_SESSION[SUPPLIER]->ID)` is false, then always replaces that content with `getDashboard` |
| Dashboard of Due, Overdue, and Paid invoices | Implemented | `getDashboard` in `webadmin/project.functions.inc.php`. Paid rows are limited to the last 6 weeks. Due and Overdue rows are not. The call passes `blnSpecial` into the parameter named `$frDepartment` |
| Invoice list, edit, export to Excel | Implemented | `webadmin/invoice.php` |
| Pay one invoice or a selected set, with confirmation | Implemented | `Invoice::PayInvoices`. Button shown when security group id is `<= 3` |
| Undo payment back to status `New` | Implemented | Button shown when group id is `<= 2` and status is `Paid` |
| Query an invoice by email | Implemented | `Invoice::sendQuery`, template "Invoice Query" |
| Email "Invoice Paid" | Implemented | `Invoice::sendInvoicePaid` |
| Soft-delete an unpaid invoice | Implemented | `blnDeleted = 1` |
| Suppliers, including welcome email | Implemented | `webadmin/supplier.php`, `webadmin/includes/supplier.cls.php` |
| Welcome email with a generated password | Implemented | Template "Send Welcome Email". Password date stored as `2010-01-01` |
| Users, profile, password reset | Implemented | `webadmin/user.php`, `webadmin/my.profile.php`, `webadmin/resetPassword.php` |
| Security groups and menu permissions | Implemented | `webadmin/security.group.php` |
| Settings | Implemented | `webadmin/settings.php` reads and writes `sysSettings` |
| AP teams | Implemented | `webadmin/APTeam.php`, `webadmin/includes/APTeam.cls.php` |
| Remittances | Implemented | `webadmin/remittance.php` |
| Payments list | Implemented | `webadmin/includes/payment.cls.php` |
| Reports: Supplier Invoice Report, Payments Exception Report | Implemented | `webadmin/report.php` |
| Email log and templates | Implemented | `webadmin/email.php`, `webadmin/email.template.php` |
| Email read receipt | Implemented | `webadmin/email.read.receipt.php` |
| FAQ maintenance | Implemented | `webadmin/faq.php` |
| Direct document links | Implemented | Invoice file fields point at `SUPPLIER_Document_Path` plus the file name when the file exists. No separate download gateway was found |

### Scheduled work

| Feature | Status | Where |
|---|---|---|
| Import JDE payment CSV and mark invoices paid or partial | Implemented | `cron.daily.php` task 5, `import.payments.CSV.cls.php`. FTP download is commented out |
| Build paid-invoice emails and mark payments processed | Implemented, send call commented out | Task 6, template "Paid Invoices to Supplier" |
| Email the payments exception report | Implemented when the report has rows | Task 7 |
| Assign invoice due dates from supplier terms | Implemented | Task 1 |
| Move invoices to Due and Overdue | Implemented | Task 2. Skips status `Paid` and deleted rows. Does not skip `Partial Payment` |
| Email due and overdue lists | Implemented | Task 3 |
| Deactivate inactive supplier users | Not on the default path | Task 4 is inside `Action=TESTING` and the SQL is commented out |

### Deployment

| Feature | Status | Where |
|---|---|---|
| FTP deploy of `master` to QA | Implemented in pipeline config | `git ftp push` to `ftp://$FTP_HOST_QA/public_html/prsa.overdriveqa.co.za` |
| `development` branch init-only FTP step | Present in the YAML. The branch is not on the remote | Push line is commented. Path has no `public_html` |
| Exclude the pipeline file from FTP upload | Implemented | `.git-ftp-ignore` |

## Planned features

No roadmap, ticket, or TODO marks a feature as planned after `24c1e12`.

The commit message "added submit button to submit invoice to JDE" describes an outcome the button does not perform. Treat the JDE submit as **not implemented** in this repository, not as a planned item with an owner.

## In development

Nothing in the Git history is an open branch. `master` is the only remote branch, and its tip is a pipeline edit on 2020-11-18.

## Recently changed

Relative to the initial commit `9d529ab` (2020-11-16), the application commits on 2020-11-18 are the submit button. `git show e6500d1` changes two lines in `supplier/my.invoice.php`. The same message is repeated on `f919cbd`, `52579f3`, and `e6500d1`. The rest of that day is `bitbucket-pipelines.yml`.

Comments inside the PHP describe earlier product changes (password policy in 2016, Phase 2 payments in 2018) that arrived in Git already present in the initial commit. Those comments are history of the code, not commits in this repository.

## Deprecated or removed

| Item | Evidence |
|---|---|
| MD5 password login | Commented out in both login pages. Comment: the event was never used because `strPassword` is not on `sysUser` |
| Separate upload buttons for purchase order and GR | Commented out. Those file types are options on the single "other file" dropdown |
| Supplier "send query" | `MyInvoice::sendQuery` is commented out. Webadmin still sends "Invoice Query" |
| Task 4 account suspension | Comment describes it. The running SQL is commented out |
| Older QA database block | Commented block in `supplier/system.php` for `dev.overdrive.co.za` using `cmysql5-5.wadns.net` and database `sil27_pernodricard_2016`. The active block uses `sql47.jnb1.host-h.net` |

## Not in this repository

| Item | Evidence |
|---|---|
| Supplier one-time code after password | No `login2fa` page |
| Microsoft sign-in | No OAuth callback |
| JDE invoice submission | No client call. Button only |
| SonarQube project file and scan script | Named by the onboarding scan. Absent from `24c1e12` |
| Automated tests | No test suite for the portal |
