Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/MultiSas/llms.txt

Use this file to discover all available pages before exploring further.

The accounting module gives every MultiSas company a standard double-entry chart of accounts alongside the ability to issue credit notes that adjust previously generated invoices. Account plan entries classify transactions into assets, liabilities, income, and costs using a predefined set of account codes, while credit notes reference the original sale and production records to maintain a clear audit trail. These features are available starting from Plan Basico and are accessible to all company types.

Chart of Accounts

Stored in collection accountplan. Each record links a company to a specific account code and classifies its type.
FieldTypeNotes
company._idStringOwning company ID snapshot
company.name_companyStringCompany name snapshot
company.name_founderStringFounder name snapshot
company.nit_companyStringCompany NIT snapshot
code_planString (enum)Account code — see table below
account_planString (enum)Account name — see table below
type_accountString (enum)"Activo", "Pasivo", "Ingreso", "Costo", or ""
Standard account codes and names:
CodeAccount NameType
1101CajaActivo
1102BancoActivo
1201ClientesActivo
1301InventarioActivo
2101ProveedoresPasivo
2201Cuentas por pagarPasivo
4101VentasIngreso
5101Costo de ventasCosto
These codes follow the standard Colombian accounting classification: 1xxx = Assets, 2xxx = Liabilities, 4xxx = Income, 5xxx = Costs & Expenses.

Credit Notes

Stored in collection credit_note. A credit note reduces the value of a previously issued invoice — for example, to correct an overcharge, process a return, or apply a discount after the fact.
FieldTypeNotes
bill_numberStringAuto-generated credit note number
date_credit_noteStringDate the credit note was issued
reasonStringExplanation for the adjustment
totalStringAdjusted total amount
companyObjectSnapshot of company identity (_id, name_company, name_founder, nit_company)
clientObjectSnapshot of client identity (_id, document_type_client, number_document_client, name_client, emial_client, phone_client)
productionObjectSnapshot of the referenced production record (_id, bill_number, price_production, type_production, quantity_production)
saleObjectSnapshot of the original sale (_id, bill_number, date_sale, quantity, state, price, sub_total, total)
When to use a credit note: Issue a credit note when an invoice has already been delivered to a client but the amount needs to be reduced — such as when goods are returned, a pricing error is found, or a negotiated discount is applied post-invoice.

Debit Notes

Stored in collection debit_note. A debit note increases the value owed on a previously issued invoice — for example, to account for additional charges, interest, or quantities not originally billed.
FieldTypeNotes
bill_numberStringAuto-generated debit note number (automatic)
date_debit_noteStringDate the debit note was issued (automatic)
reasonStringExplanation for the additional charge (manual)
totalStringAdditional amount to be charged (manual)
companyObjectSnapshot of company identity fields
clientObjectSnapshot of client identity fields
productionObjectSnapshot of the referenced production record
saleObjectSnapshot of the original sale record
When to use a debit note: Issue a debit note when a client owes more than what was originally invoiced — such as when additional items were delivered, extra services were rendered, or a pricing correction increases the balance due.
The DebitNote model exists in the codebase (src/modules/general/models/DebitNote.js) but no HTTP route is currently registered for creating or retrieving debit notes. Only the credit note route (POST /api/notes/credit/...) is wired up in notesRoutes.js and mounted in app.js. Do not attempt to POST to a debit note endpoint — it will return a 404.

Plan Requirement

Credit notes require at minimum Plan Basico to be accessible. The TokenValidationPlan middleware enforces this check on the relevant endpoints, rejecting requests from companies on "Sin Plan".
Attempting to create credit notes on a company with available_plans: "Sin Plan" will result in a 403 Forbidden response from the plan validation middleware.

API Endpoints Summary

Account Plan — /api/account_plan

MethodEndpointDescription
POST/api/account_plan/:company_idCreate a new account plan entry
GET/api/account_plan/list/:company_idList all account entries for a company (paginated)

Notes — /api/notes

MethodEndpointDescription
POST/api/notes/credit/:company_id/:sale_id/:production_id/:client_idCreate a credit note referencing a sale, production, and client
No HTTP endpoint is currently registered for debit note creation. The DebitNote model is defined in the source but the corresponding route has not yet been implemented.

Full Accounting API Reference

Browse the complete endpoint reference for account plans and credit notes.

Build docs developers (and LLMs) love