Struct lexoffice::model::vouchers::Voucher[][src]

pub struct Voucher {
    pub id: ReadOnly<Uuid>,
    pub organization_id: Option<Uuid>,
    pub _type: Type,
    pub voucher_status: ReadOnly<VoucherStatus>,
    pub voucher_number: String,
    pub voucher_date: Date,
    pub shipping_date: Option<Date>,
    pub due_date: Option<Date>,
    pub total_gross_amount: f64,
    pub total_tax_amount: f64,
    pub tax_type: TaxType,
    pub use_collective_contact: Option<bool>,
    pub contact_id: Option<Uuid>,
    pub remark: Option<String>,
    pub voucher_items: Vec<VoucherItems>,
    pub files: Option<Vec<Uuid>>,
    pub created_date: ReadOnly<DateTime>,
    pub updated_date: ReadOnly<DateTime>,
    pub version: i64,
}
{
    "id": "a8691b5d-2393-4317-888d-bcd5d564f7d1",
    "organizationId": "aa93e8a8-2aa3-470b-b914-caad8a255dd8",
    "type": "salesinvoice",
    "voucherStatus": "open",
    "voucherNumber": "2016-000321",
    "voucherDate": "2016-06-30T00:00:00.000+02:00",
    "shippingDate": "2016-07-02T00:00:00.000+02:00",
    "dueDate": "2016-07-07T00:00:00.000+02:00",
    "totalGrossAmount": 326.00,
    "totalTaxAmount": 26.00,
    "taxType": "gross",
    "useCollectiveContact": true,
    "remark": "Bestellung von Max Mustermann.",
    "voucherItems": [
        {
            "amount": 119.00,
            "taxAmount": 19.00,
            "taxRatePercent": 19.00,
            "categoryId": "8f8664a8-fd86-11e1-a21f-0800200c9a66"
        },
        {
            "amount": 107.00,
            "taxAmount": 7.00,
            "taxRatePercent": 7.00,
            "categoryId": "8f8664a8-fd86-11e1-a21f-0800200c9a66"
        },
        {
            "amount": 100.00,
            "taxAmount": 0,
            "taxRatePercent": 0.00,
            "categoryId": "8f8664a8-fd86-11e1-a21f-0800200c9a66"
        }
    ],
    "files": [],
    "createdDate": "2016-06-30T13:28:51.012+02:00",
    "updatedDate": "2016-06-30T13:28:51.012+02:00",
    "version": 2
}

Fields

id: ReadOnly<Uuid>

Unique id of the voucher generated on creation by lexoffice.

organization_id: Option<Uuid>

Unique id of the organization the voucher was generated on.

_type: Type

Type of the voucher. Possible values are salesinvoice (e.g. for sales orders), salescreditnote (e.g. for refunds or returned sales orders), purchaseinvoice and purchasecreditnote. Note that the same categoryId can be used for salescreditnotes and for salesinvoices.

voucher_status: ReadOnly<VoucherStatus>

Billing state of the voucher. Possible values are open, paid, paidoff, voided, transferred and sepadebit.
Read-only.

voucher_number: String

Number of the voucher. Should be the order’s identification/reference number.

voucher_date: Date

Date when the voucher was issued. Format must be yyyy-MM-dd (e.g. 2016-06-28).

shipping_date: Option<Date>

Date when the purchased item/service has to be shipped/supplied. If it is a period of time, the end date must be given. Format must be yyyy-MM-dd (e.g. 2016-07-02). Please note: ShippingDate can only be specified for voucher types salesinvoice and salescreditnote.

due_date: Option<Date>

Date when the voucher’s payment has to be settled. Format must be yyyy-MM-dd (e.g. 2016-06-28).

total_gross_amount: f64

Total gross amount of the voucher. Must match the sum of all positions with added/calculated tax amounts. Format must be ##.00 (119.00).

total_tax_amount: f64

Total tax amount of the voucher. Must match the sum of all positions’ tax amounts. Format must be ##.00 (19.00).

tax_type: TaxType

Tax type of the order. Possible values are net (positions amount will be provided net and taxes have to be calculated on top), gross (positions amount will be provided gross and tax is already included).

use_collective_contact: Option<bool>

Set to true if the Collective Contact (customer/vendor) within lexoffice should be used. If used, the optional contactId will be ignored.

contact_id: Option<Uuid>

If not using the collective contact option, an existing contact id must be provided. This must exist within lexoffice before and can be created via the Contacts endpoint. If a contact is assigned to a voucher, its role must either be Customer, or both Customer and Vendor.

remark: Option<String>

Any comments or remarks to the order. This field is part of the full text search of lexoffice, any information for finding the voucher can be placed here as convenience of the lexoffice user.

voucher_items: Vec<VoucherItems>

Positions of the voucher grouped by tax rate. Specification of object voucherItems please see below.

files: Option<Vec<Uuid>>

A list of voucher image file uuids. Voucher images can be uploaded and assigned to an existing voucher via the Upload a File to a Voucher sub-resource endpoint. Please note: Each file (voucher image) can only be assigned once.

created_date: ReadOnly<DateTime>

The instant of time when the voucher was created by lexoffice in format yyyy-MM-ddTHH:mm:ss.SSSXXX as described in RFC 3339/ISO 8601 (e.g. 2020-02-21T00:00:00.000+01:00).
Read-only.

updated_date: ReadOnly<DateTime>

The instant of time when the voucher was updated by lexoffice in format yyyy-MM-ddTHH:mm:ss.SSSXXX as described in RFC 3339/ISO 8601 (e.g. 2020-02-21T00:00:00.000+01:00).
Read-only.

version: i64

Version (revision) number which will be increased on each change to handle optimistic locking. Set to 0 for initial POST, for PUT get latest version from lexoffice (via GET) and merge with your changes. Please note: If the version did not match the version stored in your system, the user must be informed about losing changes from lexoffice.

Implementations

impl Voucher[src]

pub fn builder(
) -> VoucherBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), ())>
[src]

Create a builder for building Voucher. On the builder, call .organization_id(...)(optional), ._type(...), .voucher_number(...), .voucher_date(...), .shipping_date(...)(optional), .due_date(...)(optional), .total_gross_amount(...), .total_tax_amount(...), .tax_type(...), .use_collective_contact(...)(optional), .contact_id(...)(optional), .remark(...)(optional), .voucher_items(...), .files(...)(optional) to set the values of the fields. Finally, call .build() to create the instance of Voucher.

Trait Implementations

impl Clone for Voucher[src]

impl Debug for Voucher[src]

impl<'de> Deserialize<'de> for Voucher[src]

impl HasId for Voucher[src]

impl PartialEq<Voucher> for Voucher[src]

impl Serialize for Voucher[src]

impl StructuralPartialEq for Voucher[src]

Auto Trait Implementations

impl RefUnwindSafe for Voucher

impl Send for Voucher

impl Sync for Voucher

impl Unpin for Voucher

impl UnwindSafe for Voucher

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.