diff --git a/bin/cancel_expired_customers b/bin/cancel_expired_customers index 8d1842776ee9f4dd75fc65a4be51dc91789797e1..c49f5c24fc0214ec72e25bde414806e491c4cb10 100755 --- a/bin/cancel_expired_customers +++ b/bin/cancel_expired_customers @@ -101,12 +101,13 @@ class ExpiringCustomer raise "#{@customer_id} not found" end - iq + @info = iq end end def next - raise "Call info first" unless @sessionid + raise "Call info first" unless @sessionid && @info + return EMPromise.reject(:skip) unless @info.form.field("tel") BlatherNotify.write_with_promise(BlatherNotify.command( "customer info", @@ -138,7 +139,7 @@ ported_in_promise.then { |ported_in| customer = ExpiringCustomer.new(row["customer_id"]) customer.info.then { |iq| if ported_in.include?(iq.form.field("tel")&.value&.to_s) && - row["expires_at"] > (Date.today << 12) + row["expires_at"] > (Date.today << 12).to_time puts "#{row['customer_id']} ported in, skipping" EMPromise.reject(:skip) else