Skip to content

Financial¤

Financial dataclass ¤

Financial(
    asset_number: str = "",
    warranty_expiration_date: date | None = None,
    year_purchased: int = 0,
)

Represents the financial element in an equipment register.

Parameters:

Name Type Description Default
asset_number str

The asset number in the financial system.

''
warranty_expiration_date date | None

Approximate date that the warranty expires.

None
year_purchased int

Approximate year that the equipment was purchased. A value of 0 represents that the year is unknown.

0

asset_number class-attribute instance-attribute ¤

asset_number: str = ''

The asset number in the financial system.

warranty_expiration_date class-attribute instance-attribute ¤

warranty_expiration_date: date | None = None

Approximate date that the warranty expires.

year_purchased class-attribute instance-attribute ¤

year_purchased: int = 0

Approximate year that the equipment was purchased. A value of 0 represents that the year is unknown.

from_xml classmethod ¤

from_xml(element: Element[str]) -> Financial

Convert an XML element into a Financial instance.

Parameters:

Name Type Description Default
element Element[str]

A financial XML element from an equipment register.

required

Returns:

Type Description
Financial

The Financial instance.

to_xml ¤

to_xml() -> Element[str]

Convert the Financial class into an XML element.

Returns:

Type Description
Element[str]

The Financial as an XML element.