The margin on the income statement looks healthy, yet the cash balance keeps thinning at the end of every month. At many companies, the cause is not sluggish sales but a way of calculating COGS that was wrong from the start. The cost of goods sold determines whether the selling price truly covers costs, how much gross profit you actually earn, and how much tax is owed. All three directly affect business decisions. This piece covers the COGS formula, worked examples for trading and manufacturing companies, the inventory-valuation methods recognized in Indonesia, and the point at which manual calculation starts to turn into a source of risk.
In a nutshell: COGS (cost of goods sold), known in Indonesian as HPP (Harga Pokok Penjualan), is the total direct cost of acquiring or producing the goods that were actually sold in one period. The basic formula: beginning inventory plus purchases or production costs, minus ending inventory. This figure is what's used to calculate gross profit and serves as the basis for setting the selling price.
COGS covers all costs that attach directly to the goods sold: the purchase price of merchandise, raw materials, direct labor wages, and factory overhead. What does not count are marketing costs, office staff salaries, and administrative building rent. Those items are grouped as operating expenses, separate from COGS.
Its position is clear on the income statement. Net sales minus COGS produces gross profit; gross profit minus operating expenses produces operating profit. Because COGS sits at the very top layer, a small error here propagates through the entire statement.
The example is simple. If a product sells for Rp 100,000 and its COGS is recorded as Rp 60,000, the gross margin looks like 40%. But if freight and returns are missed so that the actual COGS is Rp 72,000, the real margin is only 28%. The decisions on discounts, wholesale pricing, and sales targets built on that 40% figure automatically miss. This is where calculating COGS stops being a matter of accounting alone and becomes a matter of strategy.
For companies in Indonesia, there is an additional layer: COGS becomes the basis for calculating taxable profit when filing the Annual Tax Return (SPT). The method used to value inventory must comply with tax rules, and this is what is often overlooked when a company still relies on manual records.
For a trading company, the core formula is concise:
COGS = Beginning Inventory + Net Purchases − Ending Inventory
Its three components need to be understood one by one for the result to be accurate:
Beginning inventory: the value of all merchandise stock on the first day of the period, equal to the ending inventory of the previous period.
Net purchases: gross purchases plus inbound freight, minus purchase returns and supplier discounts. Freight is often missed, making COGS appear lower than it really is.
Ending inventory: the value of stock still remaining at the end of the period, obtained from a physical stock count (stock opname) or from the inventory system.
For a manufacturing company, this formula adds several layers because costs come not only from purchasing finished goods but also from the production process. The next section shows both with real figures.
The fastest way to understand the formula is with numbers. Start with the trading-company case. Suppose a distributor records the following data for one month:
Beginning inventory: Rp 150,000,000
Purchases: Rp 500,000,000
Inbound freight: Rp 20,000,000
Purchase returns and discounts: Rp 30,000,000
Ending inventory: Rp 120,000,000
The calculation is three steps:
Net purchases = Rp 500,000,000 + Rp 20,000,000 − Rp 30,000,000 = Rp 490,000,000
Goods available for sale = Rp 150,000,000 + Rp 490,000,000 = Rp 640,000,000
COGS = Rp 640,000,000 − Rp 120,000,000 = Rp 520,000,000
A manufacturing company takes a longer path because it has to trace costs from raw materials to finished goods. The following table uses example figures for one production period:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The core difference: a trading company directly uses the purchase price of finished goods, whereas a manufacturer must calculate production cost first before arriving at COGS. The more stages there are, the more points at which a recording error can slip in.
Two companies with identical transactions can report different COGS simply because they use different inventory-valuation methods. The cause is simple: the purchase price of the same goods rarely stays constant over time.
Take a small example. Beginning stock of 100 units at Rp 10,000, then another 100 units bought at Rp 12,000. During the period, 120 units are sold. The resulting COGS differs depending on the method chosen:
|
|
|
|
|
|
|
|
We arrive at Rp 11,000 per unit using the weighted-average method, obtained from a total inventory value of Rp 2,200,000 divided by 200 units. If purchase prices tend to rise, the FIFO method will usually produce a lower COGS and a higher profit than the average method. Although a difference of Rp 80,000 looks small in a single transaction, its impact on total profit and tax becomes very significant if your business handles thousands of stock items and hundreds of transactions every day.
In Indonesia, the choice of method is regulated too. Under Article 10 paragraph (6) of the Income Tax Law (UU PPh), companies are only permitted to use the FIFO or average method; the LIFO method is already prohibited and risks triggering a fiscal correction. An important point that is often missed is the aspect of consistency: once you choose a method, the company is required to use it continuously in subsequent years, in line with the provisions of PSAK 14. You can study the full details in the inventory-valuation provisions of the Income Tax Law.
As long as transaction volume is small and the variety of goods is limited, a spreadsheet is still adequate. The problem appears when scale grows: dozens to hundreds of SKUs, several warehouses, fluctuating purchase prices, and cross-branch sales. At that point, manual stock counts always lag behind real transactions, and an accurate COGS is only known weeks after the books are closed.
The consequences cascade. Pricing decisions are made using figures that are already stale. Physical stock often diverges from the records. During an audit or tax inspection, that discrepancy turns into a question that is hard to answer.
An integrated system such as an ERP or accounting software calculates COGS perpetually: every purchase and sale immediately updates the inventory value and cost of goods, using the same method consistently, across warehouses and branches, in real time. The result is a single source of truth used by finance, operations, and management at once.
This is where the role of a solution provider like Soltius, as an SAP and ERP implementation partner in Indonesia, helps companies move COGS calculation from spreadsheets into a system that updates it automatically and can be audited.
Not every business needs an ERP to calculate COGS correctly. Forcing an expensive system before its time only moves the data chaos onto a platform that is harder to tidy up.
Manual calculation via spreadsheet is generally still enough when:
The variety of products is small and purchase prices are relatively stable.
Operations are centralized at a single location or a single warehouse.
Transaction volume is low, so a monthly stock count is not a burden.
A small discrepancy in COGS does not change pricing decisions or meaningfully erode the margin.
The signal that you are starting to need automation appears when the situation reverses: the number of SKUs grows quickly, there is more than one warehouse, purchase prices fluctuate often, physical stock diverges from records more frequently, or management needs COGS per product to set prices. This benchmark is a field reference, not a fixed threshold; every business needs to weigh the cost of a system against the cost of the errors it is currently bearing.
There is actually no difference. HPP (Harga Pokok Penjualan) is simply the Indonesian term for Cost of Goods Sold (COGS). Both refer to the same thing: the accumulation of direct costs for products that have sold. So if you see the term COGS in an accounting app or an international report, that is the HPP we are discussing here.
The logic is simple enough: take your beginning stock, add the new stock spending (net purchases), then subtract the stock left at the end of the period. What needs care is calculating “net purchases”—make sure freight is included and returns are deducted so that your COGS figure doesn't “lie.”
Because a shop (trading company) only buys finished goods and resells them. A factory (manufacturer), meanwhile, has to assemble first. So there are extra costs that must be recorded, such as factory-worker wages, machine electricity costs, and equipment depreciation, before finally arriving at the cost-of-goods-manufactured figure.
In Indonesia, you can't just pick freely. Under the Income Tax Law (UU PPh), you may only use the FIFO or Average method. The LIFO method is already prohibited for tax reporting. Another important point is consistency: if you use FIFO this year, next year must also be FIFO so that your financial statements are not deemed problematic by the tax office.
No, the two are separate. COGS contains only the costs that attach directly to the product. Office staff salaries or Facebook advertising costs fall into the operating-expense category. This separation matters so that you know whether the product itself is already profitable before deducting office operating costs.
Yes, if you use an automated (perpetual) system. If you still use a manual method or Excel, you usually only learn the COGS figure after closing the books or completing the physical stock count (stock opname) at the end of the month. For a business with fast turnover, waiting a month is of course very risky for cash flow.
Use Excel as long as the variety of goods is still small and you can still control it yourself. But once you have more than one warehouse, more and more goods, and increasingly frequent discrepancies between the records and the actual stock, that is the time to switch to a more automated system to avoid hidden losses.
Understanding COGS is not merely a technical accounting matter but a way to keep from being “fooled” by your own profit report. Many entrepreneurs feel they are making a big profit on paper yet are puzzled about where the cash went—and the answer often lies in an imprecise COGS calculation. With disciplined record-keeping and the right method, you have a strong foundation for setting a selling price that is both competitive and safe for the business margin.
As the scale of a business grows, manual precision will of course meet its limits. Soltius is here as a partner to help you move this calculation complexity into an ERP system that is automated and compliant with Indonesia's tax rules. With the right system, you can stop worrying about stock discrepancies and start focusing on more strategic business development.
To discuss how an integrated system can tidy up COGS calculation at your company, visit www.soltius.co.id and start with a consultation session.