Class: Vatsense::Models::CreateInvoice

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/vatsense/models/create_invoice.rb,
sig/vatsense/models/create_invoice.rbs

Direct Known Subclasses

InvoiceCreateParams, InvoiceUpdateParams

Defined Under Namespace

Modules: TaxType, Type

Constant Summary collapse

Vatsense =

Returns:

  • (:InvoiceConversionInput)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(business:, currency_code:, date:, items:, tax_point:, conversion: nil, customer: nil, has_vat: nil, invoice_number: nil, is_copy: nil, is_reverse_charge: nil, notes: nil, pad_invoice_number: nil, serial: nil, tax_type: nil, type: nil, zero_rated: nil) ⇒ Object

Some parameter documentations has been truncated, see Vatsense::Models::CreateInvoice for more details.

Parameters:

  • business (Vatsense::Models::InvoiceBusinessInput)
  • currency_code (String) —

    The 3-character currency code the invoice is billed in.

  • date (String) —

    The date the invoice was issued (YYYY-MM-DD or YYYY-MM-DD HH:MM:SS).

  • items (Array<Vatsense::Models::Invoice::InvoiceItemInput>)
  • tax_point (String) —

    The tax point or "time of supply" (YYYY-MM-DD or YYYY-MM-DD HH:MM:SS).

  • conversion (Vatsense::Models::InvoiceConversionInput) (defaults to: nil)
  • customer (Vatsense::Models::InvoiceCustomerInput) (defaults to: nil)
  • has_vat (Boolean) (defaults to: nil) —

    Whether the invoice is subject to VAT.

  • invoice_number (String) (defaults to: nil) —

    A unique invoice number. If not provided, defaults to an auto-incremented number

  • is_copy (Boolean) (defaults to: nil) —

    Whether the invoice is a copy of a primary invoice.

  • is_reverse_charge (Boolean) (defaults to: nil) —

    Whether the invoice is zero-rated due to reverse charge.

  • notes (String) (defaults to: nil) —

    Any additional notes for the invoice.

  • pad_invoice_number (Integer) (defaults to: nil) —

    Pad the auto-generated invoice number with leading zeros to this length.

  • serial (String) (defaults to: nil) —

    A serial prepended to the auto-generated invoice number. Each unique serial has

  • tax_type (Symbol, Vatsense::Models::CreateInvoice::TaxType) (defaults to: nil) —

    Whether item prices include or exclude VAT.

  • type (Symbol, Vatsense::Models::CreateInvoice::Type) (defaults to: nil) —

    The type of invoice.

  • zero_rated (Boolean) (defaults to: nil) —

    Whether the invoice has been zero-rated.



# File 'lib/vatsense/models/create_invoice.rb', line 106

Instance Attribute Details

#business ⇒ Vatsense::Models::InvoiceBusinessInput



9
# File 'lib/vatsense/models/create_invoice.rb', line 9

required :business, -> { Vatsense::InvoiceBusinessInput }

#conversion ⇒ Vatsense::Models::InvoiceConversionInput?



37
# File 'lib/vatsense/models/create_invoice.rb', line 37

optional :conversion, -> { Vatsense::InvoiceConversionInput }

#currency_code ⇒ String

The 3-character currency code the invoice is billed in.

Parameters:

  • value (String)

Returns:

  • (String)


15
# File 'lib/vatsense/models/create_invoice.rb', line 15

required :currency_code, String

#customer ⇒ Vatsense::Models::InvoiceCustomerInput?



42
# File 'lib/vatsense/models/create_invoice.rb', line 42

optional :customer, -> { Vatsense::InvoiceCustomerInput }

#date ⇒ String

The date the invoice was issued (YYYY-MM-DD or YYYY-MM-DD HH:MM:SS).

Parameters:

  • value (String)

Returns:

  • (String)


21
# File 'lib/vatsense/models/create_invoice.rb', line 21

required :date, String

#has_vat ⇒ Boolean?

Whether the invoice is subject to VAT.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


48
# File 'lib/vatsense/models/create_invoice.rb', line 48

optional :has_vat, Vatsense::Internal::Type::Boolean

#invoice_number ⇒ String?

A unique invoice number. If not provided, defaults to an auto-incremented number.

Parameters:

  • (String)

Returns:

  • (String, nil)


55
# File 'lib/vatsense/models/create_invoice.rb', line 55

optional :invoice_number, String

#is_copy ⇒ Boolean?

Whether the invoice is a copy of a primary invoice.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


61
# File 'lib/vatsense/models/create_invoice.rb', line 61

optional :is_copy, Vatsense::Internal::Type::Boolean

#is_reverse_charge ⇒ Boolean?

Whether the invoice is zero-rated due to reverse charge.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


67
# File 'lib/vatsense/models/create_invoice.rb', line 67

optional :is_reverse_charge, Vatsense::Internal::Type::Boolean

#items ⇒ Array<Vatsense::Models::Invoice::InvoiceItemInput>

Parameters:

  • value (::Array[Vatsense::Invoice::InvoiceItemInput])

Returns:



26
# File 'lib/vatsense/models/create_invoice.rb', line 26

required :items, -> { Vatsense::Internal::Type::ArrayOf[Vatsense::Invoice::InvoiceItemInput] }

#notes ⇒ String?

Any additional notes for the invoice.

Parameters:

  • (String)

Returns:

  • (String, nil)


73
# File 'lib/vatsense/models/create_invoice.rb', line 73

optional :notes, String

#pad_invoice_number ⇒ Integer?

Pad the auto-generated invoice number with leading zeros to this length.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


79
# File 'lib/vatsense/models/create_invoice.rb', line 79

optional :pad_invoice_number, Integer

#serial ⇒ String?

A serial prepended to the auto-generated invoice number. Each unique serial has its own auto-increment range.

Parameters:

  • (String)

Returns:

  • (String, nil)


86
# File 'lib/vatsense/models/create_invoice.rb', line 86

optional :serial, String

#tax_point ⇒ String

The tax point or "time of supply" (YYYY-MM-DD or YYYY-MM-DD HH:MM:SS).

Parameters:

  • value (String)

Returns:

  • (String)


32
# File 'lib/vatsense/models/create_invoice.rb', line 32

required :tax_point, String

#tax_type ⇒ Symbol, ...

Whether item prices include or exclude VAT.



92
# File 'lib/vatsense/models/create_invoice.rb', line 92

optional :tax_type, enum: -> { Vatsense::CreateInvoice::TaxType }

#type ⇒ Symbol, ...

The type of invoice.

Returns:



98
# File 'lib/vatsense/models/create_invoice.rb', line 98

optional :type, enum: -> { Vatsense::CreateInvoice::Type }

#zero_rated ⇒ Boolean?

Whether the invoice has been zero-rated.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


104
# File 'lib/vatsense/models/create_invoice.rb', line 104

optional :zero_rated, Vatsense::Internal::Type::Boolean

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/vatsense/models/create_invoice.rb', line 153

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


111
# File 'sig/vatsense/models/create_invoice.rbs', line 111

def to_hash: -> {