Cost of goods (recalculation of cost of goods) is a feature in Sapera that makes it possible to systematically review and correct the cost of goods for a selected stock period. The feature processes invoices and cash closings and automatically attempts to correct any discrepancies in the stock movements. The result of each run is saved and can subsequently be reviewed in detail.
The overview of previous runs shows the creation date, the selected stock period, the run status as well as the number of processed invoices and cash reconciliations. This gives a quick overview of what has been run, and whether it went as expected.
On a daily basis, the posting of cost of goods (cost price out of stock) happens automatically when a sale, an invoice or an end-of-day is posted — provided that cost of goods is set to be posted automatically (see below). So in a normal setup you do not need this screen.
This screen is used when the cost of goods needs to be recalculated or recomputed manually — typically in two situations:
You have just enabled automatic posting of cost of goods and want to have it run historically back in time, so that previous sales/invoices also get their cost of goods posted.
There are discrepancies in the stock movements (e.g. after corrections to cost prices or stock setup), and you want the system to review the period and correct them.
What needs to be set up depends on whether you only want to adjust stock, or also want to post the cost of goods financially:
Auto-post cost of goods on the product category. The Auto book stock setting is set on the product category and can be overridden per organizational unit, so it can be enabled in some stores/departments and disabled in others. It only applies to stocked items, and it is the one that gets the actual cost of goods calculated and adjusted on stock. See the article Product categories.
Finance journal for stock adjustment in Finance setup (optional). If you select a journal in the field Finance journal for stock adjustment under Finance setup, finance entries are also created for the cost of goods. If you leave the field empty, only stock is adjusted without a finance entry — this is a perfectly valid setup if you deliberately only want stock-level adjustment. See the article Finance setup.
CRS recommends running the cost-of-goods recalculation both stock- and finance-wise — that is, that a finance journal is selected for stock adjustment — so that stock and finances always stay aligned and give an accurate set of accounts.
Once cost of goods is set up, it is calculated and posted automatically going forward when sales, invoices and end-of-day closings are posted. This recalculation screen is then only used to process the period backwards in time or to correct discrepancies. Note that the screen can only recalculate for the products and categories that are actually set up for cost of goods.
The screen is accessed via the Financial app.
Open Financial and select Setup in the menu. Then click Cost of goods.
You now see the overview of recalculation runs.
If you cannot see the menu item, you probably do not have permission for it. Contact support.
The overview shows all previous and ongoing runs in a list with the following columns.
Created: The date and time when the run was created.
Stock from date: Start date for the stock period that was recalculated.
Stock to date: End date for the stock period that was recalculated.
Status: The run status. The four possible states are described in the section about states below.
Invoice count: The number of invoices that were included in the run.
Cash reconciliations count: The number of cash closings that were included in the run.
A recalculation run can be in one of four states.
In progress: The run is in progress. The detail view automatically updates the progress every 2 seconds, so you can follow the process without reloading the page manually.
Success: The run completed without errors.
Cancelled: The run was aborted manually via the Cancel button.
Error: The run finished with an error. The sub-results in the detail view can provide further information about what went wrong.
Refresh: Reloads the list of runs. Always active.
Start new: Opens the dialog "Start recalculation of cost of goods", where you can configure and start a new run. Always active.
Cancel: Cancels the selected run. The button is only active when the selected run is in the In progress state. If you have selected a run with a different status, the button is inactive.
Help: Opens the help article for this screen.
Click Start new to open the dialog "Start recalculation of cost of goods". Fill in the fields and click Start to start the run. Click Cancel to close the dialog without starting a run.
Stock from date: Start date for the stock period to be recalculated. The field is required.
Stock to date: End date for the stock period to be recalculated. The field is required, and the date must be equal to or later than Stock from date.
Journal: The posting journal that the calculation should be linked to. The field is required. Select the journal that matches your company's workflow, e.g. "Daily posting", "Cost-of-goods recalculation" or "Invoice".
Include invoice: Check to include invoices in the calculation. At least one of the two checkboxes (Include invoice or Include cash closings) must be selected. If neither is selected, the validation error "At least one type must be included" is shown.
Include cash closings: Check to include cash closings in the calculation. See above regarding the requirement of at least one selected type.
Invoice number: Optional text field (max. 50 characters). Specify a specific invoice number to limit the calculation to exactly that invoice. If the field is left empty, all invoices in the period are processed.
Double-click a run in the overview to open the detail view. Here status information, progress and a list of sub-results for each processed element are shown.
Click Close to return to the overview. The button Refresh in the detail view reloads the entry list manually.
Status: The current state of the run (In progress, Success, Cancelled or Error).
Stock from date: The start date of the recalculated period.
Stock to date: The end date of the recalculated period.
Invoice: The progress for invoice processing, shown as "processed / total (affected corrected)". Example: "42 / 100 (5 affected, 3 corrected)". If the run has not yet started for this type, "Not started" is shown.
Cash reconciliations: The progress for cash closing processing, shown in the same way as above.
Below the progress view, a grid with one entry per processed element is shown. The grid can be filtered on Result and Entity type, so you can quickly isolate records with a particular status.
Entity type: The type of the processed element, e.g. invoice or cash closing.
Entity identifier: The identifier for the element in question. The field is a clickable link that leads directly to the source element.
Result: The result code for the processing of this element. The five possible result codes are described below.
Voucher no.: The voucher number for the accounting voucher associated with the correction. The field is a clickable link to the voucher.
Message: Any elaborating message about the processing result.
Nothing done: The element was reviewed, but there was no difference to correct.
Automatically corrected: The system found a discrepancy and has automatically corrected the cost of goods for this element.
Cannot correct: The system found a discrepancy but cannot correct it automatically. Manual review is required.
Difference below threshold: There is a difference, but it is so small that it falls below the defined threshold and therefore does not require correction.
Error: An error occurred while processing this element. The message in the Message field may contain further details.
If you have any questions, you are welcome to contact support.
Want to know more?
Read more in these related articles:
Stock journal
This article covers how to create a stock journal printout in Sapera
Stock archive
Complete walkthrough of the Stock archive screen in Financial: columns, filters, actions, the posting operation dialog with tabs, aggregated/detailed view, context menu, popups and permissions.