From 2fc391476c2318aa00adc82450ece58cfef7295c Mon Sep 17 00:00:00 2001 From: Bjorn Forsberg Date: Wed, 23 Aug 2023 22:55:38 +0200 Subject: [PATCH] Fix for usage fee in onetime revenue --- app/models/payment_history/csv_importer.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/models/payment_history/csv_importer.rb b/app/models/payment_history/csv_importer.rb index bd80673..9b3c5f8 100644 --- a/app/models/payment_history/csv_importer.rb +++ b/app/models/payment_history/csv_importer.rb @@ -27,7 +27,6 @@ class PaymentHistory::CsvImporter "One time application fee", "Theme purchase fee", "App sale – one-time", - "App sale – usage", "Service sale" ], "affiliate_revenue" => [ @@ -100,7 +99,6 @@ def import_new_payments end # Save any remaining rows save_and_reset_batch(@batch_of_payments) - true end def new_payment(csv_row) @@ -131,7 +129,7 @@ def row_too_old?(csv_row) def calculate_charge_type(csv_row) charge_type = CSV_REVENUE_TYPES.find { |_key, value| value.include?(csv_row[:charge_type]) }&.first if charge_type == "usage_revenue" - charge_type = user.count_usage_charges_as_recurring ? "recurring_revenue" : "onetime_revenue" + charge_type = user.count_usage_charges_as_recurring == true ? "recurring_revenue" : "onetime_revenue" end charge_type end