# Payments

## Recording a Payment

1. Open the bill detail page
2. Click **Record Payment**
3. Select payment method
4. Enter amount
5. Add reference number, notes, or payment proof photo if applicable
6. Click **Save**

The bill status updates automatically:
- Full payment → `paid`
- Partial payment → `partial-paid`

---

## Payment Methods

Each payment method can be enabled or disabled per tenant under
**Configuration → Payment Methods**.

| Method | Description |
|---|---|
| `cash` | In-person cash collection |
| `easypaisa` | EasyPaisa mobile wallet |
| `jazzcash` | JazzCash mobile wallet |
| `bank_transfer` | Bank deposit or IBFT |
| `cheque` | Cheque payment |
| `other` | Any other method |

### Per-Method Configuration

For each enabled method you can configure:
- `display_name` — label shown to customers
- `account_number` — account/wallet number
- `account_title` — account holder name
- `instructions` — payment instructions shown to customer
- `surcharge_type` / `surcharge_value` — fee charged on top of bill amount
- `minimum_amount` / `maximum_amount` — accepted payment range
- `has_live_gateway` — whether to use live EasyPaisa/JazzCash API
- `gateway_credentials` — API credentials (stored encrypted)

---

## Surcharges

If a payment method has a surcharge configured:
- `percentage`: `surcharge = amount × (surcharge_value / 100)`
- `fixed`: `surcharge = surcharge_value`

The payment record stores:
- `amount` — what the customer owes
- `surcharge_amount` — the surcharge
- `net_amount` — total collected (`amount + surcharge_amount`)

---

## Payment Proof

Staff can upload a photo of the payment receipt or bank deposit slip.
Stored in `storage/payments/`.

---

## Defaults (Demo Tenant)

| Method | Enabled |
|---|---|
| Cash | ✓ |
| EasyPaisa | ✓ |
| JazzCash | ✓ |
| Bank Transfer | ✗ |
| Cheque | ✗ |
| Other | ✗ |
