Class: LockstepSdk::PaymentAppliedModel

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/models/payment_applied_model.rb

Overview

A Payment Application is created by a business who receives a Payment from a customer. A customer may make a single Payment to match an Invoice exactly, a partial Payment for an Invoice, or a single Payment may be made for multiple smaller Invoices. The Payment Application contains information about which Invoices are connected to which Payments and for which amounts.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ PaymentAppliedModel

Initialize the PaymentAppliedModel using the provided prototype



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/lockstep_sdk/models/payment_applied_model.rb', line 28

def initialize(params = {})
    @group_key = params.dig(:group_key)
    @payment_applied_id = params.dig(:payment_applied_id)
    @invoice_id = params.dig(:invoice_id)
    @payment_id = params.dig(:payment_id)
    @erp_key = params.dig(:erp_key)
    @entry_number = params.dig(:entry_number)
    @apply_to_invoice_date = params.dig(:apply_to_invoice_date)
    @payment_applied_amount = params.dig(:payment_applied_amount)
    @created = params.dig(:created)
    @created_user_id = params.dig(:created_user_id)
    @modified = params.dig(:modified)
    @modified_user_id = params.dig(:modified_user_id)
    @app_enrollment_id = params.dig(:app_enrollment_id)
    @payment = params.dig(:payment)
    @invoice = params.dig(:invoice)
end

Instance Attribute Details

#app_enrollment_idUuid

Returns The AppEnrollmentId of the application that imported this record. For accounts with more than one financial system connected, this field identifies the originating financial system that produced this record. This value is null if this record was not loaded from an external ERP or financial system.

Returns:

  • (Uuid)

    The AppEnrollmentId of the application that imported this record. For accounts with more than one financial system connected, this field identifies the originating financial system that produced this record. This value is null if this record was not loaded from an external ERP or financial system.



96
97
98
# File 'lib/lockstep_sdk/models/payment_applied_model.rb', line 96

def app_enrollment_id
  @app_enrollment_id
end

#apply_to_invoice_dateDate-time

Returns The date this payment was applied to this invoice.

Returns:

  • (Date-time)

    The date this payment was applied to this invoice.



72
73
74
# File 'lib/lockstep_sdk/models/payment_applied_model.rb', line 72

def apply_to_invoice_date
  @apply_to_invoice_date
end

#createdDate-time

Returns Date payment applied record was created.

Returns:

  • (Date-time)

    Date payment applied record was created.



80
81
82
# File 'lib/lockstep_sdk/models/payment_applied_model.rb', line 80

def created
  @created
end

#created_user_idUuid

Returns The id of the user who created this applied payment.

Returns:

  • (Uuid)

    The id of the user who created this applied payment.



84
85
86
# File 'lib/lockstep_sdk/models/payment_applied_model.rb', line 84

def created_user_id
  @created_user_id
end

#entry_numberInt32

Returns The entry number of this payment application. This is often a journal entry number, confirmation code, or other identifying field for this payment application.

Returns:

  • (Int32)

    The entry number of this payment application. This is often a journal entry number, confirmation code, or other identifying field for this payment application.



68
69
70
# File 'lib/lockstep_sdk/models/payment_applied_model.rb', line 68

def entry_number
  @entry_number
end

#erp_keyString

Returns The unique ID of this record as it was known in its originating financial system. If this company record was imported from a financial system, it will have the value ‘ErpKey` set to the original primary key number of the record as it was known in the originating financial system. If this record was not imported, this value will be `null`. For more information, see [Identity Columns](developer.lockstep.io/docs/identity-columns).

Returns:

  • (String)

    The unique ID of this record as it was known in its originating financial system. If this company record was imported from a financial system, it will have the value ‘ErpKey` set to the original primary key number of the record as it was known in the originating financial system. If this record was not imported, this value will be `null`. For more information, see [Identity Columns](developer.lockstep.io/docs/identity-columns).



64
65
66
# File 'lib/lockstep_sdk/models/payment_applied_model.rb', line 64

