Skip to content

Worksheets Workflow

1. Executive Summary

Purpose

The worksheets workflow is the central cash application process in Client Processing. When a buyer's payment arrives at a UTA bank account and is captured as a cash receipt, a worksheet is the working document where that cash is allocated against specific receivables (billing item details), on-account client ledger entries, and outbound payment items. Every dollar that flows through the system must pass through a worksheet before it can post to the general ledger as UTA revenue (REV) or leave the building as an outbound bank payment to the client and their party (PAY). The worksheet enforces segregation of duties through a strict multi-step lifecycle: a Cash Manager applies cash, a Cash Processor creates settlements, a Settlement Approver approves and dispatches payment items.

Scope

Covered:

  • Creating a worksheet from a cash receipt split
  • Searching for and adding receivables (billing item details) to the worksheet
  • Entering cash application amounts for REV and PAY detail lines
  • Adding deductions at the application level (tax withholding, bank charges, etc.)
  • Adding on-account client ledger entries when cash cannot be matched to a specific receivable
  • Adding passthrough and loan payout records directly
  • Status transitions: Draft → Applied → Settled → Approved → Returned
  • Reverse transitions (reject): Settled → Applied, Applied → Draft
  • The three-document return process (original sealed, reversal worksheet auto-created, replacement draft created)
  • Worksheet queue management: viewing, filtering, bulk approving, and bulk rejecting settled worksheets

Not covered (documented separately):

Key Objectives

  • Ensure every dollar received from a buyer is explicitly allocated to UTA's revenue (REV) and/or to the client's payout (PAY) before any GL posting or bank transmission occurs.
  • Enforce role-based segregation of duties so that the same user cannot apply, settle, and approve a worksheet.
  • Provide a complete, immutable audit trail: approved worksheets are never edited in-place; corrections always produce a reversal worksheet and a new replacement draft.
  • Prevent premature bank transmission by only unlocking payment items for pickup after the Settlement Approver's final approval.

2. Process Overview

mermaid
flowchart TD
    A[Cash Receipt Split exists] --> B[Create Worksheet\nCash Manager]
    B --> C[Draft status - D]
    C --> D[Add Receivables\nSearch and apply REV + PAY amounts]
    D --> E[Add Deductions\nOptional tax / bank charges]
    E --> F[Add Client Ledger\nOptional on-account entries]
    F --> G[Add Payouts\nOptional passthrough / loan items]
    G --> H{Apply Worksheet\nCash Manager}
    H -->|Validation passes| I[Applied status - P\nREV staged for GL posting]
    H -->|Reject Applied| C
    I --> J[Cash Processor creates\nSettlements for PAY applications]
    J --> K{Settle Worksheet\nCash Processor}
    K -->|All PAY have settlements| L[Settled status - T]
    K -->|Reject Settled| I
    L --> M{Approve Worksheet\nSettlement Approver}
    M -->|Approved| N[Approved status - A\nPayment items created\nReady for bank]
    M -->|Reject Settled| I
    N --> O{Return Worksheet?\nSettlement Approver}
    O -->|Yes - provide reason| P[Three documents produced]
    P --> Q[Original sealed as Returned - R]
    P --> R[Reversal worksheet auto-created\nnegative entries for ALL items]
    P --> S[Replacement draft created\nonly LOCKED items pre-populated]
    S --> D
    O -->|No| T[Worksheet complete\nPayments transmit to bank]

Walkthrough

  1. Create Worksheet — A Cash Manager opens a cash receipt split that has no active worksheet and clicks "Create Worksheet." The system validates the split, checks the parent receipt is not voided or posted, confirms no other active worksheet exists for this split, and locks the receipt to the user. A new worksheet record is created in Draft (D) status.

  2. Add Receivables — In Draft status, the user searches for billing items using client, deal, buyer, department, or payment term reference filters. Selected billing items display their REV and PAY detail lines. The user enters the dollar amounts to apply to each detail. Tax deduction badges appear automatically when withholding or VAT is calculated for the billing item's party. The user can also trigger the Auto-Apply function to fill amounts at the billing item's outstanding balance.

  3. Add Deductions (Optional) — For each receivable row, the user may open the Deductions dialog to record application-level deductions (US NRA withholding, UK FEU withholding, UK VAT, bank charges, discounts, direct payments, etc.). Suggested deductions are pre-populated from the tax engine when applicable.

  4. Add Client Ledger Entries (Optional) — If cash cannot be matched to a specific receivable, the user adds an on-account entry by selecting an existing client ledger item or creating a new one. Client ledger entries post to GL at Apply time.

  5. Add Payout Records (Optional) — The user may create passthrough (type P), loan (type L), or VAT pass-through (type V) payout records directly on the worksheet without going through the settlement process.

  6. Apply Worksheet — The Cash Manager clicks Apply. The system checks that at least one application exists. The worksheet moves to Applied (P). posting_status_cd is set to U (Unposted) on the worksheet, marking REV applications and client ledger entries as ready for GL pickup.

  7. Reject from Applied (if needed) — A Cash Processor can move the worksheet back to Draft (D) by clicking Reject. This clears the apply timestamps and posting status so cash applications can be corrected.

  8. Create Settlements — In Applied status, a Cash Processor selects PAY receivable rows using checkboxes and clicks "Create Settlement." The settlement sheet opens where the processor specifies how the PAY amount is divided among the deal parties (artist, manager, lawyer, etc.). Saving a settlement auto-creates corresponding payout records of type S.

  9. Settle Worksheet — Once all PAY applications have linked settlements, the Cash Processor clicks Settle. The worksheet moves to Settled (T). All linked settlements are also updated to Settled status. The Settle button is disabled until all PAY applications have a participant_settlement_id.

  10. Reject from Settled (if needed) — A Settlement Approver can move the worksheet back to Applied (P) by clicking Reject from the Settled tab. Settlement statuses revert to Draft so they can be edited.

  11. Approve Worksheet — The Settlement Approver reviews the worksheet and settlements in the Worksheet Queue. They click Approve (individually or in bulk). The worksheet moves to Approved (A). Payment items are created from all cash_receipt_payout records. do_not_send_ind is cleared on unlocked items so the bank transmission job picks them up.

  12. Return Worksheet (if needed) — If an approved worksheet must be corrected (e.g., wrong amount, wrong party), the Settlement Approver clicks "Reopen Worksheet" and provides a return reason. Three documents are produced: the original is sealed as Returned (R), a reversal worksheet is auto-created with negative entries for all items, and a replacement draft is created with only locked (sent-to-bank) items pre-populated as read-only. Users add fresh applications manually to the replacement draft.


3. Business Rules

3.1 One Active Worksheet Per Split

Business rule: Each cash receipt split may have at most one active worksheet at any time. A worksheet is active when cash_receipt_worksheet.current_item_ind = true. If a worksheet already exists for a split, a new one cannot be created until the existing one is returned or deleted.

Foundation reference: Validation — Worksheet Creation

Workflow context: The "Create Worksheet" button on the split is hidden or disabled when a record with current_item_ind = true already exists for that split.


3.2 Receipt Must Not Be Voided or Posted

Business rule: A worksheet cannot be created for a cash receipt that has been voided (cash_receipt.posting_status_cd = 'V') or posted (cash_receipt.posting_status_cd = 'P'). Only Unposted receipts are eligible for worksheet creation.

Foundation reference: Validation — Receipt Eligibility


3.3 At Least One Application Required to Apply

Business rule: A worksheet cannot transition from Draft (D) to Applied (P) unless at least one record exists across cash_receipt_application, cash_receipt_client_ledger, or cash_receipt_payout. An empty worksheet cannot be applied.

Foundation reference: Apply Transition — D to P

Workflow context: The Apply button is disabled when the worksheet has no applications. Once any application is added, the Apply button becomes enabled for users with canApplyWorksheet = true.


3.4 Partial Application Is Allowed

Business rule: The worksheet's unapplied balance does not need to equal zero for any status transition. Cash can be applied to only a portion of a split, and the remaining balance can be transferred to another split after approval.

Foundation reference: Apply Transition — Partial Application

Workflow context: The balance display in the worksheet header always shows the remaining unallocated amount. A non-zero remaining balance does not block Apply, Settle, or Approve.


3.5 All PAY Applications Must Have Settlements Before Settling

