# Features — snell-crondaily

Evidence date: 2026-10-03. Revision: `master` `60aeb26` (2023-11-17).

No feature list exists in the source repository. Status below is from the VB project, `App.config`, the form designer, and git history.

Planned features: **none are written down**. Commented blocks are inactive code, not a backlog.

## Current features

| Feature | Status | Where |
|---|---|---|
| Windows Forms host titled Snell CronDaily | Current | `frmMain.Designer.vb` |
| Footer `SNELL CronDaily Version 1.{build}.{revision} - 17 Nov 2023` | Current. Assembly `1.0.1.1` displays 1.1.1 | `frmMain_Load`, `AssemblyInfo.vb` |
| Run once and close when setting `Debug` is false | Current in code. Value in git is `True`, so this path is not what a build of `App.config` does | `frmMain_Load` |
| Leave the form open and wait for Run when setting `Debug` is true | Current for the committed config | `frmMain_Load`, `btnRun` |
| Email Log button, independent of Run | Current | `btnEmailLog` |
| Customer and Product checkboxes, both default checked | Current | `frmMain.Designer.vb` |
| Single-instance application | Current | `My Project/Application.myapp` |
| Show Imports, Imported, and Exports paths | Current. Paths are `{exe}` plus those folder names | `frmMain_Load` |
| Copy `pda_crm.txt` from the download folder into `Imports\` | Current | `Process.DownloadFile` |
| Copy `pdaprod.txt` the same way | Current | same |
| Accept `.txt` and `.csv` only | Current | `Process.CheckLocalFile` |
| Truncate `stgCustomer` / `stgProduct` and insert parsed rows | Current | `ClearStagingTable`, `sqlInsertStaging` |
| Customer: 22 header fields, required code, name, channel, region | Current | `Customer_Process.sqlInsertStaging` |
| Customer code stored from the last 7 characters, cast to integer | Current | same |
| Product: code, name, category, brand, case price, bottle price | Current | `Product_Process.sqlInsertStaging` |
| Product code stored from the last 6 characters, cast to integer | Current | same |
| Reject a product whose case price and bottle price sum to 0 | Current | same |
| Warn on duplicate staging keys, do not remove them | Current | `Process.LogDuplicates` |
| Set every `dwdCustomer.blnActive` or `dwdProduct.blnActive` to 0 | Current | `Process.SetInactives` |
| Customer warehouse via `sysQuery` 23, 24, 25 | Current as a call. SQL text is in the database | `Customer_Process.ProcessDW` |
| Product warehouse via `sysQuery` 21, 22 | Current as a call. SQL text is in the database | `Product_Process.ProcessDW` |
| Clear `dwdCustomer.blnPromotionalAccounts`, then run query 25 | Current | `Customer_Process.ProcessDW` |
| Rewrite `strRegionDesc2` values beginning `Gauteng ` to `Gauteng` | Current | same |
| Archive to `Imported\` with a timestamp suffix. DEBUG copies; Release moves | Current | `Process.ArchiveFile` |
| Truncate `stgSuperbowlLog` at batch start | Current | `frmMain.Run` |
| HTML log email to each `EmailRgbc` address | Current | `ProjectFunctions.EmailLog` |
| Progress bars `barCustomer` and `barProduct` | Current while a process runs | `Process.Progress` |
| Release vs DEBUG connection, SMTP, and download folder | Current, compile-time | `db.generic.vb`, `ProjectFunctions.vb`, `frmMain.vb` |

## Completed features

Nothing in git is marked shipped and then removed as a completed product version. The 2015–2018 comments describe work that is still in the tree (email log, Gauteng rename, SMTP change).

The Bitbucket history that is newer than those comments:

| Commit | Date | What landed |
|---|---|---|
| `86821ee` | 2023-11-17 | Customer warehouse failures log `error` with the exception message. Product warehouse failures log `warning` with message and stack. Empty catches on those steps were replaced |
| `234cedd` | 2023-11-17 | Log mail moved to after the batch. `VersionDate` set to 17 Nov 2023. `EmailRgbc` set to lloyd@overdrive.co.za, maanie@overdrive.co.za, and dimphoz@esnell.co.za. `EmailBfbe` set to maanie@overdrive.co.za. Form designer regenerated |
| `60aeb26` | 2023-11-17 | Comment on setting `Debug`: change to false in production. The value stayed `True` |

## Planned features

None documented.

`chkPartialImport` (default checked, caption "Partial Import") has no reader. The calls that would have passed it into `SetDeletes` are commented out. That is not a written plan to finish partial import.

## In development

No branch other than `master`. No TODO file. Last commit 2023-11-17.

## Recently changed

Relative to the 2020 initial commit, the 2023-11-17 commits are the recent set. See the table under Completed features. Behaviour that changed for an operator:

- The log email describes the batch that just ran. It used to be sent before `stgSuperbowlLog` was truncated, so it described the previous contents of that table.
- Warehouse SQL failures are written to the log instead of disappearing into an empty catch.
- Recipients in `App.config` changed. Recipients in the tracked Debug `exe.config` did not.

## Deprecated or removed

| Item | Evidence | Status |
|---|---|---|
| Email the log before truncating it | `frmMain.Run` comment and the `234cedd` diff | Removed from the live path |
| Insert `stgSuperbowlLog` into `logSuperbowl` at batch end | Commented SQL in `frmMain.Run` | Not executed |
| `AdvPDA CRM` export of `pda_crm.csv` from `sysQuery` 35 | Commented construction in `frmMain_Load`. `lstExport` is never filled. The export `Select Case` arm is commented | Not executed |
| `SetDeletes` / `DeleteDW` on customer and product | Methods exist on `Process`. Both call sites are commented. Comment on `SetDeletes` (2014-04-30) says partial import skips deletes because AdvM supplied day files | Not executed |
| DEBUG SMTP host `192.168.100.6` | Setting `SMTPHostDebug`. Construction from that host is commented. DEBUG mail uses `smtp.office365.com` | Setting remains, unused by `EmailLog` |
| Live `tblDwf` name `tmp` + entity | `#Else` branch comment "switch when live". Both branches assign `dwf` + entity | Not the live assignment |
| Copy of the batch log into a durable table | Not present as working code | Absent |

