FileAccess Orion

BillServiceParent extends BaseContent
in package

Class providing shared methods to implement bills and services

Table of Contents

$company  : Company|null
The linked company object
$prices  : array<string|int, mixed>|null
Buffer prices
$project  : Project|null
In project context
$relation  : Relation|null
$root  : string
The root storage folder starting at %DATA%/folder/
__construct()  : mixed
Base type constructor.
AddEventEntry()  : Result
Add new event
AddPriceRow()  : Result
Currency()  : string
Get the currency of the basket
DateFormatted()  : string
Get the formatted date range
DateToFormatted()  : DateTime|string|null
Get date as object or formatted
FullPrice()  : float|string
Get price Get the full gross price of this project
FullPriceNet()  : float|string
Get price Get the full net price of this project (without tax)
FullTax()  : float|string
Get tax price Get the full taxes of this project
GeneralSearchFields()  : array<string|int, mixed>
Get the general search fields for index
GetCompany()  : string|null
Get company id Get the company id from content
GetCompanyExtra()  : string|null
Get the assignment extra
GetCompanyObject()  : Company|null
Get company
GetLastKnownEvent()  : Event|null
Get most recent event of certain type
MainProject()  : Project|null
Resolve the main project of this service/bill
MainRelation()  : Relation|null
Get / Set the main relation
Name()  : mixed|null
PriceList()  : array<string|int, RowPrice>
Price list Resolve the prices list to row price objects. This method is cached.
Refunds()  : array<string|int, mixed>|null
Get the refunds
RefundsSum()  : float
Refund sum
Save()  : mixed
SearchFields()  : array<string|int, mixed>
Return search indexer fields Convert instance to search indexer values
TaxRateMap()  : array<string|int, mixed>
Get the groups of included taxes
ToPlainObject()  : stdClass
Add a deep link to the plain object on demand
ToPlainReducedObject()  : stdClass
Convert to reduced plain data set

Properties

$prices

Buffer prices

protected array<string|int, mixed>|null $prices = null

Storage for row prices as resolved object list.

A list of row prices

$project

In project context

protected Project|null $project = null

A reference to another overlaying project

A project object

$root

The root storage folder starting at %DATA%/folder/

protected string $root = 'media/projects/'

Methods

__construct()

Base type constructor.

public __construct(string $type[, null|string $id = null ][, null|string $language = null ]) : mixed
Parameters
$type : string

Subtype

$id : null|string = null

The bill id

$language : null|string = null

The local language or null

Return values
mixed

AddEventEntry()

Add new event

public AddEventEntry(array<string|int, mixed> $event) : Result
Parameters
$event : array<string|int, mixed>
Return values
Result

AddPriceRow()

public AddPriceRow(array<string|int, mixed> $row) : Result
Parameters
$row : array<string|int, mixed>
Return values
Result

Currency()

Get the currency of the basket

public Currency([bool $symbol = true ]) : string

This is hard coded at the moment but may become dynamic in the future

Parameters
$symbol : bool = true

As symbol like €

Return values
string

The currency

DateFormatted()

Get the formatted date range

public DateFormatted([null|string $time_zone = FAA_TIMEZONE ][, string|null $format = 'd.m.Y H:i' ]) : string
Parameters
$time_zone : null|string = FAA_TIMEZONE
$format : string|null = 'd.m.Y H:i'
Return values
string

DateToFormatted()

Get date as object or formatted

public DateToFormatted([string|null $time_zone = FAA_TIMEZONE ][, string|null $format = 'd.m.Y H:i' ][, int $offset = 30 ]) : DateTime|string|null
Parameters
$time_zone : string|null = FAA_TIMEZONE

Time zone to render in

$format : string|null = 'd.m.Y H:i'

If set return formatted otherwise as string

$offset : int = 30

Additional offset in days

Return values
DateTime|string|null

FullPrice()

Get price Get the full gross price of this project

public FullPrice([bool $format = false ][, bool $include_refund = true ]) : float|string
Parameters
$format : bool = false

When true as formatted string

$include_refund : bool = true
Return values
float|string

Either a formatted output or, the raw value

FullPriceNet()

Get price Get the full net price of this project (without tax)

public FullPriceNet([bool $format = false ]) : float|string
Parameters
$format : bool = false

When true as formatted string

Return values
float|string

Either a formatted output or, the raw value

FullTax()

Get tax price Get the full taxes of this project

public FullTax([bool $format = false ]) : float|string
Parameters
$format : bool = false

When true as formatted string

Return values
float|string

Either a formatted output or, the raw value

GeneralSearchFields()

Get the general search fields for index

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

GetCompany()

Get company id Get the company id from content

public GetCompany() : string|null
Return values
string|null

The content id

GetCompanyExtra()

Get the assignment extra

public GetCompanyExtra() : string|null
Return values
string|null

GetCompanyObject()

Get company

public GetCompanyObject() : Company|null

Get the main company from content

Return values
Company|null

A company object or null when list is empty

GetLastKnownEvent()

Get most recent event of certain type

public GetLastKnownEvent( $type) : Event|null

Iterate of elements list and return the newest entry

Parameters
$type :
Return values
Event|null

PriceList()

Price list Resolve the prices list to row price objects. This method is cached.

public PriceList() : array<string|int, RowPrice>
Return values
array<string|int, RowPrice>

A list of row price objects

Refunds()

Get the refunds

public Refunds() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null

RefundsSum()

Refund sum

public RefundsSum() : float
Return values
float

Save()

public Save([mixed $force_new_id = false ]) : mixed
Parameters
$force_new_id : mixed = false
Tags
inheritDoc
Return values
mixed

SearchFields()

Return search indexer fields Convert instance to search indexer values

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

The search indexer fields

TaxRateMap()

Get the groups of included taxes

public TaxRateMap([bool $format = false ]) : array<string|int, mixed>
Parameters
$format : bool = false

When true as formatted string

Return values
array<string|int, mixed>

ToPlainObject()

Add a deep link to the plain object on demand

public ToPlainObject([null $language = null ][, bool $with_parent = true ]) : stdClass
Parameters
$language : null = null
$with_parent : bool = true
Return values
stdClass

ToPlainReducedObject()

Convert to reduced plain data set

public ToPlainReducedObject(array<string|int, mixed> $fields[, string|null $language = null ]) : stdClass

Translate and expose the current data attribute as plain resolved object with filtered attributes

Parameters
$fields : array<string|int, mixed>

List of attributes to show

$language : string|null = null

A system language code or empty for raw setup

Return values
stdClass

A simple attribute based php object

Search results