LEDES 1998B User Guide

ERPNext Legal E-Billing Export
User Guide & Functional Documentation
LEDES® 1998B-compatible Sales Invoice export for ERPNext
| Purpose This guide explains the first-time LEDES field setup, the ERPNext-to-LEDES field mapping, how the app generates a LEDES® 1998B-compatible pipe-delimited file, and how users validate the generated output before submission to a legal e-billing platform. |
Version 1.0
1. Application Overview
The application extends ERPNext Sales Invoice with a legal e-billing export function. Before the first export is generated, the required LEDES identifiers and billing values must be maintained in the relevant ERPNext master records and Sales Invoice fields. Once the invoice is prepared, users can download a pipe-delimited LEDES® 1998B text file from the Sales Invoice Export menu.
| Documentation convention Screenshots are documented by screen, not by individual field. When one ERPNext screen contains several LEDES source fields, the screenshot is shown once and all related mappings are explained together underneath it. |
2. End-to-End Workflow
| 01 Set master IDs Customer, Company, Employee and Item |
02 Prepare invoice header Dates, references and description |
03 Prepare billing lines Type, quantity, rate, codes and dates |
| 04 Review invoice totals Confirm line and invoice values |
05 Download LEDES.txt Use the Sales Invoice Export menu |
06 Validate output Check all 24 fields and billing rows |
3. Initial Data Setup and Field Mapping
This is the first implementation step. Configure the source values shown in the following ERPNext screens before generating the LEDES file. Together, these configuration screens and the Sales Invoice provide the source data for all 24 LEDES® 1998B fields. Where shown, a red rectangle highlights the field or group of fields used by the exporter.
3.1 Customer Master - LEDES Client ID

Figure 1. Customer master with LEDES Client ID
Maintain the client identifier in the Customer master. The Sales Invoice Customer determines which client master record is used during export.
| LEDES field | ERPNext source / meaning | Sample value |
| CLIENT_ID | Customer > LEDES Client ID | ABC-001 |
| Implementation note Use the client identifier expected by the receiving e-billing platform. Do not rely on the Customer Name as a substitute unless the client specifically requires it. |
3.2 Company Master - LEDES Law Firm ID

Figure 2. Company master with LEDES Law Firm ID
Maintain the law-firm identifier on the ERPNext Company record. The exporter uses this value to identify the billing firm.
| LEDES field | ERPNext source / meaning | Sample value |
| LAW_FIRM_ID | Company > LEDES Law Firm ID | LAW-001 |
3.3 Employee Master - Timekeeper Information

Figure 3. Employee master with Timekeeper ID and classification
Timekeeper information identifies the professional associated with a billing line. The sample employee record stores the Timekeeper ID and Timekeeper Classification, while the employee name supplies the Timekeeper Name used in the export.
| LEDES field | ERPNext source / meaning | Sample value |
| TIMEKEEPER_ID | Employee > Timekeeper ID | TK-001 |
| TIMEKEEPER_NAME | Employee name | Ahmed |
| TIMEKEEPER_CLASSIFICATION | Employee > Timekeeper Classification | Associate |
| Data governance Keep timekeeper identifiers and classifications controlled in the Employee master. This avoids hard-coded values in the export and supports consistent billing when multiple professionals are used. |
3.4 Sales Invoice Header - Invoice and Matter Information

Figure 4. Sales Invoice header fields used by the LEDES export
The Sales Invoice header contains the primary invoice, matter and billing-period information. One screenshot is used because all of the following LEDES fields are sourced from this screen.
| LEDES field | ERPNext source / meaning | Sample value |
| INVOICE_DATE | Posting Date | 04-10-2026 -> 20261004 |
| INVOICE_NUMBER | Sales Invoice document number | ACC-SINV-2026-00036 |
| LAW_FIRM_MATTER_ID | Our Reference | MAT-2026-001 |
| BILLING_START_DATE | Billing Start Date | 01-09-2026 -> 20260901 |
| BILLING_END_DATE | Billing End Date | 30-09-2026 -> 20260930 |
| INVOICE_DESCRIPTION | LEDES Invoice Description | Legal services ... September 2026 |
| CLIENT_MATTER_ID | Your Financial Ref | ABC-MAT-2026-001 |
| Related master data The Customer selected on the Sales Invoice is also used to retrieve CLIENT_ID from the Customer master. CLIENT_ID is therefore not typed separately on the invoice. |
3.5 Sales Invoice Items - Quantities, Rates and Amounts

