Aakvatech Limited - ERPNext COGS: Trading Account vs Perpetual Inventory
COGS can be calculated using a traditional trading account or posted continuously through ERPNext’s perpetual inventory. The difference matters because landed costs, stock adjustments, and timing can
ERPNext COGS: Trading Account vs Perpetual Inventory and the Role of Landed Cost Voucher
For many finance teams, the familiar way to calculate Cost of Goods Sold is through a trading account:
Opening Stock
+ Purchases
+/- Stock Adjustments
- Closing Stock
= Cost of Goods Sold
This method is easy to understand and works well for periodic accounting. But ERPNext, when perpetual inventory is enabled, follows a more transaction-driven approach. Instead of waiting until month-end to derive COGS, ERPNext books inventory and COGS movements as stock transactions happen.
This distinction becomes especially important when additional import, freight, clearing, duty, insurance, or handling costs are added through a Landed Cost Voucher. These costs do not merely sit as separate expenses; they can become part of the item valuation and therefore affect future COGS.
The traditional trading account method
A traditional trading account calculates COGS at the end of a period.
A simplified format looks like this:
| Particulars | Amount |
|---|---|
| Opening Stock | 100,000 |
| Add: Purchases | 500,000 |
| Add/Less: Stock Adjustments | 20,000 |
| Less: Closing Stock | (150,000) |
| Cost of Goods Sold | 470,000 |
The formula is:
COGS = Opening Stock + Purchases + Net Adjustments - Closing Stock
This is a periodic inventory view. Purchases are accumulated during the period, closing stock is determined at the end, and COGS is calculated as the balancing figure.
The strength of this method is simplicity. It is easy for accountants, auditors, and business owners to understand. The weakness is that COGS is not known accurately until the closing stock value is finalized.
How ERPNext perpetual inventory works
ERPNext’s perpetual inventory works differently. According to ERPNext documentation, under perpetual inventory, an accounting entry is made for every stock transaction. When items are received into a warehouse, the warehouse account balance increases. When items are delivered from the warehouse, an expense is booked and the warehouse account is reduced. ERPNext also notes that perpetual accounting is enabled by default in a new ERPNext site. (Frappe Docs)
This means purchases do not immediately become COGS.
Instead, the purchase first increases inventory:
| Account | Debit | Credit |
|---|---|---|
| Stock In Hand / Warehouse Account | XXX | |
| Stock Received But Not Billed / Payable Clearing | XXX |
When goods are sold or delivered, ERPNext moves the cost from stock to expense:
| Account | Debit | Credit |
|---|---|---|
| Cost of Goods Sold | XXX | |
| Stock In Hand / Warehouse Account | XXX |
ERPNext’s documentation explains that when an item is delivered from a warehouse, the warehouse account is credited and an equal amount is debited to Cost of Goods Sold. The amount is based on the valuation amount of the sold item, calculated using the selected valuation method such as FIFO or Moving Average, or actual cost for serialized items. (Frappe Docs)
The key accounting difference
The difference is not only technical. It changes how profit is recognized.
In the trading account method:
Purchases are part of the COGS calculation.
In ERPNext perpetual inventory:
Purchases first become inventory assets.
COGS is recognized only when stock is issued, delivered, or sold.
So the trading account asks:
What was consumed during the period?
ERPNext asks:
What was the actual valuation of each stock movement?
That makes ERPNext more precise, especially when item valuation changes over time.
Where Stock Ledger fits in
The Stock Ledger Report is central to ERPNext’s inventory accounting. ERPNext describes it as a detailed record of stock movements, covering inward and outward transactions related to manufacturing, purchasing, selling, and stock transfers. It reflects quantity and value of stock issued, received, or transferred by item and warehouse. (Frappe Docs)
The same documentation says that the Stock Ledger Report is useful when perpetual inventory is enabled because it reflects the history of all stock transactions and gives a granular view. It also shows valuation-related fields such as incoming rate, valuation rate, and balance value. (Frappe Docs)
This is why, in ERPNext, the better report is often not just a traditional trading account. A better report is:
Inventory Movement and COGS Reconciliation
| Particulars | Source |
|---|---|
| Opening Stock Value | Stock Ledger opening balance |
| Purchases / Receipts | Purchase Receipt / Purchase Invoice with Update Stock |
| Landed Cost Additions | Landed Cost Voucher valuation impact |
| Stock Adjustments | Stock Entry / Stock Reconciliation |
| Closing Stock Value | Stock Ledger closing balance |
| Calculated COGS | Opening + Purchases + Adjustments - Closing |
| GL COGS | General Ledger COGS account |
| Difference | Reconciliation variance |
This gives both views: the familiar trading-account logic and the ERPNext ledger-based accounting reality.
How Landed Cost Voucher affects COGS
A Landed Cost Voucher is used when the purchase price alone does not represent the true cost of inventory.
For example, assume goods are imported. The supplier invoice may show the basic item cost, but the business may also incur:
- Freight
- Clearing charges
- Customs duty
- Port charges
- Insurance
- Local transport
- Other costs required to bring the item into usable inventory
ERPNext documentation explains that a Landed Cost Voucher can be created against a Purchase Receipt and Purchase Invoice, and that additional costs can be added for items until they land in inventory. These additional charges are added to the item valuation rate and update the item rate. (Frappe Docs)
That means landed cost affects COGS through valuation.
Example: without Landed Cost Voucher
Assume:
| Item | Quantity | Basic Rate | Total |
|---|---|---|---|
| Item A | 100 units | 10 | 1,000 |
If 40 units are sold, COGS is:
40 × 10 = 400
Example: with Landed Cost Voucher
Now assume additional landed costs of 200 are allocated to the same 100 units.
| Cost Component | Amount |
|---|---|
| Basic Purchase Cost | 1,000 |
| Freight / Duty / Clearing | 200 |
| Total Inventory Value | 1,200 |
New valuation rate:
1,200 / 100 = 12 per unit
If 40 units are sold, COGS becomes:
40 × 12 = 480
The Landed Cost Voucher increases the stock valuation rate from 10 to 12. As a result, COGS increases from 400 to 480 when goods are sold.
This gives a more accurate gross profit.
Without landed cost:
Selling Price - Basic Purchase Cost = Overstated Margin
With landed cost:
Selling Price - True Landed Cost = More Accurate Margin
Why landed cost matters in perpetual inventory
In a traditional trading account, landed costs may be posted separately as expenses. That can be acceptable for high-level accounting, but it may distort item-level profitability.
For example, if freight and duty are posted only as indirect expenses, the item may appear more profitable than it really is.
ERPNext’s perpetual inventory model handles this better because landed costs can be absorbed into item valuation. When the item is sold later, the COGS includes the allocated landed cost.
This is important for:
- Importers
- Distributors
- Manufacturers
- Businesses with freight-heavy procurement
- Companies comparing item-level gross margin
- Businesses that need accurate warehouse and item valuation
How this affects closing stock
Landed Cost Voucher also affects closing stock.
Suppose 100 units are purchased, but only 40 are sold.
Without landed cost:
| Particulars | Calculation | Amount |
|---|---|---|
| COGS | 40 × 10 | 400 |
| Closing Stock | 60 × 10 | 600 |
With landed cost:
| Particulars | Calculation | Amount |
|---|---|---|
| COGS | 40 × 12 | 480 |
| Closing Stock | 60 × 12 | 720 |
So landed cost does not only increase COGS. It also increases the value of unsold stock.
That is the correct treatment because the remaining stock still carries part of the freight, duty, clearing, or other landed costs.
Why ERPNext perpetual inventory is usually better
For ERPNext users, perpetual inventory is usually better than the traditional trading-account-only method because it gives more accurate, timely, and traceable inventory accounting.
1. COGS is recognized at the right time
In perpetual inventory, COGS is booked when stock is sold or delivered.
This gives more accurate monthly gross profit. You do not need to wait until the end of the period to estimate COGS.
2. Stock valuation is transaction-based
ERPNext calculates valuation based on actual stock movement and the selected valuation method. This is stronger than using a broad period-end formula because it respects purchase timing, landed cost, stock adjustments, and item-level movement.
3. Landed costs are properly capitalized
A Landed Cost Voucher allows additional procurement costs to become part of inventory value instead of being treated as generic expenses.
This gives better item profitability.
4. Reconciliation is easier
Because ERPNext maintains both Stock Ledger and General Ledger impact, finance teams can compare:
Stock value as per Stock Ledger
vs
Stock account balance as per General Ledger
ERPNext includes stock reports such as Stock Ledger Report, Closing Stock Balance, Stock Value and Account Value Comparison Report, and Stock Ledger Variance Report under the Stock reporting area. (Frappe Docs)
5. It supports operational control
Perpetual inventory gives better visibility into:
- Warehouse-wise stock value
- Item-wise valuation
- Stock movement history
- Backdated transaction impact
- Stock adjustments
- Landed cost allocation
- Gross margin accuracy
This is especially useful in ERP implementations where management expects real-time dashboards and reliable financial reports.
When the trading account method is still useful
The traditional trading account is not wrong. It is still useful as a summary and reconciliation report.
It is especially useful for:
- Management reporting
- Auditor-friendly presentation
- Month-end review
- High-level gross profit analysis
- Comparing inventory movement with GL COGS
- Detecting valuation or posting differences
But in ERPNext, it should usually be treated as a reconciliation view, not the primary accounting engine.
Recommended approach in ERPNext
For ERPNext implementations, the recommended approach is:
- Use Perpetual Inventory as the primary accounting method.
- Use Stock Ledger as the source of stock movement and valuation history.
- Use Landed Cost Voucher to capitalize freight, customs duty, clearing, and other directly attributable procurement costs.
- Use a Trading Account / COGS Reconciliation Report for period-end review.
- Compare calculated COGS with GL COGS to detect differences.
A good ERPNext report should show:
| Section | Purpose |
|---|---|
| Opening Stock | Beginning inventory value |
| Purchases / Receipts | Inventory added during the period |
| Landed Cost Additions | Additional costs capitalized into stock |
| Stock Adjustments | Material issues, receipts, reconciliations |
| Closing Stock | Ending stock value |
| Calculated COGS | Traditional trading formula result |
| GL COGS | Actual COGS posted by ERPNext |
| Difference | Reconciliation gap |
Final recommendation
For manual accounting, a trading account is simple and sufficient.
For ERPNext, perpetual inventory is better because it reflects the real movement and valuation of stock. It recognizes COGS when stock is sold, values inventory continuously, and allows landed costs to be absorbed into item valuation.
The best practice is not to discard the trading account format. Instead, use it as a management and reconciliation report on top of ERPNext’s perpetual inventory records.
In short:
Perpetual Inventory = accounting engine
Trading Account = reporting and reconciliation view
Landed Cost Voucher = true cost capitalization mechanism
This gives finance teams the best of both worlds: accurate real-time accounting and a familiar period-end trading account presentation.
Reference articles and discussions
- ERPNext Documentation: Perpetual Inventory. (Frappe Docs)
- ERPNext Documentation: Landed Cost Voucher. (Frappe Docs)
- ERPNext Documentation: Stock Ledger Report. (Frappe Docs)
- Discussion context: user-provided requirement to explain trading account COGS, ERPNext perpetual inventory, landed cost voucher impact, and why one approach is better than the other.
- Tooling: Draft structured using the Frappe Blog skill.
Aakvatech Limited is a Frappe Gold Partner and ERPNext implementation company headquartered in Dar es Salaam, Tanzania, operating across East Africa and the UAE.
This article was co-created using AI to accelerate drafting, with final insights curated and validated by the author. Any customer, personal, or sensitive data referenced during drafting has been anonymized or masked where applicable. All contributors, reference URLs, tools, and materials used to assist this content curation are credited in the Reference section.
No comments yet. Login to start a new discussion Start a new discussion