## Code present, not on the batch path

These methods are compiled and are not called from `frmMain`, the two process classes, or each other.

| Method | What the source would do if something called it |
|---|---|
| `EmailUnIinvoicedRequisitions` | On Monday, select `fsrRequisition` rows with an active request type, status `Approved`, blank invoice number, and `dtDate` older than 14 days. Mail `Genevieve@esnell.co.za`, CC `pj@overdrive.co.za` and `maanie@overdrive.co.za`. Subject `Un-Invoiced Requisitions`. Release SMTP client is created without the credentials `EmailLog` sets |
| `CheckPeriods` | If the newest `mstPeriod` is fewer than 30 months ahead of the current `yyyyMM`, insert the next 6 periods using `mstCompany` where `strCompany = 'RGBC'` and `strFYStart` |
| `LogDWD` | Insert one `dlyDataWarehouse` row with counts of `dwdCustomer.strCustomerNo` and `dwdProduct.strProdCode` |
| `BackupMintPromos` | On Monday, `SELECT INTO` dated copies of `dwfCustomer` and `dwfOnconPromo` |
| `Export_Process.Run` / `dataExport.Execute` | Run a SQL string, write a pipe-separated file with commas, quotes, percent signs, and semicolons stripped, copy it to the download directory |
| `getLastCompletedFiscalStart` / `getLastCompletedFiscalEnd` | Read `mstCompany` CompanyID 1 and `mstPeriod` for this month |

`FormatPercent` and `FormatNumber` in `ProjectFunctions` have no caller in this solution. `FormatNumber` replaces character 160 with a comma. The comment says the RGBC server used that as a group separator.

## Not features of this product

- Free-stock draft, submit, and approve screens. Those are `snell-freestock`.
- The free-stock CSV import, requisition PDF mail, and SAP ORDERS export. Those are `snell-cronjob`.
- A SonarQube scan checked into this repo. The onboarding issue listed two sonar files. Git does not contain them.
- A login, a role model, or an API.

## Source map

| Path | Role |
|---|---|
| `SNELL_CronDaily/SNELL_CronDaily.sln` | Visual Studio 2017 solution. TFS binding to `tfs01` |
| `SNELL_CronDaily/SNELL_CronDaily/frmMain.vb` | Batch orchestration |
| `SNELL_CronDaily/SNELL_CronDaily/frmMain.Designer.vb` | Form layout |
| `SNELL_CronDaily/SNELL_CronDaily/Process.vb` | Shared import steps |
| `SNELL_CronDaily/SNELL_CronDaily/Export_Process.vb` | Unused export runner |
| `SNELL_CronDaily/SNELL_CronDaily/App_Code/Processes/Customer.process.vb` | Customer import |
| `SNELL_CronDaily/SNELL_CronDaily/App_Code/Processes/Product.process.vb` | Product import |
| `SNELL_CronDaily/SNELL_CronDaily/App_Code/VB/ProjectFunctions.vb` | Log and mail |
| `SNELL_CronDaily/SNELL_CronDaily/App_Code/VB/dataExport.vb` | Pipe-delimited writer |
| `SNELL_CronDaily/SNELL_CronDaily/App_Code/VB/SystemFunctions.vb` | Date and mail-row colour |
| `SNELL_CronDaily/SNELL_CronDaily/App_Code/VB/Duodecimal.vb` | Month arithmetic for the uncalled period helper |
| `SNELL_CronDaily/SNELL_CronDaily/db.generic.vb` | SQL connection and commands |
| `SNELL_CronDaily/SNELL_CronDaily/db.cls.vb` | Empty subclass `xdb` |
| `SNELL_CronDaily/SNELL_CronDaily/App.config` | Connections, SMTP, `Debug`, recipients |
| `SNELL_CronDaily/SNELL_CronDaily/My Project/Settings.settings` | Same settings as the designer store |
| `SNELL_CronDaily/SNELL_CronDaily/bin/Debug/SNELL CronDaily.exe.config` | Older recipient list than `App.config` |
| `BuildProcessTemplates/*.xaml` | Stock TFS 11 templates. No project-specific build steps were found in them |
