Calculator
in package
Tags
Table of Contents
- $mods : array<string|int, CalculatorModInterface>
- addMod() : void
- calculate() : bool
- getSubtotals() : array<string|int, mixed>
- apply() : void
- applyUsedGoods() : bool
- calculateLine() : void
- clear() : void
- save() : bool
Properties
$mods
public
static array<string|int, CalculatorModInterface>
$mods
= []
Methods
addMod()
public
static addMod(CalculatorModInterface $mod) : void
Parameters
- $mod : CalculatorModInterface
Return values
void —calculate()
public
static calculate(BusinessDocument &$doc, array<string|int, mixed> &$lines, bool $save) : bool
Parameters
- $doc : BusinessDocument
- $lines : array<string|int, mixed>
- $save : bool
Return values
bool —getSubtotals()
public
static getSubtotals(BusinessDocument $doc, array<string|int, BusinessDocumentLine> $lines) : array<string|int, mixed>
Parameters
- $doc : BusinessDocument
- $lines : array<string|int, BusinessDocumentLine>
Return values
array<string|int, mixed> —apply()
private
static apply(BusinessDocument &$doc, array<string|int, BusinessDocumentLine> &$lines) : void
Parameters
- $doc : BusinessDocument
- $lines : array<string|int, BusinessDocumentLine>
Return values
void —applyUsedGoods()
private
static applyUsedGoods(array<string|int, mixed> &$subtotals, BusinessDocument $doc, BusinessDocumentLine $line, string $ivaKey, float $pvpTotal, float $totalCoste) : bool
Parameters
- $subtotals : array<string|int, mixed>
- $doc : BusinessDocument
- $line : BusinessDocumentLine
- $ivaKey : string
- $pvpTotal : float
- $totalCoste : float
Return values
bool —calculateLine()
private
static calculateLine(BusinessDocument $doc, BusinessDocumentLine &$line) : void
Parameters
- $doc : BusinessDocument
- $line : BusinessDocumentLine
Return values
void —clear()
private
static clear(BusinessDocument &$doc, array<string|int, BusinessDocumentLine> &$lines) : void
Parameters
- $doc : BusinessDocument
- $lines : array<string|int, BusinessDocumentLine>
Return values
void —save()
private
static save(BusinessDocument &$doc, array<string|int, BusinessDocumentLine> &$lines) : bool
Parameters
- $doc : BusinessDocument
- $lines : array<string|int, BusinessDocumentLine>