Class: Dolibarr::Payment

Inherits:
Record
  • Object
show all
Defined in:
lib/dolibarr/payment.rb

Overview

A payment recorded against an invoice. The amount is BigDecimal; the rest of the Dolibarr payload stays reachable via Record#raw / Record#[].

Instance Attribute Summary

Attributes inherited from Record

#raw

Instance Method Summary collapse

Methods inherited from Record

#==, #[], from, #hash, #id, #initialize, #to_h

Constructor Details

This class inherits a constructor from Dolibarr::Record

Instance Method Details

#amountBigDecimal?

Returns the paid amount.

Returns:

  • (BigDecimal, nil)

    the paid amount



8
9
10
# File 'lib/dolibarr/payment.rb', line 8

def amount
  self['amount']
end

#dateString?

Returns the payment date as returned by Dolibarr.

Returns:

  • (String, nil)

    the payment date as returned by Dolibarr



18
19
20
# File 'lib/dolibarr/payment.rb', line 18

def date
  self['date']
end

#refString?

Returns the payment reference, when present.

Returns:

  • (String, nil)

    the payment reference, when present



23
24
25
# File 'lib/dolibarr/payment.rb', line 23

def ref
  self['ref']
end

#typeString?

Returns the payment mode label/code (e.g. "VIR", "CHQ").

Returns:

  • (String, nil)

    the payment mode label/code (e.g. "VIR", "CHQ")



13
14
15
# File 'lib/dolibarr/payment.rb', line 13

def type
  self['type']
end