Skip to content

Receipt Vouchers

Receipt vouchers (سندات القبض) are multi-line receipt documents used for complex receipts from business partners. Each voucher can contain multiple lines, each targeting a different GL account, payment method, or check number. When approved, the system automatically creates a balanced journal entry. The print endpoint provides enriched data with company info and amount in words (Arabic and English).

Purpose

  • Record multi-line receipts from business partners
  • Support mixed payment methods within a single voucher (cash, check, bank transfer, card)
  • Auto-generate voucher numbers via the sequence service
  • Create journal entries automatically on approval
  • Reverse journal entries on cancellation
  • Provide printable voucher data with amount in words and company letterhead info
  • Track cross-references to other documents (invoices, sales orders, etc.)

Entity Attributes

Receipt Voucher (Header)

FieldTypeDescription
idbigintPrimary key
company_idbigintFK to companies
branch_idbigint?FK to branches
voucher_numberstringAuto-generated sequence number (e.g., RV-2026-0001)
datedateVoucher date
partner_idbigint?FK to business_partners
total_amountdecimal(12,3)Total receipt amount
amount_in_wordsstring?Amount written in words (stored value)
payment_methodenumPrimary method: cash, check, bank_transfer, card, mixed
receiving_account_idbigint?FK to accounts (primary receiving GL account)
bank_account_idbigint?FK to bank_accounts
check_numberstring?Check number (header level)
check_datedate?Check date
check_bankstring?Issuing bank name
descriptionstring?English description
description_arstring?Arabic description
reference_typestring?Related document type (e.g., invoice, sales_order)
reference_idbigint?Related document ID
reference_numberstring?Related document number
cost_center_idbigint?FK to cost_centers
currency_idbigint?FK to currencies
exchange_ratedecimal(12,6)?Exchange rate if non-base currency
statusenumdraft, approved, cancelled
journal_entry_idbigint?FK to journal_entries (set on approval)
created_bybigintFK to users
approved_bybigint?FK to users
approved_atdatetime?Approval timestamp
created_attimestampCreation timestamp
updated_attimestampLast update timestamp
deleted_attimestamp?Soft-delete timestamp

Receipt Voucher Line

FieldTypeDescription
idbigintPrimary key
receipt_voucher_idbigintFK to receipt_vouchers
account_idbigint?FK to accounts (revenue/credit account)
partner_account_idbigint?FK to accounts (partner's AR account)
amountdecimal(12,3)Line amount
payment_methodenum?Line-level payment method override
bank_account_idbigint?Line-level bank account
check_numberstring?Line-level check number
descriptionstring?Line description

Relationships

Lifecycle

API Endpoints

MethodPathDescription
GET/api/accounting/receipt-vouchersList receipt vouchers (paginated)
POST/api/accounting/receipt-vouchersCreate a new receipt voucher (draft)
GET/api/accounting/receipt-vouchers/{id}Get a single receipt voucher with lines
PUT/api/accounting/receipt-vouchers/{id}Update a receipt voucher (draft only)
DELETE/api/accounting/receipt-vouchers/{id}Soft-delete a receipt voucher (draft only)
POST/api/accounting/receipt-vouchers/{id}/approveApprove and create journal entry
POST/api/accounting/receipt-vouchers/{id}/cancelCancel and reverse journal entry
GET/api/accounting/receipt-vouchers/{id}/printGet printable voucher data

Query Parameters

ParameterTypeRequiredDescription
statusstringNoFilter by status: draft, approved, cancelled
partner_idintegerNoFilter by business partner
branch_idintegerNoFilter by branch
date_fromdateNoFilter vouchers on or after this date
date_todateNoFilter vouchers on or before this date
pageintegerNoPage number (25 per page)

Request/Response Examples

Create Receipt Voucher

Request POST /api/accounting/receipt-vouchers

bash
curl -X POST https://moon-erp.test/api/accounting/receipt-vouchers \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "date": "2026-02-23",
    "partner_id": 8,
    "total_amount": "7500.000",
    "payment_method": "bank_transfer",
    "receiving_account_id": 15,
    "bank_account_id": 1,
    "description": "Customer payment for Jan/Feb invoices",
    "description_ar": "دفعة عميل لفواتير يناير وفبراير",
    "cost_center_id": 1,
    "currency_id": 1,
    "branch_id": 1,
    "lines": [
      {
        "account_id": 60,
        "partner_account_id": 10,
        "amount": "5000.000",
        "description": "Invoice #INV-2026-0008"
      },
      {
        "account_id": 60,
        "partner_account_id": 10,
        "amount": "2500.000",
        "description": "Invoice #INV-2026-0011"
      }
    ]
  }'
dart
final response = await http.post(
  Uri.parse('https://moon-erp.test/api/accounting/receipt-vouchers'),
  headers: {
    'Authorization': 'Bearer $token',
    'Content-Type': 'application/json',
    'Accept': 'application/json',
  },
  body: jsonEncode({
    'date': '2026-02-23',
    'partner_id': 8,
    'total_amount': '7500.000',
    'payment_method': 'bank_transfer',
    'receiving_account_id': 15,
    'bank_account_id': 1,
    'description': 'Customer payment for Jan/Feb invoices',
    'description_ar': 'دفعة عميل لفواتير يناير وفبراير',
    'cost_center_id': 1,
    'currency_id': 1,
    'branch_id': 1,
    'lines': [
      {
        'account_id': 60,
        'partner_account_id': 10,
        'amount': '5000.000',
        'description': 'Invoice #INV-2026-0008',
      },
      {
        'account_id': 60,
        'partner_account_id': 10,
        'amount': '2500.000',
        'description': 'Invoice #INV-2026-0011',
      },
    ],
  }),
);