Business rule: A worksheet cannot transition from Applied (P) to Settled (T) if any PAY-type application (where billing_item_detail.billing_item_detail_type_cd = 'PAY' and cash_receipt_application.cash_receipt_amt_applied > 0) has a null cash_receipt_application.participant_settlement_id.

Foundation reference: Settle Transition — P to T

Workflow context: The Settle button is disabled with the tooltip "Create settlements for all PAY applications before settling" when hasUnsettledPayApplications = true. The Receivables table highlights unsettled PAY rows so the user can identify which items still need settlements.


3.6 Settlement Total Must Equal PAY Applied

Business rule: The sum of all participant_settlement_item.participant_settlement_commission_amt entries for a settlement must equal the total PAY cash_receipt_application.cash_receipt_amt_applied for the associated applications, within a tolerance of 0.01.

Foundation reference: Settlement Save Validation

Workflow context: The settlement dialog shows a running total and a mismatch error message. The Save button is disabled until the settlement items sum matches the PAY amount selected.


3.7 Worksheets Never Move Backward — Corrections Require Return

Business rule: No worksheet transitions backward through the lifecycle from Approved. An Approved worksheet cannot become Draft again. Corrections to an Approved worksheet require the Return process, which seals the original, auto-creates a reversal worksheet, and creates a new replacement draft.

Foundation reference: Return/Reopen Transition — A to R

IMPORTANT

The reject actions (Settled → Applied, Applied → Draft) are pre-approval step-back operations available while the workflow is still in progress. They do not generate reversal documents and are distinct from Return. Return is only available from Approved status and always produces three documents.


3.8 Replacement Draft Contains Only Locked Items

Business rule: When a worksheet is returned, the replacement draft is pre-populated only with applications that are locked — those where the associated payment item's payment_item.payment_execution_status_cd is PROCESSING, SENT, ACKNOWLEDGED, or PAID. Unlocked applications (payments not yet sent to the bank) are not copied to the replacement draft. Users must add fresh applications manually to avoid duplicate accumulation across successive returns.

Foundation reference: Payment Item Locking Rules

Workflow context: Locked applications appear as read-only rows in the replacement draft with a lock icon and cannot be edited or removed. Unlocked applications must be re-entered from scratch.


3.9 REV Always Reversible; Locked PAY Cannot Be Reversed

Business rule: REV applications are always reversible because the money stays in UTA's accounts. PAY applications can only be reversed if the associated payment has not been sent to the bank. Once payment_item.payment_execution_status_cd is SENT or beyond, the PAY application, its settlement, and its payment are locked and cannot be reversed. The reversal worksheet auto-generated on return always contains negative entries for ALL items (including locked), but locked PAY reversals do not post to GL.

Foundation reference: What Can and Cannot Be Reversed


3.10 GL Posting Timing Differs for REV and PAY

Business rule: REV applications and client ledger entries are staged for GL posting when the worksheet moves from Draft to Applied (cash_receipt_worksheet.posting_status_cd set to 'U'). PAY applications do not post to GL at Apply time. PAY posts to GL only after the bank confirms the outbound payment (payment_item.payment_execution_status_cd = 'ACKNOWLEDGED' or 'PAID').

Foundation reference: GL Posting — Key Integration Points


3.11 Bilateral Lock Rule

Business rule: When any payment item in a settlement is locked (PROCESSING, SENT, ACKNOWLEDGED, or PAID), the entire settlement locks — all settlement items, their associated PAY applications, and the paired REV applications are locked together. A locked PAY application also locks its corresponding REV application within the same settlement.

Foundation reference: Bilateral Lock Rule

Workflow context: On a returned worksheet, locked REV rows appear alongside locked PAY rows as read-only context. Users cannot edit or delete either.


3.12 Write-Off Worksheets Cannot Be Returned

Business rule: Worksheets associated with a write-off receipt (cash_receipt.receipt_type_cd = 'WRITE_OFF') cannot be returned through the standard reopen process. Write-off recovery uses a separate workflow.

Foundation reference: Return/Reopen Preconditions

Workflow context: The "Reopen Worksheet" button is hidden for write-off worksheets (isWriteOff = true). Write-off worksheets also skip the settlement step — they are applied directly to written-off REV receivables without requiring PAY settlements.


3.13 Receipt Lock Acquired on Worksheet Creation

Business rule: When a worksheet is created, cash_receipt.locked_by_user_id is set to the creating user's ID. This prevents concurrent worksheet creation by another user. The lock is released when the worksheet is approved.

Foundation reference: Create Worksheet — Step 5

Workflow context: If another user holds the lock, the "Create Worksheet" action fails with an error identifying the user holding the lock. The lock is also released when the user navigates away from the worksheet.


3.14 Same Billing Item Detail May Appear Multiple Times on One Worksheet

Business rule: A single billing_item_detail_id can appear multiple times on the same worksheet as separate cash_receipt_application records. This supports incremental application events, adjustments, and credits. Cross-worksheet exclusivity still applies: an active application for a detail should not exist on a different active (non-Approved, non-Returned) worksheet.

Foundation reference: cash_receipt_application — Important Note


4. Data Access & Operations References

4.1 Queries Used

OperationFoundation DocPurpose in This Workflow
getWorksheetByIdGet Worksheet by IDRetrieve the worksheet header record by primary key
getWorksheetByIdWithReceiptGet Worksheet by ID with Receipt ContextLoad the full worksheet context including split amount, receipt metadata, bank account, and lifecycle user display names for the Worksheet Detail screen
getCurrentWorksheetByCashReceiptIdGet Current Worksheet by Cash Receipt IDNavigate from a cash receipt to its current active worksheet
getWorksheetApplicationsGet Applications for WorksheetLoad all cash_receipt_application records with billing item detail and billing item context for the Receivables table
getWorksheetApplicationsUnifiedGet Unified ApplicationsLoad receivable applications, client ledger applications, and payment payouts together for balance calculation
getClientLedgerApplicationsByWorksheetIdGet Client Ledger ApplicationsLoad all cash_receipt_client_ledger records for the Client Ledger section
getPaymentItemPayoutsByWorksheetIdGet Payment PayoutsLoad all cash_receipt_payout records for the Payments section
searchReceivablesSearch ReceivablesFind billing item details matching user-entered search criteria (client, deal, buyer, department, payment term ref, etc.) for the Add Receivables dialog
getWorksheetsForQueueGet Worksheets for QueueLoad all active worksheets by status for the Worksheet Queue, including application summaries, settlement summaries, and document counts
getWorksheetStatusCountsGet Worksheet Status CountsPopulate the status tab count badges in the Worksheet Queue header
getSettledWorksheetsWithSettlementsGet Settled Worksheets with SettlementsLoad the settlement-first hierarchical view for the Settled tab in the Worksheet Queue
getSettlementsByWorksheetIdGet Settlements by Worksheet IDLoad linked settlements per billing item for the settlement status indicator on the Receivables table
getMatchReferencesForSplitTODO: Document in foundation/queries/cash-receipts.mdLoad cash_receipt_reference records for the worksheet's split to pre-filter the Search Receivables dialog and populate client IDs for Client Ledger suggestions

4.2 Procedures Used

