---
tags: [vompay, database]
module: VomPay
---

# [DB]DatabaseTables

## Connections
[[_VomPay]] · [[[Model]Models]]

## Tables (tenant connection)

### vom_pay_invoices
Created by: `2024_02_12_070815_create_vompay_invoices_table`

| Column | Type | Notes |
|---|---|---|
| id | bigIncrements | PK |
| my_fatoorah_invoice_id | bigInteger | MyFatoorah's invoice ID |
| payment_url | text | The payment link URL sent to customer |
| paiable_type | varchar | Polymorphic type (Invoice / ProformaInvoice / SalesEstimate) |
| paiable_id | bigInteger | Polymorphic ID |
| status | varchar | `VomPayInvoiceStatusesEnum` — indexed |
| amount | decimal 12,4 | Amount charged |
| payment_date | datetime | nullable — set on successful payment |
| payment_id | datetime | nullable ⚠️ typed as datetime (likely should be string/bigint — MyFatoorah transaction ID) |
| customer_id | FK → customers.id | cascade delete |
| notes | longText | nullable |
| created_at / updated_at | timestamps | |

### vom_pay_settings
_No explicit migration found — likely created by Tenant module or a missing migration._

| Column | Purpose |
|---|---|
| expense_account_id | FK → accounts (gateway fee account) |
| payment_account_id | FK → accounts (payment receipt account) |
| cost_center_id | FK → cost_centers (nullable) |
| apply_on_invoice | boolean — auto-link on invoice save |
| apply_on_proforma | boolean — auto-link on proforma save |
| apply_on_debit_note | boolean — auto-link on debit note save |
| apply_on_customer_receipt | boolean — auto-create receipt on payment |
| auto_convert_proforma | boolean — TODO feature |
| notes | text (nullable) |

---

## Modified Tables

### settings (central/tenant)
Migration: `2024_01_31_095204_add_is_integrated_with_vompay`

| Column Added | Type | Notes |
|---|---|---|
| is_integrated_with_vompay | boolean | default 0, nullable — set to true by `VomPaySupplierStatusService` when MyFatoorah approves supplier |

This flag gates the entire VomPay payment link feature across the Sales module.
