Download the PHP package azaharizaman/nexus-receivable without Composer
On this page you can find all versions of the php package azaharizaman/nexus-receivable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download azaharizaman/nexus-receivable
More information about azaharizaman/nexus-receivable
Files in azaharizaman/nexus-receivable
Package nexus-receivable
Short Description Accounts Receivable (A/R) package for Nexus ERP - manages customer invoicing, payment receipts, credit control, and collections
License MIT
Informations about the package nexus-receivable
Nexus\Receivable
Accounts Receivable (A/R) Package for Nexus ERP
Framework-agnostic accounts receivable management handling customer invoicing, payment receipts, credit control, and collections.
📋 Table of Contents
- Overview
- Installation
- Core Concepts
- Architecture
- Revenue Recognition
- Payment Allocation Strategies
- Credit Limit Enforcement
- Dunning & Collections
- Multi-Currency Support
- Integration Points
- Usage Examples
Overview
Nexus\Receivable manages the complete Accounts Receivable lifecycle:
- Invoicing: Creating invoices from fulfilled sales orders
- Payment Application: Tracking and applying customer payments
- Credit Control: Enforcing credit limits before order confirmation
- Collections: Automated dunning for overdue invoices
- Bad Debt: Write-off procedures with GL integration
Key Features
- ✅ Framework-agnostic pure PHP package
- ✅ Accrual basis revenue recognition (IFRS 15/ASC 606 compliant)
- ✅ Multi-currency payment support with FX gain/loss posting
- ✅ Flexible payment allocation strategies (FIFO, Proportional, Manual)
- ✅ Customer and customer group credit limits
- ✅ Automated collections workflow integration
- ✅ Unapplied cash (prepayment) management
- ✅ Comprehensive aging reports (Current, 1-30, 31-60, 61-90, 90+ days)
Installation
Add to your application's composer.json:
Install dependencies:
Required Dependencies
This package requires the following Nexus packages:
azaharizaman/nexus-finance- General Ledger integrationazaharizaman/nexus-party- Customer entity managementazaharizaman/nexus-sales- Sales order integrationazaharizaman/nexus-currency- Multi-currency supportazaharizaman/nexus-period- Accounting period validationazaharizaman/nexus-sequencing- Invoice number generationazaharizaman/nexus-audit-logger- Audit trail tracking
Core Concepts
Invoice Lifecycle
Invoice Status Definitions
| Status | Description | Can Receive Payment | Contributes to AR Balance |
|---|---|---|---|
DRAFT |
Invoice created but not submitted | ❌ | ❌ |
PENDING_APPROVAL |
Awaiting approval | ❌ | ❌ |
APPROVED |
Approved, ready for GL posting | ❌ | ❌ |
POSTED |
GL journal entry created | ✅ | ✅ |
PARTIALLY_PAID |
Some payment received | ✅ | ✅ |
PAID |
Fully paid | ❌ | ❌ |
OVERDUE |
Past due date | ✅ | ✅ |
CANCELLED |
Voided/cancelled | ❌ | ❌ |
WRITTEN_OFF |
Bad debt written off | ❌ | ❌ |
Payment Receipt Lifecycle
Architecture
Package Structure
Key Design Patterns
- Contract-Driven Design: All dependencies defined via interfaces
- Immutable Value Objects: InvoiceNumber, AgingBucket, ReceiptNumber
- Native PHP 8.x Enums: Business logic embedded in enums
- Strategy Pattern: Payment allocation strategies (FIFO, Proportional, Manual)
- Repository Pattern: Data persistence abstraction
Revenue Recognition
Accrual Basis (Default and Mandatory)
Revenue is recognized on invoice creation (or goods/service delivery), in compliance with IFRS 15/ASC 606.
Revenue Recognition Flow
Why No Cash-Basis Option?
Cash-basis revenue recognition is NOT supported to maintain:
- Compliance Integrity: IFRS/GAAP mandate accrual accounting for most entities
- Architectural Simplicity: Avoids dual-mode complexity in Finance package
- Accurate Financial Reporting: Prevents revenue manipulation
Cash-basis reporting is handled by Nexus\QueryEngine as a reporting view, not a transactional mode.
Payment Allocation Strategies
The package supports multiple strategies for applying payments across open invoices:
1. FIFO Strategy (Default)
First In, First Out - Applies payment to oldest invoice first.
Use Case: Standard practice for most businesses.
2. Proportional Strategy
Distributes payment proportionally across all open invoices.
Use Case: Customer preference for balanced allocation.
3. Manual Strategy
User specifies exact allocation amounts.
Use Case: Specific customer instructions or disputes.
Configuration
Set customer's preferred allocation strategy in Party package:
Credit Limit Enforcement
Credit limits are enforced before sales order confirmation to prevent over-extension of credit.
Individual Customer Limits
Customer Group Limits
For corporate customers with multiple subsidiaries under a single credit umbrella:
Outstanding Balance Calculation
Outstanding balance includes invoices with status:
POSTEDPARTIALLY_PAIDOVERDUE
Formula:
Integration with Sales
The CreditLimitChecker replaces the NoOpCreditLimitChecker stub in Nexus\Sales:
Dunning & Collections
Automated collections workflow for overdue invoices.
Escalation Levels
| Days Overdue | Level | Action | Integration |
|---|---|---|---|
| 7 | First Reminder | Email notification | Nexus\Notifier |
| 14 | Second Reminder | Email + phone call flag | Nexus\Notifier |
| 30 | Final Notice | Certified letter | Nexus\Notifier + Nexus\Workflow |
| 60+ | Collections | Credit status change | Nexus\Party |
Usage
Template Variables
Dunning email templates (managed via Nexus\Notifier) support:
{{customer_name}}{{invoice_number}}{{days_overdue}}{{amount_due}}{{total_outstanding}}{{due_date}}
Workflow Integration
The dunning process integrates with Nexus\Workflow:
Multi-Currency Support
Handle payments in different currency than invoice.
Scenario
- Invoice: $1,000 USD
- Payment Received: 4,500 MYR
- Exchange Rate (on payment date): 4.50 MYR/USD
Processing
Database Storage
GL Posting with FX Gain/Loss
FX Gain/Loss Calculation:
Exchange Rate Source
Exchange rates are retrieved from Nexus\Currency package:
Integration Points
With Nexus\Sales
Trigger: SalesOrderFulfilledEvent
Credit Limit Check:
With Nexus\Finance
GL Posting - Revenue Recognition:
GL Posting - Payment Receipt:
GL Posting - Bad Debt Write-Off:
With Nexus\Party
Customer Entity:
With Nexus\Notifier
Dunning Emails:
With Nexus\Workflow
Collections Escalation:
With Nexus\AuditLogger
All state transitions are logged:
Logged Events:
invoice_createdinvoice_approvedinvoice_postedpayment_receivedpayment_appliedinvoice_overdueinvoice_written_off
With Nexus\EventStream (Optional)
For large enterprises requiring payment lifecycle replay:
Usage Examples
Create Invoice from Sales Order
Approve and Post Invoice
Record and Apply Payment
Handle Prepayment (Unapplied Cash)
Generate Aging Report
Write Off Bad Debt
📖 Documentation
Package Documentation
- Getting Started Guide
- API Reference
- Integration Guide
- Examples
Additional Resources
IMPLEMENTATION_SUMMARY.md- Implementation progressREQUIREMENTS.md- RequirementsTEST_SUITE_SUMMARY.md- TestsVALUATION_MATRIX.md- Valuation
License
MIT License - see LICENSE file for details.
Support
For issues and questions, please refer to the main Nexus ERP documentation.
Package Version: 1.0.0
Nexus ERP Compatibility: Laravel 12+
PHP Requirement: ^8.3