---
title: "ZeyOS.ObjectTransaction"
description: "ZeyOS.Object"
canonical_url: "https://www.zeyos.com/zymba/ref/zeyos/zeyos-objecttransaction"
markdown_url: "https://www.zeyos.com/ai/guide/zymba/ref/zeyos/zeyos-objecttransaction.md"
section: "zymba-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/zymbaref.json"
source_sha256: "05a361c6ddc32e74f4a6dc16fd06f218210ff1b7ce57f26ca1994bfffc407915"
---

# ZeyOS.ObjectTransaction

## ZeyOS.ObjectTransaction

```
object @ZeyOS.ObjectTransaction(@ZeyOS.Object) {
	construct(?int $id) {}
	book(): bool {}
	calculateTaxes(): object {}
	calculateTotals(): object {}
	canCancel(): bool {}
	cancel(): bool {}
	canClose(): bool {}
	close(): bool {}
	fromEinvoice(string $document): object {}
	fromXML(string $xml): object {}
	getBalance(): float {}
	getItems(): object {}
	isBilling(): bool {}
	isProcurement(): bool {}
	isProduction(): bool {}
	process(object $fields, object $serials): bool {}
	setItems(object $items): $this {}
	toEinvoice(object $extra): string {}
	toXML(string $format, string $context, object $extra): string {}
}
```

### Prototype

**[ZeyOS.Object](#)**

## Methods


### `$this.construct()`


```code
$this.construct(?int $id): void
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| id | `?int`  |  | new |




### `$this.book()`


```code
$this.book(): bool
```

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `$this.calculateTaxes()`


```code
$this.calculateTaxes(): object
```

##### Returns

| Type | Value |
| --- | ---  |
| `object` | [[taxrate: ..., totalnet: ..., totalgross: ..., tax: ...], ...] |




### `$this.calculateTotals()`


```code
$this.calculateTotals(): object
```

##### Returns

| Type | Value |
| --- | ---  |
| `object` | [discount: ..., netamount: ..., tax:: ..., costs: ..., weight: ...] |




### `$this.canCancel()`


```code
$this.canCancel(): bool
```

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `$this.cancel()`


```code
$this.cancel(): bool
```

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `$this.canClose()`


```code
$this.canClose(): bool
```

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `$this.close()`


```code
$this.close(): bool
```

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `$this.fromEinvoice()`


```code
$this.fromEinvoice(string $document): object
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| document | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `object` |  |




### `$this.fromXML()`


```code
$this.fromXML(string $xml): object
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| xml | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `object` |  |




### `$this.getBalance()`


```code
$this.getBalance(): float
```

##### Returns

| Type | Value |
| --- | ---  |
| `float` |  |




### `$this.getItems()`


```code
$this.getItems(): object
```

##### Returns

| Type | Value |
| --- | ---  |
| `object` |  |




### `$this.isBilling()`


```code
$this.isBilling(): bool
```

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `$this.isProcurement()`


```code
$this.isProcurement(): bool
```

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `$this.isProduction()`


```code
$this.isProduction(): bool
```

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `$this.process()`


```code
$this.process(object $fields, object $serials): bool
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| fields | `object`  | [name: value, ...] | [] |
| serials | `object`  | [serialnum, ...] | [] |

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `$this.setItems()`


```code
$this.setItems(object $items): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| items | `object`  |  | [] |

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.toEinvoice()`


```code
$this.toEinvoice(object $extra): string
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| extra | `object`  | [name: value, ...] | [] |

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |




### `$this.toXML()`


```code
$this.toXML(string $format, string $context, object $extra): string
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| format | `string`  |  | "CII" |
| context | `string`  |  | "" |
| extra | `object`  | [name: value, ...] | [] |

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |
