Projects:Average Cost Per Invoice Price/Technical Documentation
Average Cost Per Invoice Price - Technical Specification
This article will explain how to proceed in order to create an Algorithm to calculate the Average Cost of a Product based on the Invoice Price.
Average Cost Per Invoice Price
- Create a Java file that extends from AverageAlgorithm and overrides the method getReceiptCost() from CostingAlgorithm. This method must retrieve the price from the Invoice instead of doing it from the Order. In this method, if there is not an Invoice to retrieve the price from, an exception must be launched and the process will stop. It will not be able to continue until an Invoice is created.
- The module needs to be created.
- A new Costing Algorithm must be created and associated to the previous Java file.
- A dataset must be exported within the module with the new Costing Algorithm.