def erp_key
  @erp_key
end

#group_keyUuid

Returns The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see [Accounts and GroupKeys](developer.lockstep.io/docs/accounts-and-groupkeys).

Returns:

  • (Uuid)

    The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see [Accounts and GroupKeys](developer.lockstep.io/docs/accounts-and-groupkeys).



48
49
50
# File 'lib/lockstep_sdk/models/payment_applied_model.rb', line 48

def group_key
  @group_key
end

#invoiceInvoiceModel

Returns The invoice associated with this applied payment.

Returns:

  • (InvoiceModel)

    The invoice associated with this applied payment.



104
105
106
# File 'lib/lockstep_sdk/models/payment_applied_model.rb', line 104

def invoice
  @invoice
end

#invoice_idUuid

Returns The Invoice this payment is applied to.

Returns:

  • (Uuid)

    The Invoice this payment is applied to.



56
57
58
# File 'lib/lockstep_sdk/models/payment_applied_model.rb', line 56

def invoice_id
  @invoice_id
end

#modifiedDate-time

Returns Date payment applied record was modified.

Returns:

  • (Date-time)

    Date payment applied record was modified.



88
89
90
# File 'lib/lockstep_sdk/models/payment_applied_model.rb', line 88

def modified
  @modified
end

#modified_user_idUuid

Returns The id of the user who modified this applied payment.

Returns:

  • (Uuid)

    The id of the user who modified this applied payment.



92
93
94
# File 'lib/lockstep_sdk/models/payment_applied_model.rb', line 92

def modified_user_id
  @modified_user_id
end

#paymentPaymentModel

Returns The payment associated with this applied payment.

Returns:

  • (PaymentModel)

    The payment associated with this applied payment



100
101
102
# File 'lib/lockstep_sdk/models/payment_applied_model.rb', line 100

def payment
  @payment
end

#payment_applied_amountDouble

Returns The total amount that was applied to this Invoice from the Payment.

Returns:

  • (Double)

    The total amount that was applied to this Invoice from the Payment.



76
77
78
# File 'lib/lockstep_sdk/models/payment_applied_model.rb', line 76

def payment_applied_amount
  @payment_applied_amount
end

#payment_applied_idUuid

Returns The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform. For the ID of this record in its originating financial system, see ‘ErpKey`.

Returns:

  • (Uuid)

    The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform. For the ID of this record in its originating financial system, see ‘ErpKey`.



52
53
54
# File 'lib/lockstep_sdk/models/payment_applied_model.rb', line 52

def payment_applied_id
  @payment_applied_id
end

#payment_idUuid

Returns The Payment applied to the invoice.

Returns:

  • (Uuid)

    The Payment applied to the invoice.



60
61
62
# File 'lib/lockstep_sdk/models/payment_applied_model.rb', line 60

def payment_id
  @payment_id
end

Instance Method Details

#as_json(options = {}) ⇒ object

Returns This object as a JSON key-value structure.

Returns:

  • (object)

    This object as a JSON key-value structure



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/lockstep_sdk/models/payment_applied_model.rb', line 108

def as_json(options={})
    {
        'groupKey' => @group_key,
        'paymentAppliedId' => @payment_applied_id,
        'invoiceId' => @invoice_id,
        'paymentId' => @payment_id,
        'erpKey' => @erp_key,
        'entryNumber' => @entry_number,
        'applyToInvoiceDate' => @apply_to_invoice_date,
        'paymentAppliedAmount' => @payment_applied_amount,
        'created' => @created,
        'createdUserId' => @created_user_id,
        'modified' => @modified,
        'modifiedUserId' => @modified_user_id,
        'appEnrollmentId' => @app_enrollment_id,
        'payment' => @payment,
        'invoice' => @invoice,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



130
131
132
# File 'lib/lockstep_sdk/models/payment_applied_model.rb', line 130

def to_json(*options)
    "[#{as_json(*options).to_json(*options)}]"
end