System
Unified timeline of data changes (saves, imports, deletes) and backend errors. Filter by type, area, severity, or search.
274,902 results · Page 5492 of 5499
{"file_name":"ESSENTIAL_FILES_ANALYSIS.md","mime_type":"application/octet-stream"}
[]
{"backend_document_id":"23","document_type":"upload","title":"All Essential Files for Customer DB","slug":"all-essential-files-for-customer-db","summary_text":"All Essential Files for Customer DB","content_markdown":null,"content_html":null,"file_name":"ESSENTIAL_FILES_ANALYSIS.md","stored_name":"20260420-183627-ab045aa6.md","mime_type":"application/octet-stream","file_size_bytes":"9785","storage_path":"/mnt/drive1/customerdb/backend/documents_storage/20260420-183627-ab045aa6.md","is_deleted":"0","created_at":"2026-04-20 14:36:27","updated_at":"2026-04-20 14:36:27","editor_content":"# Essential Files Analysis - C:\\code\\customerdb\n\n**Generated:** April 17, 2026\n\n---\n\n## Summary\n\nThis document identifies which files are essential to keep vs which can be safely removed to reduce disk usage and simplify the codebase.\n\n**Estimated Space Savings:** ~200+ MB\n\n---\n\n## KEEP - Essential Files\n\n### Core Application\n\n```\nC:\\code\\customerdb\\backend\\ # Main PHP backend (98 files)\nC:\\code\\customerdb\\frontend\\ # Front Desk app (15 HTML pages)\nC:\\code\\customerdb\\frontend\\api\\ # Frontend API endpoints\nC:\\code\\customerdb\\scripts\\ # Import/sync scripts\nC:\\code\\customerdb\\migrations\\ # SQL migrations\nC:\\code\\customerdb\\csv\\ # Active CSV data\nC:\\code\\customerdb\\docs\\ # Documentation\nC:\\code\\customerdb\\backups\\ # Database backups (prune old)\nC:\\code\\customerdb\\mariadb_core_schema.sql\nC:\\code\\customerdb\\backup.sh\n```\n\n### Backend - Essential Files (98 PHP files)\n\n| File | Purpose |\n|------|---------|\n| `bootstrap.php` | Core bootstrap |\n| `customer_service.php` | Customer management |\n| `customer.php` | Customer API |\n| `visit_service.php` | Visit records |\n| `visit.php` | Visit API |\n| `customer_totals_service.php` | Daily totals |\n| `report_service.php` | Reporting (80KB) |\n| `schedule.php` | Appointment scheduling |\n| `setmore_service.php` | Setmore integration |\n| `email_service.php` | Email handling |\n| `bank_service.php` | Banking |\n| `gold_silver_service.php` | Precious metals |\n| `duke_service.php` | Energy tracking |\n| `payroll_service.php` | Payroll |\n| `stocks_crypto_service.php` | Investments |\n| `medication_service.php` | Medication tracking |\n| `backup_database_service.php` | Database backup |\n| `cron_manager.php` | Cron management |\n| `nightly_reports_service.php` | Nightly reports |\n| `morning_jobs_service.php` | Morning batch jobs |\n| `square_terminal_service.php` | Square POS |\n| `live_table_manager_service.php` | Live data tables |\n| `notifications_service.php` | Notifications |\n\n**API Endpoints:** 58 files in `/backend/api/` - all active REST endpoints\n\n### Frontend - HTML Pages (15 files)\n\n| File | Purpose |\n|------|---------|\n| `visit.html` | Visit management (254KB) |\n| `customer.html` | Customer records |\n| `index.html` | Main dashboard |\n| `reports.html` | Reports viewer |\n| `schedule.html` | Schedule view |\n| `work_order.html` | Work orders |\n| `workload.html` | Workload view |\n| `receipt.html` | Receipt printing |\n| `login.html` | Authentication |\n| `upcoming.html` | Upcoming appointments |\n| `square_customer.html` | Square integration |\n| `item_types.html` | Item types |\n| `todo.html` | Todo lists |\n| `customer_display.html` | Customer display |\n\n### Scripts - Essential (7 files)\n\n| Script | Purpose |\n|--------|---------|\n| `import_csv_v2.py` | CSV import |\n| `import_access_v2.py` | Access DB import |\n| `access_to_mariadb_parser.py` | Access parser |\n| `import_legacy_totals_from_excel.ps1` | Excel import |\n| `sync_backend_mirror.ps1` | Mirror sync |\n| `check_backend_mirror.ps1` | Mirror check |\n| `signature_blob_loader.py` | Signature loader |\n\n### Migrations - Essential (3 files)\n\n| File | Purpose |\n|------|---------|\n| `20260407_add_conversion_job.sql` | Conversion job table |\n| `20260411_order_items_item_type_name_no_fk.sql` | Item type changes |\n| `20260416_blog_prompt_templates.sql` | Blog prompts |\n\n### CSV Data - Essential\n\n| File | Purpose |\n|------|---------|\n| `CustomerTable.csv` | Customer records |\n| `CustomerVisits.csv` | Visit records |\n| `CustomerTotals.csv` | Daily totals |\n| `AlterationItems.csv` | Alteration items |\n\n---\n\n## REMOVE - Redundant/Unused Files\n\n### Priority 1 - Safe to Delete (Complete Directories)\n\n| Directory | Size | Action |\n|-----------|------|--------|\n| `notused\\` | ~85 MB | DELETE ENTIRE |\n| `venv\\` | ~100 MB | DELETE ENTIRE |\n| `OldFiles\\` | ~1 MB | DELETE ENTIRE |\n| `.vs\\` | ~1 MB | DELETE ENTIRE |\n| `.vscode\\` | small | DELETE |\n\n#### notused/ Contents (DELETE ALL)\n```\nnotused\\access_to_mariadb_parser (1).py # duplicates\nnotused\\access_to_mariadb_parser (2).py # duplicates\nnotused\\customerdb_v2_staging_schema.sql # duplicate\nnotused\\mariadb_core_schema.sql # duplicate\nnotused\\mariadb-12.2.2-winx64.msi # MariaDB installer (89MB!)\nnotused\\Backend\\ # old PHP code\nnotused\\backups\\ # old backups\nnotused\\csv\\ # old CSVs\nnotused\\docs\\ # old docs\nnotused\\schema\\ # old schemas\nnotused\\scripts\\ # old scripts\nnotused\\webui\\ # old webui\n```\n\n### Priority 2 - Duplicate WebUI (Check First)\n\n| Directory | Purpose |\n|-----------|---------|\n| `webui\\` | ~15 MB - mirrors backend/frontend |\n\nThis directory appears to mirror the main `backend/` and `frontend/` directories. If `webui` is NOT served as a separate application, DELETE ENTIRE:\n\n```\nwebui\\backend\\ # 89 files - duplicate of ../backend/\nwebui\\frontend\\ # mirrors ../frontend/\nwebui\\api\\ # similar to ../frontend/api/\n```\n\n### Priority 3 - Temporary Files\n\nDelete all files matching patterns:\n```\ntmp_*.php (~30 files) # temp PHP scripts\ntmp_*.sql (~30 files) # temp SQL queries\ntmp_*.sh (1 file) # temp shell scripts\ntmp_*.csv (1 file) # temp CSV files\n```\n\nExamples:\n- `tmp_check_129411.sql`\n- `tmp_nightly_preview.php`\n- `tmp_compare_sheet_customer_totals.sql`\n- `tmp_mirror_drive.sh`\n- `tmp_customertotalsaccess.csv`\n\n### Priority 4 - Check Before Delete\n\n| Directory | Purpose | Action |\n|-----------|---------|--------|\n| `blog\\` | Blog module | Verify if used, else DELETE |\n| `Topaz\\` | Signature pad drivers | Verify if needed, else DELETE |\n| `wordpress-plugin\\` | WP integration | Verify if used, else DELETE |\n| `schedule\\` | Laravel scheduling app | Verify if integrated, else DELETE |\n| `csv\\back\\` | 8 backup CSVs | Likely duplicate, verify then DELETE |\n\n### Priority 5 - Backup Files\n\n| File Pattern | Action |\n|-------------|--------|\n| `*.bak_*` | DELETE |\n| `*.bak` | DELETE |\n| `*.backup` | DELETE |\n| `*~` | DELETE |\n\n### Priority 6 - Root Level Large Unused Files\n\n| File | Size | Action |\n|------|------|--------|\n| `Items To Test or Comlete.odt` | 26KB | Move to docs or DELETE |\n\n---\n\n## Directory Structure After Cleanup\n\n```\ncustomerdb/\n├── backend/ # KEEP - Main PHP backend\n│ ├── api/ # KEEP - API endpoints\n│ ├── jobs/ # KEEP - Cron jobs\n│ └── bin/ # KEEP - Binaries\n├── frontend/ # KEEP - Front Desk app\n│ ├── api/ # KEEP - API calls\n│ └── reports/ # KEEP - PDF reports\n├── scripts/ # KEEP - Import scripts\n├── migrations/ # KEEP - DB migrations\n├── csv/ # KEEP - Active data\n│ └── back/ # DELETE - backup copies\n├── docs/ # KEEP - Documentation\n├── backups/ # KEEP - Keep latest, prune old\n├── schema/ # KEEP or DELETE (empty)\n├── mariadb_core_schema.sql # KEEP - Core schema\n├── migrate_add_visit_type.sql # KEEP - Migration\n├── backup.sh # KEEP - Backup script\n├── .gitignore # KEEP\n│\n├── notused/ # DELETE ENTIRE (~85 MB)\n├── OldFiles/ # DELETE ENTIRE (~1 MB)\n├── .vs/ # DELETE (~1 MB)\n├── .vscode/ # DELETE\n├── venv/ # DELETE (~100 MB)\n├── webui/ # DELETE OR VERIFY FIRST\n├── blog/ # VERIFY - then delete\n├── Topaz/ # VERIFY - then delete\n├── wordpress-plugin/ # VERIFY - then delete\n├── schedule/ # VERIFY - then delete\n└── tmp_*.* # DELETE ALL (~2 MB)\n```\n\n---\n\n## Space Savings Summary\n\n| Category | Savings |\n|----------|----------|\n| `notused/` directory | ~85 MB |\n| `venv/` directory | ~100 MB |\n| `tmp_*` files | ~2 MB |\n| `OldFiles/` | ~1 MB |\n| `.vs`, `.vscode` | ~1 MB |\n| `webui/` (if duplicate) | ~15 MB |\n| `csv/back/` | ~2 MB |\n| **TOTAL** | **~200+ MB** |\n\n---\n\n## Commands to Remove Files\n\n### PowerShell - Delete Priority 1 (Safe to Delete)\n\n```powershell\n# Delete notused directory\nRemove-Item -Recurse -Force \"C:\\code\\customerdb\\notused\"\n\n# Delete OldFiles directory\nRemove-Item -Recurse -Force \"C:\\code\\customerdb\\OldFiles\"\n\n# Delete .vs directory\nRemove-Item -Recurse -Force \"C:\\code\\customerdb\\.vs\"\n\n# Delete .vscode directory\nRemove-Item -Recurse -Force \"C:\\code\\customerdb\\.vscode\"\n\n# Delete venv directory\nRemove-Item -Recurse -Force \"C:\\code\\customerdb\\venv\"\n```\n\n### PowerShell - Delete Temporary Files\n\n```powershell\n# Delete all tmp_* files in root\nGet-ChildItem \"C:\\code\\customerdb\" -Filter \"tmp_*\" | Remove-Item -Force\n\n# Delete backup files\nGet-ChildItem \"C:\\code\\customerdb\" -Filter \"*.bak*\" | Remove-Item -Force\n```\n\n### PowerShell - Delete Duplicate WebUI (After Verification)\n\n```powershell\n# Only run if webui is NOT served separately\nRemove-Item -Recurse -Force \"C:\\code\\customerdb\\webui\"\n```\n\n---\n\n## Verification Checklist Before Delete\n\n- [ ] **webui/** - Is port 8894 served from this directory? If yes, KEEP. If served from `backend/`, DELETE.\n- [ ] **blog/** - Is blog feature actively used in the application?\n- [ ] **Topaz/** - Is the Topaz signature pad still in use?\n- [ ] **wordpress-plugin/** - Is WordPress integration still active?\n- [ ] **schedule/** - Is the Laravel scheduling app still integrated?\n\n---\n\n*End of Analysis*","is_text_editable":1,"can_edit_inline":1}
{"type":"Error","file":"/mnt/drive1/customerdb/backend/tabby_terminal.php","line":15,"trace":"#0 /mnt/drive1/customerdb/webui/backend/tabby_terminal.php(5): require()\n#1 {main}"}
{"type":"Error","file":"/mnt/drive1/customerdb/backend/tabby_terminal.php","line":15,"trace":"#0 /mnt/drive1/customerdb/webui/backend/tabby_terminal.php(5): require()\n#1 {main}"}
{"type":"Error","file":"/mnt/drive1/customerdb/backend/tabby_terminal.php","line":15,"trace":"#0 /mnt/drive1/customerdb/webui/backend/tabby_terminal.php(5): require()\n#1 {main}"}
{"type":"Error","file":"/mnt/drive1/customerdb/backend/tabby_terminal.php","line":15,"trace":"#0 /mnt/drive1/customerdb/webui/backend/tabby_terminal.php(5): require()\n#1 {main}"}
{"type":"Error","file":"/mnt/drive1/customerdb/backend/tabby_terminal.php","line":15,"trace":"#0 /mnt/drive1/customerdb/webui/backend/tabby_terminal.php(5): require()\n#1 {main}"}
{"type":"Error","file":"/mnt/drive1/customerdb/backend/tabby_terminal.php","line":15,"trace":"#0 /mnt/drive1/customerdb/webui/backend/tabby_terminal.php(5): require()\n#1 {main}"}
{"type":"Error","file":"/mnt/drive1/customerdb/backend/tabby_terminal.php","line":15,"trace":"#0 /mnt/drive1/customerdb/webui/backend/tabby_terminal.php(5): require()\n#1 {main}"}
{"type":"Error","file":"/mnt/drive1/customerdb/backend/tabby_terminal.php","line":15,"trace":"#0 /mnt/drive1/customerdb/webui/backend/tabby_terminal.php(5): require()\n#1 {main}"}
{"workflow_status":"no_show","visit_id":129358,"order_id":104111}
[]
{"workflow_id":"9","source":"visit","source_key":"129358","appointment_date":"2026-04-20","customer_id":"489071","visit_id":"129358","order_id":null,"workflow_status":"no_show","payment_state":null,"payment_method":null,"payment_amount":"0.00","paid_in_advance":"0","report_required":"0","report_attached":"0","report_checked_at":"2026-04-20 13:54:02","provider_notes_text":null,"operator_notes":null,"no_show_email_key":"none","created_at":"2026-04-20 13:54:02","updated_at":"2026-04-20 13:54:02"}
[]
[]
{"customer_date":"2026-04-20 14:55:00","customer_name":"Edwards","dopu_can":"Edwards","edwards":100,"edwards_type":"mileage","update_flag":"47"}
{"type":"UnexpectedValueException","file":"/mnt/drive1/customerdb/webui/backend/api/sysadmin.php","line":290,"trace":"#0 /mnt/drive1/customerdb/webui/backend/api/sysadmin.php(290): DirectoryIterator->__construct()\n#1 {main}"}
{"workflow_status":"no_show","visit_id":129401,"order_id":104154}
[]
{"workflow_id":"8","source":"visit","source_key":"129401","appointment_date":"2026-04-19","customer_id":"3478","visit_id":"129401","order_id":null,"workflow_status":"no_show","payment_state":null,"payment_method":null,"payment_amount":"0.00","paid_in_advance":"0","report_required":"0","report_attached":"0","report_checked_at":"2026-04-19 15:46:07","provider_notes_text":null,"operator_notes":"Status: 3/23/2026 Drop Off","no_show_email_key":"none","created_at":"2026-04-19 15:46:07","updated_at":"2026-04-19 15:46:07"}
[]
{"customer_payment_transaction_id":"5982","payment_id":"63997","order_id":"104085","visit_id":"129332","customer_id":"489019","customer_name":"Chevy Stern","transaction_date":"2026-04-12 00:00:00","payment_method":"Square","payment_type":"Deposit","bucket":"credit","amount":"45.60","tip_amount":"0.00","is_new_customer":"0","source":"payments","created_at":"2026-04-19 13:15:17","updated_at":"2026-04-19 13:15:17"}
{"deleted":true}
[]
{"customer_payment_transaction_id":"5983","payment_id":"63998","order_id":"104085","visit_id":"129332","customer_id":"489019","customer_name":"Chevy Stern","transaction_date":"2026-04-12 00:00:00","payment_method":"Square","payment_type":"Deposit","bucket":"credit","amount":"40.00","tip_amount":"0.00","is_new_customer":"0","source":"payments","created_at":"2026-04-19 13:15:17","updated_at":"2026-04-19 13:15:17"}
{"deleted":true}
[]
{"customer_payment_transaction_id":"5984","payment_id":"63999","order_id":"104085","visit_id":"129332","customer_id":"489019","customer_name":"Chevy Stern","transaction_date":"2026-04-12 00:00:00","payment_method":"Square","payment_type":"Balance","bucket":"credit","amount":"40.00","tip_amount":"0.00","is_new_customer":"0","source":"payments","created_at":"2026-04-19 13:15:17","updated_at":"2026-04-19 13:15:17"}
{"deleted":true}
[]
{"customer_payment_transaction_id":"5985","payment_id":"64000","order_id":"104085","visit_id":"129332","customer_id":"489019","customer_name":"Chevy Stern","transaction_date":"2026-04-12 00:00:00","payment_method":"Square","payment_type":"Tip","bucket":"tip","amount":"0.00","tip_amount":"0.00","is_new_customer":"0","source":"payments","created_at":"2026-04-19 13:15:17","updated_at":"2026-04-19 13:15:17"}
{"deleted":true}
{"workflow_status":"no_show","visit_id":129391,"order_id":104144}
[]
{"workflow_id":"7","source":"visit","source_key":"129391","appointment_date":"2026-04-18","customer_id":"3503","visit_id":"129391","order_id":null,"workflow_status":"no_show","payment_state":null,"payment_method":null,"payment_amount":"0.00","paid_in_advance":"0","report_required":"0","report_attached":"0","report_checked_at":"2026-04-18 17:02:58","provider_notes_text":null,"operator_notes":"App CreatedApp CreatedApp CreatedPayment Type:Credit Paid Date: 3/30/2026 3:30:00 PMPayment Type: Credit Paid Amount: $707.00Payment: 3/30/2026 707","no_show_email_key":"none","created_at":"2026-04-18 17:02:58","updated_at":"2026-04-18 17:02:58"}
{"workflow_status":"no_show","visit_id":129386,"order_id":104139}
[]
{"workflow_id":"6","source":"visit","source_key":"129386","appointment_date":"2026-04-18","customer_id":"3501","visit_id":"129386","order_id":null,"workflow_status":"no_show","payment_state":null,"payment_method":null,"payment_amount":"0.00","paid_in_advance":"0","report_required":"0","report_attached":"0","report_checked_at":"2026-04-18 16:34:20","provider_notes_text":null,"operator_notes":"Project Details 2 silk pants need hem and 1 pair jeansWhen Needed? couple weeksBooked from Custom Booking PageProject Details 2 silk pants need hem and 1 pair jeansWhen Needed? couple weeksBooked from Custom Booking PageProject Details 2 silk pants need hem and 1 pair jeansWhen Needed? couple weeksBooked from Custom Booking PagePayment Type:None Paid Date: 3/20/2026 2:30:00 PMDeposit Amount: $60.00Deposit Date: 3/6/2026","no_show_email_key":"none","created_at":"2026-04-18 16:34:20","updated_at":"2026-04-18 16:34:20"}
{"customer":"Christy Ralston","email":"christyr.ralston@gmail.com"}
{"customer":"Sarah Hughes","email":"regenttamppansdar@gmail.com"}
{"customer":"Nancy Adams","email":"qwzx9j@gmail.com"}
{"customer":"Roxanne Adams","email":"roxanne_ad@hotmail.com"}
{"customer":"Michelle Ramirez","email":"rammic1017@gmail.com"}
{"customer":"Victoria Gonzalez","email":"vgonzalez-saez@hotmail.com"}
{"customer":"Josefina Reyes","email":"josefinareyes0114@gmail.com"}
{"customer":"Chevy Stern","email":"honeymstern@gmail.com"}
{"customer":"Alyssa Odonahoe","email":"aodonahoe@gmail.com"}
{"customer":"Julian Jazxhi","email":"jjazxhi@gmail.com"}
{"customer":"Yolanda Martin","email":"martin110406@sbcglobal.net"}
{"customer":"Daisy Martinez","email":"daisymartinez701@yahoo.com"}
{"file_name":"2026-04-17-implementation-report.md","mime_type":"application/octet-stream"}
[]
{"backend_document_id":"22","document_type":"upload","title":"Codex Updates 04-17-2026","slug":"codex-updates-04-17-2026","summary_text":"Codex Updates 04-17-2026","content_markdown":null,"content_html":null,"file_name":"2026-04-17-implementation-report.md","stored_name":"20260417-191931-4b36a7df.md","mime_type":"application/octet-stream","file_size_bytes":"8180","storage_path":"/mnt/drive1/customerdb/backend/documents_storage/20260417-191931-4b36a7df.md","is_deleted":"0","created_at":"2026-04-17 15:19:31","updated_at":"2026-04-17 15:19:31","editor_content":"# Implementation Report - April 17, 2026\n\n## Scope\nThis document summarizes all completed work from this support/maintenance session, including:\n- Issues found\n- Root causes\n- Fixes implemented\n- Files changed\n- Live deployment actions\n- Verification results\n- Remaining follow-up items\n\nDate: 2026-04-17\n\n---\n\n## 1) Cron Email Failures (421 Downstream server error)\n\n### Reported issue\nCron jobs were failing email delivery from:\n- `/mnt/drive1/customerdb/backend/jobs/run_cron_job.php 7`\n\nBounce details showed:\n- Relay path through `relay.mailchannels.net`\n- Recipient looked like an SMTP host mailbox (`kefa@de-fra-smtpout7.hostinger.io`)\n- Error: `421 Downstream server error`\n\n### Root causes identified\n1. Mis-targeted recipient (SMTP server domain used as mailbox address).\n2. Mail path could fall back to `mail()` when SMTP config was missing/unavailable, which routed through MailChannels.\n\n### Fixes completed\n#### Code hardening\nUpdated `backend/mail_service.php`:\n- Added recipient and sender email validation (`FILTER_VALIDATE_EMAIL`).\n- Improved SMTP security mode handling (`ssl`, `tls`, `none`).\n- SMTP auth now enabled only when username exists.\n- Disabled `mail()` fallback for CLI jobs (cron path), so cron fails explicitly instead of silently routing via MailChannels.\n\n#### Live SMTP configuration\nOn live host (`192.168.7.202`), app settings were updated to Hostinger SMTP:\n- `smtp_host = smtp.hostinger.com`\n- `smtp_port = 465`\n- `smtp_secure = ssl`\n- `smtp_user = admin@ellasalterations.com`\n- `smtp_pass = [updated in DB]`\n- `smtp_from_email = admin@ellasalterations.com`\n- `smtp_from_name = Ella's Alterations`\n- `cron_notify_email = admin@ellasalterations.com`\n- `nightly_report_to_email = admin@ellasalterations.com`\n\n### Validation\n- `app_send_mail()` test on live host returned success via PHPMailer.\n- Cron job re-run succeeded:\n - `php8.3 /mnt/drive1/customerdb/backend/jobs/run_cron_job.php 7`\n - Returned `\"ok\": true`\n\n### Follow-up\n- Recommended mailbox password rotation after credentials were shared in chat.\n\n---\n\n## 2) Receipt Disclosure Requirements\n\n### Requested behavior\nEnsure the following actions include required disclosures at the end:\n- Print Receipt\n- Email Receipt\n- Save Receipt (PDF)\n\n### Fixes completed\nUpdated disclosure handling across all receipt generation paths:\n\n#### `frontend/visit.html`\n- Added canonical `REQUIRED_RECEIPT_DISCLOSURES` constant.\n- Added `buildReceiptDisclosureHtml()` to render disclosure blocks.\n- `sendEmailReceipt()` path now appends required disclosures in generated email HTML.\n- `generateVisitReport()` now sends `report_disclaimer_override` to backend PDF generator so saved PDFs use same required text.\n\n#### `frontend/api/visit_report_generate.php`\n- Added support for request payload key: `report_disclaimer_override`.\n- Enhanced disclaimer parser to handle uppercase heading lines with colon format (e.g., `DEPOSIT POLICY:`).\n- Uses override text when provided, otherwise settings fallback.\n\n#### `frontend/receipt.html`\n- Added required disclosure constant and merge logic.\n- Replaced old extra notice injection with required disclosure merge.\n- Terms rendering updated to preserve heading/body format.\n\n### Validation\n- PHP syntax check passed on `frontend/api/visit_report_generate.php`.\n- Confirmed references to new disclosure constants/functions in all required paths.\n\n---\n\n## 3) Dashboard Today Totals Incorrect (5/5 vs expected 8/8)\n\n### Reported issue\nDashboard showed:\n- `Today Customers: 5`\n- `Today New: 5`\nExpected:\n- `8` and `8`\n\n### Root causes identified\nIn `frontend/api/totals_snapshot_live.php`:\n1. Logic prioritized `customer_totals` and only checked `visits` if count was zero.\n - If `customer_totals` lagged, dashboard stayed low.\n2. A `Walk In` drop-off row needed exclusion for this specific metric.\n\n### Fixes completed\nUpdated `ts_today_payment_totals_live()` in `frontend/api/totals_snapshot_live.php`:\n- Compute drop-off counts from both sources (`customer_totals`, `visits`).\n- Use max of the two counts instead of one-way fallback.\n- Exclude `booking_source = 'walk in'` when visits table has that column.\n\n### Deployment and validation\n- Deployed updated API file to live host.\n- Live endpoint check returned:\n - `\"today_totals\":{\"total_customers\":8,\"new_customers\":8,...}`\n\n---\n\n## 4) Morning Import Visit Reuse Rules\n\n### Requested rules\nFor morning Setmore import:\n1. If customer has visit type `drop off` or `rescheduled` or `no show`: reuse visit and add Setmore notes.\n2. If customer has visit type `pick up`: create a new visit and add Setmore notes.\n3. If customer has no visit record: create a new visit and add Setmore notes.\n\n### Fixes completed\nUpdated `backend/setmore_service.php`:\n\n#### Rule enforcement\n- `app_setmore_reusable_dropoff_visit()` now inspects latest customer visit and allows reuse only for copy-source statuses (`dropoff`, `rescheduled`, `noshow`).\n- If latest status is pickup, reuse is not selected, so a new visit is created.\n- If no prior visit exists, new visit creation continues as normal.\n\n#### Notes behavior\n- Added `app_setmore_merge_notes()`.\n- Reused visit updates now merge/append Setmore notes instead of replacing existing operator notes.\n\n#### Safety improvement\n- On reused visits, preserve existing `source_key_value` if it belongs to another appointment key.\n\n### Deployment and validation\n- Deployed to live host.\n- Lint with `php8.3 -l` passed.\n- Morning smoke test passed:\n - `php8.3 /mnt/drive1/customerdb/backend/jobs/smoke_morning_jobs.php`\n\nNote:\n- Default `php -l` binary on host showed parse issue due different PHP binary path; `php8.3` (actual cron/runtime binary) is clean.\n\n---\n\n## 5) Nightly Summary Section Order Drift\n\n### Reported issue\nNightly summary sections had moved around.\n\n### Required order\n1. Daily Detail Report\n2. Daily Summary Report\n3. Month To Date Report\n4. Yearly Summary Report\n5. Daily Imported People List\n6. Alterations Next 7 Days\n\n### Fix completed\nReordered report block assembly in `backend/nightly_reports_service.php` to match exact required sequence.\n\n### Deployment and validation\n- Deployed to live host.\n- `php8.3 -l /mnt/drive1/customerdb/backend/nightly_reports_service.php` passed.\n\n---\n\n## 6) PDF Files Saving with Raw HTML Text\n\n### Reported issue\nSome saved PDFs looked wrong (HTML source printed in the PDF instead of rendered receipt layout).\n\n### Investigation findings\n- Sample file `Hannah-Goncalves-448248-04032026.pdf` is a valid PDF container but includes raw HTML source text (`<!DOCTYPE html>`, tags visible in extracted text).\n- Bulk scan found 4 affected files, all in `04032026` batch:\n - `Hannah-Goncalves-448248-04032026.pdf`\n - `Emiliano-Delgado-3226-04032026.pdf`\n - `Laura-Coyne-488970-04032026.pdf`\n - `Jamie-Miller-488977-04032026.pdf`\n- Newer reports were rendering normally.\n\n### Fix completed (preventive)\nUpdated `frontend/api/visit_report_generate.php`:\n- Added `vrg_pdf_looks_like_html_source()` quality gate.\n- If generated PDF appears to contain HTML source text, generation now fails fast and does not save corrupt output.\n\n### Deployment and validation\n- Deployed to live host.\n- `php8.3 -l` passed.\n\n### Follow-up required\n- Re-generate the 4 historical affected files from UI (`Save Receipt PDF`) to replace bad copies.\n\n---\n\n## Files Changed In This Session (Core)\n\n### Backend\n- `backend/mail_service.php`\n- `backend/setmore_service.php`\n- `backend/nightly_reports_service.php`\n\n### Frontend\n- `frontend/visit.html`\n- `frontend/receipt.html`\n- `frontend/api/visit_report_generate.php`\n- `frontend/api/totals_snapshot_live.php`\n\n---\n\n## Operational Notes\n\n- Multiple live updates were deployed directly to host `192.168.7.202`.\n- Runtime checks were executed with `php8.3` to match cron/runtime behavior.\n- Temporary maintenance scripts used during diagnosis were deleted from local and remote `/tmp`.\n\n---\n\n## Remaining Action Items\n\n1. Rotate SMTP mailbox password (credential was provided in conversation text).\n2. Re-generate the 4 known bad PDFs from `04032026` batch.\n3. Optional: Add an admin audit endpoint to list historically malformed PDFs using the same detection method, for one-time cleanup.\r\n","is_text_editable":1,"can_edit_inline":1}
{"file_name":"SESSION_COMPLETION_2026-04-17.md","mime_type":"application/octet-stream"}
[]
{"backend_document_id":"21","document_type":"upload","title":"Curser Updates 04-17-2026","slug":"curser-updates-04-17-2026","summary_text":"Curser Updates 04-17-2026","content_markdown":null,"content_html":null,"file_name":"SESSION_COMPLETION_2026-04-17.md","stored_name":"20260417-191850-3b41b6c5.md","mime_type":"application/octet-stream","file_size_bytes":"11631","storage_path":"/mnt/drive1/customerdb/backend/documents_storage/20260417-191850-3b41b6c5.md","is_deleted":"0","created_at":"2026-04-17 15:18:50","updated_at":"2026-04-17 15:18:50","editor_content":"# Session completion summary — 2026-04-17\n\nThis document records work completed across multiple backend/UI areas: problems observed, root causes, fixes applied, and new or changed behavior. Paths are relative to the repository root (`customerdb`).\n\n---\n\n## 1. Reminders (`backend/reminders.php`)\n\n### Requested behavior\n- Embedded reminders iframe should use more of the layout; later, remove the reminder queue panel entirely and enlarge the embed.\n\n### Changes\n1. **Two-column layout (1/4 + 3/4)** \n - Replaced shared `grid cols-2` (~50/50) with a local class `reminders-embed-grid` using `grid-template-columns: 1fr 3fr`, with a `920px` breakpoint stacking to one column (aligned with `page_helpers.php`).\n\n2. **Queue removed; full-width tall iframe** \n - Removed the “Reminder Queue” article (stats + table) and all related PHP (`reminder_service.php` queries, `$summary`, `$rows`).\n - Single `article.panel` with the iframe only.\n - CSS: `min-height: 720px`, `height: calc(100vh - 200px)` and `calc(100dvh - 200px)` for viewport-relative height (with `vh` fallback).\n - Removed nested duplicate `.shell` if it had been introduced earlier in this file (payroll had a similar issue; reminders stayed within header shell only).\n\n### Notes\n- `webui/backend/reminders.php` remains a thin loader to `backend/reminders.php`.\n\n---\n\n## 2. Umami analytics (`backend/umami.php`)\n\n### Issues\n- Iframe pointed at a non-existent path (`/backend/umami-embed/login`) → “not found” in the frame.\n- After switching to `https://umami.myexperttailor.com/...`, browsers showed **refused to connect** / embedding failures (CSP / `frame-ancestors`, or network).\n\n### Fixes\n- Set public dashboard URL to the provided Umami website URL.\n- **Embedding:** iframe now targets the **LAN Umami** instance `http://192.168.7.206:3006` with the same `/websites/{uuid}` path so framing is not blocked like the public HTTPS host often is.\n- Copy updated to explain LAN vs public; **Open Public Umami** still opens HTTPS in a new tab.\n\n### Notes\n- True fix for embedding the public host requires server-side headers or a reverse proxy; documented in repo history (`documents_storage`, session logs).\n\n---\n\n## 3. Issue tracker (`backend/issue_tracker.php`)\n\n### Requested behavior\n- Square corners on “boxes,” not rounded.\n\n### Implementation\n- Wrapper class `issue-tracker-square` with overrides for `.panel`, `.card`, `.stat`, `.notice`, inputs, selects, textareas, and `.btn` → `border-radius: 0`.\n- `.done-pill` / `.open-pill` set to `border-radius: 0` for consistency.\n- Scoped so global backend chrome outside the wrapper is unchanged.\n\n---\n\n## 4. Medications (`backend/medication.php`)\n\n### Requested behavior\n- No rounded corners on medication page “boxes.”\n- **Update Medication** as a pill (rounded control); row action aligned with that wording.\n\n### Implementation\n- Wrapper `medication-page-square` with overrides (panels, notices, inputs, buttons square).\n- Exception class **`med-update-pill`** → `border-radius: 999px !important` on:\n - Submit button in **edit** mode (“Update Medication”).\n - Table row link (label **Update Medication**, was “Edit”).\n- Local components (`med-calc-row`, `filter-tab`, `badge`, `person-chip`) set to square radii.\n\n### Follow-on (reports)\n- See **§10 Medication reports** (`medication_report.php`).\n\n---\n\n## 5. Medication reports — printable Excel-style (`backend/medication_report.php`)\n\n### Issues\n- `@media print` hid **`.panel:not(.print-keep)`**, which hid almost all report content; “Print” flow was broken for real output.\n- “Due soon” was card layout, not spreadsheet-like.\n\n### Fixes / features\n- **`mrep-excel`** tables: `border-collapse`, full cell borders, gray header row, zebra rows.\n- **Due in next 5 days** converted from flex cards to a **single table** with columns including an on-screen Edit column; **`.mrep-no-print`** hides action column in print.\n- Overdue, by-person inner tables, inactive list → **`mrep-excel`**.\n- Print CSS: hide summary dash, hero actions, buttons; tighten typography; `print-color-adjust: exact` where helpful.\n- Header action: **Print Report** with stable **`id=\"mrep-print-btn\"`**; `page_helpers.php` extended so **anchor** actions can carry **`id`** (same as buttons).\n\n---\n\n## 6. Payroll — stats & theme (`backend/payroll.php`)\n\n### Issues\n- Stat numbers appeared “all black” / not aligned with **settings / theme** CSS variables.\n- Extra **nested `<div class=\"shell\">`** duplicated `app_backend_render_header()`’s shell.\n\n### Fixes\n- **`.pay-stat`**: `var(--backend-box-bg)`, `--backend-line`, `--backend-box-text`, labels `--backend-muted`.\n- **`.worker-yana` / `.worker-lola`**: `var(--teal)` and `var(--accent)` instead of hard-coded hex.\n- All six stats (including **Yana/Lola total rows**) use worker color classes.\n- Tabs / table / paste area hints aligned with backend variables where touched.\n- Unpaid tab badge uses `var(--accent)` + `var(--button-text)`.\n- **Removed inner `.shell` wrapper.**\n\n---\n\n## 7. Payroll — paste import & Excel dates (`backend/payroll_service.php` + `payroll.php`)\n\n### Bugs / issues\n1. **Header row detection** compared normalized Excel headers to a list of **non-normalized** variants (e.g. `amount paid` vs `amount_paid`) → header row often misclassified → wrong column map → skips / zero imports (especially **Yana**-style sheets).\n2. **Excel date serials** and US dates not parsed by `DateTimeImmutable` alone.\n3. **UTF-8 BOM** and **NBSP** breaking header matching.\n4. On paste **exception**, POST resubmit UX; success notice used POST worker string vs canonical.\n\n### Fixes\n- Strip **BOM**; normalize **NBSP** to space in paste text.\n- Build **`$knownHeaderVariants`** using the same **`$norm()`** as header cells.\n- **`$toDate`**: serial range **20000–119999** via **25569** Excel→Unix conversion; explicit `createFromFormat` attempts (`n/j/Y`, `m/d/Y`, etc.) with `DateTimeImmutable::getLastErrors()` guard; fallback parse.\n- Expanded **column aliases** (`customerdatetime`, `custdate`, `client`, etc.).\n- Return array includes **`worker`** (canonical); notice uses it.\n- **Redirect** `?tab=paste&error=...` on paste import exception.\n- **`payroll.php`**: hint text mentions serials and BOM.\n\n---\n\n## 8. Payroll — printable Excel-style (`backend/payroll.php`)\n\n### Features\n- Wrapper **`pay-print-root`**; tables use **`pay-excel`** (grid borders, header strip, zebra).\n- **`@media print`**: hide stats, tabs, mark-paid toolbar, check-all links, inputs/forms inside data tables; compact borders/fonts.\n- **Print** button in hero (`id=\"pay-print-btn\"`) + JS `window.print()`.\n\n---\n\n## 9. Payroll — mark multiple paid (`backend/payroll.php`)\n\n### Bug\n- **Nested `<form>`** for row delete inside the **mark paid** `<form>`. HTML forbids nested forms; the browser **closes the outer form** at the inner `<form>`, so most **`entry_ids[]`** checkboxes were **outside** the mark-paid form → only **one** (or erratic) ID posted.\n\n### Fix\n- Delete control: **`<button type=\"submit\" form=\"payroll-del-{id}\">`**.\n- **Hidden `<form id=\"payroll-del-…\">`** per row, emitted **after** `</form>` of mark-paid (merged Yana + Lola unpaid rows).\n- Main form **`id=\"payroll-mark-paid\"`**.\n\n---\n\n## 10. Stocks & crypto — average cost precision (`backend/stocks_crypto.php`, `backend/stocks_crypto_service.php`)\n\n### Issue\n- **`avg_cost DECIMAL(14,6)`** and form **`step=\"0.000001\"`** / six-decimal display capped precision (problematic for crypto).\n\n### Fixes\n- Schema: **`DECIMAL(24,12)`**; `ALTER` to widen existing DBs (try/catch).\n- Save: pass **numeric string** into SQL (comma stripped, escaped) instead of float stringification for INSERT/UPDATE.\n- Form: **`step=\"any\"`**; edit value from **`trim((string)$editAsset['avg_cost'])`** (DB string).\n- Portfolio avg column: display **string** from DB to avoid float truncation.\n- Chart: **`hist_asset`** path uses JSON-encoded string → **`Number()`** in JS for the avg line.\n\n---\n\n## 11. Stocks & crypto — duplicate ticker / lots (`backend/stocks_crypto_service.php`, `backend/stocks_crypto.php`, `backend/api/stocks_summary.php`)\n\n### Issue\n- **`UNIQUE KEY uq_ticker (ticker)`** prevented a second **BTC** row even when notes differed.\n\n### Fixes\n- New installs: **`KEY ix_stocks_asset_ticker (ticker)`** (non-unique) instead of `uq_ticker`.\n- Existing DBs: **`ALTER TABLE stocks_asset DROP INDEX uq_ticker`** (try/catch); **`ADD KEY ix_stocks_asset_ticker`** if missing (try/catch).\n- **Portfolio / chart links:** `hist={ticker}&hist_asset={stocks_asset_id}` (+ optional `type=` filter) so **avg cost** matches the correct lot when tickers repeat.\n- **Prices tab:** inputs **`name=\"price_a_{stocks_asset_id}\"`**; **`save_prices`** resolves asset id → ticker (duplicate tickers no longer overwrite the same POST key).\n- **`app_stocks_fetch_all_live`:** fetch **once per distinct ticker** (dedupe).\n- **`stocks_summary` API:** each asset includes **`id`** (`stocks_asset_id`).\n\n### Related: `backend/page_helpers.php`\n- **`id`** attribute supported on **link**-type header actions (used by medication report print link).\n\n---\n\n## Files touched (summary)\n\n| File | Nature of change |\n|------|------------------|\n| `backend/reminders.php` | Layout + iframe-only page |\n| `backend/umami.php` | Embed URL, copy, LAN vs public |\n| `backend/issue_tracker.php` | Square-corner scoped CSS |\n| `backend/medication.php` | Square UI + pill update control + row link label |\n| `backend/medication_report.php` | Excel tables + print CSS + print button id on links |\n| `backend/page_helpers.php` | `id` on `<a>` action items |\n| `backend/payroll.php` | Theme vars, no nested shell, Excel/print, paste UX, mark-paid/delete forms |\n| `backend/payroll_service.php` | Paste import robustness, dates, headers, worker in return |\n| `backend/stocks_crypto.php` | avg_cost UI, `hist_asset`, portfolio URLs, `price_a_*` |\n| `backend/stocks_crypto_service.php` | Schema avg_cost, drop uq_ticker, index, save avg string, live fetch dedupe |\n| `backend/api/stocks_summary.php` | `id` on each asset in JSON |\n\nThin loaders under `webui/backend/` were unchanged where they only `require` canonical `backend/*.php`.\n\n---\n\n## Testing suggestions (manual)\n\n1. **Reminders:** load `/backend/reminders.php` — iframe fills width and height sensibly.\n2. **Umami:** confirm LAN iframe loads; public link in new tab.\n3. **Issue tracker / medication:** visual check square corners and pill(s) on medication update path.\n4. **Medication report:** Print preview — tables have grid lines; no empty printout.\n5. **Payroll:** paste Yana/Lola sheets with BOM, serial dates, varied headers; mark **multiple** unpaid rows paid in one submit.\n6. **Payroll print:** Print preview hides chrome; tables print.\n7. **Stocks:** add two **BTC** lots with different notes; set high-precision avg cost; prices tab saves both rows; chart `hist_asset` matches correct avg line; API returns distinct `id` per row.\n\n---\n\n## Known limitations / follow-ups\n\n- **Umami public host** embedding still depends on remote CSP / network; LAN proxy is the reliable approach.\n- **PHP `float`** still limits extreme precision in some JS chart paths; DB stores **12** fractional digits for `avg_cost`.\n- **Payroll paste** very large pastes may hit `max_input_vars` / post size limits (server config), not addressed in code.\n- **Medication** “Update Medication” row link text is long in narrow tables; acceptable per product request.\n\n---\n\n*Generated from implementation session work; adjust dates or add ticket IDs if you track work in an external system.*\n","is_text_editable":1,"can_edit_inline":1}
[]
[]
{"backend_speed_dial_id":"38","link_name":"MUV","link_url":"https://muvfl.com/locations/zephyrhills","sort_order":"0","is_active":"1","created_at":"2026-04-17 15:05:43","updated_at":"2026-04-17 15:05:43"}
[]
[]
{"backend_speed_dial_id":"37","link_name":"Target","link_url":"https://www.target.com/","sort_order":"0","is_active":"1","created_at":"2026-04-17 15:05:27","updated_at":"2026-04-17 15:05:27"}
[]
[]
{"backend_speed_dial_id":"36","link_name":"Video Compress","link_url":"https://freecompress.com/reduce-video","sort_order":"0","is_active":"1","created_at":"2026-04-17 15:05:13","updated_at":"2026-04-17 15:05:13"}
[]
[]
{"backend_speed_dial_id":"35","link_name":"Duke Energy","link_url":"https://www.duke-energy.com/home","sort_order":"0","is_active":"1","created_at":"2026-04-17 15:04:58","updated_at":"2026-04-17 15:04:58"}
[]
[]
{"backend_speed_dial_id":"34","link_name":"Monument Metals","link_url":"https://monumentmetals.com/","sort_order":"0","is_active":"1","created_at":"2026-04-17 15:04:34","updated_at":"2026-04-17 15:04:34"}
[]
[]
{"backend_speed_dial_id":"33","link_name":"Johnson & Johnson Insurance","link_url":"https://www.jjins.com/","sort_order":"0","is_active":"1","created_at":"2026-04-17 15:04:16","updated_at":"2026-04-17 15:04:16"}
[]
[]
{"backend_speed_dial_id":"32","link_name":"Blue Sky","link_url":"https://bsky.app/","sort_order":"0","is_active":"1","created_at":"2026-04-17 15:03:51","updated_at":"2026-04-17 15:03:51"}
[]
[]
{"backend_speed_dial_id":"31","link_name":"Civitai","link_url":"https://civitai.com/","sort_order":"0","is_active":"1","created_at":"2026-04-17 15:03:32","updated_at":"2026-04-17 15:03:32"}
[]
[]
{"backend_speed_dial_id":"30","link_name":"Ambient Weather","link_url":"https://ambientweather.net/","sort_order":"0","is_active":"1","created_at":"2026-04-17 15:03:18","updated_at":"2026-04-17 15:03:18"}
[]
[]
{"backend_speed_dial_id":"29","link_name":"Threads","link_url":"https://www.threads.net/","sort_order":"0","is_active":"1","created_at":"2026-04-17 15:02:52","updated_at":"2026-04-17 15:02:52"}
[]
[]
{"backend_speed_dial_id":"28","link_name":"Mastodon","link_url":"https://mastodon.social/deck/getting-started","sort_order":"0","is_active":"1","created_at":"2026-04-17 15:02:41","updated_at":"2026-04-17 15:02:41"}
[]
[]
{"backend_speed_dial_id":"27","link_name":"Truth Social","link_url":"https://truthsocial.com/","sort_order":"0","is_active":"1","created_at":"2026-04-17 15:02:24","updated_at":"2026-04-17 15:02:24"}
[]
[]
{"backend_speed_dial_id":"26","link_name":"Rumble","link_url":"https://rumble.com/","sort_order":"0","is_active":"1","created_at":"2026-04-17 15:02:16","updated_at":"2026-04-17 15:02:16"}
[]
[]
{"backend_speed_dial_id":"25","link_name":"Tiktok","link_url":"https://www.tiktok.com/","sort_order":"0","is_active":"1","created_at":"2026-04-17 15:01:32","updated_at":"2026-04-17 15:01:32"}
[]
[]
{"backend_speed_dial_id":"24","link_name":"Suno","link_url":"http://suno.com/","sort_order":"0","is_active":"1","created_at":"2026-04-17 15:01:18","updated_at":"2026-04-17 15:01:18"}
[]
[]
{"backend_speed_dial_id":"23","link_name":"Youtube","link_url":"https://www.youtube.com/","sort_order":"0","is_active":"1","created_at":"2026-04-17 15:01:02","updated_at":"2026-04-17 15:01:02"}
[]
[]
{"backend_speed_dial_id":"22","link_name":"Instagram","link_url":"https://www.instagram.com/","sort_order":"0","is_active":"1","created_at":"2026-04-17 15:00:50","updated_at":"2026-04-17 15:00:50"}