OperationFoundation DocTrigger in This Workflow
createWorksheetCreate WorksheetUser clicks "Create Worksheet" on a cash receipt split
getOrCreateWorksheetGet or Create WorksheetUser opens a cash receipt that auto-opens its current worksheet
addApplicationAdd Receivable ApplicationUser adds a billing item from the Add Receivables dialog or Auto-Apply
updateApplicationUpdate Receivable ApplicationUser edits the REV or PAY amount on a saved receivable row
removeApplicationRemove Receivable ApplicationUser clicks delete on a saved receivable row
addReceivableImmediateAdd Receivable ImmediateUser confirms the Add Receivables dialog — creates REV and PAY applications atomically
addClientLedgerApplicationAdd Client Ledger ApplicationUser adds an existing client ledger item to the worksheet
updateClientLedgerApplicationUpdate Client Ledger ApplicationUser edits the amount on a saved client ledger row
deleteClientLedgerApplicationDelete Client Ledger ApplicationUser removes a client ledger row
createOnAccountClientLedgerCreate On-Account Client LedgerUser fills the "Create On-Account" form — creates a new client_ledger (type OA) and a linked cash_receipt_client_ledger application atomically
createPayoutOnlyCreate PayoutUser adds a passthrough, loan, or VAT pass-through payout record directly
updatePayoutUpdate PayoutUser edits a payout amount or toggles the Do Not Send flag
deletePayoutDelete PayoutUser removes a payout record
saveDeductionsSave Application DeductionsUser saves the Deductions dialog for a receivable application
applyWorksheetApply Worksheet — D to PUser clicks Apply
settleWorksheetSettle Worksheet — P to TUser clicks Settle
approveWorksheetApprove Worksheet — T to AUser clicks Approve (individual or bulk)
reopenWorksheetReturn/Reopen Worksheet — A to RUser clicks Reopen Worksheet and provides a return reason
rejectWorksheetFromAppliedReject from Applied — P to DUser clicks Reject from Applied status
rejectWorksheetFromSettledReject from Settled — T to PUser clicks Reject from Settled status or bulk-rejects from the Worksheet Queue
saveSettlementSave SettlementUser saves the Settlement Sheet — settlement record and payouts (type S) created atomically
deleteSettlementDelete SettlementUser deletes a settlement — linked payouts voided, PAY application unlinked
bulkApproveWorksheetsBulk Approve WorksheetsSettlement Approver selects multiple Settled worksheets and bulk approves from the Worksheet Queue
bulkRejectWorksheetsBulk Reject WorksheetsSettlement Approver bulk-rejects Settled worksheets back to Applied from the Worksheet Queue

5. Key User Actions

5.1 Create Worksheet

Preconditions:

  • User has CASH_MANAGER or IT role.
  • The target cash_receipt_split exists.
  • cash_receipt.posting_status_cd is neither 'V' (Voided) nor 'P' (Posted).
  • No active worksheet (current_item_ind = true) exists for the split.
  • cash_receipt.locked_by_user_id is null or matches the current user.

Procedure reference: Create Worksheet

Steps:

  1. User navigates to a cash receipt's split and sees no active worksheet exists.
  2. User clicks "Create Worksheet."
  3. System validates all preconditions, locks the receipt, and inserts a new cash_receipt_worksheet in Draft (D) status.
  4. User is navigated to the Worksheet Detail screen.

Postconditions:

  • cash_receipt_worksheet.cash_receipt_worksheet_status_cd = 'D'
  • cash_receipt_worksheet.current_item_ind = true
  • cash_receipt.locked_by_user_id = current user's ID

UI trigger: "Create Worksheet" button on the split detail. Visible when no active worksheet exists for the split. Enabled when the parent receipt is not voided.


5.2 Add Receivables (Search and Apply)

Preconditions:

  • Worksheet cash_receipt_worksheet_status_cd = 'D' and is not read-only.
  • User has CASH_MANAGER or IT role.

Procedure reference: Add Receivable Application

Steps:

  1. User clicks "Add Receivables" to open the Add Receivables dialog, or "Search" to open the full Search Receivables sheet.
  2. User enters search criteria (client, deal, buyer, department, payment term reference). Split-level match references from Cash Matching pre-populate the filters.
  3. System returns matching billing items with their outstanding REV and PAY balances.
  4. User selects one or more items and confirms. REV and PAY amounts default to the item's outstanding balance.
  5. System creates cash_receipt_application records for each selected REV and PAY detail and adds them to the Receivables table.

Postconditions:

  • New cash_receipt_application records exist for each added billing item detail with cash_receipt_amt_applied set to the user-entered or default amount.

UI trigger: "Add Receivables" button in the Receivables section header. Visible when cash_receipt_worksheet_status_cd = 'D'. Enabled when worksheet is not read-only.


5.3 Edit Application Amount

Preconditions:

  • Worksheet is in Draft (D) or Applied (P) status.
  • The application is not locked (associated payment_item.payment_execution_status_cd is not PROCESSING, SENT, ACKNOWLEDGED, or PAID).

Procedure reference: Update Receivable Application

Steps:

  1. User clicks the amount cell on a receivable row to make it editable.
  2. User enters the new amount.
  3. User saves (via Save All or focus loss). System updates cash_receipt_application.cash_receipt_amt_applied.

Postconditions:

  • cash_receipt_application.cash_receipt_amt_applied updated to the new value.
  • Worksheet balance recalculated in the header.

UI trigger: Inline editable number field on each receivable row in the REV and PAY amount columns. Editable when the worksheet is not read-only and the application is not locked.


5.4 Add Application Deduction

Preconditions:

  • Worksheet cash_receipt_worksheet_status_cd = 'D'.
  • A cash_receipt_application record exists for the billing item detail.

Procedure reference: Save Application Deductions

Steps:

  1. User clicks the deduction badge or "Add Deduction" option in the row action menu.
  2. The Deductions dialog opens, pre-populated with suggested deductions from the tax engine (US NRA withholding, UK FEU withholding, UK VAT) where applicable.
  3. User reviews and adjusts deduction amounts and types (billing_item_deduction_type_cd).
  4. User clicks Save. System creates or updates cash_receipt_application_deduction records linked to the application.

Postconditions:

  • cash_receipt_application_deduction records created with the specified billing_item_deduction_type_cd and deduction_amt_applied.
  • Tax badges on the receivable row reflect the saved deductions.

UI trigger: Deduction badge icon on each receivable row (visible when deductions exist). "Add Deduction" option in the row action menu. Both visible in Draft status when the row is not locked.


5.5 Add On-Account Client Ledger Entry

Preconditions:

  • Worksheet cash_receipt_worksheet_status_cd = 'D' and is not read-only.
  • Client context is available via match references (cash_receipt_reference with type_cd = 'CLIENT_ID') or from receivable applications.

Procedure reference: Create On-Account Client Ledger

Steps:

  1. User clicks "Create On-Account" in the Client Ledger section.
  2. User fills the form: client, optional deal/buyer/entity/department, and a descriptive name.
  3. User clicks Save. System creates a new client_ledger (type OA, status C, client_ledger_amt = '0.00') and immediately creates a linked cash_receipt_client_ledger application.
  4. The new row appears in the Client Ledger table with an editable amount field.
  5. User enters the application amount and saves.

Postconditions:

  • client_ledger.client_ledger_type_cd = 'OA' with client_ledger_open_item_ind = true
  • cash_receipt_client_ledger.cash_receipt_amt_applied set to the user-entered amount
  • Worksheet balance includes the ledger application in the total applied

UI trigger: "Create On-Account" button in the Client Ledger section header. Visible when cash_receipt_worksheet_status_cd = 'D'. Enabled when at least one client is available from match references or receivable applications.


5.6 Add Passthrough Payout

Preconditions:

  • Worksheet cash_receipt_worksheet_status_cd = 'D' and is not read-only.
  • Deal parties are available (populated from billing items already on the worksheet).

Procedure reference: Create Payout

Steps:

  1. User clicks "Add Payment" in the Payments section.
  2. User fills the Create Payment dialog: party, amount, payment type (P for Passthrough or L for Loan), optional currency, bank account, and payment date.
  3. User clicks Save. System creates a cash_receipt_payout record.

Postconditions:

  • New cash_receipt_payout with payment_item_type_cd = 'P' or 'L' and payout_status_cd = 'PENDING'.

UI trigger: "Add Payment" button in the Payments section header. Visible when cash_receipt_worksheet_status_cd = 'D' and not read-only.


5.7 Apply Worksheet (Draft → Applied)

Preconditions:

  • cash_receipt_worksheet_status_cd = 'D'
  • User has CASH_MANAGER or IT role (canApplyWorksheet = true).
  • At least one application exists across cash_receipt_application, cash_receipt_client_ledger, or cash_receipt_payout.

Procedure reference: Apply Worksheet — D to P

Steps:

  1. User clicks Apply in the worksheet header.
  2. System validates that the worksheet is in Draft and has at least one application.
  3. System sets cash_receipt_worksheet_status_cd = 'P', posting_status_cd = 'U', applied_dt = now(), applied_by = userName.
  4. Worksheet becomes read-only for editing; settlement creation becomes available to Cash Processors.

Postconditions:

  • cash_receipt_worksheet.cash_receipt_worksheet_status_cd = 'P'
  • cash_receipt_worksheet.posting_status_cd = 'U' (REV and client ledger entries ready for GL pickup)
  • cash_receipt_worksheet.applied_dt and applied_by populated

