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.



603
604
605
# File 'lib/saft/v2/html.rb', line 603

def initialize(supplier)
  @supplier = supplier
end

Instance Attribute Details

#supplierObject (readonly)

Returns the value of attribute supplier.



601
602
603
# File 'lib/saft/v2/html.rb', line 601

def supplier
  @supplier
end

Instance Method Details

#nameObject



615
616
617
# File 'lib/saft/v2/html.rb', line 615

def name
  supplier.name
end

#titleObject



607
608
609
610
611
612
613
# File 'lib/saft/v2/html.rb', line 607

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