ERPNext tutorials

Project costing in ERPNext: see where the margin went

The short answer

The short version of any ERPNext project costing tutorial: put the project on every timesheet, supplier bill, stock issue, expense claim and sales invoice. The project form then subtracts timesheet, purchase, material and claim costs from the amount invoiced before VAT, and shows a gross margin. Profitability Analysis gives a second answer from the ledger, without timesheet labour. Know the assumptions behind each number.

What the project margin counts, and what it leaves out

An ERPNext project fills its costing section from documents that carry its name. The documented formula does not match the code, so this table follows the version 16 source, which we re-read on 25-11-2026 (release 16.60.0).

Where each project figure comes from (ERPNext version 16)
Project fieldComes fromIn the margin?
Total Billed AmountSubmitted sales invoices with the project on the row or the invoice. Net of VAT.Yes, as revenue
Total Costing AmountSubmitted timesheet rows: hours times costing rate.Yes
Total Purchase CostSubmitted purchase invoice rows with the project, for items that are not kept in stock. Net of VAT.Yes
Total Consumed Material CostStock that leaves a warehouse for the project, at its stock value. Material Receipt entries are left out.Yes
Total Expense ClaimSanctioned amounts on submitted expense claims.Only with Frappe HR
Total Sales AmountSubmitted sales orders.No, for reference
Total Billable AmountBillable timesheet hours at billing rates.No, for reference
Estimated CostTyped in by you.No

Source: ERPNext v16 source: Project costing.

Source: Frappe HR v16 source: expense claims in project cost.

Gross margin is the billed amount minus the four cost lines. Gross margin % divides that by the billed amount. Some things never reach it: drafts, purchase orders not yet billed, and journal entries, even when they carry the project. Overheads such as rent have no line either.

ERPNext timesheet costing: where the hourly rate comes from

Labour enters a project through timesheets. Each row has an activity type, hours and a costing rate. ERPNext fills the rate in this order:

  1. Activity CostA rate set for this employee and this activity type, or one with no employee named.
  2. Activity TypeThe default rate for the activity, when there is no Activity Cost.
  3. Typed rateA rate already on the row stays. ERPNext only fills an empty one.

Source: ERPNext documentation: Activity Cost.

Source: ERPNext v16 source: Timesheet Detail.

The costing amount is hours times costing rate. The billing amount is billing hours times billing rate. A row with Bill unticked has no billing hours, but its hours still cost money. That is how rework shows up as cost. Once a timesheet is submitted, its rates lock.

Source: ERPNext documentation: Timesheet.

Two assumptions sit behind every labour number:

  • It is a standard rate, not payroll. A timesheet posts nothing to the accounts. An old rate gives an old margin, so review rates when pay changes.
  • You decide what the rate includes. A fictional engineer costs AED 17,600 a month in salary, allowances and other employment costs, and logs about 160 client hours a month: AED 110 an hour. Divide by all paid hours and the rate drops, so every job looks better than it is. Add a share of rent and admin if the margin should cover overheads. Write the rule down.

Source: ERPNext v16 source: Timesheet.

ERPNext project costing tutorial: connect each document

Set up once, then make tagging a habit.

  1. Create the projectLink the customer and sales order. Enter an Estimated Cost for your own comparison.
  2. Log timeStaff submit timesheets with the project and an activity type on each row. Add an activity type such as Rework so wasted hours stand out.
  3. Tag supplier billsOn a purchase invoice, the project sits on each item row, because one bill can cover several jobs.
  4. Issue stock to the jobA Material Issue stock entry with the project takes items out of the warehouse and charges their value to the job.
  5. Claim expensesStaff pick the project on an expense claim. This needs Frappe HR, a separate app since version 14.
  6. Invoice the customerSet the project on the sales invoice or its rows.

Source: ERPNext documentation: Project Profitability.

Source: ERPNext documentation: Project and managing expenses.

Source: Frappe HR on GitHub: README.

Three habits keep the numbers honest:

  • Count stock once. In the version 15 and 16 source we read, the purchase cost line leaves out stock items. They reach the project when you issue them from the warehouse. A stock item on a tagged bill shows up in the margin only after the issue. Older releases may behave differently, so check your own version.
  • Submit, do not park drafts. Drafts are left out of every project figure.
  • Refresh before you read. Selling Settings decides how often sales figures reach the project: each transaction, daily or monthly. The default is daily, so today’s invoice may not show yet. The project’s Actions menu has Update Costing and Billing.

Source: ERPNext documentation: Selling Settings.

Source: ERPNext v16 source: Project form.

For quoting and billing models, see the service company workflow and agency retainers and timesheets. The invoice itself is in our sales invoice tutorial.