UI trigger: "Apply" button in the worksheet header. Visible when status_cd = 'D' and canApplyWorksheet = true. Disabled while application migration is in progress.


5.8 Reject from Applied (Applied → Draft)

Preconditions:

  • cash_receipt_worksheet_status_cd = 'P'
  • User has CASH_PROCESSOR or IT role (canSettleWorksheet = true).

Procedure reference: Reject from Applied — P to D

Steps:

  1. User clicks Reject in the worksheet header when status is Applied.
  2. System sets cash_receipt_worksheet_status_cd = 'D', clears applied_dt, applied_by, and sets posting_status_cd = null.
  3. Worksheet returns to editable Draft state.

Postconditions:

  • cash_receipt_worksheet.cash_receipt_worksheet_status_cd = 'D'
  • cash_receipt_worksheet.posting_status_cd = null

UI trigger: "Reject" button visible when status_cd = 'P' and canSettleWorksheet = true.


5.9 Create Settlement for PAY Applications

Preconditions:

  • Worksheet is in Applied (P) status (also permitted from Draft D).
  • User has CASH_PROCESSOR or IT role (canSettleWorksheet = true).
  • At least one PAY application row is selected via checkbox.

Procedure reference: Save Settlement

Steps:

  1. User selects one or more PAY receivable rows using checkboxes in the Receivables table.
  2. "Create Settlement" button appears showing the count of selected rows.
  3. User clicks "Create Settlement." The Settlement Sheet panel opens.
  4. User specifies how the PAY amount is divided: selects parties and enters commission percentages or flat amounts. Settlement total must equal PAY applied for the selected applications.
  5. User clicks Save. System creates a participant_settlement header and participant_settlement_item records per party, links the PAY applications via participant_settlement_id, and auto-creates cash_receipt_payout records (type S).

Postconditions:

  • participant_settlement.participant_settlement_status_cd = 'D'
  • cash_receipt_application.participant_settlement_id populated for linked PAY applications
  • cash_receipt_payout records (type S) created and linked to settlement items

UI trigger: Checkboxes appear on PAY receivable rows when canCreateSettlement = true (status D or P, user has settle permission). "Create Settlement" button appears above the table when rows are selected.


5.10 Settle Worksheet (Applied → Settled)

Preconditions:

  • cash_receipt_worksheet_status_cd = 'P'
  • User has CASH_PROCESSOR or IT role (canSettleWorksheet = true).
  • All PAY applications have a non-null cash_receipt_application.participant_settlement_id.

Procedure reference: Settle Worksheet — P to T

Steps:

  1. User clicks Settle in the worksheet header.
  2. System validates that all PAY applications have settlements.
  3. System sets cash_receipt_worksheet_status_cd = 'T', settled_dt = now(), settled_by = userName.
  4. All linked participant_settlement records are updated to Settled (T) status.

Postconditions:

  • cash_receipt_worksheet.cash_receipt_worksheet_status_cd = 'T'
  • All linked participant_settlement.participant_settlement_status_cd = 'T'
  • cash_receipt_worksheet.settled_dt and settled_by populated

UI trigger: "Settle" button visible when status_cd = 'P' and canSettleWorksheet = true. Disabled when hasUnsettledPayApplications = true.


5.11 Reject from Settled (Settled → Applied)

Preconditions:

  • cash_receipt_worksheet_status_cd = 'T'
  • User has SETTLEMENT_APPROVER or IT role (canApprove = true).

Procedure reference: Reject from Settled — T to P

Steps:

  1. User clicks Reject in the worksheet header (when status is Settled), or bulk-rejects from the Worksheet Queue.
  2. System sets cash_receipt_worksheet_status_cd = 'P', clears settled_dt and settled_by.
  3. All linked settlements revert to Draft (D) status so they can be edited or recreated.

Postconditions:

  • cash_receipt_worksheet.cash_receipt_worksheet_status_cd = 'P'
  • All linked participant_settlement.participant_settlement_status_cd = 'D'

UI trigger: "Reject" button visible when status_cd = 'T' and canApprove = true. Also available as "Reject Selected" bulk action in the Worksheet Queue Settled tab.


5.12 Approve Worksheet (Settled → Approved)

Preconditions:

  • cash_receipt_worksheet_status_cd = 'T'
  • User has SETTLEMENT_APPROVER or IT role (canApprove = true).

Procedure reference: Approve Worksheet — T to A

Steps:

  1. User clicks Approve in the worksheet detail header, or selects worksheets in the Worksheet Queue Settled tab and clicks Bulk Approve.
  2. System sets cash_receipt_worksheet_status_cd = 'A', approved_dt = now(), approved_by = userName.
  3. All linked settlements are approved.
  4. payment_item records are created from all cash_receipt_payout entries.
  5. cash_receipt_payout.do_not_send_ind is reset to false on unlocked payment items so the bank transmission batch picks them up.
  6. Fully paid billing items have billing_item.open_item_ind = false.
  7. cash_receipt.locked_by_user_id = null (lock released).

Postconditions:

  • cash_receipt_worksheet.cash_receipt_worksheet_status_cd = 'A'
  • payment_item records created with payment_execution_status_cd = 'WAITING'
  • billing_item.open_item_ind = false for fully paid items
  • cash_receipt.locked_by_user_id = null

UI trigger: "Approve" button visible when status_cd = 'T' and canApprove = true. Bulk "Approve Selected" button visible in the Worksheet Queue Settled tab when one or more worksheets are selected and canApproveWorksheet = true.


5.13 Return Worksheet (Approved → Returned + Three Documents)

Preconditions:

  • cash_receipt_worksheet_status_cd = 'A'
  • User has SETTLEMENT_APPROVER or IT role (canReopenWorksheet = true).
  • cash_receipt.receipt_type_cd != 'WRITE_OFF'.
  • cash_receipt_worksheet.cash_receipt_split_id is not null.
  • cash_receipt_worksheet.replaced_by_worksheet_id is null (not already returned).

Procedure reference: Return/Reopen Worksheet — A to R

Steps:

  1. User clicks "Reopen Worksheet" in the worksheet header.
  2. The Return Reason dialog opens. User enters a required return reason.
  3. User confirms. System produces three documents:
    • Original worksheet sealed: cash_receipt_worksheet_status_cd = 'R', current_item_ind = false, worksheet_type_cd = 'ORIGINAL'. returned_dt, returned_by, return_reason populated. replaced_by_worksheet_id points to the replacement draft.
    • Reversal worksheet inserted: worksheet_type_cd = 'REVERSAL', current_item_ind = false, posting_status_cd = 'U'. Negative mirror entries for ALL applications, client ledger entries, and payouts. reversal_of_*_id fields link back to originals.
    • Replacement draft inserted: worksheet_type_cd = 'REPLACEMENT', current_item_ind = true, cash_receipt_worksheet_status_cd = 'D'. Only LOCKED applications copied as read-only. previous_worksheet_id points to the original.
  4. User is navigated to the replacement draft worksheet.

Postconditions:

  • Original: cash_receipt_worksheet_status_cd = 'R', current_item_ind = false, replaced_by_worksheet_id set
  • Reversal: new worksheet with all negative entries, current_item_ind = false, posting_status_cd = 'U'
  • Replacement draft: new worksheet status_cd = 'D', current_item_ind = true, locked items pre-populated read-only

UI trigger: "Reopen Worksheet" button visible when status_cd = 'A', canReopenWorksheet = true, replaced_by_worksheet_id is null, and isWriteOff = false.


5.14 Bulk Approve from Worksheet Queue

Preconditions:

  • One or more worksheets with cash_receipt_worksheet_status_cd = 'T' are selected in the Worksheet Queue.
  • User has SETTLEMENT_APPROVER or IT role (canApproveWorksheet = true).

Procedure reference: Bulk Approve Worksheets

Steps:

  1. User selects one or more rows in the Settled tab using checkboxes.
  2. User clicks "Approve Selected."
  3. System processes each worksheet using the same service path as individual approval.
  4. Results show count of approved and count of failed with error messages.

Postconditions:

  • All successfully approved worksheets: cash_receipt_worksheet_status_cd = 'A' with newly created payment_item records.

