Overview
Cash adjustments capture income or outflow transactions broken down by tender type (cash, card, transfer). Each adjustment contains a header with metadata and one or more lines representing individual tender amounts.Adjustment Types
From CashAdjustment.php:30-33:| Type | Purpose | When to Use |
|---|---|---|
EXTERNAL_IMPORT | Daily sales totals from external POS | End-of-day import from another system |
CORRECTION | Manual adjustments to fix variances | Physical count doesn’t match expected balance |
Direction
From CashAdjustment.php:35-38:| Direction | Description | Effect on Balance |
|---|---|---|
INFLOW | Income or deposits | Increases closing balance |
OUTFLOW | Withdrawals or transfers out | Decreases closing balance |
Most adjustments are
INFLOW (daily sales). Use OUTFLOW for vault transfers or withdrawals.Adjustment Structure
Header Fields
| Field | Type | Description |
|---|---|---|
cash_session_id | Foreign Key | Links to the daily session |
source_system | String | External system name (e.g., “ExternalPOS”) |
type | Enum | EXTERNAL_IMPORT or CORRECTION |
direction | Enum | INFLOW or OUTFLOW |
notes | Text | Additional context or reason |
posted_by | Foreign Key | User who approved (nullable until posted) |
posted_at | Timestamp | When finalized (nullable until posted) |
meta | JSON | Extra metadata (batch ID, external reference) |
Line Fields
From CashAdjustmentLine.php:15-24:| Field | Type | Required | Description |
|---|---|---|---|
cash_adjustment_id | Foreign Key | Yes | Links to adjustment header |
tender_type | Enum | Yes | CASH, CARD, or TRANSFER |
amount | Decimal | Yes | Transaction amount (4 decimal places) |
currency | String | Yes | Currency code (default: MXN) |
card_terminal_id | Foreign Key | If CARD | Links to terminal |
bank_account_id | Foreign Key | If TRANSFER | Links to bank account |
reference | String | No | External batch or transaction ID |
meta | JSON | No | Tips, fees, or other data |
Tender Type Constants
From CashAdjustmentLine.php:32-37:Create an Adjustment
Endpoint
Request Example
From CreateCashAdjustmentController.php:38-52:Response
Post an Adjustment
Posting finalizes the adjustment, making it immutable and including it in the session’s closing balance.Endpoint
Posting sets
posted_by to the authenticated user and posted_at to the current timestamp.Query Scopes
From CashAdjustment.php:66-110:Helper Methods
Status Check
Total Amount
From CashAdjustment.php:123-126:Relationships
Adjustment Header
- cashSession: Parent session CashAdjustment.php:43-46
- lines: All tender lines CashAdjustment.php:51-54
- postedBy: User who approved CashAdjustment.php:59-62
Adjustment Lines
- cashAdjustment: Parent header CashAdjustmentLine.php:42-45
- cardTerminal: Terminal for
CARDlines CashAdjustmentLine.php:50-53 - bankAccount: Account for
TRANSFERlines CashAdjustmentLine.php:58-61
Workflow Diagram
Use Cases
Daily POS Import
Import end-of-day totals from external system:Variance Correction
Physical count shows $50 less than expected:Vault Transfer
Transfer excess cash to vault:Best Practices
Batch Imports
Batch Imports
Use
source_system and reference fields to track external batch IDs for reconciliationCorrection Notes
Correction Notes
Always provide detailed
notes for corrections explaining the variance and resolutionDraft Review
Draft Review
Review all lines before posting. Once posted, adjustments become immutable.
Terminal Assignment
Terminal Assignment
Assign card lines to the correct terminal to track settlement by provider and terminal
Currency Consistency
Currency Consistency
Ensure all lines within an adjustment use the same currency (typically
MXN)Multi-Tender Example
Complete end-of-day import with all tender types:Error Handling
Next Steps
Cash Sessions
Learn how adjustments affect session balances
Cash Expenses
Record operational expenses during sessions