A fictional project, traced line by line

Rimal Point Network Services LLC (fictional) agrees to cable and set up an office network for Sahra Gate Logistics LLC (fictional). The fixed fee is AED 80,000 before VAT, invoiced in two halves of AED 40,000 plus AED 2,000 VAT at 5%. Because the fee is fixed, the team leaves Bill unticked on timesheets.

Government source: VAT Decree-Law, FTA translation, Article 3.

Fictional project: plan against actual (AED, before VAT)
LineSource documentPlannedActual
Fee invoicedTwo sales invoices80,00080,000
Engineer at AED 110 an hourTimesheets17,600 (160 h)19,800 (180 h)
Technicians at AED 60 an hourTimesheets18,000 (300 h)22,800 (340 h + 40 h rework)
Cabling subcontractorPurchase invoice, project on the row9,00010,500
Switches, cable and racksMaterial Issue stock entries7,0007,600
Parking and taxisExpense claims400900
Total cost52,00061,600
Gross marginProject form28,000 (35%)18,400 (23%)

The project form shows 18,400 and 23%, but not why. The plan does:

Where AED 9,600 of margin went (fictional)
StepAEDMargin left
Planned margin28,000
20 extra engineer hours-2,20025,800
40 extra technician hours-2,40023,400
40 hours of rework-2,40021,000
Subcontractor variation not billed to the customer-1,50019,500
Extra cable from stock-60018,900
Extra site expenses-50018,400

Each step traces to a document. Rework has its own activity type. The variation is a supplier bill with no matching invoice line. AED 7,000 of the 9,600 is people’s time, visible only if timesheets are complete.

We worked these figures out by hand from the rules above. We have not entered this example in a test ERPNext site, so there are no screenshots. On your own site, enter one small job and check that the project form and Profitability Analysis give the totals you expect.

ERPNext project profitability report: why two views disagree

The documentation points to Accounting, then Profitability Analysis, filtered by project. It reads the general ledger: income minus expense for entries tagged with the project.

Source: ERPNext documentation: Project Profitability.

Source: ERPNext v16 source: Profitability Analysis.

For Rimal Point, assume the subcontractor bill and the issued stock post to expense accounts, and salaries post without the project. The report then shows income of 80,000 and expenses of 19,000: the bill, the stock and the claims. Profit is 61,000. The project form says 18,400. The gap is the 42,600 of timesheet labour, which never reaches the ledger.

Neither is wrong. The project form is a management view at your standard rates. Profitability Analysis is the accounting view: it includes labour only when salary postings carry the project, which a journal entry row can do, and it counts tagged journal entries the form ignores. Use one view for job reviews and say which.

Source: ERPNext documentation: Journal Entry.

A third report, Project Profitability, comes with Frappe HR. It lists only timesheets linked to both a submitted salary slip and a submitted sales invoice. Cost is gross pay times utilisation, and profit uses the invoice grand total, which includes VAT. If your salary slips are not created from timesheets, it returns no rows.

Source: Frappe HR documentation: Project Profitability Report.

Source: Frappe HR v16 source: Project Profitability.

Standard reports, and what needs a custom one

Project reporting in ERPNext and Frappe HR, version 16
You want to seeStandard toolLimit
Margin for one project, labour includedProject form, costing sectionOne total per cost type. No plan, no commitments.
Ledger income and expense by projectProfitability AnalysisNo timesheet labour unless salaries carry the project.
Hours and billing by person or projectTimesheet Billing SummaryBilling, not cost. Version 15 also has Project Billing Summary and Employee Billing Summary.
Task progressProject SummaryTasks only, no money.
Spend against a limitBudget against the project, Budget Variance ReportLedger accounts only, so timesheet labour is outside it.
Utilisation and profit per employeeProject Profitability (Frappe HR)Needs salary slips created from timesheets.
Plan against actual by cost type, open purchase orders and a margin bridgeNoneNeeds a custom report.

Source: ERPNext v16 source: Projects reports.

Source: ERPNext documentation: Budget.

The last row is often the one owners want. A custom report reads the same timesheets, bills, stock entries and claims, adds open purchase orders and your plan, and lays them out like the bridge above. Build it in a separate custom app rather than editing ERPNext’s own code. A Budget against the project can already warn or stop a purchase order over its limit.

Before you pay for one, run a real job through the standard tools. Our ERPNext limitations guide covers other places where standard features stop, and the trial checklist helps you test with your own numbers.

Prepared by the StarterKit team. Regulatory statements link to UAE government sources. Examples and suggested work plans are labelled separately; they do not determine your business’s legal or tax position. Check the linked decisions for the full conditions and later changes.