UI trigger: Checkboxes on rows in the Settled tab. "Approve Selected" toolbar button appears when at least one row is checked and canApproveWorksheet = true.


6. Permissions & Role-Based Access

ActionCASH_MANAGERCASH_PROCESSORSETTLEMENT_APPROVERIT
Create WorksheetYesYes
Add / Edit / Remove ReceivablesYesYes
Add DeductionsYesYes
Add Client Ledger EntriesYesYes
Add Payout Records (Passthrough / Loan)YesYes
Apply Worksheet (D → P)YesYes
Reject from Applied (P → D)YesYes
Create Settlements (Draft or Applied)YesYes
Settle Worksheet (P → T)YesYes
Reject from Settled (T → P)YesYes
Approve Worksheet (T → A)YesYes
Bulk Approve from QueueYesYes
Bulk Reject from QueueYesYes
Return Worksheet (A → R)YesYes
View Worksheet (all statuses)YesYesYesYes
View Worksheet QueueYesYesYesYes

Field-level restrictions:

  • Locked application rows (associated payment sent to bank) are read-only for all roles — no role can edit or remove a locked application.
  • Write-off worksheets (cash_receipt.receipt_type_cd = 'WRITE_OFF') cannot be returned; the "Reopen Worksheet" button is hidden for all roles.
  • Worksheets with replaced_by_worksheet_id set are permanently read-only for all roles (original after return).
  • Settled (T) status is read-only for all users unless the user has canApprove = true (Settlement Approver or IT can approve or reject from Settled).

7. Integration Points

7.1 Upstream

SourceData ProvidedMechanism
Cash Receipts workflowcash_receipt_split with split_amt — the parent record worksheets are attached toFK cash_receipt_worksheet.cash_receipt_split_idcash_receipt_split
Cash Matching workflowcash_receipt_reference records (client ID, deal ID, buyer ID, payment term ref) tagging which client/deal the receipt relates toQueried at worksheet load via getMatchReferencesForSplit to pre-filter receivable search and populate client ledger suggestions
Billing Items / Revenuebilling_item_detail REV and PAY rows — the receivables that cash is applied against; outstanding balance computed from prior applicationsFK cash_receipt_application.billing_item_detail_idbilling_item_detail; balance queried at receivable search time
Tax EnginePre-calculated tax deductions and withholding requirements for each billing item's contracted partyTax previews loaded at worksheet load time; suggested deductions pre-populate the Deductions dialog

7.2 Downstream

ConsumerData ConsumedMechanism
General Ledger (GL) postingREV applications and client ledger entries staged for posting when cash_receipt_worksheet.posting_status_cd = 'U' (set at Apply transition)GL posting batch reads records with posting_status_cd = 'U' and sets to 'P' after posting
Settlements workflowcash_receipt_application PAY rows — source for settlement creation. Each PAY application gets linked to a participant_settlement via participant_settlement_idFK cash_receipt_application.participant_settlement_idparticipant_settlement
Payments workflowcash_receipt_payout records converted to payment_item records at worksheet approval; payment items enter the bank transmission queuecreatePaymentItemsFromPayouts called at approval; payment_item.payment_execution_status_cd starts at 'WAITING'
AR Aging reportsBilling item balances recalculated after applications are added or removed; billing_item.open_item_ind set to false when fully paid at approvalBilling item balance queries sum cash_receipt_application.cash_receipt_amt_applied across all active worksheets
Write-offsWrite-off status surfaced as a warning banner when any client on the worksheet has written-off receivablesuseWriteOffWarnings queries billing_item_detail.write_off_status_cd for clients on the worksheet

7.3 External Integrations

No external integrations are triggered directly by worksheet operations. Outbound bank payments are triggered downstream when the Payments workflow transmits payment items created at worksheet approval — see Payments Workflow for bank adapter details (CNB EASI Link, JPM ISO 20022, BofA ISO 20022).


8. Functional Screen Requirements

8.1 Worksheet Queue

Route: /cash-processing/worksheets

Data loading:

Status Tabs Region

Displays count badges for each worksheet status. Clicking a tab re-filters the queue list.

Field / ColumnSourceEditable?Condition
Draft tab countComputed: getWorksheetStatusCounts result for DNoAlways visible
Applied tab countComputed: getWorksheetStatusCounts result for PNoAlways visible
Settled tab countComputed: getWorksheetStatusCounts result for TNoAlways visible
Approved tab countComputed: getWorksheetStatusCounts result for ANoAlways visible
Returned tab countComputed: getWorksheetStatusCounts result for RNoAlways visible

Worksheet List Region

Tabular list of active worksheets (current_item_ind = true) filtered by the selected status tab.

Field / ColumnSourceEditable?Condition
Worksheet IDcash_receipt_worksheet.cash_receipt_worksheet_idNoAlways visible
Status badgecash_receipt_worksheet.cash_receipt_worksheet_status_cdNoAlways visible
Created datecash_receipt_worksheet.created_dtNoAlways visible
Created byResolved from users.first_name, users.last_nameNoAlways visible
Receipt refcash_receipt.cash_receipt_refNoAlways visible
Deposit datecash_receipt.deposit_dateNoAlways visible
Receipt amountcash_receipt.net_receipt_amt with currency_cdNoAlways visible
Split amountcash_receipt_split.split_amtNoAlways visible
Split sequencecash_receipt_split.split_sequenceNoWhen receipt has multiple splits
Bank accountbank_account.bank_account_nameNoWhen populated
Entry statuscash_receipt.entry_status (BOOK/PDNG)NoWhen populated (bank-originated receipts)
REV applied totalComputed: sum of REV cash_receipt_application.cash_receipt_amt_appliedNoWhen applications exist
PAY applied totalComputed: sum of PAY cash_receipt_application.cash_receipt_amt_appliedNoWhen applications exist
Settlement countComputed: count of distinct participant_settlement_id valuesNoWhen settlements exist
Settlement totalComputed: sum of participant_settlement_item.participant_settlement_commission_amtNoWhen settlements exist
Settlement partiesComputed: first 2–3 party display names from settlement itemsNoWhen settlements exist
Return reasoncash_receipt_worksheet.return_reasonNoWhen status_cd = 'R'
Lock indicatorcash_receipt_worksheet.locked_by_user_id and resolved user nameNoWhen locked
Document countComputed: file count for cash_receipt_worksheet entityNoAlways visible
Select checkboxClient stateYesWhen canApproveWorksheet = true and status_cd = 'T' (Settled tab)

Grid features:

  • Sortable columns: worksheet ID, created date, receipt ref, deposit date, receipt amount, split amount
  • Filters: free-text search on receipt ref and bank account name; entry status filter (BOOK/PDNG)
  • Row selection: multi-select checkbox — used for bulk Approve and bulk Reject (Settled tab only)
  • Pagination: yes, default 25 per page

Conditional display:

  • "Approve Selected" and "Reject Selected" bulk action buttons visible when at least one row is checked and canApproveWorksheet = true
  • Row-level "Review" slide-out panel appears on row click — shows inline settlement detail, Approve, and Reject buttons
  • The Settled tab shows a settlement-first hierarchical view grouped by worksheet with expanded settlement items, instead of flat rows
  • Amount threshold highlighting applied to settlement totals: yellow at warning threshold, distinct at critical threshold

8.2 Worksheet Detail

Route: /worksheets/[id]

Data loading:

  • getWorksheetWithReceiptGet Worksheet by ID with Receipt Context
  • getWorksheetApplicationsUnified — all applications (receivables, client ledger, payouts) for balance calculation and table population
  • getSettlementsByWorksheetId — linked settlements per billing item for settlement status indicators
  • getMatchReferencesForSplit — split references for pre-filtering receivable search and client ledger suggestions
  • getDealPartiesForWorksheet — deal parties available for payout creation dialogs
  • getAllDepartments, getAllEntities — global reference data for dropdown options
  • getCurrentUserPermissions — loaded server-side at page entry

Header Region

Displays the worksheet's identity, status, receipt context, currency, source traceability, lifecycle metadata, tax summary, and action buttons.

