Bitrix API

CostPriceCalculator

Class CostPriceCalculator

Calculate purchasing price by different methods.

Table of Contents

Constants

METHOD_AVERAGE  = 'average'
METHOD_FIFO  = 'fifo'

Methods

__construct()  : mixed
calculate()  : float
Calculate purchasing price by quantity. Is able to calculate in certain store and get result in required currency.
getMethod()  : string
Return current purchasing price calculation method.
getMethodList()  : array<string|int, mixed>
setMethod()  : void
Set current purchasing price calculation method value.

Constants

Methods

calculate()

Calculate purchasing price by quantity. Is able to calculate in certain store and get result in required currency.

public calculate(float $quantity, int $storeId[, string|null $currency = null ]) : float
Parameters
$quantity : float
$storeId : int
$currency : string|null = null
Tags
throws
LoaderException
Return values
float

getMethod()

Return current purchasing price calculation method.

public static getMethod() : string
Return values
string

getMethodList()

public static getMethodList() : array<string|int, mixed>
Return values
array<string|int, mixed>

setMethod()

Set current purchasing price calculation method value.

public static setMethod(string $method) : void
Parameters
$method : string
Tags
throws
ArgumentOutOfRangeException

        
On this page

Search results