Figure 5. Sales Invoice item grid and invoice total
The item grid supplies the quantity, unit rate and line amount for each billing row. The Sales Invoice total is exported as the invoice-level total and repeats on each LEDES billing row.
| LEDES field | ERPNext source / meaning | Sample value |
| INVOICE_TOTAL | Sales Invoice > Total | 6750.00 |
| LINE_ITEM_NUMBER | Item row number / No. | 1 |
| LINE_ITEM_NUMBER_OF_UNITS | Item > Quantity | 5.00 |
| LINE_ITEM_TOTAL | Item > Amount | 4000.00 |
| LINE_ITEM_UNIT_COST | Item > Rate | 800.00 |
3.6 Sales Invoice Item Detail - LEDES Line-Level Fields

Figure 6. Expanded Sales Invoice Item showing LEDES line-level fields
Open the item row using the edit icon to maintain the LEDES line-level attributes. The visible screen contains the description, line type, adjustment amount, line date and expense code. Task and activity codes are maintained on the linked Item master and are documented separately in Section 3.7.
| LEDES field | ERPNext source / meaning | Sample value |
| EXP/FEE/INV_ADJ_TYPE | Item > LEDES Type | F |
| LINE_ITEM_ADJUSTMENT_AMOUNT | Item > LEDES Adjustment Amount | 0.00 |
| LINE_ITEM_DATE | Item > LEDES Line Date | 04-10-2026 -> 20261004 |
| LINE_ITEM_EXPENSE_CODE | Item > LEDES Expense Code | EXP-001 |
| LINE_ITEM_DESCRIPTION | Item > Description | Contract Review - Senior Lawyer |
| Line-type behavior In the sample output, F is used for fee lines and E is used for expense lines. Enter the expense code when required for the billing line. Task and activity codes are maintained on the Item master as shown in Section 3.7. |
3.7 Item Master - LEDES Task and Activity Codes

Figure 7. Item master with LEDES Activity Code and Task Code
Maintain the LEDES task and activity codes on the Item master. When the item is used on a Sales Invoice, these values provide the billing codes exported for the corresponding LEDES line. The codes should match the values required by the receiving client or e-billing platform.
| LEDES field | ERPNext source / meaning | Sample value |
| LINE_ITEM_TASK_CODE | Item Master > Task Code | TASK-003 |
| LINE_ITEM_ACTIVITY_CODE | Item Master > Activity Code | ACT-003 |
| Billing code control Use the client-approved task and activity codes. Maintaining the values on the Item master keeps the billing-code source consistent for repeated use of the same service item. |
4. Complete LEDES® 1998B Field Mapping
The exporter writes the following 24 fields in the fixed order shown below. Dates are represented in the generated text file as YYYYMMDD. Invoice-level values repeat across billing rows so that each line remains complete in context.
| # | LEDES field | ERPNext source | Example |
| 1 | INVOICE_DATE | Sales Invoice - Posting Date | 20261004 |
| 2 | INVOICE_NUMBER | Sales Invoice document number | ACC-SINV-2026-00036 |
| 3 | CLIENT_ID | Customer - LEDES Client ID | ABC-001 |
| 4 | LAW_FIRM_MATTER_ID | Sales Invoice - Our Reference | MAT-2026-001 |
| 5 | INVOICE_TOTAL | Sales Invoice - Total | 6750.00 |
| 6 | BILLING_START_DATE | Sales Invoice - Billing Start Date | 20260901 |
| 7 | BILLING_END_DATE | Sales Invoice - Billing End Date | 20260930 |
| 8 | INVOICE_DESCRIPTION | Sales Invoice - LEDES Invoice Description | Legal services ... |
| 9 | LINE_ITEM_NUMBER | Sales Invoice Item - Row number | 1 |
| 10 | EXP/FEE/INV_ADJ_TYPE | Sales Invoice Item - LEDES Type | F |
| 11 | LINE_ITEM_NUMBER_OF_UNITS | Sales Invoice Item - Quantity | 5.00 |
| 12 | LINE_ITEM_ADJUSTMENT_AMOUNT | Sales Invoice Item - LEDES Adjustment Amount | 0.00 |
| 13 | LINE_ITEM_TOTAL | Sales Invoice Item - Amount | 4000.00 |
| 14 | LINE_ITEM_DATE | Sales Invoice Item - LEDES Line Date | 20261004 |
| 15 | LINE_ITEM_TASK_CODE | Item Master - Task Code | TASK-003 |
| 16 | LINE_ITEM_EXPENSE_CODE | Sales Invoice Item - LEDES Expense Code | EXP-001 |
| 17 | LINE_ITEM_ACTIVITY_CODE | Item Master - Activity Code | ACT-003 |
| 18 | TIMEKEEPER_ID | Employee - Timekeeper ID | TK-001 |
| 19 | LINE_ITEM_DESCRIPTION | Sales Invoice Item - Description | Contract Review - Senior Lawyer |
| 20 | LAW_FIRM_ID | Company - LEDES Law Firm ID | LAW-001 |
| 21 | LINE_ITEM_UNIT_COST | Sales Invoice Item - Rate | 800.00 |
| 22 | TIMEKEEPER_NAME | Employee name | Ahmed |
| 23 | TIMEKEEPER_CLASSIFICATION | Employee - Timekeeper Classification | Associate |
| 24 | CLIENT_MATTER_ID | Sales Invoice - Your Financial Ref | ABC-MAT-2026-001 |
5. Exporting a Sales Invoice
Use the following procedure after the master values, invoice header and item-level LEDES fields have been prepared and reviewed.
5.1 Open the Export menu

