Sha256: 88f1d9e909f406291e9c2152fe911c1e738b5d25c34f2a3212cc423c4d5fae02

Contents?: true

Size: 799 Bytes

Versions: 195

Compression:

Stored size: 799 Bytes

Contents

json.data do
  json.array! @sale_reports do |d|
    json.id d.id
    json.staff d.staff.user.real_name
    json.client d.client
    # json.amount d.amount
    json.month d.month.strftime("%Y-%m")
    json.content d.content.truncate(30)
    json.finish_rate "#{d.finish_rate}%"
    json.level1_score d.level1_score || 0
    json.level2_score d.level2_score || 0
    json.level3_score d.level3_score || 0
    json.updated_at d.updated_at.to_s
    json.weekly d.weekly
    json.created_at d.created_at.to_s
    json.month d.month.strftime("%Y-%m")
  end
end

json.totalRow do
  sum = @sale_reports.inject(0) { |score, i| score + i.finish_rate}
  json.finish_rate ( @sale_reports.size > 0 ? (sum.to_f / @sale_reports.size).round(2).to_s : '0' ) + '%'
end
json.code 0
json.count @sale_reports.total_count

Version data entries

195 entries across 195 versions & 1 rubygems

Version Path
educode_sales-1.10.74 app/views/educode_sales/operation_reports/index.json.jbuilder
educode_sales-1.10.73 app/views/educode_sales/operation_reports/index.json.jbuilder
educode_sales-1.10.72 app/views/educode_sales/operation_reports/index.json.jbuilder
educode_sales-1.10.71 app/views/educode_sales/operation_reports/index.json.jbuilder
educode_sales-1.10.70 app/views/educode_sales/operation_reports/index.json.jbuilder
educode_sales-1.10.59 app/views/educode_sales/operation_reports/index.json.jbuilder
educode_sales-1.10.58 app/views/educode_sales/operation_reports/index.json.jbuilder
educode_sales-1.10.49 app/views/educode_sales/operation_reports/index.json.jbuilder
educode_sales-1.10.48 app/views/educode_sales/operation_reports/index.json.jbuilder
educode_sales-1.10.46 app/views/educode_sales/operation_reports/index.json.jbuilder
educode_sales-1.10.41 app/views/educode_sales/operation_reports/index.json.jbuilder
educode_sales-1.10.37 app/views/educode_sales/operation_reports/index.json.jbuilder
educode_sales-1.10.36 app/views/educode_sales/operation_reports/index.json.jbuilder
educode_sales-1.10.35 app/views/educode_sales/operation_reports/index.json.jbuilder
educode_sales-1.10.34 app/views/educode_sales/operation_reports/index.json.jbuilder
educode_sales-1.10.33 app/views/educode_sales/operation_reports/index.json.jbuilder
educode_sales-1.10.31 app/views/educode_sales/operation_reports/index.json.jbuilder
educode_sales-1.10.30 app/views/educode_sales/operation_reports/index.json.jbuilder
educode_sales-1.10.29 app/views/educode_sales/operation_reports/index.json.jbuilder
educode_sales-1.10.28 app/views/educode_sales/operation_reports/index.json.jbuilder