class Mindee::Product::FR::Payslip::PayslipV2PayDetail
Detailed information about the pay.
def initialize(prediction, page_id)
-
page_id
(Integer, nil
) -- -
prediction
(Hash
) --
def initialize(prediction, page_id) super @gross_salary = prediction['gross_salary'] @gross_salary_ytd = prediction['gross_salary_ytd'] @income_tax_rate = prediction['income_tax_rate'] @income_tax_withheld = prediction['income_tax_withheld'] @net_paid = prediction['net_paid'] @net_paid_before_tax = prediction['net_paid_before_tax'] @net_taxable = prediction['net_taxable'] @net_taxable_ytd = prediction['net_taxable_ytd'] @total_cost_employer = prediction['total_cost_employer'] @total_taxes_and_deductions = prediction['total_taxes_and_deductions'] @page_id = page_id end
def printable_values
-
(Hash)
-
def printable_values printable = {} printable[:gross_salary] = @gross_salary.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@gross_salary) printable[:gross_salary_ytd] = @gross_salary_ytd.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@gross_salary_ytd) printable[:income_tax_rate] = @income_tax_rate.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@income_tax_rate) printable[:income_tax_withheld] = if @income_tax_withheld.nil? '' else Parsing::Standard::BaseField.float_to_string(@income_tax_withheld) end printable[:net_paid] = @net_paid.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@net_paid) printable[:net_paid_before_tax] = if @net_paid_before_tax.nil? '' else Parsing::Standard::BaseField.float_to_string(@net_paid_before_tax) end printable[:net_taxable] = @net_taxable.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@net_taxable) printable[:net_taxable_ytd] = @net_taxable_ytd.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@net_taxable_ytd) printable[:total_cost_employer] = if @total_cost_employer.nil? '' else Parsing::Standard::BaseField.float_to_string(@total_cost_employer) end printable[:total_taxes_and_deductions] = if @total_taxes_and_deductions.nil? '' else Parsing::Standard::BaseField.float_to_string(@total_taxes_and_deductions) end printable end
def to_s
-
(String)
-
def to_s printable = printable_values out_str = String.new out_str << "\n :Gross Salary: #{printable[:gross_salary]}" out_str << "\n :Gross Salary YTD: #{printable[:gross_salary_ytd]}" out_str << "\n :Income Tax Rate: #{printable[:income_tax_rate]}" out_str << "\n :Income Tax Withheld: #{printable[:income_tax_withheld]}" out_str << "\n :Net Paid: #{printable[:net_paid]}" out_str << "\n :Net Paid Before Tax: #{printable[:net_paid_before_tax]}" out_str << "\n :Net Taxable: #{printable[:net_taxable]}" out_str << "\n :Net Taxable YTD: #{printable[:net_taxable_ytd]}" out_str << "\n :Total Cost Employer: #{printable[:total_cost_employer]}" out_str << "\n :Total Taxes and Deductions: #{printable[:total_taxes_and_deductions]}" out_str end