Figure 8. Export control in the Sales Invoice header
From the Sales Invoice header, select Export. The custom legal e-billing action is available from this menu.
5.2 Select Download LEDES.txt

Figure 9. Download LEDES.txt option
Select Download LEDES.txt. The browser downloads a plain-text file containing the mapped invoice and billing-line information in LEDES® 1998B-compatible field order.
6. Validating the Generated LEDES File

Figure 10. Generated LEDES text file opened in a plain-text editor
The generated output begins with the LEDES1998B format identifier, followed by the 24-field header and the billing rows. Fields are separated by the pipe character | and each record ends with the two-character LEDES row terminator: an opening square bracket immediately followed by a closing square bracket.
· Confirm that the 24 header fields appear in the documented order.
· Confirm that invoice-level identifiers and totals repeat consistently across billing rows.
· Confirm that each billing row contains the correct line number, line type, units, amount, date, billing codes and timekeeper details.
· Confirm that dates are exported as YYYYMMDD (for example, 04-10-2026 becomes 20261004).
· Blank optional values should remain represented by adjacent pipe separators; do not manually remove or reorder separators.
| Sample validation The sample output shows CLIENT_ID = ABC-001, LAW_FIRM_MATTER_ID = MAT-2026-001, LAW_FIRM_ID = LAW-001, TIMEKEEPER_ID = TK-001, TIMEKEEPER_NAME = Ahmed, TIMEKEEPER_CLASSIFICATION = Associate, and CLIENT_MATTER_ID = ABC-MAT-2026-001. The file should always be reconciled against the corresponding ERPNext invoice before submission. |
7. Validation & Troubleshooting
7.1 Pre-submission checklist
☐ Invoice number and invoice date match the ERPNext Sales Invoice.
☐ CLIENT_ID, LAW_FIRM_MATTER_ID, LAW_FIRM_ID and CLIENT_MATTER_ID match the receiving client requirements.
☐ Invoice total and all line totals reconcile with ERPNext.
☐ Fee, expense and adjustment line types are correct.
☐ Required task, activity and expense codes are populated.
☐ Timekeeper ID, name, classification and rate are complete where required.
☐ Billing period and line-item dates are valid.
☐ Line descriptions comply with the client billing guidelines.
7.2 Common issues
| Issue | Possible reason | Recommended action |
| Download option missing | App/feature unavailable or insufficient access. | Confirm app installation and Sales Invoice permissions. |
| Blank fields | Required source data or mapping is missing. | Complete the relevant customer, company, invoice, item or employee data and export again. |
| Portal rejection | Client-specific rule or invalid identifier/code. | Review the portal rejection and compare the exported values with the client billing rules. |
| Amount mismatch | Line values, adjustments, taxes or mapping differ. | Reconcile each exported billing row with the source invoice and configured export logic. |
| Duplicate submission | Invoice was submitted previously. | Check the receiving portal status before resubmitting. |
7.3 Operational recommendations
· Use controlled master data for client IDs, matter IDs, law-firm IDs, billing codes and timekeeper information.
· Keep the ERPNext Sales Invoice number linked to the external submission status for reconciliation and audit.
· Validate at least one sample export against the intended client e-billing platform before production rollout.
· Treat file generation as the start of submission validation, not as final acceptance; the receiving platform may apply additional client-specific checks.
8. Reference
LEDES® 1998B field order and file structure are represented in this guide as implemented by the ERPNext Legal E-Billing Export app. Client-specific e-billing rules may impose additional validation requirements beyond the generated file structure.