Response 201 Created

json
{
  "data": {
    "id": 1,
    "company_id": 1,
    "branch_id": 1,
    "voucher_number": "RV-2026-0001",
    "date": "2026-02-23",
    "partner_id": 8,
    "partner": {
      "id": 8,
      "name": "Al Safat Trading",
      "name_ar": "شركة الصفاة التجارية"
    },
    "total_amount": "7500.000",
    "amount_in_words": null,
    "payment_method": "bank_transfer",
    "payment_method_label": "Bank Transfer",
    "receiving_account_id": 15,
    "receiving_account": {
      "id": 15,
      "code": "1201001",
      "name": "NBK Main Account"
    },
    "bank_account_id": 1,
    "check_number": null,
    "check_date": null,
    "check_bank": null,
    "description": "Customer payment for Jan/Feb invoices",
    "description_en": "Customer payment for Jan/Feb invoices",
    "description_ar": "دفعة عميل لفواتير يناير وفبراير",
    "reference_type": null,
    "reference_id": null,
    "reference_number": null,
    "status": "draft",
    "status_label": "Draft",
    "journal_entry_id": null,
    "cost_center_id": 1,
    "currency_id": 1,
    "exchange_rate": null,
    "lines": [
      {
        "id": 1,
        "account_id": 60,
        "partner_account_id": 10,
        "amount": "5000.000",
        "payment_method": null,
        "payment_method_label": null,
        "bank_account_id": null,
        "check_number": null,
        "description": "Invoice #INV-2026-0008"
      },
      {
        "id": 2,
        "account_id": 60,
        "partner_account_id": 10,
        "amount": "2500.000",
        "payment_method": null,
        "payment_method_label": null,
        "bank_account_id": null,
        "check_number": null,
        "description": "Invoice #INV-2026-0011"
      }
    ],
    "created_by": 1,
    "approved_by": null,
    "approved_at": null,
    "created_at": "2026-02-23T10:00:00.000000Z",
    "updated_at": "2026-02-23T10:00:00.000000Z"
  }
}

Request GET /api/accounting/receipt-vouchers/1/print

Response 200 OK

json
{
  "data": {
    "voucher": {
      "id": 1,
      "voucher_number": "RV-2026-0001",
      "date": "2026-02-23",
      "partner": { "id": 8, "name": "Al Safat Trading" },
      "total_amount": "7500.000",
      "payment_method": "bank_transfer",
      "status": "approved",
      "lines": [
        { "account_id": 60, "amount": "5000.000", "description": "Invoice #INV-2026-0008" },
        { "account_id": 60, "amount": "2500.000", "description": "Invoice #INV-2026-0011" }
      ]
    },
    "company": {
      "name": "Moon ERP Co.",
      "name_ar": "شركة مون",
      "address": "Kuwait City, Block 5",
      "address_ar": "مدينة الكويت، قطعة 5",
      "phone": "+965-12345678",
      "email": "info@moonerp.com",
      "tax_number": "123456789",
      "commercial_register": "CR-2024-001",
      "logo": "logo.png"
    },
    "branch": {
      "name": "Main Branch",
      "name_ar": "الفرع الرئيسي",
      "address": "Kuwait City",
      "phone": "+965-12345678"
    },
    "amount_in_words_en": "Seven Thousand Five Hundred Kuwaiti Dinars",
    "amount_in_words_ar": "سبعة آلاف وخمسمائة دينار كويتي",
    "print_date": "2026-02-23",
    "printed_by": "Admin"
  }
}

Generated Journal Entry

When a receipt voucher is approved, the system creates a posted journal entry. The debit goes to the receiving account, and the credit lines come from the voucher lines.

LineAccountDebitCreditDescription
1Receiving account (e.g., NBK Main Account)7,500.000--Total received
2Line 1 account (e.g., AR/Revenue)--5,000.000Invoice #INV-2026-0008
3Line 2 account (e.g., AR/Revenue)--2,500.000Invoice #INV-2026-0011

Business Rules

RuleDescription
Draft-only editsVouchers can only be updated or deleted while in draft status
Auto voucher numbervoucher_number is auto-generated via the sequence service on creation
Lines replaced on updateWhen updating with lines, all existing lines are replaced with the new set
Approval creates JEApproving a draft voucher creates a posted journal entry
Cancel reverses JECancelling an approved voucher reverses the associated journal entry
Multi-line supportEach line can have its own account, amount, payment method, and check number
Mixed paymentsSet payment_method to mixed when lines use different payment methods
Company scopedAll vouchers are filtered by the authenticated user's company
Print enrichmentThe print endpoint returns company/branch info, amount in words (Arabic/English), and all relationships

Permissions

PermissionDescription
accounting.receipt-vouchers.viewView receipt vouchers and print
accounting.receipt-vouchers.createCreate new receipt vouchers
accounting.receipt-vouchers.updateUpdate draft receipt vouchers
accounting.receipt-vouchers.approveApprove draft receipt vouchers
accounting.receipt-vouchers.cancelCancel approved receipt vouchers

Moon ERP API Documentation