Field / ColumnSourceEditable?Condition
Worksheet IDcash_receipt_worksheet.cash_receipt_worksheet_idNoAlways visible
Status badgecash_receipt_worksheet.cash_receipt_worksheet_status_cdNoAlways visible
Write-Off badgeComputed: cash_receipt.receipt_type_cd = 'WRITE_OFF'NoWhen write-off worksheet
Receipt referencecash_receipt.cash_receipt_refNoAlways visible
Original currencycash_receipt.currency_cdNoAlways visible
FX ratecash_receipt.fx_rateNoAlways visible
Bank accountbank_account.bank_account_nameNoWhen populated
Filenamecash_receipt.filenameNoWhen bank-originated
Entry statuscash_receipt.entry_statusNoWhen bank-originated
Createdcash_receipt_worksheet.created_dt and creator display nameNoAlways visible
Appliedcash_receipt_worksheet.applied_dt and applied_byNoWhen status_cd >= P
Settledcash_receipt_worksheet.settled_dt and settled_byNoWhen status_cd >= T
Approvedcash_receipt_worksheet.approved_dt and approved_byNoWhen status_cd = 'A' or 'R'
Rejectedcash_receipt_worksheet.rejected_dt and rejected_byNoWhen a reject occurred
Previous Reopenedreturned_dt from the worksheet identified by previous_worksheet_idNoWhen this is a replacement draft
Tax Summary barComputed from tax engine: total withholding, total VAT, required tax forms, receivables with taxNoWhen total withholding or VAT > 0

Balance Display Region

Field / ColumnSourceEditable?Condition
Split amountcash_receipt_split.split_amtNoAlways visible
REV appliedComputed: sum of REV application amountsNoAlways visible
PAY appliedComputed: sum of PAY application amountsNoAlways visible
Total appliedComputed: REV + PAY + client ledger + payoutsNoAlways visible
Remaining balanceComputed: split amount – total appliedNoAlways visible
On-account pendingComputed: sum of auto-populated client ledger amounts not yet savedNoWhen auto-populated items exist

Action Buttons Region

Field / ColumnSourceEditable?Condition
Apply buttonCalls applyWorksheetYesstatus_cd = 'D' and canApplyWorksheet = true and not migrating
Settle buttonCalls settleWorksheetYesstatus_cd = 'P' and canSettleWorksheet = true; disabled when hasUnsettledPayApplications = true
Reject (Applied → Draft)Calls rejectWorksheetFromAppliedYesstatus_cd = 'P' and canSettleWorksheet = true
Approve buttonCalls approveWorksheetYesstatus_cd = 'T' and canApprove = true
Reject (Settled → Applied)Calls rejectWorksheetFromSettledYesstatus_cd = 'T' and canApprove = true
Reopen Worksheet buttonOpens Return Reason dialogYesstatus_cd = 'A' and canReopenWorksheet = true and replaced_by_worksheet_id is null and not write-off
Back to WorksheetsNavigation to queueYesWhen status_cd is S, A, or worksheet is read-only
Read-Only View indicatorStatic textNoWhen replaced_by_worksheet_id is set or other read-only conditions

Receivables Table Region

Displays all cash_receipt_application records grouped by billing item, with REV and PAY rows per item.

Field / ColumnSourceEditable?Condition
Select checkboxClient stateYescanCreateSettlement = true and PAY amount > 0 and no existing settlement
Client namebilling_item.client_idparty.display_nameNoAlways visible
Deal namebilling_item.deal_iddeal.deal_nameNoAlways visible
Billing item namebilling_item.billing_item_nameNoAlways visible
REV amount appliedcash_receipt_application.cash_receipt_amt_applied (REV detail row)YesWhen not read-only and application not locked
PAY amount appliedcash_receipt_application.cash_receipt_amt_applied (PAY detail row)YesWhen not read-only and application not locked
REV outstanding balanceComputed: billing_item_detail.billing_item_detail_total_amt minus sum of prior applicationsNoAlways visible
PAY outstanding balanceComputed: same for PAY detailNoAlways visible
Tax badgeComputed from tax engine preview for billing itemNoWhen tax withholding or VAT applies
Deduction badgeDerived from cash_receipt_application_deduction records countNoWhen deductions exist
Settlement status badgeparticipant_settlement.participant_settlement_status_cd via participant_settlement_idNoWhen settlement linked
Write-off badgebilling_item_detail.write_off_status_cdNoWhen write_off_status_cd != 'NOT_WRITTEN_OFF'
Lock iconDerived from payment_item.payment_execution_status_cdNoWhen application is locked
Row action menuActions: Add Commission, Commission Adjust, Split Billing, Payment Adjust, Open Deductions, RemoveYesWhen not read-only and not locked

