Sales Invoice
The Sales Invoice Logic manages validations, credit checks, and subscription ledger updates when a Sales Invoice is created, submitted, or cancelled.
Main Functions
- Validate: Updates customer address, checks IMEI validity, and calculates total amounts for device subscription items.
- Before Submit: Verifies customer credit limit before allowing submission.
- On Submit: Creates entries in the Subscription Ledger for each device sold.
- On Cancel: Cancels related ledger entries only if no active sales exist for the same IMEI.
Credit Limit Validation
Credit Limit Validation helps control customer transactions based on their approved credit or deposit amount.
Steps
- Enable Credit Limit Based Transactions in Customer.
- Set Credit Limit.
- When you submit an invoice, the system checks if the limit is exceeded.
- If exceeded, it shows a warning and marks it as Pending for approval.
- If within limit, it auto-approves as Approved.
This ensures safe, controlled spending and proper approval before exceeding limits.
Video Tutorial
Watch the video below for a step-by-step demonstration of credit limit validation:
Deposit Flow
Deposit represents the amount added to a customer’s account to increase their available credit limit.
Steps
- Create a Journal Entry for the customer’s deposit.
- Select the customer under the Party Type and enter the deposit amount.
- Once submitted, the amount updates in the customer’s Total Deposit.
- The system then increases the customer’s Active Credit Limit automatically.
- This deposit can be used for future payments or invoice adjustments.
In short — adding a deposit through Journal Entry increases the supplier’s available credit for new transactions.
Video Tutorial
Watch the video below for a step-by-step demonstration of deposit and credit limit flow:
Subscription Validations
- Ensures each IMEI has an active Purchase Invoice before creating a Sales Invoice.
- Prevents overlapping sales periods for the same IMEI number.
- Checks that the sales period does not exceed the available purchase coverage.
- Validates date ranges so that End Date is always later than Start Date.
Sales Invoice with multiple purchase invoices
Subscription Totals
The total for each subscription item is automatically calculated based on quantity × rate − discount.
Credit Limit Check
The system checks the customer’s credit limit before submission. If the limit is exceeded, the invoice cannot be submitted until the outstanding amount is cleared.
Cancellation Rules
A Sales Invoice cannot be cancelled if any related Subscription Ledger entries are still active. Once those are cleared, the linked ledger entries are marked as cancelled.
Purpose
- Ensures valid IMEI and subscription periods before billing.
- Keeps Subscription Ledger entries synchronized with invoices.
- Prevents credit limit breaches and duplicate device sales.
- Maintains accurate financial and subscription records.