app/models/receipt.rb
def prepare_report_detail()
    Ruport::Data::Table.new( :column_names => self.class.report_detail_symbols() ) { |t|
    t << self.to_a_s( self.class.report_detail_symbols(), CONVERTED_FLOAT2STRING_FIXED_PRECISION, 8 )
      percentage_amount = 0.0
      if self.patient && self.patient.is_a_firm? && self.patient.is_fiscal?
        account_percent = AppParameterCustomizations.get_receipt_account_percent()
        percentage_amount = self.account_percentage_amount( account_percent )
        t << ['',
              I18n.t(:vat_withholding),
              "#{Format.float_value( account_percent, 0, CONVERTED_PERCENT2STRING_FIXED_LENGTH )} %",
              Format.float_value( percentage_amount, 2, CONVERTED_FLOAT2STRING_FIXED_LENGTH )
        ]
      end
      costs = self.get_additional_cost_totals()
      total_amount = (self.net_price() + percentage_amount + costs[:positive] - costs[:negative])
      t << ['',
            '',
            "<i>#{I18n.t(:to_be_payed, {:scope=>[:receipt]})}:</i>",
            "<b>#{Format.float_value( total_amount, 2, CONVERTED_FLOAT2STRING_FIXED_LENGTH )}</b>"
      ]
    }
  end
# Returns a Ruport::Data::Table containing a summarized report detail for the current instance
# data.
# This method is used in building the Receipt PDF layout.
#
Returns a Ruport::Data::Table containing a summarized report detail for the current instance
data.
This method is used in building the Receipt PDF layout.
Returns a Ruport :: Data :: Table containing a summarized report detail for the current instance data . This method is used in building the Receipt PDF layout .
def prepare_report_detail()
    Ruport::Data::Table.new( :column_names => self.class.report_detail_symbols() ) { |t|
    t << self.to_a_s( self.class.report_detail_symbols(), CONVERTED_FLOAT2STRING_FIXED_PRECISION, 8 )
      percentage_amount = 0.0
      if self.patient && self.patient.is_a_firm? && self.patient.is_fiscal?
        account_percent = AppParameterCustomizations.get_receipt_account_percent()
        percentage_amount = self.account_percentage_amount( account_percent )
        t << ['',
              I18n.t(:vat_withholding),
              "#{Format.float_value( account_percent, 0, CONVERTED_PERCENT2STRING_FIXED_LENGTH )} %",
              Format.float_value( percentage_amount, 2, CONVERTED_FLOAT2STRING_FIXED_LENGTH )
        ]
      end
      costs = self.get_additional_cost_totals()
      total_amount = (self.net_price() + percentage_amount + costs[:positive] - costs[:negative])
      t << ['',
            '',
            "<i>#{I18n.t(:to_be_payed, {:scope=>[:receipt]})}:</i>",
            "<b>#{Format.float_value( total_amount, 2, CONVERTED_FLOAT2STRING_FIXED_LENGTH )}</b>"
      ]
    }
  end
def prepare_report_detail ( ) Ruport :: Data :: Table . new ( :column_names => self . class . report_detail_symbols ( ) ) { | t | t << self . to_a_s ( self . class . report_detail_symbols ( ) , CONVERTED_FLOAT2STRING_FIXED_PRECISION , 8 ) percentage_amount = 0.0 if self . patient && self . patient . is_a_firm? && self . patient . is_fiscal? account_percent = AppParameterCustomizations . get_receipt_account_percent ( ) percentage_amount = self . account_percentage_amount ( account_percent ) t << [ '' , I18n . t ( :vat_withholding ) , "#{Format.float_value( account_percent, 0, CONVERTED_PERCENT2STRING_FIXED_LENGTH )} %" , Format . float_value ( percentage_amount , 2 , CONVERTED_FLOAT2STRING_FIXED_LENGTH ) ] end costs = self . get_additional_cost_totals ( ) total_amount = ( self . net_price ( ) + percentage_amount + costs [ :positive ] - costs [ :negative ] ) t << [ '' , '' , "<i>#{I18n.t(:to_be_payed, {:scope=>[:receipt]})}:</i>" , "<b>#{Format.float_value( total_amount, 2, CONVERTED_FLOAT2STRING_FIXED_LENGTH )}</b>" ] } end
Returns a Ruport::Data::Table containing a summarized report detail for the current instance
data.
Returns a Ruport :: Data :: Table containing a summarized report detail for the current instance data .