Skip to content

Configuration

HorstOeko edited this page Nov 16, 2024 · 5 revisions

Table of contents

General

By means of the ZugferdSettings class it is possible to control various options for XML and PDF generation:

Options

public static function getAmountDecimals(): int

Returns the currently configured number of decimal places for amount fields (Default: 2).

public static function setAmountDecimals(int $amountDecimals): void

Set the number of decimal places for amount fields.

public static function getQuantityDecimals(): int

Returns the currently configured number of decimal places for quantity fields (Default: 2).

public static function setQuantityDecimals(int $quantityDecimals): void

Set the number of decimal places for quantity fields.

public static function getPercentDecimals(): int

Returns the currently configured number of decimal places for percentage fields (Default: 2).

public static function setPercentDecimals(int $percentDecimals): void

Set the number of decimal places for percentage fields.

public static function getMeasureDecimals(): int

Returns the currently configured number of decimal places for measure fields (Default: 2).

public static function setMeasureDecimals(int $measureDecimals): void

Set the number of decimal places for measure fields.

public static function getDecimalSeparator(): string

Returns the currently configured character for the decimal separator. _(Default: .)

public static function setDecimalSeparator(string $decimalSeparator): void

Set the character to use as the decimal separator.

public static function getThousandsSeparator(): string

Returns the currently configured character for the thousands separator. (Default: Empty)

public static function setThousandsSeparator(string $thousandsSeparator): void

Set the character to use as the thousands separator.

More granular definition of decimal places

It is possible to specify further different decimal places for individual node paths, for example:

ZugferdSettings::addSpecialDecimalPlacesMap('/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeAgreement/ram:GrossPriceProductTradePrice/ram:ChargeAmount', 5);