From 76de3410a51ea67748dd6affecc18ddc19842358 Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Mon, 18 Sep 2023 14:10:54 +0100 Subject: [PATCH] feat: update breakdown --- DO NOT COMMIT/org_missing_town_or_city_breakdown.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/DO NOT COMMIT/org_missing_town_or_city_breakdown.rb b/DO NOT COMMIT/org_missing_town_or_city_breakdown.rb index c40cb6475..bf4f3a8ea 100644 --- a/DO NOT COMMIT/org_missing_town_or_city_breakdown.rb +++ b/DO NOT COMMIT/org_missing_town_or_city_breakdown.rb @@ -15,11 +15,14 @@ def print_org_data(org_names, fields, illness_fields) print "" print org_name print ">" - fields.each do |field| - print "#{org.lettings_logs.where(status: "in_progress").select{ |l| l.send(field).nil? }.count}>" - end + + # fields.each do |field| + # print "#{org.lettings_logs.where(status: "in_progress").select{ |l| l.send(field).nil? }.count}>" + # end + print "#{org.lettings_logs.where(status: "in_progress").select{ |l| l.referral.nil? && l.renewal == 0 }.count}>" + print "#{org.lettings_logs.where(status: "in_progress").select{ |l| l.tenancylength.nil? && [4, 6].include?(l.tenancy) }.count}>" print "#{org.lettings_logs.where(status: "in_progress").select{ |l| l.illness == 1 && illness_fields.all? { |illness_field| l.send(illness_field).zero?} }.count}>" - # + # fields.each do |field| # print "#{org.sales_logs.where(status: "in_progress").select{ |l| l.send(field).nil? }.count}>" # end