Skip to content

m-imprest Module

Cash and Imprest account management for Depots.


class ImprestAccount(BaseDocType):
"""Depot Cash/Bank account for imprest operations."""
code: str = Field(max_length=20, unique=True)
name: str = Field(max_length=200)
depot: str # FK to Depot
account_type: str # Main, Imprest
bank_type: str | None = None # SBI, PNB, Other, Cash
# Bank details (if not cash)
bank_name: str | None = None
bank_account_number: str | None = None
branch_number: str | None = None
ifsc_code: str | None = None
# Address
address_line_1: str | None = None
address_line_2: str | None = None
city: str | None = None
pincode: str | None = None
# Limits
at_par_limit: Decimal = Decimal("0")
daily_drawal_limit: Decimal = Decimal("0")
# GL link
gl_account: str | None = None # FK to Account in Book-Keeper
is_active: bool = True
class Meta:
table_name = "imprest_account"
class ImprestRequisition(BaseDocType):
"""Depot request for imprest funds from HO."""
requisition_number: str = Field(max_length=50, unique=True)
depot: str # FK to Depot
requisition_for_month: str # "2024-01"
requisition_date: date
receipt_date_at_ho: date | None = None
amount: Decimal
closing_balance: Decimal | None = None # Last imprest stmt balance
last_imprest_stmt_number: str | None = None
mode: str = "Letter" # Letter, Fax, Email
letter_number: str | None = None
remarks: str | None = None
status: str = "Pending" # Pending, Approved, Remitted
class Meta:
table_name = "imprest_requisition"
class ImprestRemittance(BaseDocType):
"""HO remittance to Depot against requisition."""
remittance_number: str = Field(max_length=50, unique=True)
depot: str
requisition: str | None = None # FK to ImprestRequisition
remittance_date: date
remittance_for_month: str
total_approved_amount: Decimal
number_of_instalments: int = 1
status: str = "Pending"
# Child: instalments
instalments: list["RemittanceInstalment"] = []
class Meta:
table_name = "imprest_remittance"
class RemittanceInstalment(BaseDocType):
"""Individual instalment of a remittance."""
parent: str # FK to ImprestRemittance
instalment_number: int
amount: Decimal
tt_number: str | None = None # Telegraphic transfer
tt_issue_date: date | None = None
tt_acknowledgement_date: date | None = None
class Meta:
table_name = "remittance_instalment"
class ImprestStatement(BaseDocType):
"""Weekly/Monthly imprest statement from Depot."""
statement_number: str = Field(max_length=50, unique=True)
depot: str
year: str # FK to Year
statement_type: str # Cash, Imprest
start_date: date
end_date: date
# Status
is_verified: bool = False
is_reconciled: bool = False
is_posted_to_gl: bool = False
posting_date: date | None = None
posting_for_month: str | None = None
# Child: vouchers
vouchers: list["ImprestVoucher"] = []
class Meta:
table_name = "imprest_statement"
class ImprestVoucher(BaseDocType):
"""Receipt/Payment voucher in imprest statement."""
voucher_number: str = Field(max_length=50)
statement: str # FK to ImprestStatement
depot: str
voucher_date: date
voucher_type: str # MR (Main Receipt), MP, IR, IP, JV
transaction_type: str # FK to transaction type
receipt_or_payment: str # R, P
party_type: str | None = None
party_code: str | None = None
memo_number: str | None = None
memo_date: date | None = None
memo_section: str | None = None
amount: Decimal
narration: str | None = None
# Reconciliation
is_reconciled: bool = False
is_verified: bool = False
# Payment details (child)
payment_details: list["VoucherPaymentDetail"] = []
class Meta:
table_name = "imprest_voucher"
unique_together = [("depot", "voucher_number", "voucher_type")]
class VoucherPaymentDetail(BaseDocType):
"""Mode of payment details for a voucher."""
parent: str # FK to ImprestVoucher
line_number: int
mode: str # Cash, Cheque, DD, TT, MO
cheque_dd_number: str | None = None
issue_date: date | None = None
amount: Decimal
clearing_date: date | None = None
is_reconciled: bool = False
class Meta:
table_name = "voucher_payment_detail"

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Depot β”‚ ──► β”‚ Requisition β”‚ ──► β”‚ HO Reviews β”‚
β”‚ Submits Reqβ”‚ β”‚ Created β”‚ β”‚ & Approves β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Depot β”‚ ◄── β”‚ TT Sent β”‚ ◄── β”‚ Remittance β”‚
β”‚ Receives β”‚ β”‚ (Instalment)β”‚ β”‚ Created β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Endpoint Method Description
/api/v1/imprest-account GET, POST Depot accounts
/api/v1/imprest-requisition GET, POST Requisitions
/api/v1/imprest-remittance GET, POST Remittances
/api/v1/imprest-statement GET, POST Statements
/api/v1/imprest-voucher GET, POST Vouchers
/api/v1/imprest-statement/{id}/verify POST Verify statement
/api/v1/imprest-statement/{id}/post POST Post to GL