---
tags: [purchases, model]
module: Purchases
---

# [Model]SupplierPaymentReceipt

## Connections
[[_Purchases]] · [[[Model]Supplier]] · [[[Model]PurchaseBill]] · [[[Model]BillReturn]] · [[[Controller]Controllers]] · [[[Service]SupplierReceiptServices]] · [[[Repo]Repositories]] · [[[Observer]Observers]] · [[[Enum]Enums]] · [[[Cross]CrossModuleDependencies]]

## Source
`Modules/Purchases/Models/SupplierPaymentReceipt.php`  
Related: `SupplierPaymentReceiptAttachment.php`

## Responsibilities
- Records a payment made to or received from a supplier
- `kind` enum: `paid` (outgoing) | `received` (incoming credit)
- Tracks `paid_amount` and `not_allocated_amount` (unassigned balance)
- Can be assigned to multiple PurchaseBills and BillReturns
- Has `SupplierPaymentReceiptObserver` → records usage for `PaymentReceiptsLimits` feature
- Auditable, FormatDateAndTimeTrait, SoftDeletes, UsesTenantConnection
- `UPLOAD_PATH = 'supplier_payment_receipts'`

## Key Relationships
| Relation | Type | Target |
|---|---|---|
| supplier | belongsTo | Supplier (withTrashed) |
| account | belongsTo | Account (Accounting) via `payment_account_id` |
| formDesign | belongsTo | FormDesign (Settings) |
| attachments | hasMany | SupplierPaymentReceiptAttachment via `payment_receipt_id` |
| purchaseBills | hasManyThrough | PurchaseBill via BillPaymentReceipt |
| billsPayments | hasMany | BillPaymentReceipt |
| purchaseBillsReturns | hasManyThrough | BillReturn via BillReturnPaymentReceipt |
| billsReturnsPayments | hasMany | BillReturnPaymentReceipt |
| costCenter | belongsTo | CostCenter (Products) |
| journalEntry | belongsTo | JournalEntry (Accounting) |
| addedBy | belongsTo | User (CompanyUser) withTrashed |

## Accessors / Mutators
`paid_amount` · `not_allocated_amount` · `supplier_balance_after_transaction` (all trimNumber)  
`formatted_date` getter

## Methods
`disableAudit()` · `enableAudit()`

---

## [Model]SupplierPaymentReceiptAttachment

**Table:** `supplier_payment_receipt_attachments` — FK: `payment_receipt_id`  
`UPLOAD_PATH = 'supplier_payment_receipts'`  
Appends: `file_path`
