System
Unified timeline of data changes (saves, imports, deletes) and backend errors. Filter by type, area, severity, or search.
1,139,020 results · Page 22774 of 22781
[]
[]
{"customer_id":3503,"visit_id":129045,"email":"angiedelossantos742@gmail.com","status":"sent","delivery_result":"Sent via SMTP (PHPMailer)"}
[]
[]
{"customer_id":200481,"visit_id":34954,"email":"aodonahoe@gmail.com","status":"sent","delivery_result":"Sent via SMTP (PHPMailer)"}
[]
[]
{"customer_id":148003,"visit_id":22301,"email":"kimberlymatt2017@gmail.com","status":"sent"}
{"mode":"mark_sent","type":"TypeError","file":"/mnt/drive3/customerdb/backend/bootstrap.php","line":434,"trace":"#0 /mnt/drive3/customerdb/backend/cust_email_service.php(687): app_log_backend_change()\n#1 /mnt/drive3/customerdb/backend/cust_email.php(25): app_review_request_mark_sent()\n#2 /mnt/drive3/customerdb/webui/backend/cust_email.php(5): require('...')\n#3 {main}"}
{"type":"ParseError","file":"/mnt/drive3/customerdb/backend/cust_email_service.php","line":124,"trace":"#0 /mnt/drive3/customerdb/webui/backend/cust_email.php(5): require()\n#1 {main}"}
{"mode":"import_customers","type":"JsonException","file":"/mnt/drive3/customerdb/backend/cust_email.php","line":101,"trace":"#0 /mnt/drive3/customerdb/backend/cust_email.php(101): json_decode()\n#1 /mnt/drive3/customerdb/webui/backend/cust_email.php(5): require('...')\n#2 {main}"}
{"mode":"import_customers","type":"JsonException","file":"/mnt/drive3/customerdb/backend/cust_email.php","line":101,"trace":"#0 /mnt/drive3/customerdb/backend/cust_email.php(101): json_decode()\n#1 /mnt/drive3/customerdb/webui/backend/cust_email.php(5): require('...')\n#2 {main}"}
{"type":"mysqli_sql_exception","file":"/mnt/drive3/customerdb/backend/bills.php","line":19,"trace":"#0 /mnt/drive3/customerdb/backend/bills.php(19): mysqli->prepare()\n#1 /mnt/drive3/customerdb/backend/bills.php(246): dbQuery()\n#2 /mnt/drive3/customerdb/webui/backend/bills.php(5): require('...')\n#3 {main}"}
{"type":"mysqli_sql_exception","file":"/mnt/drive3/customerdb/backend/bills.php","line":19,"trace":"#0 /mnt/drive3/customerdb/backend/bills.php(19): mysqli->prepare()\n#1 /mnt/drive3/customerdb/backend/bills.php(378): dbQuery()\n#2 /mnt/drive3/customerdb/webui/backend/bills.php(5): require('...')\n#3 {main}"}
{"type":"mysqli_sql_exception","file":"/mnt/drive3/customerdb/backend/bills.php","line":19,"trace":"#0 /mnt/drive3/customerdb/backend/bills.php(19): mysqli->prepare()\n#1 /mnt/drive3/customerdb/backend/bills.php(378): dbQuery()\n#2 /mnt/drive3/customerdb/webui/backend/bills.php(5): require('...')\n#3 {main}"}
{"type":"mysqli_sql_exception","file":"/mnt/drive3/customerdb/backend/bills.php","line":19,"trace":"#0 /mnt/drive3/customerdb/backend/bills.php(19): mysqli->prepare()\n#1 /mnt/drive3/customerdb/backend/bills.php(378): dbQuery()\n#2 /mnt/drive3/customerdb/webui/backend/bills.php(5): require('...')\n#3 {main}"}
{"type":"mysqli_sql_exception","file":"/mnt/drive3/customerdb/backend/bills.php","line":19,"trace":"#0 /mnt/drive3/customerdb/backend/bills.php(19): mysqli->prepare()\n#1 /mnt/drive3/customerdb/backend/bills.php(246): dbQuery()\n#2 /mnt/drive3/customerdb/webui/backend/bills.php(5): require('...')\n#3 {main}"}
{"type":"mysqli_sql_exception","file":"/mnt/drive3/customerdb/backend/bills.php","line":19,"trace":"#0 /mnt/drive3/customerdb/backend/bills.php(19): mysqli->prepare()\n#1 /mnt/drive3/customerdb/backend/bills.php(378): dbQuery()\n#2 /mnt/drive3/customerdb/webui/backend/bills.php(5): require('...')\n#3 {main}"}
{"mode":"send_email","type":"Error","file":"/mnt/drive3/customerdb/backend/cust_email_service.php","line":277,"trace":"#0 /mnt/drive3/customerdb/backend/cust_email.php(20): app_review_request_send_email()\n#1 /mnt/drive3/customerdb/webui/backend/cust_email.php(5): require('...')\n#2 {main}"}
[]
{"customer_payment_transaction_id":"6112","payment_id":"64091","order_id":"104165","visit_id":"129412","customer_id":"148006","customer_name":"Alison Belletete","transaction_date":"2026-04-20 00:00:00","payment_method":"Cash","payment_type":"Deposit","bucket":"cash","amount":"100.00","tip_amount":"0.00","is_new_customer":"0","source":"payments","created_at":"2026-04-20 16:35:33","updated_at":"2026-04-20 16:35:33"}
{"customer_payment_transaction_id":"6112","payment_id":"64091","order_id":"104165","visit_id":"129412","customer_id":"148006","customer_name":"Alison Belletete","transaction_date":"2026-04-20 00:00:00","payment_method":"Cash","payment_type":"Payment","bucket":"cash","amount":"270.00","tip_amount":"0.00","is_new_customer":"0","source":"payments","created_at":"2026-04-20 16:35:00","updated_at":"2026-04-20 16:35:00"}
[]
{"customer_payment_transaction_id":"6113","payment_id":"64092","order_id":"104165","visit_id":"129412","customer_id":"148006","customer_name":"Alison Belletete","transaction_date":"2026-04-20 00:00:00","payment_method":"Cash","payment_type":"Balance","bucket":"cash","amount":"270.00","tip_amount":"0.00","is_new_customer":"0","source":"payments","created_at":"2026-04-20 16:35:33","updated_at":"2026-04-20 16:35:33"}
{"deleted":true}
[]
{"customer_payment_transaction_id":"6114","payment_id":"64093","order_id":"104165","visit_id":"129412","customer_id":"148006","customer_name":"Alison Belletete","transaction_date":"2026-04-20 00:00:00","payment_method":"Cash","payment_type":"Tip","bucket":"tip","amount":"69.20","tip_amount":"69.20","is_new_customer":"0","source":"payments","created_at":"2026-04-20 16:35:33","updated_at":"2026-04-20 16:35:33"}
{"deleted":true}
[]
{"customer_payment_transaction_id":"6115","payment_id":"64094","order_id":"104165","visit_id":"129412","customer_id":"148006","customer_name":"Alison Belletete","transaction_date":"2026-04-20 00:00:00","payment_method":"Cash","payment_type":"Deposit","bucket":"cash","amount":"170.00","tip_amount":"0.00","is_new_customer":"0","source":"payments","created_at":"2026-04-20 16:35:33","updated_at":"2026-04-20 16:35:33"}
{"customer_payment_transaction_id":"6115","payment_id":"64094","order_id":"104165","visit_id":"129412","customer_id":"148006","customer_name":"Alison Belletete","transaction_date":"2026-04-20 00:00:00","payment_method":"Cash","payment_type":"Deposit","bucket":"cash","amount":"100.00","tip_amount":"0.00","is_new_customer":"0","source":"payments","created_at":"2026-04-20 16:35:00","updated_at":"2026-04-20 16:35:00"}
{"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}