Commit graph

11 commits

Author SHA1 Message Date
John Mizerek
c79a750a50 Show full order total on receipt, payment method below
Grand total now always shows the actual order amount. Balance and
payment method shown as informational lines underneath instead of
subtracting balance from the total.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 12:08:18 -07:00
John Mizerek
acdb28a0d0 Fix receipt for balance-only payments and add tip display
Receipt was treating balance-only orders as card payments, adding
Stripe processing fees that inflated the total. Now checks
PaymentFromCreditCard to determine if card fees apply. Also adds
tip line and includes TipAmount in total calculation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 12:05:42 -07:00
John Mizerek
214c65adb2 Fix receipt page: Payments PK is PaymentID not ID
Payments table still uses old prefixed column names.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 11:51:25 -07:00
John Mizerek
06adc1211e Fix receipt showing processing fee for cash orders
Cash orders have no card processing fee. Now checks PaymentPaidInCash
to determine payment type and skips the Stripe fee calculation + display
for cash orders.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:24:23 -07:00
John Mizerek
c580e6ec78 Auto-apply user balance on cash and card orders
Balance from cash change now silently reduces the amount owed on the
next order. For cash: deducted immediately in submitCash, reduces cash
the worker needs to collect (or skips cash task entirely if fully
covered). For card: reduces the Stripe PaymentIntent amount, deducted
in webhook on successful payment. Receipt shows "Balance applied" line.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 14:16:21 -08:00
John Mizerek
4ae3b8b3d8 Fix receipt rounding to match Stripe charge exactly
Calculate total first without intermediate rounding, then work backwards for display values.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 17:11:00 -08:00
John Mizerek
e8b70ec372 Add processing fee to receipt, match actual charge
Shows: subtotal, tax, service fee, processing fee (Stripe 2.9% + $0.30), total

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 17:08:27 -08:00
John Mizerek
379de66e6f Use business PayfritFee instead of hardcoded 5%
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 17:06:26 -08:00
John Mizerek
3e1f344fc1 Fix receipt page: show service fee, fix tax calculation
- Always show service fee (was hidden from non-admin)
- Fix tax formula: /100 not /10000

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 17:05:01 -08:00
John Mizerek
8dff081407 Fix remaining old column names missed by initial batch rename
Second pass fixing 70+ references across 32 files:
- Orders: DeliveryMultiplier→BusinessDeliveryMultiplier, OrderTipAmount→TipAmount,
  OrderPaymentCompletedOn→PaymentCompletedOn, OrderPaymentError→PaymentError
- Orders PK: WHERE OrderID=? → WHERE ID=? on Orders table
- OrderLineItems PK: OrderLineItemID→ID in INSERT, WHERE, and query results
- Items: parent.ItemID→parent.ID in JOIN conditions
- Tasks: t.TaskID→t.ID in JOIN conditions
- Users PK: WHERE UserID=X → WHERE ID=X on Users table
- Addresses PK: A.AddressID→A.ID in JOIN conditions
- tt_States: tt_StateID→ID, remove nonexistent tt_StateCountryID/tt_StateSortOrder
- tt_OrderTypes: tt_OrderTypeID→ID, tt_OrderTypeName→Name
- tt_Days: D.tt_DayID→D.ID
- confirm_email.cfm: Add missing SELECT/FROM to queries
- setLineItem.cfm: Fix 13 old column references
- Stripe webhook/payment: Fix column names and PK references

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 22:58:46 -08:00
John Mizerek
1210249f54 Normalize database column and table names across entire codebase
Update all SQL queries, query result references, and ColdFusion code to match
the renamed database schema. Tables use plural CamelCase, PKs are all `ID`,
column prefixes stripped (e.g. BusinessName→Name, UserFirstName→FirstName).

Key changes:
- Strip table-name prefixes from all column references (Businesses, Users,
  Addresses, Hours, Menus, Categories, Items, Stations, Orders,
  OrderLineItems, Tasks, TaskCategories, TaskRatings, QuickTaskTemplates,
  ScheduledTaskDefinitions, ChatMessages, Beacons, ServicePoints, Employees,
  VisitorTrackings, ApiPerfLogs, tt_States, tt_Days, tt_AddressTypes,
  tt_OrderTypes, tt_TaskTypes)
- Rename PK references from {TableName}ID to ID in all queries
- Rewrite 7 admin beacon files to use ServicePoints.BeaconID instead of
  dropped lt_Beacon_Businesses_ServicePoints link table
- Rewrite beacon assignment files (list, save, delete) for new schema
- Fix FK references incorrectly changed to ID (OrderLineItems.OrderID,
  Categories.MenuID, Tasks.CategoryID, ServicePoints.BeaconID)
- Update Addresses: AddressLat→Latitude, AddressLng→Longitude
- Update Users: UserPassword→Password, UserIsEmailVerified→IsEmailVerified,
  UserIsActive→IsActive, UserBalance→Balance, etc.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:39:12 -08:00