Class: SAFT::V2::HTML::Supplier

Inherits:
Object
  • Object
show all
Defined in:
lib/saft/v2/html.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(supplier) ⇒ Supplier

Returns a new instance of Supplier.



595
596
597
# File 'lib/saft/v2/html.rb', line 595

def initialize(supplier)
  @supplier = supplier
end

Instance Attribute Details

#supplierObject (readonly)

Returns the value of attribute supplier.



593
594
595
# File 'lib/saft/v2/html.rb', line 593

def supplier
  @supplier
end

Instance Method Details

#nameObject



607
608
609
# File 'lib/saft/v2/html.rb', line 607

def name
  supplier.name
end

#titleObject



599
600
601
602
603
604
605
# File 'lib/saft/v2/html.rb', line 599

def title
  <<~TEXT
    #{supplier.name} #{supplier.registration_number}
    opening balance #{HTML.format_big_decimal(supplier.opening_debit_balance || -supplier.opening_credit_balance)}
    closing balance #{HTML.format_big_decimal(supplier.closing_debit_balance || -supplier.closing_credit_balance)}
  TEXT
end