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

# [Command]Commands

## Connections
[[_Purchases]] · [[[Model]PurchaseBill]] · [[[Model]SupplierPaymentReceipt]] · [[[Repo]Repositories]] · [[[Cross]CrossModuleDependencies]]

## Source
`Modules/Purchases/Console/`  
Registered in: `Modules/Purchases/Providers/PurchasesServiceProvider.php`

---

## NotifyDuePurchaseBillsCommand
**Signature:** `notify:due-bills {subdomain} {--force}`

Sends notifications about due bills for a single tenant. Delegates to `NotifyDueBillsService`.  
Called per-tenant by `RunNotifyDuePurchaseBillsCommand`.

---

## RunNotifyDuePurchaseBillsCommand
**Signature:** `run:notify-due-bills {--force}`

Orchestrator — retrieves all tenants via `RetrievingTenantsService` (Tenant module), then fires `notify:due-bills` for each subdomain via Artisan.

---

## FixBillsAndReturnsAmountWhenDeletingReceiptCommand
**Signature:** `fix:bill-receipts-amount`

Data-fix command. Iterates all tenants and corrects `paid_amount` on `PurchaseBill` and `BillReturn` rows where a linked `SupplierPaymentReceipt` was deleted without properly recalculating the amounts.

Uses: `BillsPaymentReceiptsRepository` · `BillsReturnsPaymentReceiptsRepository` · `SupplierPaymentReceiptsRepository` · `PaymentReceiptTypesEnum`

---

## Notification Support
`NotifyDueBill` — queued database notification, stores `type` + `item_reference` + `reference_id`  
`NotifyDueBillContentGenerator` — extends `ContentGenerator` (CompanyUser module), generates human-readable message: "Bill {reference} should be paid"  
Translation namespace: `purchases::purchase_bills.notifications.*`
