Class: Dolibarr::Invoice
Overview
A customer invoice. Amounts are BigDecimal; every other field stays reachable via Record#raw / Record#[].
Instance Attribute Summary
Attributes inherited from Record
Instance Method Summary collapse
-
#paid? ⇒ Boolean
Whether Dolibarr flags the invoice as paid (
paye == 1). -
#ref ⇒ String?
The invoice reference (e.g. "FA2601-0007").
-
#remaining_to_pay ⇒ BigDecimal?
Amount still due.
-
#socid ⇒ String?
The thirdparty (customer) id.
-
#total_ht ⇒ BigDecimal?
Total excluding tax.
-
#total_ttc ⇒ BigDecimal?
Total including tax.
-
#total_tva ⇒ BigDecimal?
Total tax.
Methods inherited from Record
#==, #[], from, #hash, #id, #initialize, #to_h
Constructor Details
This class inherits a constructor from Dolibarr::Record
Instance Method Details
#paid? ⇒ Boolean
Returns whether Dolibarr flags the invoice as paid (paye == 1).
38 39 40 |
# File 'lib/dolibarr/invoice.rb', line 38 def paid? self['paye'].to_s == '1' end |
#ref ⇒ String?
Returns the invoice reference (e.g. "FA2601-0007").
8 9 10 |
# File 'lib/dolibarr/invoice.rb', line 8 def ref self['ref'] end |
#remaining_to_pay ⇒ BigDecimal?
Returns amount still due.
33 34 35 |
# File 'lib/dolibarr/invoice.rb', line 33 def remaining_to_pay self['remaintopay'] end |
#socid ⇒ String?
Returns the thirdparty (customer) id.
13 14 15 |
# File 'lib/dolibarr/invoice.rb', line 13 def socid self['socid'] end |
#total_ht ⇒ BigDecimal?
Returns total excluding tax.
18 19 20 |
# File 'lib/dolibarr/invoice.rb', line 18 def total_ht self['total_ht'] end |
#total_ttc ⇒ BigDecimal?
Returns total including tax.
28 29 30 |
# File 'lib/dolibarr/invoice.rb', line 28 def total_ttc self['total_ttc'] end |
#total_tva ⇒ BigDecimal?
Returns total tax.
23 24 25 |
# File 'lib/dolibarr/invoice.rb', line 23 def total_tva self['total_tva'] end |