Configuration - horstoeko/zugferd GitHub Wiki

Table of contents

General

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

Options

Get the currently configured number of decimal places for amount fields

public static function getAmountDecimals(): int

By default this returns: 2

Set the number of decimal places for amount fields

public static function setAmountDecimals(int $amountDecimals): void

Get the currently configured number of decimal places for quantity fields

public static function getQuantityDecimals(): int

By default this returns: 2

Set the number of decimal places for quantity fields

public static function setQuantityDecimals(int $quantityDecimals): void

Get the currently configured number of decimal places for percentage fields

public static function getPercentDecimals(): int

By default this returns: 2

Set the number of decimal places for percentage fields

public static function setPercentDecimals(int $percentDecimals): void

Get the currently configured number of decimal places for measure fields

public static function getMeasureDecimals(): int

By default this returns: 2

Set the number of decimal places for measure fields

public static function setMeasureDecimals(int $measureDecimals): void

Get the currently configured character for the decimal separator

public static function getDecimalSeparator(): string

By default this returns: . (a dot)

Set the character to use as the decimal separator

public static function setDecimalSeparator(string $decimalSeparator): void

Get the currently configured character for the thousands separator

public static function getThousandsSeparator(): string

By default this returns an empty string

Set the character to use as the thousands separator

public static function setThousandsSeparator(string $thousandsSeparator): void

Get the directory where the internal serializer stores it's cache

public static function getSerializerCacheDirectory(): string

By default this returns an empty string

Set the directory where the internal serializer stores it's cache

public static function setSerializerCacheDirectory(string $serializerCacheDirectoty): void

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);