Class: SAFT::V2::HTML::Customer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(customer) ⇒ Customer

Returns a new instance of Customer.



563
564
565
# File 'lib/saft/v2/html.rb', line 563

def initialize(customer)
  @customer = customer
end

Instance Attribute Details

#customerObject (readonly)

Returns the value of attribute customer.



561
562
563
# File 'lib/saft/v2/html.rb', line 561

def customer
  @customer
end

Instance Method Details

#nameObject



575
576
577
# File 'lib/saft/v2/html.rb', line 575

def name
  customer.name
end

#titleObject



567
568
569
570
571
572
573
# File 'lib/saft/v2/html.rb', line 567

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