Skip to main content

MGCLatticeInventoryCostService

Custom service for inventory cost operations: calculating item costs in a costing version, which records the calculated costs as pending prices, and activating the pending prices of a costing version, which makes new standard costs (and pending purchase and sales prices) active and revalues on-hand inventory at the new cost.

Methods​

new​

Initializes a new instance of the MGCLatticeInventoryCostService class.

  • Visibility: public
  • Returns: void

No parameters.

construct​

Creates a new instance of the MGCLatticeInventoryCostService class.

  • Visibility: public
  • Returns: MGCLatticeInventoryCostService A new MGCLatticeInventoryCostService instance.

No parameters.

activatePendingPrices​

Activates the pending prices of a costing version: the new standard costs (and, when requested, pending purchase and sales prices) become the active prices, and on-hand inventory of a standard cost item is revalued at its new cost. Runs the standard activation (InventItemPriceActivationJob) in one transaction, so either every eligible pending price is activated or, when one fails, none is.

  • Visibility: public
  • Returns: MGCLatticeOrderOperationResponseContract An MGCLatticeOrderOperationResponseContract: DocumentId is the costing version, PostedDocumentId the voucher of the inventory revaluation (empty when no on-hand inventory was revalued), and the message names the items whose price was activated.
NameTypeOptionalDescription
_requestMGCLatticePendingPriceActivationRequestContractNoThe request containing CostingVersionId, the price types, optional ItemIds, and standard header fields.

activatePendingPricesBatch​

Activates the pending prices of several costing versions or legal entities in a single bulk operation.

  • Visibility: public
  • Returns: MGCLatticeBulkOperationResponseContract An MGCLatticeBulkOperationResponseContract containing per-item results.
NameTypeOptionalDescription
_requestsListNoList of MGCLatticePendingPriceActivationRequestContract.

calculateItemCosts​

Calculates item costs in a costing version, as the costing version's Calculation does: the standard item cost calculation (BOMCalcJob_All) rolls up each item's BOM and route costs (or, for an item procured by purchase when the version calculates those, its purchase price) and records the result as the item's pending cost price in the version, dated the calculation date. Nothing is activated or posted: activatePendingPrices makes the calculated prices active.

  • Visibility: public
  • Returns: MGCLatticeOrderOperationResponseContract An MGCLatticeOrderOperationResponseContract: DocumentId is the costing version, PostedDocumentId the calculation number (the BOM calculation the pending price refers to) of the first calculated item in item number order, and the message counts the pending prices calculated and names their items.
NameTypeOptionalDescription
_requestMGCLatticeItemCostCalculationRequestContractNoThe request containing CostingVersionId, SiteId, CalculationDate, optional ItemIds, and standard header fields.

calculateItemCostsBatch​

Calculates item costs in several costing versions, sites or legal entities in a single bulk operation; each item runs as one calculateItemCosts request with its own result.

  • Visibility: public
  • Returns: MGCLatticeBulkOperationResponseContract An MGCLatticeBulkOperationResponseContract containing per-item results.
NameTypeOptionalDescription
_requestsListNoList of MGCLatticeItemCostCalculationRequestContract.