Grid features:

  • Sortable columns: client name, deal name
  • Filters: none (items are fixed to this worksheet's applications)
  • Row selection: multi-select checkbox on PAY rows for settlement creation
  • Pagination: no (all rows shown)

Conditional display:

  • "Add Receivables" button in section header visible when status_cd = 'D' and not read-only
  • "Create Settlement" button appears above grid when PAY rows are selected and canCreateSettlement = true
  • Write-Off Warning Banner appears above the table when any client on the worksheet has written-off receivables

Client Ledger Table Region

Displays all cash_receipt_client_ledger and auto-populated on-account entries.

Field / ColumnSourceEditable?Condition
Client namecash_receipt_client_ledger.client_idparty.display_nameNoAlways visible
Ledger nameclient_ledger.client_ledger_nameNoAlways visible
Deal namecash_receipt_client_ledger.deal_iddeal.deal_nameNoWhen deal is set
Amount appliedcash_receipt_client_ledger.cash_receipt_amt_appliedYesWhen not read-only; inline editable
Auto-populated amountClient state: autoPopulatedAmounts mapYesWhen auto-populated from client ledger suggestions
Remove buttonClient actionYesWhen not read-only

Grid features:

  • Sortable columns: none
  • Filters: none
  • Row selection: none
  • Pagination: no

Conditional display:

  • "Create On-Account" button visible when status_cd = 'D' and not read-only and clients are available
  • Auto-populated rows appear before being saved; styled differently to indicate pending state

Payments Table Region

Displays all cash_receipt_payout records.

Field / ColumnSourceEditable?Condition
Party namecash_receipt_payout.payout_party_idparty.display_nameNoAlways visible
Payment typecash_receipt_payout.payment_item_type_cd (label: Settlement, Passthrough, Loan, VAT, Reversal)NoAlways visible
Amountcash_receipt_payout.payment_item_amtYesWhen not read-only and not locked
Currencycash_receipt_payout.payment_item_currency_cdNoAlways visible
Payment datecash_receipt_payout.payment_dateNoWhen populated
Do Not Sendcash_receipt_payout.do_not_send_indYesWhen not read-only
Payout statuscash_receipt_payout.payout_status_cdNoWhen not PENDING
Remove buttonClient actionYesWhen not locked and not read-only; not available for settlement-derived payouts (type S)

Grid features:

  • Sortable columns: none
  • Filters: none
  • Row selection: none
  • Pagination: no

Conditional display:

  • "Add Payment" button visible when status_cd = 'D' and not read-only
  • Locked payouts from the returned worksheet displayed with lock icon and no edit controls

Documents Region

Displays files attached to the worksheet and linked settlements.

Field / ColumnSourceEditable?Condition
File nameFile storage metadataNoWhen files exist
File typeFile storage metadataNoWhen files exist
Settlement selectorDropdown: linked participant_settlement records with document countsYesWhen settlements with documents exist

Grid features:

  • Sortable columns: none
  • Filters: none
  • Row selection: none
  • Pagination: no

Conditional display:

  • Upload button visible when not read-only
  • PDF document preview opens when a settlement document is selected

8.3 Add Receivables Dialog

Route: Modal dialog within /worksheets/[id]

Data loading:

  • searchReceivablesSearch Receivables triggered by search criteria changes or on dialog open

Search Criteria Region

Field / ColumnSourceEditable?Condition
Client filterUser input; pre-populated from cash_receipt_reference match referencesYesAlways visible
Deal filterUser input; pre-populated from match referencesYesAlways visible
Buyer filterUser inputYesAlways visible
Department filterUser inputYesAlways visible
Payment term ref filterUser input; pre-populated from match referencesYesAlways visible
Hide zero balance toggleClient state, default trueYesAlways visible

Results Grid Region

Field / ColumnSourceEditable?Condition
Client namebilling_item.client_idparty.display_nameNoAlways visible
Deal namebilling_item.deal_iddeal.deal_nameNoAlways visible
Billing item namebilling_item.billing_item_nameNoAlways visible
REV outstanding balanceComputed: billing_item_detail.billing_item_detail_total_amt – sum appliedNoAlways visible
PAY outstanding balanceComputed: same for PAY detailNoAlways visible
REV amount to applyUser input, default = outstanding balanceYesAlways visible
PAY amount to applyUser input, default = outstanding balanceYesAlways visible
Tax badgeTax engine preview for billing itemNoWhen tax applies
Select checkboxClient stateYesAlways visible

Grid features:

  • Sortable columns: client name, deal name
  • Filters: driven by Search Criteria Region
  • Row selection: multi-select checkbox
  • Pagination: yes

Conditional display:

  • "Add to Worksheet" confirm button enabled when at least one row is selected
  • Items already on the worksheet shown with an indicator but still selectable (multiple applications per item are allowed)

8.4 Settlement Sheet

Route: Slide-over panel within /worksheets/[id]

Data loading:

  • getSettlementDefaults — default party and commission data from deal configuration
  • getSettlementByApplicationIds — existing settlement data when editing

Settlement Form Region

Field / ColumnSourceEditable?Condition
PAY applied (display only)Computed: sum of PAY cash_receipt_amt_applied for selected applicationsNoAlways visible
Settlement total (running)Computed: sum of entered commission amountsNoAlways visible
Mismatch warningComputed: settlement total ≠ PAY appliedNoWhen mismatch exists
Party nameparticipant_settlement_item.payment_party_idparty.display_nameYesPer row
Commission percentageparticipant_settlement_item.participant_settlment_commission_percYesPer row (percentage-based)
Commission amountparticipant_settlement_item.participant_settlement_commission_amtYesPer row
Flat amount indicatorparticipant_settlement_item.participant_settlement_commission_flat_indYesPer row
Add party buttonClient actionYesAlways visible
Remove party buttonClient actionYesPer row when more than one party

Grid features:

  • Sortable columns: none
  • Filters: none
  • Row selection: none
  • Pagination: no

Conditional display:

  • Save button disabled when settlement total does not equal PAY applied
  • "Delete Settlement" button visible when editing an existing settlement that is not locked

8.5 Deductions Dialog

Route: Modal dialog within /worksheets/[id]

Data loading:

  • getSuggestedDeductions — from tax engine preview data already loaded at worksheet entry

Deduction Rows Region

Field / ColumnSourceEditable?Condition
Deduction typecash_receipt_application_deduction.billing_item_deduction_type_cdYesPer row
Amountcash_receipt_application_deduction.deduction_amt_appliedYesPer row
Pre-populated indicatorDerived from tax engine suggestionNoWhen suggestion provided
Add deduction row buttonClient actionYesAlways visible
Remove row buttonClient actionYesPer row

Grid features:

  • Sortable columns: none
  • Filters: none
  • Row selection: none
  • Pagination: no

Conditional display:

  • "Apply Suggested" button visible when the tax engine has calculated deductions for the billing item
  • Warning displayed when total deduction amount exceeds the application amount

8.6 Return Reason Dialog

Route: Modal dialog within /worksheets/[id]

Data loading: None — captures user input only.

Dialog Region

Field / ColumnSourceEditable?Condition
Return reason textUser input, stored in cash_receipt_worksheet.return_reasonYesAlways editable
Confirm buttonClient action, calls reopenWorksheetYesEnabled when reason is non-empty
Cancel buttonClient actionYesAlways visible

Grid features: None.

Conditional display:

  • Confirm button disabled when returnReason is empty or whitespace only.

9. Additional Diagrams

Worksheet Status State Machine

mermaid
stateDiagram-v2
    [*] --> D : Create worksheet
    D --> P : Apply\n(Cash Manager)
    P --> D : Reject\n(Cash Processor)
    P --> T : Settle\n(Cash Processor)
    T --> P : Reject\n(Settlement Approver)
    T --> A : Approve\n(Settlement Approver)
    A --> R : Return\n(Settlement Approver)
    R --> [*]

    state "Draft (D)" as D
    state "Applied (P)" as P
    state "Settled (T)" as T
    state "Approved (A)" as A
    state "Returned (R)" as R

Three-Document Return Process

mermaid
sequenceDiagram
    participant User as Settlement Approver
    participant System
    participant Original as Original Worksheet (A)
    participant Reversal as Reversal Worksheet
    participant Replacement as Replacement Draft

    User->>System: Click Reopen Worksheet
    System->>User: Prompt for return reason
    User->>System: Enter reason and confirm
    System->>Original: status = R, current_item_ind = false\nworksheet_type_cd = ORIGINAL\nreturned_dt, returned_by, return_reason set
    System->>Reversal: Insert new worksheet\nworksheet_type_cd = REVERSAL\ncurrent_item_ind = false\nposting_status_cd = U\nNegative mirror entries for ALL items
    System->>Replacement: Insert new worksheet\nworksheet_type_cd = REPLACEMENT\ncurrent_item_ind = true\nOnly LOCKED items copied as read-only
    System->>Original: replaced_by_worksheet_id = Replacement.id
    System->>Replacement: previous_worksheet_id = Original.id
    System->>User: Navigate to Replacement Draft

GL Posting Timing

mermaid
flowchart LR
    A[Apply Worksheet\nD to P] -->|posting_status_cd set to U| B[GL Batch picks up REV\nand Client Ledger entries]
    B --> C[REV posted to GL\nposting_status_cd set to P]
    D[Approve Worksheet\nT to A] --> E[Payment items created\ndo_not_send_ind reset to false]
    E --> F[Bank confirms payment\nACKNOWLEDGED or PAID]
    F --> G[PAY posted to GL]

10. Cross-References

DocumentRelationship
Worksheets Data ModelDefines all tables used in this workflow: cash_receipt_worksheet, cash_receipt_application, cash_receipt_application_deduction, cash_receipt_client_ledger, cash_receipt_payout, client_ledger
Worksheets QueriesSpecifies all data retrieval operations for worksheet loading, receivable search, queue display, and balance calculation
Worksheets ProceduresSpecifies all data mutation operations for worksheet creation, application CRUD, status transitions, and the three-document return process
Billing Items Data ModelDefines billing_item and billing_item_detail — the receivables worksheets apply cash against. REV and PAY detail types drive the split between UTA revenue and client payout
Cash Receipts Data ModelDefines cash_receipt and cash_receipt_split — the parent records from which worksheets are created. Receipt posting status and split amount constrain worksheet creation and balance calculations
Cash Receipts WorkflowUpstream: cash receipt and split lifecycle, split status management, and the agent submission flow that precedes worksheet creation
Cash Matching WorkflowUpstream: tagging a split with client/deal/buyer references that pre-filter the receivable search dialog and trigger client ledger suggestions
Settlements WorkflowDownstream: creating and managing participant settlements for PAY applications. Settlements are initiated from within the worksheet in Applied status
Payments WorkflowDownstream: outbound payment transmission. Payment items created at worksheet approval enter the payment execution queue
Write-Offs WorkflowRelated: write-off worksheets skip settlement and cannot be returned; write-off recovery produces a separate type of receipt
AR Aging WorkflowRelated: billing item balances depend on worksheet applications; approved worksheets close billing_item.open_item_ind on fully paid items

11. Gherkin Scenarios

gherkin
Feature: Worksheets - Cash Application Lifecycle

  Scenario: Happy path - full worksheet lifecycle for a standard receipt
    Given a cash receipt with `cash_receipt.posting_status_cd = 'U'` for $10,000 USD
    And a `cash_receipt_split` with `split_amt = '10000.00'` and `split_status_cd = 'A'`
    And a billing item for client "Taylor Swift" with REV detail total $1,500.00 and PAY detail total $8,500.00
    And the current user has role CASH_MANAGER
    When the user clicks "Create Worksheet" for the split
    Then a `cash_receipt_worksheet` record exists with `cash_receipt_worksheet_status_cd = 'D'` and `current_item_ind = true`
    And `cash_receipt.locked_by_user_id` is set to the current user's ID
    When the user adds the billing item with REV amount $1,500.00 and PAY amount $8,500.00
    Then two `cash_receipt_application` records exist on the worksheet
    And the worksheet balance shows Remaining = $0.00
    When the user with role CASH_MANAGER clicks Apply
    Then `cash_receipt_worksheet.cash_receipt_worksheet_status_cd = 'P'`
    And `cash_receipt_worksheet.posting_status_cd = 'U'`
    And `cash_receipt_worksheet.applied_dt` is populated
    When a user with role CASH_PROCESSOR selects the PAY row and creates a settlement for "Taylor Swift" at 100% for $8,500.00
    Then a `participant_settlement` exists with `participant_settlement_status_cd = 'D'`
    And `cash_receipt_application.participant_settlement_id` is populated for the PAY application
    And a `cash_receipt_payout` exists with `payment_item_type_cd = 'S'` and `payment_item_amt = '8500.00'`
    When the user with role CASH_PROCESSOR clicks Settle
    Then `cash_receipt_worksheet.cash_receipt_worksheet_status_cd = 'T'`
    And `participant_settlement.participant_settlement_status_cd = 'T'`
    When a user with role SETTLEMENT_APPROVER clicks Approve
    Then `cash_receipt_worksheet.cash_receipt_worksheet_status_cd = 'A'`
    And a `payment_item` exists with `payment_execution_status_cd = 'WAITING'`
    And `cash_receipt.locked_by_user_id` is null

  Scenario: Happy path - partial application leaves remaining balance
    Given a `cash_receipt_split` with `split_amt = '15000.00'`
    And a billing item for client "Ed Sheeran" with REV detail $1,200.00 and PAY detail $6,800.00
    When the user adds the billing item with REV $1,200.00 and PAY $6,800.00
    Then total applied = $8,000.00 and remaining = $7,000.00
    When the user with role CASH_MANAGER clicks Apply
    Then the Apply succeeds despite remaining > $0.00
    And `cash_receipt_worksheet.cash_receipt_worksheet_status_cd = 'P'`

  Scenario: Happy path - on-account client ledger entry
    Given a worksheet in Draft status with a `cash_receipt_reference` tagging client "Drake" via `type_cd = 'CLIENT_ID'`
    When the user clicks "Create On-Account" and fills in name "Drake Q1 Advance" with no specific deal
    Then a `client_ledger` record exists with `client_ledger_type_cd = 'OA'` and `client_ledger_amt = '0.00'`
    And a `cash_receipt_client_ledger` record exists linked to the worksheet
    When the user enters $5,000.00 in the amount field and saves
    Then `cash_receipt_client_ledger.cash_receipt_amt_applied = '5000.00'`
    And the worksheet balance includes the $5,000.00 in total applied

  Scenario: Edge case - settlement total does not equal PAY applied
    Given a worksheet in Applied status with PAY `cash_receipt_application.cash_receipt_amt_applied = '8500.00'`
    And a user with role CASH_PROCESSOR opens the Settlement Sheet
    When the user enters settlement items summing to $8,000.00
    Then the Save button is disabled
    And a validation message shows "Settlement total (8000.00) must equal PAY Applied (8500.00)"
    When the user adjusts the items to sum to $8,500.00
    Then the Save button becomes enabled

  Scenario: Edge case - Settle button disabled when PAY application has no settlement
    Given a worksheet in Applied status with a PAY application where `participant_settlement_id` is null
    When a user with role CASH_PROCESSOR views the worksheet header
    Then the Settle button is disabled
    And a tooltip reads "Create settlements for all PAY applications before settling"
    When the user creates a settlement linking that PAY application
    Then `cash_receipt_application.participant_settlement_id` is set
    And the Settle button becomes enabled

  Scenario: Edge case - Apply rejected because no applications exist
    Given a worksheet in Draft status with zero records in `cash_receipt_application`, `cash_receipt_client_ledger`, and `cash_receipt_payout`
    When a user with role CASH_MANAGER clicks Apply
    Then the action fails with error "Cannot apply: No cash applications exist"
    And `cash_receipt_worksheet.cash_receipt_worksheet_status_cd` remains `'D'`

  Scenario: Error case - Create Worksheet blocked by concurrent lock
    Given a cash receipt with `locked_by_user_id` set to user ID 42 ("Jane Smith")
    When a different user with role CASH_MANAGER attempts to create a worksheet for the receipt's split
    Then the action fails with an error indicating the receipt is locked by "Jane Smith"

  Scenario: Error case - Return blocked for write-off worksheet
    Given a worksheet in Approved status where `cash_receipt.receipt_type_cd = 'WRITE_OFF'`
    And the current user has role SETTLEMENT_APPROVER
    When the user views the worksheet header
    Then the "Reopen Worksheet" button is not visible

  Scenario: Error case - Settlement deletion blocked by locked payment
    Given a `participant_settlement` linked to a PAY application on an approved worksheet
    And the associated `payment_item.payment_execution_status_cd = 'SENT'`
    When any user attempts to delete the settlement
    Then the action fails with error "Cannot delete settlement with locked payment items. One or more payments have been sent to the bank."

  Scenario: Return case - Three documents produced with mixed locked and unlocked items
    Given an approved worksheet with two PAY applications:
      - Application A: `payment_item.payment_execution_status_cd = 'PAID'` (locked)
      - Application B: `payment_item.payment_execution_status_cd = 'WAITING'` (unlocked)
    And the current user has role SETTLEMENT_APPROVER
    When the user clicks "Reopen Worksheet" and provides return reason "Incorrect amount on deal 2"
    Then the original worksheet has `cash_receipt_worksheet_status_cd = 'R'` and `current_item_ind = false`
    And `cash_receipt_worksheet.return_reason = 'Incorrect amount on deal 2'`
    And a reversal worksheet is created with `worksheet_type_cd = 'REVERSAL'` and `posting_status_cd = 'U'` containing negative entries for BOTH Application A and Application B
    And a replacement draft is created with `worksheet_type_cd = 'REPLACEMENT'` and `current_item_ind = true`
    And the replacement draft contains a read-only copy of Application A (locked)
    And the replacement draft does NOT contain Application B (unlocked — not pre-populated)

  Scenario: Return case - Replacement draft balance reflects locked items
    Given a replacement draft with a locked PAY application of $6,000.00 (read-only, already pre-populated)
    When the user adds a new receivable for client "Beyonce" with REV $1,000.00 and PAY $5,500.00
    Then total applied = $12,500.00 (locked $6,000.00 + new $6,500.00)
    And the new REV and PAY rows are editable
    And the locked rows remain read-only

  Scenario: Happy path - bulk approve multiple settled worksheets
    Given three worksheets with `cash_receipt_worksheet_status_cd = 'T'` (IDs 101, 102, 103)
    And the current user has role SETTLEMENT_APPROVER
    When the user selects all three worksheets in the Settled tab and clicks "Approve Selected"
    Then worksheets 101, 102, 103 all have `cash_receipt_worksheet_status_cd = 'A'`
    And `payment_item` records are created for each worksheet's `cash_receipt_payout` entries
    And the Settled tab count decreases by 3 and Approved tab count increases by 3

  Scenario: Reject workflow - Settled to Applied for settlement correction
    Given a worksheet with `cash_receipt_worksheet_status_cd = 'T'` and linked `participant_settlement.participant_settlement_status_cd = 'T'`
    And the current user has role SETTLEMENT_APPROVER
    When the user clicks Reject on the worksheet
    Then `cash_receipt_worksheet.cash_receipt_worksheet_status_cd = 'P'`
    And `participant_settlement.participant_settlement_status_cd = 'D'`
    When the user edits the settlement and re-settles
    Then `cash_receipt_worksheet.cash_receipt_worksheet_status_cd = 'T'`

NOTE

PoC Artifact: The rejectWorksheetFromApplied and rejectWorksheetFromSettled server actions move the worksheet backward in status (P→D and T→P respectively) as direct database updates with no reversal document generation. These pre-approval step-back operations differ architecturally from the three-document Return process. Production implementation should consider whether these backward transitions require additional audit logging or a lightweight document trail.

NOTE

PoC Artifact: The applyWorksheet server action's validation rule comment block lists "APPLY-03: Worksheet balance must be 0 (all funds applied)" but then explicitly does not enforce it with the comment "Partial application allowed — no balance check required." The comment block was not updated after the business rule was relaxed. The correct behavior — partial application is permitted — is implemented and aligns with the CLAUDE.md domain rules. The stale comment should be removed in production code.

Confidential. For internal use only.