I’ll expand the statement model from ledger-only reporting to a full order-level distribution report. Each order will show customer payment, gross food value, discounts/promotions, taxes, restaurant payable, platform fees/commission, driver allocation, refunds, adjustments, payment status, transaction date, and settlement date, with range subtotals and totals.
I’ve identified a balance-accounting issue in the earlier ledger: customer totals included delivery and service amounts, but those allocations were not separated before calculating the merchant balance. I’m correcting that by posting distinct service-fee and driver-allocation entries so the closing balance reconciles exactly to the restaurant payable amount.
The order distribution table now includes every requested field and a totals footer. I’ve also added configurable sales tax so taxes are captured as immutable order snapshots alongside discounts, commission, restaurant payable, driver allocation, payment status, and transaction time.
The reconciliation math now distinguishes original customer payment from net allocations: cancelled orders retain the original payment and refund amounts for audit visibility, while net commission, service-fee revenue, driver allocation, and restaurant payable correctly reverse to zero. Partial merchant-funded refunds reduce the restaurant payable and outstanding balance exactly as recorded in the ledger.
Implemented Enhanced Comprehensive Account Statements with complete order-level financial distribution.
Order Breakdown
Every order now reports:
- Order number
- Branch and processing terminal
- Transaction date
- Settlement date
- Payment method
- Current payment status
- Current settlement status
- Gross food value before promotions
- Discounts and promotions
- Net food subtotal
- Applicable taxes
- Customer service fee
- Total paid by the customer
- Platform commission
- Delivery-driver allocation
- Refund amount
- Financial adjustments
- Amount payable to the restaurant
- Amount already settled
- Outstanding restaurant balance
Payment Statuses
- Paid
- Partially refunded
- Refunded
- Failed
Settlement Statuses
- Unsettled
- Partially settled
- Settled
Date-Range Totals
The order breakdown includes a totals row for the selected period:
- Number of orders
- Gross food value
- Discounts
- Net food value
- Taxes
- Service fees
- Customer payments
- Platform commissions
- Driver allocations
- Refunds
- Adjustments
- Restaurant payable
- Settled amount
- Outstanding balance
Corrected Reconciliation
The financial ledger now separates:
- Customer payment credit
- Restaurant commission deduction
- Service-fee allocation
- Driver allocation
- Refunds
- Commission reversals
- Service-fee reversals
- Driver-allocation reversals
- Adjustments
- Settlements
This ensures the account closing balance reconciles to the actual restaurant payable amount rather than incorrectly including platform or driver funds.
Refund Handling
- Cancelled orders retain the original customer payment and refund for audit visibility.
- Commission, service fee, and driver allocation reverse to zero.
- Restaurant payable also reverses to zero.
- Partial merchant-funded refunds reduce the restaurant payable and outstanding balance.
Financial Snapshots
New orders preserve:
- Gross subtotal
- Discount amount
- Promotion name
- Tax amount
- Service fee
- Historical commission amount
- Restaurant payable
- Driver allocation
- Payment status
- Payment date
Historical amounts remain unchanged if administrators later modify tax or commission parameters.
Administrator Controls
- Added configurable sales-tax percentage.
- Existing restaurant commission percentage remains configurable.
- Administrators can associate refunds, adjustments, or settlements with a specific order to populate its settlement and reconciliation details.
Exports
CSV exports now contain two sections:
- Complete order-payment distribution
- Detailed chronological transaction ledger
The enhanced report remains available to owners, assigned terminal users, and administrators according to their existing data scope.
The production build completed successfully.