(108.4ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar(255), "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar(255) DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar(255) DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar(255), "number" varchar(255), "deleted_at" datetime)   (0.2ms) select sqlite_version(*)  (114.2ms) CREATE INDEX "index_billing_bills_on_billable_id_and_billable_type" ON "billing_bills" ("billable_id", "billable_type")  (0.4ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'  (129.5ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.4ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.4ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'   (127.9ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'   (129.4ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (120.9ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar(255), "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar(255) DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar(255), "description" varchar(255), "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar(255) DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))   (121.9ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.4ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (120.9ms) CREATE INDEX "index_billing_charges_on_chargable_id_and_chargable_type" ON "billing_charges" ("chargable_id", "chargable_type")  (0.4ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'   (0.4ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (127.4ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.4ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.4ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'   (0.4ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (126.3ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (120.4ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (137.4ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar(255), "tax_group_id" integer, "type" varchar(255), "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (130.1ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.5ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (145.4ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (131.5ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar(255) DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (122.5ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (138.0ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar(255))   (122.6ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.5ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (120.7ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (131.5ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar(255), "type" varchar(255), "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (145.5ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (129.7ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar(255), "payment_model" varchar(255) DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer)   (122.2ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.5ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (128.5ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.4ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.4ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (144.0ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (130.4ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar(255), "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)  (138.1ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (138.8ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar(255) DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar(255), "payment_type_id" integer, "status" varchar(255), "name" varchar(255), "description" varchar(255), "external_token" varchar(255), "note" varchar(255), "deleted_at" datetime)  (114.4ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.4ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (138.8ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (146.5ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar(255) DEFAULT 'USD' NOT NULL, "code" varchar(255), "type" varchar(255), "banned" boolean, "deleted_at" datetime)  (130.8ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.4ms) SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'  (130.4ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (130.8ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime)  (130.7ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)   (122.5ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'   (130.2ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (137.8ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar(255) DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar(255) DEFAULT 'USD' NOT NULL, "note" text, "type" varchar(255), "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar(255), "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar(255) DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (130.9ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (147.3ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar(255), "properties" text, "banned" boolean, "type" varchar(255), "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)   (113.0ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar(255), "deleted_at" datetime)  (130.0ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)   (139.0ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'   (132.1ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (121.5ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar(255) NOT NULL, "item_id" integer NOT NULL, "event" varchar(255) NOT NULL, "whodunnit" varchar(255), "object" text, "created_at" datetime, "ip" varchar(255), "user_agent" varchar(255), "object_changes" text, "master_id" integer, "master_type" varchar)   (139.3ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (131.0ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)   (135.8ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)  (130.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.2ms) SELECT version FROM "schema_migrations"  (107.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150512040421')  (106.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140718104656') ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (134.1ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar(255), "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar(255) DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar(255) DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar(255), "number" varchar(255), "deleted_at" datetime, "print_job_id" integer)   (0.3ms) select sqlite_version(*)  (105.5ms) CREATE INDEX "index_billing_bills_on_billable_id_and_billable_type" ON "billing_bills" ("billable_id", "billable_type")  (0.7ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'  (103.4ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.4ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.4ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'   (102.2ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.4ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.4ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.4ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'   (101.1ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (111.2ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar(255), "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar(255) DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar(255), "description" varchar(255), "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar(255) DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))   (97.0ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.5ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (111.8ms) CREATE INDEX "index_billing_charges_on_chargable_id_and_chargable_type" ON "billing_charges" ("chargable_id", "chargable_type")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'   (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (112.2ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (112.2ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'  (0.4ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (118.5ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (120.9ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar(255), "tax_group_id" integer, "type" varchar(255), "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (113.2ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (122.1ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (104.6ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar(255) DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (98.3ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (98.1ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar(255))   (97.8ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (104.9ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (105.6ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar(255), "type" varchar(255), "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (122.5ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (121.8ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar(255), "payment_model" varchar(255) DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar)   (106.5ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (106.0ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (112.4ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (113.4ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar(255), "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)  (114.5ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (113.6ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar(255) DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar(255), "payment_type_id" integer, "status" varchar(255), "name" varchar(255), "description" varchar(255), "external_token" varchar(255), "note" varchar(255), "deleted_at" datetime)  (114.1ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (99.0ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (105.3ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar(255) DEFAULT 'USD' NOT NULL, "code" varchar(255), "type" varchar(255), "banned" boolean, "deleted_at" datetime)  (106.0ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.5ms) SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'  (112.6ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (114.6ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime)  (113.3ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)   (106.7ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.5ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'   (111.8ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (119.9ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar(255) DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar(255) DEFAULT 'USD' NOT NULL, "note" text, "type" varchar(255), "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar(255), "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar(255) DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (106.1ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (113.0ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar(255), "properties" text, "banned" boolean, "type" varchar(255), "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)   (105.9ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar(255), "deleted_at" datetime)  (113.1ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)   (124.3ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.4ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'   (112.2ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (121.0ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar(255) NOT NULL, "item_id" integer NOT NULL, "event" varchar(255) NOT NULL, "whodunnit" varchar(255), "object" text, "created_at" datetime, "ip" varchar(255), "user_agent" varchar(255), "object_changes" text, "master_id" integer, "master_type" varchar)   (122.4ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (122.7ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)   (117.7ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)  (106.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (91.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20160824235224')  (74.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140718104656') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (116.4ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar(255), "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar(255) DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar(255) DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar(255), "number" varchar(255), "deleted_at" datetime, "print_job_id" integer)   (0.2ms) select sqlite_version(*)  (89.0ms) CREATE INDEX "index_billing_bills_on_billable_id_and_billable_type" ON "billing_bills" ("billable_id", "billable_type")  (0.4ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'  (97.8ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'   (105.6ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'   (104.6ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (129.5ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar(255), "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar(255) DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar(255), "description" varchar(255), "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar(255) DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))   (131.1ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (131.1ms) CREATE INDEX "index_billing_charges_on_chargable_id_and_chargable_type" ON "billing_charges" ("chargable_id", "chargable_type")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (131.0ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (106.2ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (103.8ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (123.0ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar(255), "tax_group_id" integer, "type" varchar(255), "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (98.8ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (130.9ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (98.2ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar(255) DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (114.7ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (132.8ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar(255))   (139.3ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (114.5ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (106.2ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar(255), "type" varchar(255), "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (114.8ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (106.3ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar(255), "payment_model" varchar(255) DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar)   (106.9ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (122.9ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (112.7ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (105.2ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar(255), "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)  (122.6ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (130.7ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar(255) DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar(255), "payment_type_id" integer, "status" varchar(255), "name" varchar(255), "description" varchar(255), "external_token" varchar(255), "note" varchar(255), "deleted_at" datetime)  (130.8ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (131.8ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (138.9ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar(255) DEFAULT 'USD' NOT NULL, "code" varchar(255), "type" varchar(255), "banned" boolean, "deleted_at" datetime)  (114.7ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'  (122.6ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (139.1ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime)  (129.6ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)   (98.3ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'   (105.7ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (146.0ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar(255) DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar(255) DEFAULT 'USD' NOT NULL, "note" text, "type" varchar(255), "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar(255), "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar(255) DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (114.2ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (113.4ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar(255), "properties" text, "banned" boolean, "type" varchar(255), "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)   (104.9ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar(255), "deleted_at" datetime)  (113.8ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)   (122.5ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'   (114.7ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (130.8ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar(255) NOT NULL, "item_id" integer NOT NULL, "event" varchar(255) NOT NULL, "whodunnit" varchar(255), "object" text, "created_at" datetime, "ip" varchar(255), "user_agent" varchar(255), "object_changes" text, "master_id" integer, "master_type" varchar)   (122.7ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (122.7ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)   (117.4ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)  (114.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (70.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20160824235224')  (73.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140718104656') ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (123.7ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar(255), "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar(255) DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar(255) DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar(255), "number" varchar(255), "deleted_at" datetime, "print_job_id" integer)   (0.2ms) select sqlite_version(*)  (98.0ms) CREATE INDEX "index_billing_bills_on_billable_id_and_billable_type" ON "billing_bills" ("billable_id", "billable_type")  (0.4ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'  (97.3ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'   (89.9ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'   (112.3ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (73.2ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar(255), "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar(255) DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar(255), "description" varchar(255), "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar(255) DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))   (123.1ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (122.6ms) CREATE INDEX "index_billing_charges_on_chargable_id_and_chargable_type" ON "billing_charges" ("chargable_id", "chargable_type")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (113.3ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (138.7ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (87.9ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (106.7ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar(255), "tax_group_id" integer, "type" varchar(255), "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (106.5ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (88.8ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (131.2ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar(255) DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (124.2ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (122.7ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar(255))   (122.6ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (122.7ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (131.0ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar(255), "type" varchar(255), "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (131.6ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (121.7ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar(255), "payment_model" varchar(255) DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar)   (122.9ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (114.2ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (122.4ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (97.8ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar(255), "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)  (107.8ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (114.1ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar(255) DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar(255), "payment_type_id" integer, "status" varchar(255), "name" varchar(255), "description" varchar(255), "external_token" varchar(255), "note" varchar(255), "deleted_at" datetime)  (131.1ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (139.7ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (138.7ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar(255) DEFAULT 'USD' NOT NULL, "code" varchar(255), "type" varchar(255), "banned" boolean, "deleted_at" datetime)  (123.5ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'  (122.4ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (122.6ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime)  (106.4ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)   (131.0ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'   (114.3ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (107.3ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar(255) DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar(255) DEFAULT 'USD' NOT NULL, "note" text, "type" varchar(255), "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar(255), "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar(255) DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (131.0ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (122.8ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar(255), "properties" text, "banned" boolean, "type" varchar(255), "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)   (130.5ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar(255), "deleted_at" datetime)  (122.8ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)   (106.0ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'   (139.6ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (130.1ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar(255) NOT NULL, "item_id" integer NOT NULL, "event" varchar(255) NOT NULL, "whodunnit" varchar(255), "object" text, "created_at" datetime, "ip" varchar(255), "user_agent" varchar(255), "object_changes" text, "master_id" integer, "master_type" varchar)   (131.0ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (114.3ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)   (103.7ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)  (132.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT version FROM "schema_migrations"  (88.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20160824235224')  (98.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140718104656') ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (132.4ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar(255), "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar(255) DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar(255) DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar(255), "number" varchar(255), "deleted_at" datetime, "print_job_id" integer)   (0.2ms) select sqlite_version(*)  (114.8ms) CREATE INDEX "index_billing_bills_on_billable_id_and_billable_type" ON "billing_bills" ("billable_id", "billable_type")  (0.5ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'  (113.5ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'   (112.9ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'   (79.8ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (105.4ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar(255), "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar(255) DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar(255), "description" varchar(255), "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar(255) DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))   (106.5ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (106.6ms) CREATE INDEX "index_billing_charges_on_chargable_id_and_chargable_type" ON "billing_charges" ("chargable_id", "chargable_type")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (114.1ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (88.1ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (120.3ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (97.7ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar(255), "tax_group_id" integer, "type" varchar(255), "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (124.6ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (128.2ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (117.7ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar(255) DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (115.0ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (123.6ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar(255))   (115.2ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (122.2ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (131.3ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar(255), "type" varchar(255), "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (131.5ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (131.7ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar(255), "payment_model" varchar(255) DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar)   (130.7ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (131.4ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (139.4ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (106.6ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar(255), "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)  (114.5ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (106.6ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar(255) DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar(255), "payment_type_id" integer, "status" varchar(255), "name" varchar(255), "description" varchar(255), "external_token" varchar(255), "note" varchar(255), "deleted_at" datetime)  (131.1ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (131.5ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (130.8ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar(255) DEFAULT 'USD' NOT NULL, "code" varchar(255), "type" varchar(255), "banned" boolean, "deleted_at" datetime)  (131.5ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'  (130.9ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (115.0ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime)  (116.6ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)   (114.9ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'   (113.9ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (130.1ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar(255) DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar(255) DEFAULT 'USD' NOT NULL, "note" text, "type" varchar(255), "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar(255), "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar(255) DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (122.8ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (123.7ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar(255), "properties" text, "banned" boolean, "type" varchar(255), "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)   (130.3ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar(255), "deleted_at" datetime)  (131.3ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)   (123.1ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'   (122.3ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (138.5ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar(255) NOT NULL, "item_id" integer NOT NULL, "event" varchar(255) NOT NULL, "whodunnit" varchar(255), "object" text, "created_at" datetime, "ip" varchar(255), "user_agent" varchar(255), "object_changes" text, "master_id" integer, "master_type" varchar)   (116.6ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (123.0ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)   (121.0ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)  (140.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.2ms) SELECT version FROM "schema_migrations"  (112.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20160824235224')  (80.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140718104656') ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateBillingAccounts (20140717180443)  (0.2ms) begin transaction  (0.6ms) CREATE TABLE "billing_accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar, "created_at" datetime, "updated_at" datetime)   (0.1ms) select sqlite_version(*)  (0.3ms) CREATE INDEX "index_billing_accounts_on_billable_type_and_billable_id" ON "billing_accounts" ("billable_type", "billable_id") SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140717180443"]]  (147.4ms) commit transaction Migrating to CreateBillingCharges (20140717181134)  (0.1ms) begin transaction  (0.3ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "account_id" integer, "chargable_id" integer, "chargable_type" varchar, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime)   (0.1ms) rollback transaction ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (150.7ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar(255), "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar(255) DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar(255) DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar(255), "number" varchar(255), "deleted_at" datetime, "print_job_id" integer)   (0.1ms) select sqlite_version(*)  (115.0ms) CREATE INDEX "index_billing_bills_on_billable_id_and_billable_type" ON "billing_bills" ("billable_id", "billable_type")  (0.4ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'  (105.5ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'   (105.7ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'   (121.6ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (122.1ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar(255), "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar(255) DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar(255), "description" varchar(255), "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar(255) DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))   (124.2ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (114.7ms) CREATE INDEX "index_billing_charges_on_chargable_id_and_chargable_type" ON "billing_charges" ("chargable_id", "chargable_type")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (121.2ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (129.1ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (121.6ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (98.4ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar(255), "tax_group_id" integer, "type" varchar(255), "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (106.9ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (113.6ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (114.4ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar(255) DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (82.0ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (131.2ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar(255))   (155.3ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (124.9ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (122.7ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar(255), "type" varchar(255), "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (106.5ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (98.3ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar(255), "payment_model" varchar(255) DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar, "receipt_config_id" integer)   (114.9ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (113.4ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (89.5ms) CREATE INDEX "index_billing_origins_on_receipt_config_id" ON "billing_origins" ("receipt_config_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (95.8ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (98.1ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar(255), "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)  (99.1ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (138.9ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar(255) DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar(255), "payment_type_id" integer, "status" varchar(255), "name" varchar(255), "description" varchar(255), "external_token" varchar(255), "note" varchar(255), "deleted_at" datetime)  (139.6ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (98.3ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (97.0ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar(255) DEFAULT 'USD' NOT NULL, "code" varchar(255), "type" varchar(255), "banned" boolean, "deleted_at" datetime)  (123.2ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'  (113.9ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (89.9ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime)  (114.5ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)   (98.0ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'   (97.7ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (99.3ms) CREATE TABLE "billing_receipt_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "type" varchar, "name" varchar, "discount_text" varchar, "surcharge_text" varchar, "sound_signal" boolean, "open_cash_drawer" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "paper_cut" boolean, "custom_commands" boolean, "custom_commands_text" varchar)   (129.7ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar(255) DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar(255) DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar(255) DEFAULT 'USD' NOT NULL, "note" text, "type" varchar(255), "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar(255), "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar(255) DEFAULT 'USD' NOT NULL, "deleted_at" datetime)  (131.5ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (130.9ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar(255), "properties" text, "banned" boolean, "type" varchar(255), "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)  (123.1ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar(255), "deleted_at" datetime)   (122.2ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (98.5ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'  (122.6ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (123.0ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar(255) NOT NULL, "item_id" integer NOT NULL, "event" varchar(255) NOT NULL, "whodunnit" varchar(255), "object" text, "created_at" datetime, "ip" varchar(255), "user_agent" varchar(255), "object_changes" text, "master_id" integer, "master_type" varchar)  (107.3ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (98.5ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)  (131.6ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)   (115.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.2ms) SELECT version FROM "schema_migrations"  (102.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20170329013520')  (65.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140718104656') ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateBillingAccounts (20140717180443)  (0.1ms) begin transaction  (0.3ms) CREATE TABLE "billing_accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar, "created_at" datetime, "updated_at" datetime)   (0.1ms) select sqlite_version(*)  (0.1ms) CREATE INDEX "index_billing_accounts_on_billable_type_and_billable_id" ON "billing_accounts" ("billable_type", "billable_id") SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140717180443"]]  (128.1ms) commit transaction Migrating to CreateBillingCharges (20140717181134)  (0.2ms) begin transaction  (0.4ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "account_id" integer, "chargable_id" integer, "chargable_type" varchar, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime)   (0.1ms) rollback transaction  (89.5ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar, "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar, "number" varchar, "deleted_at" datetime, "print_job_id" integer)   (0.1ms) select sqlite_version(*)  (56.8ms) CREATE INDEX "index_billing_bills_on_billable_type_and_billable_id" ON "billing_bills" ("billable_type", "billable_id")  (0.5ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'  (56.1ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (63.9ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (88.2ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (72.7ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar, "description" varchar, "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))   (83.5ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (80.8ms) CREATE INDEX "index_billing_charges_on_chargable_type_and_chargable_id" ON "billing_charges" ("chargable_type", "chargable_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (71.6ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (64.2ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (54.6ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (65.3ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "tax_group_id" integer, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (65.4ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (64.5ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (73.1ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (73.7ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (73.3ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar)   (74.8ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (64.6ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (73.3ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (65.6ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (72.2ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar, "payment_model" varchar DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar, "receipt_config_id" integer)   (65.9ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (72.5ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (71.1ms) CREATE INDEX "index_billing_origins_on_receipt_config_id" ON "billing_origins" ("receipt_config_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index'  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (70.5ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (90.4ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar, "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)  (73.3ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (80.9ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar, "payment_type_id" integer, "status" varchar, "name" varchar, "description" varchar, "external_token" varchar, "note" varchar, "deleted_at" datetime)  (91.2ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (72.7ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (72.9ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "code" varchar, "type" varchar, "banned" boolean, "deleted_at" datetime)  (57.3ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'  (56.9ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (57.1ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime)  (65.4ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)   (65.1ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'   (73.3ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (81.6ms) CREATE TABLE "billing_receipt_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "type" varchar, "name" varchar, "discount_text" varchar, "surcharge_text" varchar, "sound_signal" boolean, "open_cash_drawer" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "paper_cut" boolean, "custom_commands" boolean, "custom_commands_text" varchar)   (81.1ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar DEFAULT 'USD' NOT NULL, "note" text, "type" varchar, "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar, "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)  (98.4ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (99.5ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "properties" text, "banned" boolean, "type" varchar, "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)  (64.3ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar, "deleted_at" datetime)   (65.3ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (90.4ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'  (65.0ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (147.2ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar NOT NULL, "item_id" integer NOT NULL, "event" varchar NOT NULL, "whodunnit" varchar, "object" text, "created_at" datetime, "ip" varchar, "user_agent" varchar, "object_changes" text, "master_id" integer, "master_type" varchar)  (82.1ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (82.0ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)  (79.1ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)   (74.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.1ms) SELECT version FROM "schema_migrations"  (64.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20170329013520')  (65.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140718104656') ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (107.8ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar, "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar, "number" varchar, "deleted_at" datetime, "print_job_id" integer)   (0.3ms) select sqlite_version(*)  (63.9ms) CREATE INDEX "index_billing_bills_on_billable_type_and_billable_id" ON "billing_bills" ("billable_type", "billable_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'  (65.3ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (64.8ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (64.4ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (73.1ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar, "description" varchar, "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))   (73.4ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (64.2ms) CREATE INDEX "index_billing_charges_on_chargable_type_and_chargable_id" ON "billing_charges" ("chargable_type", "chargable_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (80.4ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'   (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (70.2ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (71.4ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (57.3ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "tax_group_id" integer, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (58.7ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (64.7ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (73.7ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (65.5ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (65.3ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar)   (73.4ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (73.5ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (73.4ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (57.4ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (81.9ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar, "payment_model" varchar DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar, "receipt_config_id" integer)   (65.7ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (73.9ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (66.1ms) CREATE INDEX "index_billing_origins_on_receipt_config_id" ON "billing_origins" ("receipt_config_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (64.3ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (90.3ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar, "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)  (81.8ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (73.3ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar, "payment_type_id" integer, "status" varchar, "name" varchar, "description" varchar, "external_token" varchar, "note" varchar, "deleted_at" datetime)  (82.0ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (73.5ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (81.9ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "code" varchar, "type" varchar, "banned" boolean, "deleted_at" datetime)  (73.2ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'  (72.7ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (65.5ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime)  (65.4ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)   (65.5ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'   (82.0ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (81.4ms) CREATE TABLE "billing_receipt_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "type" varchar, "name" varchar, "discount_text" varchar, "surcharge_text" varchar, "sound_signal" boolean, "open_cash_drawer" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "paper_cut" boolean, "custom_commands" boolean, "custom_commands_text" varchar)   (89.7ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar DEFAULT 'USD' NOT NULL, "note" text, "type" varchar, "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar, "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)  (81.3ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (73.8ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "properties" text, "banned" boolean, "type" varchar, "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)  (73.4ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar, "deleted_at" datetime)   (81.3ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (96.6ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'  (72.4ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (64.8ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar NOT NULL, "item_id" integer NOT NULL, "event" varchar NOT NULL, "whodunnit" varchar, "object" text, "created_at" datetime, "ip" varchar, "user_agent" varchar, "object_changes" text, "master_id" integer, "master_type" varchar)  (65.3ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (65.6ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)  (71.3ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)   (82.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.2ms) SELECT version FROM "schema_migrations"  (78.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20170329013520') ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (84.8ms) DROP TABLE "billing_bills"  (78.7ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar, "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar, "number" varchar, "deleted_at" datetime, "print_job_id" integer)   (0.2ms) select sqlite_version(*)  (55.8ms) CREATE INDEX "index_billing_bills_on_billable_type_and_billable_id" ON "billing_bills" ("billable_type", "billable_id")  (0.6ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'  (54.8ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (55.2ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (62.5ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (79.3ms) DROP TABLE "billing_charges"  (71.6ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar, "description" varchar, "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))  (64.6ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (63.6ms) CREATE INDEX "index_billing_charges_on_chargable_type_and_chargable_id" ON "billing_charges" ("chargable_type", "chargable_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (56.8ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (57.4ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (67.6ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (61.7ms) DROP TABLE "billing_departments"  (53.5ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "tax_group_id" integer, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (67.3ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (80.5ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (57.6ms) DROP TABLE "billing_modifiers"  (106.4ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)  (83.6ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (62.0ms) DROP TABLE "billing_op_fp_mappings"  (74.0ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar)   (212.9ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (72.3ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (73.0ms) DROP TABLE "billing_operators"  (65.8ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)  (65.2ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (55.9ms) DROP TABLE "billing_origins"  (57.5ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar, "payment_model" varchar DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar, "receipt_config_id" integer)   (65.2ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (64.8ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (62.4ms) CREATE INDEX "index_billing_origins_on_receipt_config_id" ON "billing_origins" ("receipt_config_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index'  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (62.8ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (64.0ms) DROP TABLE "billing_payment_types"  (57.9ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar, "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)   (73.2ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (72.9ms) DROP TABLE "billing_payments"  (73.3ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar, "payment_type_id" integer, "status" varchar, "name" varchar, "description" varchar, "external_token" varchar, "note" varchar, "deleted_at" datetime)  (72.9ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (71.5ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (64.9ms) DROP TABLE "billing_plus"  (56.6ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "code" varchar, "type" varchar, "banned" boolean, "deleted_at" datetime)   (64.9ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'   (48.0ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (56.5ms) DROP TABLE "billing_profiles"  (57.6ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime)  (73.1ms) DROP TABLE "billing_pt_fp_mappings"  (57.4ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (64.9ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'  (64.0ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (72.7ms) DROP TABLE "billing_receipt_configs"  (57.5ms) CREATE TABLE "billing_receipt_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "type" varchar, "name" varchar, "discount_text" varchar, "surcharge_text" varchar, "sound_signal" boolean, "open_cash_drawer" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "paper_cut" boolean, "custom_commands" boolean, "custom_commands_text" varchar)   (64.1ms) DROP TABLE "billing_reports"  (56.2ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar DEFAULT 'USD' NOT NULL, "note" text, "type" varchar, "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar, "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (56.3ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (55.6ms) DROP TABLE "billing_resources"  (57.0ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "properties" text, "banned" boolean, "type" varchar, "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)  (56.6ms) DROP TABLE "billing_tax_groups"  (81.4ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar, "deleted_at" datetime)  (56.5ms) DROP TABLE "billing_tg_fp_mappings"  (73.6ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (72.7ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'  (72.1ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (72.3ms) DROP TABLE "billing_versions"  (57.4ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar NOT NULL, "item_id" integer NOT NULL, "event" varchar NOT NULL, "whodunnit" varchar, "object" text, "created_at" datetime, "ip" varchar, "user_agent" varchar, "object_changes" text, "master_id" integer, "master_type" varchar)   (72.6ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (72.9ms) DROP TABLE "profiles"  (73.8ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)  (0.3ms) SELECT version FROM "schema_migrations" Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types"  (0.1ms) begin transaction Fixture Delete (0.2ms) DELETE FROM "billing_payment_types" Fixture Insert (0.6ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 01:46:25', '2017-03-29 01:46:25', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 01:46:25', '2017-03-29 01:46:25', 298486374) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Cash', 't', 'f', '2017-03-29 01:46:25', '2017-03-29 01:46:25', 112846265) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Fiscal', 't', 't', '2017-03-29 01:46:25', '2017-03-29 01:46:25', 817124681) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Card', 'f', 't', '2017-03-29 01:46:25', '2017-03-29 01:46:25', 370448595) Fixture Delete (0.2ms) DELETE FROM "billing_origins" Fixture Insert (0.2ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 01:46:25', '2017-03-29 01:46:25', 980190962) Fixture Insert (0.2ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 01:46:25', '2017-03-29 01:46:25', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_plus" Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:46:25', '2017-03-29 01:46:25', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:46:25', '2017-03-29 01:46:25', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_payments" Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (100, 'USD', 'Billing::PaymentWithType', '2017-03-29 01:46:25', '2017-03-29 01:46:25', 980190962, 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (200, 'USD', 'Billing::PaymentWithType', '2017-03-29 01:46:25', '2017-03-29 01:46:25', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_bills" Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id", "origin_id") VALUES ('2017-03-29 01:46:25', '2017-03-29 01:46:25', 980190962, 'Profile', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id") VALUES ('2017-03-29 01:46:25', '2017-03-29 01:46:25', 298486374, 'Profile', 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_resources" Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 01:46:25', '2017-03-29 01:46:25', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 01:46:25', '2017-03-29 01:46:25', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_receipt_configs" Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 01:46:25', '2017-03-29 01:46:25', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 01:46:25', '2017-03-29 01:46:25', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_charges" Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (100, 'USD', '2017-03-29 01:46:25', '2017-03-29 01:46:25', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (200, 'USD', '2017-03-29 01:46:25', '2017-03-29 01:46:25', 298486374, 980190962) Fixture Delete (0.2ms) DELETE FROM "billing_departments" Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group1', NULL, '2017-03-29 01:46:25', '2017-03-29 01:46:25', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group2', NULL, '2017-03-29 01:46:25', '2017-03-29 01:46:25', 298486374, 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_modifiers" Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("percent_ratio", "created_at", "updated_at", "id", "bill_id") VALUES (1.0, '2017-03-29 01:46:25', '2017-03-29 01:46:25', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "fixed_value_currency", "created_at", "updated_at", "id", "bill_id", "charge_id") VALUES (100, 'USD', '2017-03-29 01:46:25', '2017-03-29 01:46:25', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_profiles" Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:46:25', '2017-03-29 01:46:25', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:46:25', '2017-03-29 01:46:25', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_operators" Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 01:46:25', '2017-03-29 01:46:25', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 01:46:25', '2017-03-29 01:46:25', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_tax_groups" Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:46:25', '2017-03-29 01:46:25', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:46:25', '2017-03-29 01:46:25', 298486374) Fixture Delete (0.1ms) DELETE FROM "profiles" Fixture Insert (0.1ms) INSERT INTO "profiles" ("created_at", "updated_at", "id") VALUES ('2017-03-29 01:46:25', '2017-03-29 01:46:25', 980190962)  (92.1ms) commit transaction  (0.2ms) begin transaction ----------------------------------------- Billing::ChargeTest: test_string_protocol ----------------------------------------- Billing::Charge Load (0.3ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Plu Load (0.2ms) SELECT "billing_plus".* FROM "billing_plus" WHERE "billing_plus"."id" = ? LIMIT 1 [["id", 980190962]] Billing::TaxGroup Load (0.2ms) SELECT "billing_tax_groups".* FROM "billing_tax_groups" WHERE "billing_tax_groups"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------- Billing::ChargeTest: test_wild_class_method ------------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ----------------------- BillingTest: test_truth -----------------------  (0.0ms) rollback transaction  (0.1ms) begin transaction --------------------------------- Billing::PaymentTest: test_create --------------------------------- Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.3ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.2ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ---------------------------------------------------------------------------- Billing::PaymentTest: test_should_be_instance_of_bill's_origin_payment_model ---------------------------------------------------------------------------- Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.4ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction --------------------------------------------------------- Billing::PaymentTest: test_should_be_single_cash_payments --------------------------------------------------------- Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.1ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction ------------------------------------------------------------------------------ Billing::PaymentTest: test_should_have_same_fiscal_flag_as_other_bill_payments ------------------------------------------------------------------------------ Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.1ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------ Billing::BillTest: test_charge ------------------------------ Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.6ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:46:26.564871"], ["id", 980190962]] SQL (0.3ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:46:25.000000000 Z\nupdated_at: 2017-03-29 01:46:25.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:46:26.564871"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:46:25.000000000 Z\n- 2017-03-29 01:46:26.564871927 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 01:46:26.599307"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 01:46:25.000000000 Z\nupdated_at: 2017-03-29 01:46:25.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 01:46:26.599307"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 01:46:25.000000000 Z\n- 2017-03-29 01:46:26.599307294 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:46:26.564871"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:46:25.000000000 Z\nupdated_at: 2017-03-29 01:46:25.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:46:26.564871"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:46:25.000000000 Z\n- 2017-03-29 01:46:26.564871927 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 01:46:26.732985"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:46:25.000000000 Z\nupdated_at: 2017-03-29 01:46:26.564871927 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:46:26.732985"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 01:46:26.564871927 Z\n- 2017-03-29 01:46:26.732985219 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.3ms) INSERT INTO "billing_charges" ("price_cents", "bill_id", "value_cents", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["price_cents", 300], ["bill_id", 980190962], ["value_cents", 300], ["created_at", "2017-03-29 01:46:26.743792"], ["updated_at", "2017-03-29 01:46:26.743792"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 01:46:26.743792"], ["object_changes", "---\nprice_cents:\n- 0\n- 300\nbill_id:\n- \n- 980190962\nvalue_cents:\n- 0\n- 300\ncreated_at:\n- \n- &1 2017-03-29 01:46:26.743792561 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 01:46:26.732985"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:46:25.000000000 Z\nupdated_at: 2017-03-29 01:46:26.564871927 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:46:26.732985"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 01:46:26.564871927 Z\n- 2017-03-29 01:46:26.732985219 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.2ms) rollback transaction Billing::Version Load (0.3ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction -------------------------------- Billing::BillTest: test_discount -------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:46:26.938771"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:46:25.000000000 Z\nupdated_at: 2017-03-29 01:46:25.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:46:26.938771"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:46:25.000000000 Z\n- 2017-03-29 01:46:26.938771246 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 01:46:26.948363"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 01:46:25.000000000 Z\nupdated_at: 2017-03-29 01:46:25.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 01:46:26.948363"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 01:46:25.000000000 Z\n- 2017-03-29 01:46:26.948363046 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:46:26.938771"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:46:25.000000000 Z\nupdated_at: 2017-03-29 01:46:25.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:46:26.938771"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:46:25.000000000 Z\n- 2017-03-29 01:46:26.938771246 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.5ms) RELEASE SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 298486374]]  (0.2ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1 SQL (0.3ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "charge_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["fixed_value_cents", -100], ["charge_id", 298486374], ["bill_id", 980190962], ["created_at", "2017-03-29 01:46:27.136335"], ["updated_at", "2017-03-29 01:46:27.136335"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 01:46:27.136335"], ["object_changes", "---\nfixed_value_cents:\n- 0\n- -100\ncharge_id:\n- \n- 298486374\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 01:46:27.136335740 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Modifier"]] Billing::Modifier Exists (0.3ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.2ms) rollback transaction Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Modifier"]]  (0.1ms) begin transaction --------------------------------- Billing::BillTest: test_summaries --------------------------------- Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:46:27.261372"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:46:25.000000000 Z\nupdated_at: 2017-03-29 01:46:25.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:46:27.261372"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:46:25.000000000 Z\n- 2017-03-29 01:46:27.261372259 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 01:46:27.271304"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 01:46:25.000000000 Z\nupdated_at: 2017-03-29 01:46:25.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 01:46:27.271304"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 01:46:25.000000000 Z\n- 2017-03-29 01:46:27.271304873 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:46:27.261372"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:46:25.000000000 Z\nupdated_at: 2017-03-29 01:46:25.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:46:27.261372"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:46:25.000000000 Z\n- 2017-03-29 01:46:27.261372259 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction --------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_global_bill_modifier --------------------------------------------------------------- Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.1ms) begin transaction -------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_modifier_per_charge -------------------------------------------------------------- Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (101.1ms) DROP TABLE "billing_bills"  (69.0ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar, "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar, "number" varchar, "deleted_at" datetime, "print_job_id" integer)   (0.3ms) select sqlite_version(*)  (63.7ms) CREATE INDEX "index_billing_bills_on_billable_type_and_billable_id" ON "billing_bills" ("billable_type", "billable_id")  (0.4ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'  (64.2ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (71.2ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (71.5ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (73.8ms) DROP TABLE "billing_charges"  (62.5ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar, "description" varchar, "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))  (55.0ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (65.7ms) CREATE INDEX "index_billing_charges_on_chargable_type_and_chargable_id" ON "billing_charges" ("chargable_type", "chargable_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (63.8ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (63.4ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (62.0ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (75.4ms) DROP TABLE "billing_departments"  (62.9ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "tax_group_id" integer, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (64.9ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (73.8ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (58.2ms) DROP TABLE "billing_modifiers"  (65.5ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)  (64.8ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (56.4ms) DROP TABLE "billing_op_fp_mappings"  (57.7ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar)   (56.7ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (64.2ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (65.0ms) DROP TABLE "billing_operators"  (56.9ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)  (56.7ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (56.5ms) DROP TABLE "billing_origins"  (57.1ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar, "payment_model" varchar DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar, "receipt_config_id" integer)   (64.2ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (71.5ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (71.6ms) CREATE INDEX "index_billing_origins_on_receipt_config_id" ON "billing_origins" ("receipt_config_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (71.4ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (64.4ms) DROP TABLE "billing_payment_types"  (73.6ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar, "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)   (138.8ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (64.6ms) DROP TABLE "billing_payments"  (64.6ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar, "payment_type_id" integer, "status" varchar, "name" varchar, "description" varchar, "external_token" varchar, "note" varchar, "deleted_at" datetime)  (56.6ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (55.4ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (56.3ms) DROP TABLE "billing_plus"  (57.1ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "code" varchar, "type" varchar, "banned" boolean, "deleted_at" datetime)   (72.9ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'   (55.5ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (64.1ms) DROP TABLE "billing_profiles"  (57.7ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime)  (64.5ms) DROP TABLE "billing_pt_fp_mappings"  (65.4ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (64.9ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'  (64.3ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (56.4ms) DROP TABLE "billing_receipt_configs"  (64.8ms) CREATE TABLE "billing_receipt_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "type" varchar, "name" varchar, "discount_text" varchar, "surcharge_text" varchar, "sound_signal" boolean, "open_cash_drawer" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "paper_cut" boolean, "custom_commands" boolean, "custom_commands_text" varchar)   (64.7ms) DROP TABLE "billing_reports"  (65.4ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar DEFAULT 'USD' NOT NULL, "note" text, "type" varchar, "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar, "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (64.9ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (72.6ms) DROP TABLE "billing_resources"  (73.7ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "properties" text, "banned" boolean, "type" varchar, "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)  (72.9ms) DROP TABLE "billing_tax_groups"  (73.9ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar, "deleted_at" datetime)  (72.8ms) DROP TABLE "billing_tg_fp_mappings"  (73.6ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (73.1ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'  (55.9ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (73.0ms) DROP TABLE "billing_versions"  (74.3ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar NOT NULL, "item_id" integer NOT NULL, "event" varchar NOT NULL, "whodunnit" varchar, "object" text, "created_at" datetime, "ip" varchar, "user_agent" varchar, "object_changes" text, "master_id" integer, "master_type" varchar)   (72.7ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (72.5ms) DROP TABLE "profiles"  (74.1ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)  (0.4ms) SELECT version FROM "schema_migrations" Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types"  (0.1ms) begin transaction Fixture Delete (0.2ms) DELETE FROM "billing_payment_types" Fixture Insert (0.2ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 01:49:29', '2017-03-29 01:49:29', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 01:49:29', '2017-03-29 01:49:29', 298486374) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Cash', 't', 'f', '2017-03-29 01:49:29', '2017-03-29 01:49:29', 112846265) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Fiscal', 't', 't', '2017-03-29 01:49:29', '2017-03-29 01:49:29', 817124681) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Card', 'f', 't', '2017-03-29 01:49:29', '2017-03-29 01:49:29', 370448595) Fixture Delete (0.2ms) DELETE FROM "billing_origins" Fixture Insert (0.2ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 01:49:29', '2017-03-29 01:49:29', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 01:49:29', '2017-03-29 01:49:29', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_plus" Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:49:29', '2017-03-29 01:49:29', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:49:29', '2017-03-29 01:49:29', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_payments" Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (100, 'USD', 'Billing::PaymentWithType', '2017-03-29 01:49:29', '2017-03-29 01:49:29', 980190962, 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (200, 'USD', 'Billing::PaymentWithType', '2017-03-29 01:49:29', '2017-03-29 01:49:29', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_bills" Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id", "origin_id") VALUES ('2017-03-29 01:49:29', '2017-03-29 01:49:29', 980190962, 'Profile', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id") VALUES ('2017-03-29 01:49:29', '2017-03-29 01:49:29', 298486374, 'Profile', 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_resources" Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 01:49:29', '2017-03-29 01:49:29', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 01:49:29', '2017-03-29 01:49:29', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_receipt_configs" Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 01:49:29', '2017-03-29 01:49:29', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 01:49:29', '2017-03-29 01:49:29', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_charges" Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (100, 'USD', '2017-03-29 01:49:29', '2017-03-29 01:49:29', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (200, 'USD', '2017-03-29 01:49:29', '2017-03-29 01:49:29', 298486374, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_departments" Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group1', NULL, '2017-03-29 01:49:29', '2017-03-29 01:49:29', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group2', NULL, '2017-03-29 01:49:29', '2017-03-29 01:49:29', 298486374, 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_modifiers" Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("percent_ratio", "created_at", "updated_at", "id", "bill_id") VALUES (1.0, '2017-03-29 01:49:29', '2017-03-29 01:49:29', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "fixed_value_currency", "created_at", "updated_at", "id", "bill_id", "charge_id") VALUES (100, 'USD', '2017-03-29 01:49:29', '2017-03-29 01:49:29', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_profiles" Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:49:29', '2017-03-29 01:49:29', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:49:29', '2017-03-29 01:49:29', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_operators" Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 01:49:29', '2017-03-29 01:49:29', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 01:49:29', '2017-03-29 01:49:29', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_tax_groups" Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:49:29', '2017-03-29 01:49:29', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:49:29', '2017-03-29 01:49:29', 298486374) Fixture Delete (0.1ms) DELETE FROM "profiles" Fixture Insert (0.1ms) INSERT INTO "profiles" ("created_at", "updated_at", "id") VALUES ('2017-03-29 01:49:29', '2017-03-29 01:49:29', 980190962)  (99.8ms) commit transaction  (0.1ms) begin transaction --------------------------------- Billing::PaymentTest: test_create --------------------------------- Billing::Payment Load (0.3ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.2ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.3ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.4ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ---------------------------------------------------------------------------- Billing::PaymentTest: test_should_be_instance_of_bill's_origin_payment_model ---------------------------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction --------------------------------------------------------- Billing::PaymentTest: test_should_be_single_cash_payments --------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.1ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction ------------------------------------------------------------------------------ Billing::PaymentTest: test_should_have_same_fiscal_flag_as_other_bill_payments ------------------------------------------------------------------------------ Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.1ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction ----------------------------------------- Billing::ChargeTest: test_string_protocol ----------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Plu Load (0.2ms) SELECT "billing_plus".* FROM "billing_plus" WHERE "billing_plus"."id" = ? LIMIT 1 [["id", 980190962]] Billing::TaxGroup Load (0.2ms) SELECT "billing_tax_groups".* FROM "billing_tax_groups" WHERE "billing_tax_groups"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------- Billing::ChargeTest: test_wild_class_method ------------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ----------------------- BillingTest: test_truth -----------------------  (0.1ms) rollback transaction  (0.1ms) begin transaction --------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_global_bill_modifier --------------------------------------------------------------- Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction -------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_modifier_per_charge -------------------------------------------------------------- Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------ Billing::BillTest: test_charge ------------------------------ Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.0ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.5ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:49:30.184744"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:49:29.000000000 Z\nupdated_at: 2017-03-29 01:49:29.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:49:30.184744"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:49:29.000000000 Z\n- 2017-03-29 01:49:30.184744814 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 01:49:30.203796"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 01:49:29.000000000 Z\nupdated_at: 2017-03-29 01:49:29.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 01:49:30.203796"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 01:49:29.000000000 Z\n- 2017-03-29 01:49:30.203796704 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:49:30.184744"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:49:29.000000000 Z\nupdated_at: 2017-03-29 01:49:29.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:49:30.184744"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:49:29.000000000 Z\n- 2017-03-29 01:49:30.184744814 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction Billing::Version Load (0.4ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction -------------------------------- Billing::BillTest: test_discount -------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:49:30.378152"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:49:29.000000000 Z\nupdated_at: 2017-03-29 01:49:29.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:49:30.378152"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:49:29.000000000 Z\n- 2017-03-29 01:49:30.378152961 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 01:49:30.385998"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 01:49:29.000000000 Z\nupdated_at: 2017-03-29 01:49:29.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 01:49:30.385998"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 01:49:29.000000000 Z\n- 2017-03-29 01:49:30.385998845 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.5ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:49:30.378152"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:49:29.000000000 Z\nupdated_at: 2017-03-29 01:49:29.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:49:30.378152"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:49:29.000000000 Z\n- 2017-03-29 01:49:30.378152961 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.0ms) SAVEPOINT active_record_1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1 SQL (0.2ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "charge_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["fixed_value_cents", -100], ["charge_id", 298486374], ["bill_id", 980190962], ["created_at", "2017-03-29 01:49:30.485734"], ["updated_at", "2017-03-29 01:49:30.485734"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 01:49:30.485734"], ["object_changes", "---\nfixed_value_cents:\n- 0\n- -100\ncharge_id:\n- \n- 298486374\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 01:49:30.485734531 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Modifier"]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.3ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.2ms) rollback transaction Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Modifier"]]  (0.1ms) begin transaction --------------------------------- Billing::BillTest: test_summaries --------------------------------- Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:49:30.607416"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:49:29.000000000 Z\nupdated_at: 2017-03-29 01:49:29.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:49:30.607416"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:49:29.000000000 Z\n- 2017-03-29 01:49:30.607416975 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 01:49:30.615886"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 01:49:29.000000000 Z\nupdated_at: 2017-03-29 01:49:29.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 01:49:30.615886"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 01:49:29.000000000 Z\n- 2017-03-29 01:49:30.615886434 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:49:30.607416"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:49:29.000000000 Z\nupdated_at: 2017-03-29 01:49:29.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:49:30.607416"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:49:29.000000000 Z\n- 2017-03-29 01:49:30.607416975 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (128.5ms) DROP TABLE "billing_bills"  (85.5ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar, "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar, "number" varchar, "deleted_at" datetime, "print_job_id" integer)   (0.1ms) select sqlite_version(*)  (72.8ms) CREATE INDEX "index_billing_bills_on_billable_type_and_billable_id" ON "billing_bills" ("billable_type", "billable_id")  (0.4ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'  (71.9ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (72.7ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (81.4ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (81.4ms) DROP TABLE "billing_charges"  (63.3ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar, "description" varchar, "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))  (72.7ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (65.2ms) CREATE INDEX "index_billing_charges_on_chargable_type_and_chargable_id" ON "billing_charges" ("chargable_type", "chargable_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (71.7ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (71.7ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (71.3ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (66.7ms) DROP TABLE "billing_departments"  (71.6ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "tax_group_id" integer, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (56.4ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (65.9ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (69.5ms) DROP TABLE "billing_modifiers"  (73.7ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)  (56.5ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (48.2ms) DROP TABLE "billing_op_fp_mappings"  (57.3ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar)   (64.6ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (64.4ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (64.4ms) DROP TABLE "billing_operators"  (73.4ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)  (73.2ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (72.4ms) DROP TABLE "billing_origins"  (73.7ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar, "payment_model" varchar DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar, "receipt_config_id" integer)   (64.6ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (71.4ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (70.3ms) CREATE INDEX "index_billing_origins_on_receipt_config_id" ON "billing_origins" ("receipt_config_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index'  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (70.8ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (64.2ms) DROP TABLE "billing_payment_types"  (73.9ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar, "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)   (73.1ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (72.4ms) DROP TABLE "billing_payments"  (65.6ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar, "payment_type_id" integer, "status" varchar, "name" varchar, "description" varchar, "external_token" varchar, "note" varchar, "deleted_at" datetime)  (72.7ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (71.9ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (72.6ms) DROP TABLE "billing_plus"  (65.1ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "code" varchar, "type" varchar, "banned" boolean, "deleted_at" datetime)   (65.0ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'   (63.8ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (64.7ms) DROP TABLE "billing_profiles"  (65.6ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime)  (64.2ms) DROP TABLE "billing_pt_fp_mappings"  (57.8ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (64.6ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'  (72.1ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (56.1ms) DROP TABLE "billing_receipt_configs"  (57.3ms) CREATE TABLE "billing_receipt_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "type" varchar, "name" varchar, "discount_text" varchar, "surcharge_text" varchar, "sound_signal" boolean, "open_cash_drawer" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "paper_cut" boolean, "custom_commands" boolean, "custom_commands_text" varchar)   (72.2ms) DROP TABLE "billing_reports"  (72.8ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar DEFAULT 'USD' NOT NULL, "note" text, "type" varchar, "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar, "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (65.3ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (72.3ms) DROP TABLE "billing_resources"  (65.5ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "properties" text, "banned" boolean, "type" varchar, "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)  (56.6ms) DROP TABLE "billing_tax_groups"  (65.3ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar, "deleted_at" datetime)  (88.0ms) DROP TABLE "billing_tg_fp_mappings"  (223.1ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (72.8ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'  (72.4ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (63.2ms) DROP TABLE "billing_versions"  (66.8ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar NOT NULL, "item_id" integer NOT NULL, "event" varchar NOT NULL, "whodunnit" varchar, "object" text, "created_at" datetime, "ip" varchar, "user_agent" varchar, "object_changes" text, "master_id" integer, "master_type" varchar)   (64.8ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (64.4ms) DROP TABLE "profiles"  (65.7ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)  (0.5ms) SELECT version FROM "schema_migrations" Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types"  (0.1ms) begin transaction Fixture Delete (0.2ms) DELETE FROM "billing_payment_types" Fixture Insert (0.2ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 01:51:02', '2017-03-29 01:51:02', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 01:51:02', '2017-03-29 01:51:02', 298486374) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Cash', 't', 'f', '2017-03-29 01:51:02', '2017-03-29 01:51:02', 112846265) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Fiscal', 't', 't', '2017-03-29 01:51:02', '2017-03-29 01:51:02', 817124681) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Card', 'f', 't', '2017-03-29 01:51:02', '2017-03-29 01:51:02', 370448595) Fixture Delete (0.1ms) DELETE FROM "billing_origins" Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 01:51:02', '2017-03-29 01:51:02', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 01:51:02', '2017-03-29 01:51:02', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_plus" Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:51:02', '2017-03-29 01:51:02', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:51:02', '2017-03-29 01:51:02', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_payments" Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (100, 'USD', 'Billing::PaymentWithType', '2017-03-29 01:51:02', '2017-03-29 01:51:02', 980190962, 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (200, 'USD', 'Billing::PaymentWithType', '2017-03-29 01:51:02', '2017-03-29 01:51:02', 298486374, 980190962, 980190962) Fixture Delete (0.2ms) DELETE FROM "billing_bills" Fixture Insert (0.2ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id", "origin_id") VALUES ('2017-03-29 01:51:02', '2017-03-29 01:51:02', 980190962, 'Profile', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id") VALUES ('2017-03-29 01:51:02', '2017-03-29 01:51:02', 298486374, 'Profile', 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_resources" Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 01:51:02', '2017-03-29 01:51:02', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 01:51:02', '2017-03-29 01:51:02', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_receipt_configs" Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 01:51:02', '2017-03-29 01:51:02', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 01:51:02', '2017-03-29 01:51:02', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_charges" Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (100, 'USD', '2017-03-29 01:51:02', '2017-03-29 01:51:02', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (200, 'USD', '2017-03-29 01:51:02', '2017-03-29 01:51:02', 298486374, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_departments" Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group1', NULL, '2017-03-29 01:51:02', '2017-03-29 01:51:02', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group2', NULL, '2017-03-29 01:51:02', '2017-03-29 01:51:02', 298486374, 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_modifiers" Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("percent_ratio", "created_at", "updated_at", "id", "bill_id") VALUES (1.0, '2017-03-29 01:51:02', '2017-03-29 01:51:02', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "fixed_value_currency", "created_at", "updated_at", "id", "bill_id", "charge_id") VALUES (100, 'USD', '2017-03-29 01:51:02', '2017-03-29 01:51:02', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_profiles" Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:51:02', '2017-03-29 01:51:02', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:51:02', '2017-03-29 01:51:02', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_operators" Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 01:51:02', '2017-03-29 01:51:02', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 01:51:02', '2017-03-29 01:51:02', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_tax_groups" Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:51:02', '2017-03-29 01:51:02', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:51:02', '2017-03-29 01:51:02', 298486374) Fixture Delete (0.1ms) DELETE FROM "profiles" Fixture Insert (0.1ms) INSERT INTO "profiles" ("created_at", "updated_at", "id") VALUES ('2017-03-29 01:51:02', '2017-03-29 01:51:02', 980190962)  (110.3ms) commit transaction  (0.1ms) begin transaction ----------------------- BillingTest: test_truth -----------------------  (0.1ms) rollback transaction  (0.1ms) begin transaction --------------------------------- Billing::PaymentTest: test_create --------------------------------- Billing::Payment Load (0.3ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.2ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.3ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.0ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.2ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ---------------------------------------------------------------------------- Billing::PaymentTest: test_should_be_instance_of_bill's_origin_payment_model ---------------------------------------------------------------------------- Billing::Payment Load (0.3ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction --------------------------------------------------------- Billing::PaymentTest: test_should_be_single_cash_payments --------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.1ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------------------------------ Billing::PaymentTest: test_should_have_same_fiscal_flag_as_other_bill_payments ------------------------------------------------------------------------------ Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.1ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------ Billing::BillTest: test_charge ------------------------------ Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.7ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:51:02.852657"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:51:02.000000000 Z\nupdated_at: 2017-03-29 01:51:02.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:51:02.852657"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:51:02.000000000 Z\n- 2017-03-29 01:51:02.852657138 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 01:51:02.871078"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 01:51:02.000000000 Z\nupdated_at: 2017-03-29 01:51:02.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 01:51:02.871078"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 01:51:02.000000000 Z\n- 2017-03-29 01:51:02.871078761 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:51:02.852657"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:51:02.000000000 Z\nupdated_at: 2017-03-29 01:51:02.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:51:02.852657"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:51:02.000000000 Z\n- 2017-03-29 01:51:02.852657138 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 01:51:02.989585"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:51:02.000000000 Z\nupdated_at: 2017-03-29 01:51:02.852657138 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:51:02.989585"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 01:51:02.852657138 Z\n- 2017-03-29 01:51:02.989585254 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.4ms) INSERT INTO "billing_charges" ("price_cents", "bill_id", "value_cents", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["price_cents", 300], ["bill_id", 980190962], ["value_cents", 300], ["created_at", "2017-03-29 01:51:03.000949"], ["updated_at", "2017-03-29 01:51:03.000949"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 01:51:03.000949"], ["object_changes", "---\nprice_cents:\n- 0\n- 300\nbill_id:\n- \n- 980190962\nvalue_cents:\n- 0\n- 300\ncreated_at:\n- \n- &1 2017-03-29 01:51:03.000949815 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 01:51:02.989585"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:51:02.000000000 Z\nupdated_at: 2017-03-29 01:51:02.852657138 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:51:02.989585"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 01:51:02.852657138 Z\n- 2017-03-29 01:51:02.989585254 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.2ms) rollback transaction Billing::Version Load (0.3ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction -------------------------------- Billing::BillTest: test_discount -------------------------------- Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:51:03.135815"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:51:02.000000000 Z\nupdated_at: 2017-03-29 01:51:02.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:51:03.135815"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:51:02.000000000 Z\n- 2017-03-29 01:51:03.135815962 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 01:51:03.148993"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 01:51:02.000000000 Z\nupdated_at: 2017-03-29 01:51:02.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 01:51:03.148993"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 01:51:02.000000000 Z\n- 2017-03-29 01:51:03.148993474 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:51:03.135815"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:51:02.000000000 Z\nupdated_at: 2017-03-29 01:51:02.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:51:03.135815"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:51:02.000000000 Z\n- 2017-03-29 01:51:03.135815962 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 298486374]]  (0.2ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1 SQL (0.3ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "charge_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["fixed_value_cents", -100], ["charge_id", 298486374], ["bill_id", 980190962], ["created_at", "2017-03-29 01:51:03.272493"], ["updated_at", "2017-03-29 01:51:03.272493"]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 01:51:03.272493"], ["object_changes", "---\nfixed_value_cents:\n- 0\n- -100\ncharge_id:\n- \n- 298486374\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 01:51:03.272493632 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Modifier"]] Billing::Modifier Exists (0.3ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Modifier"]]  (0.1ms) begin transaction --------------------------------- Billing::BillTest: test_summaries --------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:51:03.390100"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:51:02.000000000 Z\nupdated_at: 2017-03-29 01:51:02.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:51:03.390100"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:51:02.000000000 Z\n- 2017-03-29 01:51:03.390100436 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 01:51:03.401507"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 01:51:02.000000000 Z\nupdated_at: 2017-03-29 01:51:02.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 01:51:03.401507"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 01:51:02.000000000 Z\n- 2017-03-29 01:51:03.401507211 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:51:03.390100"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:51:02.000000000 Z\nupdated_at: 2017-03-29 01:51:02.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:51:03.390100"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:51:02.000000000 Z\n- 2017-03-29 01:51:03.390100436 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.2ms) begin transaction --------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_global_bill_modifier --------------------------------------------------------------- Billing::Modifier Load (0.3ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction -------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_modifier_per_charge -------------------------------------------------------------- Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.1ms) begin transaction ----------------------------------------- Billing::ChargeTest: test_string_protocol ----------------------------------------- Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Plu Load (0.3ms) SELECT "billing_plus".* FROM "billing_plus" WHERE "billing_plus"."id" = ? LIMIT 1 [["id", 980190962]] Billing::TaxGroup Load (0.3ms) SELECT "billing_tax_groups".* FROM "billing_tax_groups" WHERE "billing_tax_groups"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------- Billing::ChargeTest: test_wild_class_method ------------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (141.0ms) DROP TABLE "billing_bills"  (60.4ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar, "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar, "number" varchar, "deleted_at" datetime, "print_job_id" integer)   (0.1ms) select sqlite_version(*)  (73.0ms) CREATE INDEX "index_billing_bills_on_billable_type_and_billable_id" ON "billing_bills" ("billable_type", "billable_id")  (0.4ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'  (55.9ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (72.6ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (80.7ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (73.1ms) DROP TABLE "billing_charges"  (71.5ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar, "description" varchar, "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))  (72.7ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (64.1ms) CREATE INDEX "index_billing_charges_on_chargable_type_and_chargable_id" ON "billing_charges" ("chargable_type", "chargable_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (72.2ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (71.4ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (86.1ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (75.1ms) DROP TABLE "billing_departments"  (55.3ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "tax_group_id" integer, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (73.4ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (72.7ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (64.6ms) DROP TABLE "billing_modifiers"  (212.1ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)  (66.7ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (55.5ms) DROP TABLE "billing_op_fp_mappings"  (57.6ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar)   (65.1ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (63.7ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (55.8ms) DROP TABLE "billing_operators"  (65.3ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)  (65.2ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (64.4ms) DROP TABLE "billing_origins"  (65.5ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar, "payment_model" varchar DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar, "receipt_config_id" integer)   (64.6ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (64.0ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (71.7ms) CREATE INDEX "index_billing_origins_on_receipt_config_id" ON "billing_origins" ("receipt_config_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (72.1ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (64.3ms) DROP TABLE "billing_payment_types"  (65.9ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar, "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)   (73.0ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (72.0ms) DROP TABLE "billing_payments"  (73.0ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar, "payment_type_id" integer, "status" varchar, "name" varchar, "description" varchar, "external_token" varchar, "note" varchar, "deleted_at" datetime)  (48.4ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (71.8ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (65.4ms) DROP TABLE "billing_plus"  (73.6ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "code" varchar, "type" varchar, "banned" boolean, "deleted_at" datetime)   (64.8ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'   (64.1ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (65.4ms) DROP TABLE "billing_profiles"  (73.8ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime)  (130.5ms) DROP TABLE "billing_pt_fp_mappings"  (57.6ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (56.6ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'  (56.0ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (56.3ms) DROP TABLE "billing_receipt_configs"  (57.4ms) CREATE TABLE "billing_receipt_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "type" varchar, "name" varchar, "discount_text" varchar, "surcharge_text" varchar, "sound_signal" boolean, "open_cash_drawer" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "paper_cut" boolean, "custom_commands" boolean, "custom_commands_text" varchar)   (81.0ms) DROP TABLE "billing_reports"  (146.3ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar DEFAULT 'USD' NOT NULL, "note" text, "type" varchar, "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar, "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (56.2ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (64.6ms) DROP TABLE "billing_resources"  (65.2ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "properties" text, "banned" boolean, "type" varchar, "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)  (64.9ms) DROP TABLE "billing_tax_groups"  (91.2ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar, "deleted_at" datetime)  (129.4ms) DROP TABLE "billing_tg_fp_mappings"  (74.0ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (73.6ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'  (72.9ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (72.9ms) DROP TABLE "billing_versions"  (73.7ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar NOT NULL, "item_id" integer NOT NULL, "event" varchar NOT NULL, "whodunnit" varchar, "object" text, "created_at" datetime, "ip" varchar, "user_agent" varchar, "object_changes" text, "master_id" integer, "master_type" varchar)   (65.0ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (63.8ms) DROP TABLE "profiles"  (74.2ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)  (0.3ms) SELECT version FROM "schema_migrations" Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types"  (0.2ms) begin transaction Fixture Delete (0.3ms) DELETE FROM "billing_payment_types" Fixture Insert (0.2ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 01:51:35', '2017-03-29 01:51:35', 980190962) Fixture Insert (0.2ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 01:51:35', '2017-03-29 01:51:35', 298486374) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Cash', 't', 'f', '2017-03-29 01:51:35', '2017-03-29 01:51:35', 112846265) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Fiscal', 't', 't', '2017-03-29 01:51:35', '2017-03-29 01:51:35', 817124681) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Card', 'f', 't', '2017-03-29 01:51:35', '2017-03-29 01:51:35', 370448595) Fixture Delete (0.2ms) DELETE FROM "billing_origins" Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 01:51:35', '2017-03-29 01:51:35', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 01:51:35', '2017-03-29 01:51:35', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_plus" Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:51:35', '2017-03-29 01:51:35', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:51:35', '2017-03-29 01:51:35', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_payments" Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (100, 'USD', 'Billing::PaymentWithType', '2017-03-29 01:51:36', '2017-03-29 01:51:36', 980190962, 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (200, 'USD', 'Billing::PaymentWithType', '2017-03-29 01:51:36', '2017-03-29 01:51:36', 298486374, 980190962, 980190962) Fixture Delete (0.2ms) DELETE FROM "billing_bills" Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id", "origin_id") VALUES ('2017-03-29 01:51:36', '2017-03-29 01:51:36', 980190962, 'Profile', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id") VALUES ('2017-03-29 01:51:36', '2017-03-29 01:51:36', 298486374, 'Profile', 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_resources" Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 01:51:36', '2017-03-29 01:51:36', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 01:51:36', '2017-03-29 01:51:36', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_receipt_configs" Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 01:51:36', '2017-03-29 01:51:36', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 01:51:36', '2017-03-29 01:51:36', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_charges" Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (100, 'USD', '2017-03-29 01:51:36', '2017-03-29 01:51:36', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (200, 'USD', '2017-03-29 01:51:36', '2017-03-29 01:51:36', 298486374, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_departments" Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group1', NULL, '2017-03-29 01:51:36', '2017-03-29 01:51:36', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group2', NULL, '2017-03-29 01:51:36', '2017-03-29 01:51:36', 298486374, 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_modifiers" Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("percent_ratio", "created_at", "updated_at", "id", "bill_id") VALUES (1.0, '2017-03-29 01:51:36', '2017-03-29 01:51:36', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "fixed_value_currency", "created_at", "updated_at", "id", "bill_id", "charge_id") VALUES (100, 'USD', '2017-03-29 01:51:36', '2017-03-29 01:51:36', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_profiles" Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:51:36', '2017-03-29 01:51:36', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:51:36', '2017-03-29 01:51:36', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_operators" Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 01:51:36', '2017-03-29 01:51:36', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 01:51:36', '2017-03-29 01:51:36', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_tax_groups" Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:51:36', '2017-03-29 01:51:36', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:51:36', '2017-03-29 01:51:36', 298486374) Fixture Delete (0.1ms) DELETE FROM "profiles" Fixture Insert (0.1ms) INSERT INTO "profiles" ("created_at", "updated_at", "id") VALUES ('2017-03-29 01:51:36', '2017-03-29 01:51:36', 980190962)  (75.6ms) commit transaction  (0.1ms) begin transaction --------------------------------- Billing::PaymentTest: test_create --------------------------------- Billing::Payment Load (0.3ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.2ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.3ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.3ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.1ms) begin transaction ---------------------------------------------------------------------------- Billing::PaymentTest: test_should_be_instance_of_bill's_origin_payment_model ---------------------------------------------------------------------------- Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.1ms) begin transaction --------------------------------------------------------- Billing::PaymentTest: test_should_be_single_cash_payments --------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.1ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------------------------------ Billing::PaymentTest: test_should_have_same_fiscal_flag_as_other_bill_payments ------------------------------------------------------------------------------ Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.1ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------ Billing::BillTest: test_charge ------------------------------ Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.0ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (1.0ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:51:36.491614"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:51:36.000000000 Z\nupdated_at: 2017-03-29 01:51:36.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:51:36.491614"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:51:36.000000000 Z\n- 2017-03-29 01:51:36.491614092 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 01:51:36.516894"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 01:51:36.000000000 Z\nupdated_at: 2017-03-29 01:51:36.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 01:51:36.516894"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 01:51:36.000000000 Z\n- 2017-03-29 01:51:36.516894710 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:51:36.491614"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:51:36.000000000 Z\nupdated_at: 2017-03-29 01:51:36.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:51:36.491614"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:51:36.000000000 Z\n- 2017-03-29 01:51:36.491614092 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 01:51:36.653344"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:51:36.000000000 Z\nupdated_at: 2017-03-29 01:51:36.491614092 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:51:36.653344"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 01:51:36.491614092 Z\n- 2017-03-29 01:51:36.653344329 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) INSERT INTO "billing_charges" ("price_cents", "bill_id", "value_cents", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["price_cents", 300], ["bill_id", 980190962], ["value_cents", 300], ["created_at", "2017-03-29 01:51:36.664230"], ["updated_at", "2017-03-29 01:51:36.664230"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 01:51:36.664230"], ["object_changes", "---\nprice_cents:\n- 0\n- 300\nbill_id:\n- \n- 980190962\nvalue_cents:\n- 0\n- 300\ncreated_at:\n- \n- &1 2017-03-29 01:51:36.664230091 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 01:51:36.653344"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:51:36.000000000 Z\nupdated_at: 2017-03-29 01:51:36.491614092 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:51:36.653344"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 01:51:36.491614092 Z\n- 2017-03-29 01:51:36.653344329 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.2ms) rollback transaction Billing::Version Load (0.3ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction -------------------------------- Billing::BillTest: test_discount -------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:51:36.817102"], ["id", 980190962]] SQL (0.3ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:51:36.000000000 Z\nupdated_at: 2017-03-29 01:51:36.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:51:36.817102"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:51:36.000000000 Z\n- 2017-03-29 01:51:36.817102046 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 01:51:36.828185"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 01:51:36.000000000 Z\nupdated_at: 2017-03-29 01:51:36.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 01:51:36.828185"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 01:51:36.000000000 Z\n- 2017-03-29 01:51:36.828185740 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:51:36.817102"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:51:36.000000000 Z\nupdated_at: 2017-03-29 01:51:36.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:51:36.817102"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:51:36.000000000 Z\n- 2017-03-29 01:51:36.817102046 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) RELEASE SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 298486374]]  (0.2ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1 SQL (0.3ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "charge_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["fixed_value_cents", -100], ["charge_id", 298486374], ["bill_id", 980190962], ["created_at", "2017-03-29 01:51:36.959343"], ["updated_at", "2017-03-29 01:51:36.959343"]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 01:51:36.959343"], ["object_changes", "---\nfixed_value_cents:\n- 0\n- -100\ncharge_id:\n- \n- 298486374\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 01:51:36.959343263 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Modifier"]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.2ms) rollback transaction Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Modifier"]]  (0.1ms) begin transaction --------------------------------- Billing::BillTest: test_summaries --------------------------------- Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:51:37.077848"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:51:36.000000000 Z\nupdated_at: 2017-03-29 01:51:36.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:51:37.077848"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:51:36.000000000 Z\n- 2017-03-29 01:51:37.077848846 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 01:51:37.088149"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 01:51:36.000000000 Z\nupdated_at: 2017-03-29 01:51:36.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 01:51:37.088149"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 01:51:36.000000000 Z\n- 2017-03-29 01:51:37.088149124 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:51:37.077848"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:51:36.000000000 Z\nupdated_at: 2017-03-29 01:51:36.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:51:37.077848"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:51:36.000000000 Z\n- 2017-03-29 01:51:37.077848846 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction --------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_global_bill_modifier --------------------------------------------------------------- Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction -------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_modifier_per_charge -------------------------------------------------------------- Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ----------------------------------------- Billing::ChargeTest: test_string_protocol ----------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Plu Load (0.3ms) SELECT "billing_plus".* FROM "billing_plus" WHERE "billing_plus"."id" = ? LIMIT 1 [["id", 980190962]] Billing::TaxGroup Load (0.3ms) SELECT "billing_tax_groups".* FROM "billing_tax_groups" WHERE "billing_tax_groups"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------- Billing::ChargeTest: test_wild_class_method ------------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.2ms) begin transaction ----------------------- BillingTest: test_truth -----------------------  (0.1ms) rollback transaction ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (90.6ms) DROP TABLE "billing_bills"  (62.0ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar, "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar, "number" varchar, "deleted_at" datetime, "print_job_id" integer)   (0.2ms) select sqlite_version(*)  (64.5ms) CREATE INDEX "index_billing_bills_on_billable_type_and_billable_id" ON "billing_bills" ("billable_type", "billable_id")  (0.7ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'  (63.4ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (112.4ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (112.9ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (73.7ms) DROP TABLE "billing_charges"  (61.5ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar, "description" varchar, "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))  (71.0ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (57.8ms) CREATE INDEX "index_billing_charges_on_chargable_type_and_chargable_id" ON "billing_charges" ("chargable_type", "chargable_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (64.1ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (81.9ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (68.5ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (72.0ms) DROP TABLE "billing_departments"  (71.3ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "tax_group_id" integer, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (72.7ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (82.0ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (70.9ms) DROP TABLE "billing_modifiers"  (73.4ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)  (73.5ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (64.3ms) DROP TABLE "billing_op_fp_mappings"  (65.7ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar)   (64.7ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (63.4ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (71.8ms) DROP TABLE "billing_operators"  (73.2ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)  (64.8ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (63.8ms) DROP TABLE "billing_origins"  (57.4ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar, "payment_model" varchar DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar, "receipt_config_id" integer)   (56.6ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (64.2ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (63.7ms) CREATE INDEX "index_billing_origins_on_receipt_config_id" ON "billing_origins" ("receipt_config_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index'  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (62.5ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (48.1ms) DROP TABLE "billing_payment_types"  (56.8ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar, "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)   (64.5ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (55.7ms) DROP TABLE "billing_payments"  (64.9ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar, "payment_type_id" integer, "status" varchar, "name" varchar, "description" varchar, "external_token" varchar, "note" varchar, "deleted_at" datetime)  (47.3ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (63.2ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (97.6ms) DROP TABLE "billing_plus"  (73.7ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "code" varchar, "type" varchar, "banned" boolean, "deleted_at" datetime)   (72.6ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'   (72.6ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (72.2ms) DROP TABLE "billing_profiles"  (73.9ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime)  (72.8ms) DROP TABLE "billing_pt_fp_mappings"  (74.1ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (72.6ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'  (72.5ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (72.3ms) DROP TABLE "billing_receipt_configs"  (74.1ms) CREATE TABLE "billing_receipt_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "type" varchar, "name" varchar, "discount_text" varchar, "surcharge_text" varchar, "sound_signal" boolean, "open_cash_drawer" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "paper_cut" boolean, "custom_commands" boolean, "custom_commands_text" varchar)   (71.8ms) DROP TABLE "billing_reports"  (73.2ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar DEFAULT 'USD' NOT NULL, "note" text, "type" varchar, "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar, "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (73.2ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (72.4ms) DROP TABLE "billing_resources"  (73.6ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "properties" text, "banned" boolean, "type" varchar, "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)  (73.0ms) DROP TABLE "billing_tax_groups"  (74.1ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar, "deleted_at" datetime)  (72.7ms) DROP TABLE "billing_tg_fp_mappings"  (280.3ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (64.7ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'  (63.8ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (64.8ms) DROP TABLE "billing_versions"  (65.2ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar NOT NULL, "item_id" integer NOT NULL, "event" varchar NOT NULL, "whodunnit" varchar, "object" text, "created_at" datetime, "ip" varchar, "user_agent" varchar, "object_changes" text, "master_id" integer, "master_type" varchar)   (56.6ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (56.6ms) DROP TABLE "profiles"  (57.6ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)  (0.4ms) SELECT version FROM "schema_migrations" Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types"  (0.1ms) begin transaction Fixture Delete (0.2ms) DELETE FROM "billing_payment_types" Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 01:53:15', '2017-03-29 01:53:15', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 01:53:15', '2017-03-29 01:53:15', 298486374) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Cash', 't', 'f', '2017-03-29 01:53:15', '2017-03-29 01:53:15', 112846265) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Fiscal', 't', 't', '2017-03-29 01:53:15', '2017-03-29 01:53:15', 817124681) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Card', 'f', 't', '2017-03-29 01:53:15', '2017-03-29 01:53:15', 370448595) Fixture Delete (0.3ms) DELETE FROM "billing_origins" Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 01:53:15', '2017-03-29 01:53:15', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 01:53:15', '2017-03-29 01:53:15', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_plus" Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:53:15', '2017-03-29 01:53:15', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:53:15', '2017-03-29 01:53:15', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_payments" Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (100, 'USD', 'Billing::PaymentWithType', '2017-03-29 01:53:15', '2017-03-29 01:53:15', 980190962, 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (200, 'USD', 'Billing::PaymentWithType', '2017-03-29 01:53:15', '2017-03-29 01:53:15', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_bills" Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id", "origin_id") VALUES ('2017-03-29 01:53:15', '2017-03-29 01:53:15', 980190962, 'Profile', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id") VALUES ('2017-03-29 01:53:15', '2017-03-29 01:53:15', 298486374, 'Profile', 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_resources" Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 01:53:15', '2017-03-29 01:53:15', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 01:53:15', '2017-03-29 01:53:15', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_receipt_configs" Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 01:53:15', '2017-03-29 01:53:15', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 01:53:15', '2017-03-29 01:53:15', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_charges" Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (100, 'USD', '2017-03-29 01:53:15', '2017-03-29 01:53:15', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (200, 'USD', '2017-03-29 01:53:15', '2017-03-29 01:53:15', 298486374, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_departments" Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group1', NULL, '2017-03-29 01:53:15', '2017-03-29 01:53:15', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group2', NULL, '2017-03-29 01:53:15', '2017-03-29 01:53:15', 298486374, 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_modifiers" Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("percent_ratio", "created_at", "updated_at", "id", "bill_id") VALUES (1.0, '2017-03-29 01:53:15', '2017-03-29 01:53:15', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "fixed_value_currency", "created_at", "updated_at", "id", "bill_id", "charge_id") VALUES (100, 'USD', '2017-03-29 01:53:15', '2017-03-29 01:53:15', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_profiles" Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:53:15', '2017-03-29 01:53:15', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:53:15', '2017-03-29 01:53:15', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_operators" Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 01:53:15', '2017-03-29 01:53:15', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 01:53:15', '2017-03-29 01:53:15', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_tax_groups" Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:53:15', '2017-03-29 01:53:15', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:53:15', '2017-03-29 01:53:15', 298486374) Fixture Delete (0.1ms) DELETE FROM "profiles" Fixture Insert (0.1ms) INSERT INTO "profiles" ("created_at", "updated_at", "id") VALUES ('2017-03-29 01:53:15', '2017-03-29 01:53:15', 980190962)  (98.1ms) commit transaction  (0.1ms) begin transaction --------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_global_bill_modifier --------------------------------------------------------------- Billing::Modifier Load (0.3ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.2ms) SAVEPOINT active_record_1 Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction -------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_modifier_per_charge -------------------------------------------------------------- Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------ Billing::BillTest: test_charge ------------------------------ Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.3ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.3ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.4ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:53:15.772669"], ["id", 980190962]] SQL (0.3ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:53:15.000000000 Z\nupdated_at: 2017-03-29 01:53:15.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:53:15.772669"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:53:15.000000000 Z\n- 2017-03-29 01:53:15.772669327 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 01:53:15.794574"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 01:53:15.000000000 Z\nupdated_at: 2017-03-29 01:53:15.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 01:53:15.794574"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 01:53:15.000000000 Z\n- 2017-03-29 01:53:15.794574776 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:53:15.772669"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:53:15.000000000 Z\nupdated_at: 2017-03-29 01:53:15.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:53:15.772669"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:53:15.000000000 Z\n- 2017-03-29 01:53:15.772669327 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 01:53:15.901020"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:53:15.000000000 Z\nupdated_at: 2017-03-29 01:53:15.772669327 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:53:15.901020"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 01:53:15.772669327 Z\n- 2017-03-29 01:53:15.901020527 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.3ms) INSERT INTO "billing_charges" ("price_cents", "bill_id", "value_cents", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["price_cents", 300], ["bill_id", 980190962], ["value_cents", 300], ["created_at", "2017-03-29 01:53:15.910697"], ["updated_at", "2017-03-29 01:53:15.910697"]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 01:53:15.910697"], ["object_changes", "---\nprice_cents:\n- 0\n- 300\nbill_id:\n- \n- 980190962\nvalue_cents:\n- 0\n- 300\ncreated_at:\n- \n- &1 2017-03-29 01:53:15.910697317 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 01:53:15.901020"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:53:15.000000000 Z\nupdated_at: 2017-03-29 01:53:15.772669327 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:53:15.901020"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 01:53:15.772669327 Z\n- 2017-03-29 01:53:15.901020527 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.3ms) rollback transaction Billing::Version Load (0.4ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction -------------------------------- Billing::BillTest: test_discount -------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:53:16.059355"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:53:15.000000000 Z\nupdated_at: 2017-03-29 01:53:15.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:53:16.059355"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:53:15.000000000 Z\n- 2017-03-29 01:53:16.059355362 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 01:53:16.067608"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 01:53:15.000000000 Z\nupdated_at: 2017-03-29 01:53:15.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 01:53:16.067608"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 01:53:15.000000000 Z\n- 2017-03-29 01:53:16.067608370 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:53:16.059355"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:53:15.000000000 Z\nupdated_at: 2017-03-29 01:53:15.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:53:16.059355"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:53:15.000000000 Z\n- 2017-03-29 01:53:16.059355362 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 298486374]]  (0.3ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Exists (0.3ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1 SQL (0.4ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "charge_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["fixed_value_cents", -100], ["charge_id", 298486374], ["bill_id", 980190962], ["created_at", "2017-03-29 01:53:16.190017"], ["updated_at", "2017-03-29 01:53:16.190017"]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 01:53:16.190017"], ["object_changes", "---\nfixed_value_cents:\n- 0\n- -100\ncharge_id:\n- \n- 298486374\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 01:53:16.190017079 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Modifier"]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Modifier"]]  (0.1ms) begin transaction --------------------------------- Billing::BillTest: test_summaries --------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.2ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:53:16.309699"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:53:15.000000000 Z\nupdated_at: 2017-03-29 01:53:15.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:53:16.309699"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:53:15.000000000 Z\n- 2017-03-29 01:53:16.309699350 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 01:53:16.317980"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 01:53:15.000000000 Z\nupdated_at: 2017-03-29 01:53:15.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 01:53:16.317980"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 01:53:15.000000000 Z\n- 2017-03-29 01:53:16.317980916 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:53:16.309699"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:53:15.000000000 Z\nupdated_at: 2017-03-29 01:53:15.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:53:16.309699"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:53:15.000000000 Z\n- 2017-03-29 01:53:16.309699350 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction --------------------------------- Billing::PaymentTest: test_create --------------------------------- Billing::Payment Load (0.3ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.4ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.2ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ---------------------------------------------------------------------------- Billing::PaymentTest: test_should_be_instance_of_bill's_origin_payment_model ---------------------------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction --------------------------------------------------------- Billing::PaymentTest: test_should_be_single_cash_payments --------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.1ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------------------------------ Billing::PaymentTest: test_should_have_same_fiscal_flag_as_other_bill_payments ------------------------------------------------------------------------------ Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.1ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ----------------------------------------- Billing::ChargeTest: test_string_protocol ----------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Plu Load (0.2ms) SELECT "billing_plus".* FROM "billing_plus" WHERE "billing_plus"."id" = ? LIMIT 1 [["id", 980190962]] Billing::TaxGroup Load (0.2ms) SELECT "billing_tax_groups".* FROM "billing_tax_groups" WHERE "billing_tax_groups"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------- Billing::ChargeTest: test_wild_class_method ------------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ----------------------- BillingTest: test_truth -----------------------  (0.0ms) rollback transaction ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (95.1ms) DROP TABLE "billing_bills"  (60.3ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar, "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar, "number" varchar, "deleted_at" datetime, "print_job_id" integer)   (0.1ms) select sqlite_version(*)  (72.8ms) CREATE INDEX "index_billing_bills_on_billable_type_and_billable_id" ON "billing_bills" ("billable_type", "billable_id")  (0.5ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'  (63.8ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (62.5ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (72.0ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (71.7ms) DROP TABLE "billing_charges"  (63.1ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar, "description" varchar, "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))  (64.4ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (56.8ms) CREATE INDEX "index_billing_charges_on_chargable_type_and_chargable_id" ON "billing_charges" ("chargable_type", "chargable_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (71.4ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (74.6ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'   (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (74.8ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (63.8ms) DROP TABLE "billing_departments"  (53.4ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "tax_group_id" integer, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (140.9ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (82.3ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (70.9ms) DROP TABLE "billing_modifiers"  (73.5ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)  (64.2ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (56.2ms) DROP TABLE "billing_op_fp_mappings"  (65.9ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar)   (65.1ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (63.5ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (56.2ms) DROP TABLE "billing_operators"  (65.2ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)  (65.0ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (72.7ms) DROP TABLE "billing_origins"  (64.7ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar, "payment_model" varchar DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar, "receipt_config_id" integer)   (64.7ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (64.2ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (78.5ms) CREATE INDEX "index_billing_origins_on_receipt_config_id" ON "billing_origins" ("receipt_config_id")  (0.4ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index'  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (78.3ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (64.1ms) DROP TABLE "billing_payment_types"  (73.7ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar, "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)   (73.3ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (72.5ms) DROP TABLE "billing_payments"  (65.0ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar, "payment_type_id" integer, "status" varchar, "name" varchar, "description" varchar, "external_token" varchar, "note" varchar, "deleted_at" datetime)  (65.3ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (63.5ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (63.4ms) DROP TABLE "billing_plus"  (65.2ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "code" varchar, "type" varchar, "banned" boolean, "deleted_at" datetime)   (64.8ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'   (63.7ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (64.5ms) DROP TABLE "billing_profiles"  (57.6ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime)  (64.6ms) DROP TABLE "billing_pt_fp_mappings"  (57.8ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (65.2ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'  (105.1ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (64.5ms) DROP TABLE "billing_receipt_configs"  (65.6ms) CREATE TABLE "billing_receipt_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "type" varchar, "name" varchar, "discount_text" varchar, "surcharge_text" varchar, "sound_signal" boolean, "open_cash_drawer" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "paper_cut" boolean, "custom_commands" boolean, "custom_commands_text" varchar)   (72.0ms) DROP TABLE "billing_reports"  (72.7ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar DEFAULT 'USD' NOT NULL, "note" text, "type" varchar, "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar, "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (65.0ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (72.6ms) DROP TABLE "billing_resources"  (73.3ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "properties" text, "banned" boolean, "type" varchar, "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)  (72.8ms) DROP TABLE "billing_tax_groups"  (73.9ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar, "deleted_at" datetime)  (72.4ms) DROP TABLE "billing_tg_fp_mappings"  (65.7ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (64.3ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'  (72.4ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (72.7ms) DROP TABLE "billing_versions"  (57.4ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar NOT NULL, "item_id" integer NOT NULL, "event" varchar NOT NULL, "whodunnit" varchar, "object" text, "created_at" datetime, "ip" varchar, "user_agent" varchar, "object_changes" text, "master_id" integer, "master_type" varchar)   (72.8ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (64.8ms) DROP TABLE "profiles"  (57.2ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)  (0.7ms) SELECT version FROM "schema_migrations" Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types"  (0.1ms) begin transaction Fixture Delete (0.3ms) DELETE FROM "billing_payment_types" Fixture Insert (0.2ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 01:53:38', '2017-03-29 01:53:38', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 01:53:38', '2017-03-29 01:53:38', 298486374) Fixture Insert (0.2ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Cash', 't', 'f', '2017-03-29 01:53:38', '2017-03-29 01:53:38', 112846265) Fixture Insert (0.2ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Fiscal', 't', 't', '2017-03-29 01:53:38', '2017-03-29 01:53:38', 817124681) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Card', 'f', 't', '2017-03-29 01:53:38', '2017-03-29 01:53:38', 370448595) Fixture Delete (0.2ms) DELETE FROM "billing_origins" Fixture Insert (0.2ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 01:53:38', '2017-03-29 01:53:38', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 01:53:38', '2017-03-29 01:53:38', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_plus" Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:53:38', '2017-03-29 01:53:38', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:53:38', '2017-03-29 01:53:38', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_payments" Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (100, 'USD', 'Billing::PaymentWithType', '2017-03-29 01:53:38', '2017-03-29 01:53:38', 980190962, 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (200, 'USD', 'Billing::PaymentWithType', '2017-03-29 01:53:38', '2017-03-29 01:53:38', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_bills" Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id", "origin_id") VALUES ('2017-03-29 01:53:38', '2017-03-29 01:53:38', 980190962, 'Profile', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id") VALUES ('2017-03-29 01:53:38', '2017-03-29 01:53:38', 298486374, 'Profile', 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_resources" Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 01:53:38', '2017-03-29 01:53:38', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 01:53:38', '2017-03-29 01:53:38', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_receipt_configs" Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 01:53:38', '2017-03-29 01:53:38', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 01:53:38', '2017-03-29 01:53:38', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_charges" Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (100, 'USD', '2017-03-29 01:53:38', '2017-03-29 01:53:38', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (200, 'USD', '2017-03-29 01:53:38', '2017-03-29 01:53:38', 298486374, 980190962) Fixture Delete (0.2ms) DELETE FROM "billing_departments" Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group1', NULL, '2017-03-29 01:53:38', '2017-03-29 01:53:38', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group2', NULL, '2017-03-29 01:53:38', '2017-03-29 01:53:38', 298486374, 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_modifiers" Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("percent_ratio", "created_at", "updated_at", "id", "bill_id") VALUES (1.0, '2017-03-29 01:53:38', '2017-03-29 01:53:38', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "fixed_value_currency", "created_at", "updated_at", "id", "bill_id", "charge_id") VALUES (100, 'USD', '2017-03-29 01:53:38', '2017-03-29 01:53:38', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_profiles" Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:53:38', '2017-03-29 01:53:38', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:53:38', '2017-03-29 01:53:38', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_operators" Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 01:53:38', '2017-03-29 01:53:38', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 01:53:38', '2017-03-29 01:53:38', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_tax_groups" Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:53:38', '2017-03-29 01:53:38', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:53:38', '2017-03-29 01:53:38', 298486374) Fixture Delete (0.1ms) DELETE FROM "profiles" Fixture Insert (0.1ms) INSERT INTO "profiles" ("created_at", "updated_at", "id") VALUES ('2017-03-29 01:53:38', '2017-03-29 01:53:38', 980190962)  (89.6ms) commit transaction  (0.1ms) begin transaction --------------------------------- Billing::PaymentTest: test_create --------------------------------- Billing::Payment Load (0.3ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.2ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.4ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ---------------------------------------------------------------------------- Billing::PaymentTest: test_should_be_instance_of_bill's_origin_payment_model ---------------------------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction --------------------------------------------------------- Billing::PaymentTest: test_should_be_single_cash_payments --------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.0ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.1ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------------------------------ Billing::PaymentTest: test_should_have_same_fiscal_flag_as_other_bill_payments ------------------------------------------------------------------------------ Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.1ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction ----------------------------------------- Billing::ChargeTest: test_string_protocol ----------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Plu Load (0.2ms) SELECT "billing_plus".* FROM "billing_plus" WHERE "billing_plus"."id" = ? LIMIT 1 [["id", 980190962]] Billing::TaxGroup Load (0.2ms) SELECT "billing_tax_groups".* FROM "billing_tax_groups" WHERE "billing_tax_groups"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------- Billing::ChargeTest: test_wild_class_method ------------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction --------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_global_bill_modifier --------------------------------------------------------------- Billing::Modifier Load (0.3ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.2ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction -------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_modifier_per_charge -------------------------------------------------------------- Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------ Billing::BillTest: test_charge ------------------------------ Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.7ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:53:39.141658"], ["id", 980190962]] SQL (0.3ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:53:38.000000000 Z\nupdated_at: 2017-03-29 01:53:38.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:53:39.141658"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:53:38.000000000 Z\n- 2017-03-29 01:53:39.141658098 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.3ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 01:53:39.164940"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 01:53:38.000000000 Z\nupdated_at: 2017-03-29 01:53:38.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 01:53:39.164940"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 01:53:38.000000000 Z\n- 2017-03-29 01:53:39.164940082 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:53:39.141658"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:53:38.000000000 Z\nupdated_at: 2017-03-29 01:53:38.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:53:39.141658"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:53:38.000000000 Z\n- 2017-03-29 01:53:39.141658098 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 01:53:39.291655"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:53:38.000000000 Z\nupdated_at: 2017-03-29 01:53:39.141658098 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:53:39.291655"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 01:53:39.141658098 Z\n- 2017-03-29 01:53:39.291655689 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.3ms) INSERT INTO "billing_charges" ("price_cents", "bill_id", "value_cents", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["price_cents", 300], ["bill_id", 980190962], ["value_cents", 300], ["created_at", "2017-03-29 01:53:39.298829"], ["updated_at", "2017-03-29 01:53:39.298829"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 01:53:39.298829"], ["object_changes", "---\nprice_cents:\n- 0\n- 300\nbill_id:\n- \n- 980190962\nvalue_cents:\n- 0\n- 300\ncreated_at:\n- \n- &1 2017-03-29 01:53:39.298829282 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 01:53:39.291655"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:53:38.000000000 Z\nupdated_at: 2017-03-29 01:53:39.141658098 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:53:39.291655"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 01:53:39.141658098 Z\n- 2017-03-29 01:53:39.291655689 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.4ms) rollback transaction Billing::Version Load (0.4ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction -------------------------------- Billing::BillTest: test_discount -------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.2ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:53:39.446212"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:53:38.000000000 Z\nupdated_at: 2017-03-29 01:53:38.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:53:39.446212"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:53:38.000000000 Z\n- 2017-03-29 01:53:39.446212510 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 01:53:39.456015"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 01:53:38.000000000 Z\nupdated_at: 2017-03-29 01:53:38.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 01:53:39.456015"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 01:53:38.000000000 Z\n- 2017-03-29 01:53:39.456015671 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:53:39.446212"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:53:38.000000000 Z\nupdated_at: 2017-03-29 01:53:38.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:53:39.446212"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:53:38.000000000 Z\n- 2017-03-29 01:53:39.446212510 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1 SQL (0.2ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "charge_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["fixed_value_cents", -100], ["charge_id", 298486374], ["bill_id", 980190962], ["created_at", "2017-03-29 01:53:39.578945"], ["updated_at", "2017-03-29 01:53:39.578945"]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 01:53:39.578945"], ["object_changes", "---\nfixed_value_cents:\n- 0\n- -100\ncharge_id:\n- \n- 298486374\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 01:53:39.578945300 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Modifier"]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.3ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Modifier"]]  (0.1ms) begin transaction --------------------------------- Billing::BillTest: test_summaries --------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:53:39.678825"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:53:38.000000000 Z\nupdated_at: 2017-03-29 01:53:38.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:53:39.678825"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:53:38.000000000 Z\n- 2017-03-29 01:53:39.678825263 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 01:53:39.687375"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 01:53:38.000000000 Z\nupdated_at: 2017-03-29 01:53:38.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 01:53:39.687375"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 01:53:38.000000000 Z\n- 2017-03-29 01:53:39.687375460 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:53:39.678825"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:53:38.000000000 Z\nupdated_at: 2017-03-29 01:53:38.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:53:39.678825"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:53:38.000000000 Z\n- 2017-03-29 01:53:39.678825263 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.2ms) begin transaction ----------------------- BillingTest: test_truth -----------------------  (0.1ms) rollback transaction ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (103.7ms) DROP TABLE "billing_bills"  (68.1ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar, "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar, "number" varchar, "deleted_at" datetime, "print_job_id" integer)   (0.2ms) select sqlite_version(*)  (64.1ms) CREATE INDEX "index_billing_bills_on_billable_type_and_billable_id" ON "billing_bills" ("billable_type", "billable_id")  (0.5ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'  (63.5ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (63.9ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (73.6ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (73.9ms) DROP TABLE "billing_charges"  (68.7ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar, "description" varchar, "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))  (82.0ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (72.0ms) CREATE INDEX "index_billing_charges_on_chargable_type_and_chargable_id" ON "billing_charges" ("chargable_type", "chargable_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (78.9ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (62.5ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (76.9ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (59.7ms) DROP TABLE "billing_departments"  (62.4ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "tax_group_id" integer, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (73.3ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (64.5ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (64.3ms) DROP TABLE "billing_modifiers"  (73.6ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)  (72.9ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (56.3ms) DROP TABLE "billing_op_fp_mappings"  (65.7ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar)   (64.3ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (64.0ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (56.1ms) DROP TABLE "billing_operators"  (65.2ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)  (64.5ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (64.0ms) DROP TABLE "billing_origins"  (65.3ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar, "payment_model" varchar DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar, "receipt_config_id" integer)   (64.4ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (63.2ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (71.8ms) CREATE INDEX "index_billing_origins_on_receipt_config_id" ON "billing_origins" ("receipt_config_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index'  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (70.9ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (63.8ms) DROP TABLE "billing_payment_types"  (66.0ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar, "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)   (64.7ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (63.6ms) DROP TABLE "billing_payments"  (65.5ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar, "payment_type_id" integer, "status" varchar, "name" varchar, "description" varchar, "external_token" varchar, "note" varchar, "deleted_at" datetime)  (56.7ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (72.5ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (72.6ms) DROP TABLE "billing_plus"  (65.0ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "code" varchar, "type" varchar, "banned" boolean, "deleted_at" datetime)   (64.5ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'   (64.2ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (64.9ms) DROP TABLE "billing_profiles"  (65.6ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime)  (64.5ms) DROP TABLE "billing_pt_fp_mappings"  (65.8ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (64.5ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'  (55.8ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (64.2ms) DROP TABLE "billing_receipt_configs"  (65.7ms) CREATE TABLE "billing_receipt_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "type" varchar, "name" varchar, "discount_text" varchar, "surcharge_text" varchar, "sound_signal" boolean, "open_cash_drawer" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "paper_cut" boolean, "custom_commands" boolean, "custom_commands_text" varchar)   (64.1ms) DROP TABLE "billing_reports"  (139.2ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar DEFAULT 'USD' NOT NULL, "note" text, "type" varchar, "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar, "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (65.3ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (64.3ms) DROP TABLE "billing_resources"  (65.5ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "properties" text, "banned" boolean, "type" varchar, "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)  (65.0ms) DROP TABLE "billing_tax_groups"  (65.6ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar, "deleted_at" datetime)  (63.9ms) DROP TABLE "billing_tg_fp_mappings"  (65.7ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (64.5ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'  (63.7ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (64.4ms) DROP TABLE "billing_versions"  (73.6ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar NOT NULL, "item_id" integer NOT NULL, "event" varchar NOT NULL, "whodunnit" varchar, "object" text, "created_at" datetime, "ip" varchar, "user_agent" varchar, "object_changes" text, "master_id" integer, "master_type" varchar)   (73.2ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (72.9ms) DROP TABLE "profiles"  (74.0ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)  (0.3ms) SELECT version FROM "schema_migrations" Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types"  (0.1ms) begin transaction Fixture Delete (0.3ms) DELETE FROM "billing_payment_types" Fixture Insert (0.2ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 01:56:28', '2017-03-29 01:56:28', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 01:56:28', '2017-03-29 01:56:28', 298486374) Fixture Insert (0.2ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Cash', 't', 'f', '2017-03-29 01:56:28', '2017-03-29 01:56:28', 112846265) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Fiscal', 't', 't', '2017-03-29 01:56:28', '2017-03-29 01:56:28', 817124681) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Card', 'f', 't', '2017-03-29 01:56:28', '2017-03-29 01:56:28', 370448595) Fixture Delete (0.2ms) DELETE FROM "billing_origins" Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 01:56:28', '2017-03-29 01:56:28', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 01:56:28', '2017-03-29 01:56:28', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_plus" Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:56:28', '2017-03-29 01:56:28', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:56:28', '2017-03-29 01:56:28', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_payments" Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (100, 'USD', 'Billing::PaymentWithType', '2017-03-29 01:56:28', '2017-03-29 01:56:28', 980190962, 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (200, 'USD', 'Billing::PaymentWithType', '2017-03-29 01:56:28', '2017-03-29 01:56:28', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_bills" Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id", "origin_id") VALUES ('2017-03-29 01:56:28', '2017-03-29 01:56:28', 980190962, 'Profile', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id") VALUES ('2017-03-29 01:56:28', '2017-03-29 01:56:28', 298486374, 'Profile', 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_resources" Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 01:56:28', '2017-03-29 01:56:28', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 01:56:28', '2017-03-29 01:56:28', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_receipt_configs" Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 01:56:28', '2017-03-29 01:56:28', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 01:56:28', '2017-03-29 01:56:28', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_charges" Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (100, 'USD', '2017-03-29 01:56:28', '2017-03-29 01:56:28', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (200, 'USD', '2017-03-29 01:56:28', '2017-03-29 01:56:28', 298486374, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_departments" Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group1', NULL, '2017-03-29 01:56:28', '2017-03-29 01:56:28', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group2', NULL, '2017-03-29 01:56:28', '2017-03-29 01:56:28', 298486374, 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_modifiers" Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("percent_ratio", "created_at", "updated_at", "id", "bill_id") VALUES (1.0, '2017-03-29 01:56:28', '2017-03-29 01:56:28', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "fixed_value_currency", "created_at", "updated_at", "id", "bill_id", "charge_id") VALUES (100, 'USD', '2017-03-29 01:56:28', '2017-03-29 01:56:28', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_profiles" Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:56:28', '2017-03-29 01:56:28', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:56:28', '2017-03-29 01:56:28', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_operators" Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 01:56:28', '2017-03-29 01:56:28', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 01:56:28', '2017-03-29 01:56:28', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_tax_groups" Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:56:28', '2017-03-29 01:56:28', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 01:56:28', '2017-03-29 01:56:28', 298486374) Fixture Delete (0.1ms) DELETE FROM "profiles" Fixture Insert (0.1ms) INSERT INTO "profiles" ("created_at", "updated_at", "id") VALUES ('2017-03-29 01:56:28', '2017-03-29 01:56:28', 980190962)  (91.4ms) commit transaction  (0.1ms) begin transaction ----------------------- BillingTest: test_truth -----------------------  (0.1ms) rollback transaction  (0.1ms) begin transaction --------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_global_bill_modifier --------------------------------------------------------------- Billing::Modifier Load (0.3ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.3ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction -------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_modifier_per_charge -------------------------------------------------------------- Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ----------------------------------------- Billing::ChargeTest: test_string_protocol ----------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Plu Load (0.1ms) SELECT "billing_plus".* FROM "billing_plus" WHERE "billing_plus"."id" = ? LIMIT 1 [["id", 980190962]] Billing::TaxGroup Load (0.2ms) SELECT "billing_tax_groups".* FROM "billing_tax_groups" WHERE "billing_tax_groups"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.0ms) begin transaction ------------------------------------------- Billing::ChargeTest: test_wild_class_method ------------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------ Billing::BillTest: test_charge ------------------------------ Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.0ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.4ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.4ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:56:29.214727"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:56:28.000000000 Z\nupdated_at: 2017-03-29 01:56:28.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:56:29.214727"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:56:28.000000000 Z\n- 2017-03-29 01:56:29.214727596 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 01:56:29.233862"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 01:56:28.000000000 Z\nupdated_at: 2017-03-29 01:56:28.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 01:56:29.233862"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 01:56:28.000000000 Z\n- 2017-03-29 01:56:29.233862894 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:56:29.214727"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:56:28.000000000 Z\nupdated_at: 2017-03-29 01:56:28.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:56:29.214727"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:56:28.000000000 Z\n- 2017-03-29 01:56:29.214727596 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 01:56:29.348240"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:56:28.000000000 Z\nupdated_at: 2017-03-29 01:56:29.214727596 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:56:29.348240"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 01:56:29.214727596 Z\n- 2017-03-29 01:56:29.348240444 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.3ms) INSERT INTO "billing_charges" ("price_cents", "bill_id", "value_cents", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["price_cents", 300], ["bill_id", 980190962], ["value_cents", 300], ["created_at", "2017-03-29 01:56:29.355980"], ["updated_at", "2017-03-29 01:56:29.355980"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 01:56:29.355980"], ["object_changes", "---\nprice_cents:\n- 0\n- 300\nbill_id:\n- \n- 980190962\nvalue_cents:\n- 0\n- 300\ncreated_at:\n- \n- &1 2017-03-29 01:56:29.355980449 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 01:56:29.348240"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:56:28.000000000 Z\nupdated_at: 2017-03-29 01:56:29.214727596 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:56:29.348240"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 01:56:29.214727596 Z\n- 2017-03-29 01:56:29.348240444 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.3ms) rollback transaction Billing::Version Load (0.3ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction -------------------------------- Billing::BillTest: test_discount -------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:56:29.499409"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:56:28.000000000 Z\nupdated_at: 2017-03-29 01:56:28.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:56:29.499409"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:56:28.000000000 Z\n- 2017-03-29 01:56:29.499409792 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 01:56:29.508016"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 01:56:28.000000000 Z\nupdated_at: 2017-03-29 01:56:28.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 01:56:29.508016"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 01:56:28.000000000 Z\n- 2017-03-29 01:56:29.508016654 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:56:29.499409"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:56:28.000000000 Z\nupdated_at: 2017-03-29 01:56:28.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:56:29.499409"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:56:28.000000000 Z\n- 2017-03-29 01:56:29.499409792 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) RELEASE SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 298486374]]  (0.3ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1 SQL (0.2ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "charge_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["fixed_value_cents", -100], ["charge_id", 298486374], ["bill_id", 980190962], ["created_at", "2017-03-29 01:56:29.620080"], ["updated_at", "2017-03-29 01:56:29.620080"]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 01:56:29.620080"], ["object_changes", "---\nfixed_value_cents:\n- 0\n- -100\ncharge_id:\n- \n- 298486374\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 01:56:29.620080361 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Modifier"]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Modifier"]]  (0.1ms) begin transaction --------------------------------- Billing::BillTest: test_summaries --------------------------------- Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:56:29.716763"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:56:28.000000000 Z\nupdated_at: 2017-03-29 01:56:28.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:56:29.716763"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:56:28.000000000 Z\n- 2017-03-29 01:56:29.716763328 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 01:56:29.724091"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 01:56:28.000000000 Z\nupdated_at: 2017-03-29 01:56:28.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 01:56:29.724091"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 01:56:28.000000000 Z\n- 2017-03-29 01:56:29.724091688 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 01:56:29.716763"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 01:56:28.000000000 Z\nupdated_at: 2017-03-29 01:56:28.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 01:56:29.716763"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 01:56:28.000000000 Z\n- 2017-03-29 01:56:29.716763328 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.2ms) begin transaction --------------------------------- Billing::PaymentTest: test_create --------------------------------- Billing::Payment Load (0.4ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.2ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.2ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction ---------------------------------------------------------------------------- Billing::PaymentTest: test_should_be_instance_of_bill's_origin_payment_model ---------------------------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction --------------------------------------------------------- Billing::PaymentTest: test_should_be_single_cash_payments --------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.1ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------------------------------ Billing::PaymentTest: test_should_have_same_fiscal_flag_as_other_bill_payments ------------------------------------------------------------------------------ Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.1ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (117.2ms) DROP TABLE "billing_bills"  (63.3ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar, "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar, "number" varchar, "deleted_at" datetime, "print_job_id" integer)   (0.2ms) select sqlite_version(*)  (64.0ms) CREATE INDEX "index_billing_bills_on_billable_type_and_billable_id" ON "billing_bills" ("billable_type", "billable_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'  (64.3ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (72.2ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (81.1ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (69.7ms) DROP TABLE "billing_charges"  (58.4ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar, "description" varchar, "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))  (75.6ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (69.6ms) CREATE INDEX "index_billing_charges_on_chargable_type_and_chargable_id" ON "billing_charges" ("chargable_type", "chargable_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (71.8ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (81.6ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (72.0ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (76.5ms) DROP TABLE "billing_departments"  (70.0ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "tax_group_id" integer, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (66.3ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (82.2ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (70.7ms) DROP TABLE "billing_modifiers"  (64.0ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)  (66.9ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (56.2ms) DROP TABLE "billing_op_fp_mappings"  (65.4ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar)   (64.7ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (56.3ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (56.5ms) DROP TABLE "billing_operators"  (131.4ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)  (65.1ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (64.2ms) DROP TABLE "billing_origins"  (65.9ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar, "payment_model" varchar DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar, "receipt_config_id" integer)   (64.7ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (63.8ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (62.6ms) CREATE INDEX "index_billing_origins_on_receipt_config_id" ON "billing_origins" ("receipt_config_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (63.9ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (64.6ms) DROP TABLE "billing_payment_types"  (65.5ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar, "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)   (64.4ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (72.2ms) DROP TABLE "billing_payments"  (64.7ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar, "payment_type_id" integer, "status" varchar, "name" varchar, "description" varchar, "external_token" varchar, "note" varchar, "deleted_at" datetime)  (73.1ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (71.8ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (72.9ms) DROP TABLE "billing_plus"  (56.9ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "code" varchar, "type" varchar, "banned" boolean, "deleted_at" datetime)   (73.1ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'   (64.1ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (56.7ms) DROP TABLE "billing_profiles"  (73.9ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime)  (72.7ms) DROP TABLE "billing_pt_fp_mappings"  (65.9ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (64.6ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'  (63.1ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (64.4ms) DROP TABLE "billing_receipt_configs"  (65.9ms) CREATE TABLE "billing_receipt_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "type" varchar, "name" varchar, "discount_text" varchar, "surcharge_text" varchar, "sound_signal" boolean, "open_cash_drawer" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "paper_cut" boolean, "custom_commands" boolean, "custom_commands_text" varchar)   (63.7ms) DROP TABLE "billing_reports"  (65.5ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar DEFAULT 'USD' NOT NULL, "note" text, "type" varchar, "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar, "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (65.0ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (64.6ms) DROP TABLE "billing_resources"  (65.3ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "properties" text, "banned" boolean, "type" varchar, "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)  (64.4ms) DROP TABLE "billing_tax_groups"  (57.5ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar, "deleted_at" datetime)  (64.4ms) DROP TABLE "billing_tg_fp_mappings"  (57.7ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (81.5ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'  (56.2ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (55.1ms) DROP TABLE "billing_versions"  (66.8ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar NOT NULL, "item_id" integer NOT NULL, "event" varchar NOT NULL, "whodunnit" varchar, "object" text, "created_at" datetime, "ip" varchar, "user_agent" varchar, "object_changes" text, "master_id" integer, "master_type" varchar)   (56.7ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (63.4ms) DROP TABLE "profiles"  (66.9ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)  (0.3ms) SELECT version FROM "schema_migrations" Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types"  (0.1ms) begin transaction Fixture Delete (0.2ms) DELETE FROM "billing_payment_types" Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 02:02:57', '2017-03-29 02:02:57', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 02:02:57', '2017-03-29 02:02:57', 298486374) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Cash', 't', 'f', '2017-03-29 02:02:57', '2017-03-29 02:02:57', 112846265) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Fiscal', 't', 't', '2017-03-29 02:02:57', '2017-03-29 02:02:57', 817124681) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Card', 'f', 't', '2017-03-29 02:02:57', '2017-03-29 02:02:57', 370448595) Fixture Delete (0.1ms) DELETE FROM "billing_origins" Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 02:02:57', '2017-03-29 02:02:57', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 02:02:57', '2017-03-29 02:02:57', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_plus" Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:02:57', '2017-03-29 02:02:57', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:02:57', '2017-03-29 02:02:57', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_payments" Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (100, 'USD', 'Billing::PaymentWithType', '2017-03-29 02:02:57', '2017-03-29 02:02:57', 980190962, 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (200, 'USD', 'Billing::PaymentWithType', '2017-03-29 02:02:57', '2017-03-29 02:02:57', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_bills" Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id", "origin_id") VALUES ('2017-03-29 02:02:57', '2017-03-29 02:02:57', 980190962, 'Profile', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id") VALUES ('2017-03-29 02:02:57', '2017-03-29 02:02:57', 298486374, 'Profile', 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_resources" Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 02:02:57', '2017-03-29 02:02:57', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 02:02:57', '2017-03-29 02:02:57', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_receipt_configs" Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 02:02:57', '2017-03-29 02:02:57', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 02:02:57', '2017-03-29 02:02:57', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_charges" Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (100, 'USD', '2017-03-29 02:02:57', '2017-03-29 02:02:57', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (200, 'USD', '2017-03-29 02:02:57', '2017-03-29 02:02:57', 298486374, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_departments" Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group1', NULL, '2017-03-29 02:02:57', '2017-03-29 02:02:57', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group2', NULL, '2017-03-29 02:02:57', '2017-03-29 02:02:57', 298486374, 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_modifiers" Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("percent_ratio", "created_at", "updated_at", "id", "bill_id") VALUES (1.0, '2017-03-29 02:02:57', '2017-03-29 02:02:57', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "fixed_value_currency", "created_at", "updated_at", "id", "bill_id", "charge_id") VALUES (100, 'USD', '2017-03-29 02:02:57', '2017-03-29 02:02:57', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_profiles" Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:02:57', '2017-03-29 02:02:57', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:02:57', '2017-03-29 02:02:57', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_operators" Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 02:02:57', '2017-03-29 02:02:57', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 02:02:57', '2017-03-29 02:02:57', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_tax_groups" Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:02:57', '2017-03-29 02:02:57', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:02:57', '2017-03-29 02:02:57', 298486374) Fixture Delete (0.1ms) DELETE FROM "profiles" Fixture Insert (0.1ms) INSERT INTO "profiles" ("created_at", "updated_at", "id") VALUES ('2017-03-29 02:02:57', '2017-03-29 02:02:57', 980190962)  (98.7ms) commit transaction  (0.2ms) begin transaction ------------------------------ Billing::BillTest: test_charge ------------------------------ Billing::Bill Load (0.3ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.3ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.2ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:02:58.091267"], ["id", 980190962]] SQL (0.3ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:02:57.000000000 Z\nupdated_at: 2017-03-29 02:02:57.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:02:58.091267"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:02:57.000000000 Z\n- 2017-03-29 02:02:58.091267732 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:02:58.115454"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:02:57.000000000 Z\nupdated_at: 2017-03-29 02:02:57.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:02:58.115454"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:02:57.000000000 Z\n- 2017-03-29 02:02:58.115454887 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:02:58.091267"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:02:57.000000000 Z\nupdated_at: 2017-03-29 02:02:57.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:02:58.091267"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:02:57.000000000 Z\n- 2017-03-29 02:02:58.091267732 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 02:02:58.227597"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:02:57.000000000 Z\nupdated_at: 2017-03-29 02:02:58.091267732 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:02:58.227597"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 02:02:58.091267732 Z\n- 2017-03-29 02:02:58.227597526 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) INSERT INTO "billing_charges" ("price_cents", "bill_id", "value_cents", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["price_cents", 300], ["bill_id", 980190962], ["value_cents", 300], ["created_at", "2017-03-29 02:02:58.234451"], ["updated_at", "2017-03-29 02:02:58.234451"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:02:58.234451"], ["object_changes", "---\nprice_cents:\n- 0\n- 300\nbill_id:\n- \n- 980190962\nvalue_cents:\n- 0\n- 300\ncreated_at:\n- \n- &1 2017-03-29 02:02:58.234451307 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 02:02:58.227597"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:02:57.000000000 Z\nupdated_at: 2017-03-29 02:02:58.091267732 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:02:58.227597"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 02:02:58.091267732 Z\n- 2017-03-29 02:02:58.227597526 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.3ms) rollback transaction Billing::Version Load (0.5ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Charge"]]  (0.2ms) begin transaction -------------------------------- Billing::BillTest: test_discount -------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:02:58.382891"], ["id", 980190962]] SQL (0.3ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:02:57.000000000 Z\nupdated_at: 2017-03-29 02:02:57.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:02:58.382891"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:02:57.000000000 Z\n- 2017-03-29 02:02:58.382891909 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:02:58.394962"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:02:57.000000000 Z\nupdated_at: 2017-03-29 02:02:57.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:02:58.394962"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:02:57.000000000 Z\n- 2017-03-29 02:02:58.394962764 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:02:58.382891"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:02:57.000000000 Z\nupdated_at: 2017-03-29 02:02:57.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:02:58.382891"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:02:57.000000000 Z\n- 2017-03-29 02:02:58.382891909 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 298486374]]  (0.2ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1 SQL (0.2ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "charge_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["fixed_value_cents", -100], ["charge_id", 298486374], ["bill_id", 980190962], ["created_at", "2017-03-29 02:02:58.511277"], ["updated_at", "2017-03-29 02:02:58.511277"]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:02:58.511277"], ["object_changes", "---\nfixed_value_cents:\n- 0\n- -100\ncharge_id:\n- \n- 298486374\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:02:58.511277844 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Modifier"]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Modifier"]]  (0.1ms) begin transaction --------------------------------- Billing::BillTest: test_summaries --------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:02:58.611769"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:02:57.000000000 Z\nupdated_at: 2017-03-29 02:02:57.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:02:58.611769"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:02:57.000000000 Z\n- 2017-03-29 02:02:58.611769729 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:02:58.623248"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:02:57.000000000 Z\nupdated_at: 2017-03-29 02:02:57.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:02:58.623248"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:02:57.000000000 Z\n- 2017-03-29 02:02:58.623248139 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:02:58.611769"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:02:57.000000000 Z\nupdated_at: 2017-03-29 02:02:57.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:02:58.611769"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:02:57.000000000 Z\n- 2017-03-29 02:02:58.611769729 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction --------------------------------- Billing::PaymentTest: test_create --------------------------------- Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.2ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ---------------------------------------------------------------------------- Billing::PaymentTest: test_should_be_instance_of_bill's_origin_payment_model ---------------------------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction --------------------------------------------------------- Billing::PaymentTest: test_should_be_single_cash_payments --------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.1ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction ------------------------------------------------------------------------------ Billing::PaymentTest: test_should_have_same_fiscal_flag_as_other_bill_payments ------------------------------------------------------------------------------ Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] Profile Load (0.1ms) SELECT "profiles".* FROM "profiles" WHERE "profiles"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ----------------------- BillingTest: test_truth -----------------------  (0.0ms) rollback transaction  (0.1ms) begin transaction ----------------------------------------- Billing::ChargeTest: test_string_protocol ----------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Plu Load (0.3ms) SELECT "billing_plus".* FROM "billing_plus" WHERE "billing_plus"."id" = ? LIMIT 1 [["id", 980190962]] Billing::TaxGroup Load (0.2ms) SELECT "billing_tax_groups".* FROM "billing_tax_groups" WHERE "billing_tax_groups"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------- Billing::ChargeTest: test_wild_class_method ------------------------------------------- Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction --------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_global_bill_modifier --------------------------------------------------------------- Billing::Modifier Load (0.3ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction -------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_modifier_per_charge -------------------------------------------------------------- Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (125.9ms) DROP TABLE "billing_bills"  (77.3ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar, "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar, "number" varchar, "deleted_at" datetime, "print_job_id" integer)   (0.2ms) select sqlite_version(*)  (56.6ms) CREATE INDEX "index_billing_bills_on_billable_type_and_billable_id" ON "billing_bills" ("billable_type", "billable_id")  (0.6ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'  (63.2ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (62.8ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (81.4ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (65.5ms) DROP TABLE "billing_charges"  (68.6ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar, "description" varchar, "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))  (66.1ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (64.2ms) CREATE INDEX "index_billing_charges_on_chargable_type_and_chargable_id" ON "billing_charges" ("chargable_type", "chargable_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (71.4ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (63.9ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (72.7ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (68.3ms) DROP TABLE "billing_departments"  (78.3ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "tax_group_id" integer, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (72.8ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (71.5ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (98.3ms) DROP TABLE "billing_modifiers"  (138.4ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)  (65.1ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (48.3ms) DROP TABLE "billing_op_fp_mappings"  (65.7ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar)   (64.7ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (64.3ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (56.2ms) DROP TABLE "billing_operators"  (65.5ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)  (65.2ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (64.7ms) DROP TABLE "billing_origins"  (65.3ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar, "payment_model" varchar DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar, "receipt_config_id" integer)   (64.3ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (64.5ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (120.9ms) CREATE INDEX "index_billing_origins_on_receipt_config_id" ON "billing_origins" ("receipt_config_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (104.0ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (56.7ms) DROP TABLE "billing_payment_types"  (65.5ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar, "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)   (56.6ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (56.0ms) DROP TABLE "billing_payments"  (64.8ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar, "payment_type_id" integer, "status" varchar, "name" varchar, "description" varchar, "external_token" varchar, "note" varchar, "deleted_at" datetime)  (48.4ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (64.1ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (64.9ms) DROP TABLE "billing_plus"  (57.1ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "code" varchar, "type" varchar, "banned" boolean, "deleted_at" datetime)   (56.3ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'   (55.5ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (64.1ms) DROP TABLE "billing_profiles"  (57.6ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime)  (64.1ms) DROP TABLE "billing_pt_fp_mappings"  (65.9ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (64.5ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'  (64.0ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (64.1ms) DROP TABLE "billing_receipt_configs"  (73.9ms) CREATE TABLE "billing_receipt_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "type" varchar, "name" varchar, "discount_text" varchar, "surcharge_text" varchar, "sound_signal" boolean, "open_cash_drawer" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "paper_cut" boolean, "custom_commands" boolean, "custom_commands_text" varchar)   (79.6ms) DROP TABLE "billing_reports"  (73.0ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar DEFAULT 'USD' NOT NULL, "note" text, "type" varchar, "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar, "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (73.5ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (72.7ms) DROP TABLE "billing_resources"  (73.6ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "properties" text, "banned" boolean, "type" varchar, "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)  (72.8ms) DROP TABLE "billing_tax_groups"  (73.8ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar, "deleted_at" datetime)  (72.7ms) DROP TABLE "billing_tg_fp_mappings"  (74.0ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (72.9ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'  (72.2ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (146.8ms) DROP TABLE "billing_versions"  (73.5ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar NOT NULL, "item_id" integer NOT NULL, "event" varchar NOT NULL, "whodunnit" varchar, "object" text, "created_at" datetime, "ip" varchar, "user_agent" varchar, "object_changes" text, "master_id" integer, "master_type" varchar)   (73.4ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (64.5ms) DROP TABLE "profiles"  (66.0ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)  (0.4ms) SELECT version FROM "schema_migrations" Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types"  (0.1ms) begin transaction Fixture Delete (0.2ms) DELETE FROM "billing_payment_types" Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 02:03:38', '2017-03-29 02:03:38', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 02:03:38', '2017-03-29 02:03:38', 298486374) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Cash', 't', 'f', '2017-03-29 02:03:38', '2017-03-29 02:03:38', 112846265) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Fiscal', 't', 't', '2017-03-29 02:03:38', '2017-03-29 02:03:38', 817124681) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Card', 'f', 't', '2017-03-29 02:03:38', '2017-03-29 02:03:38', 370448595) Fixture Delete (0.2ms) DELETE FROM "billing_origins" Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 02:03:38', '2017-03-29 02:03:38', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 02:03:38', '2017-03-29 02:03:38', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_plus" Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:03:38', '2017-03-29 02:03:38', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:03:38', '2017-03-29 02:03:38', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_payments" Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (100, 'USD', 'Billing::PaymentWithType', '2017-03-29 02:03:38', '2017-03-29 02:03:38', 980190962, 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (200, 'USD', 'Billing::PaymentWithType', '2017-03-29 02:03:38', '2017-03-29 02:03:38', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_bills" Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id", "origin_id") VALUES ('2017-03-29 02:03:38', '2017-03-29 02:03:38', 980190962, 'Profile', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id") VALUES ('2017-03-29 02:03:38', '2017-03-29 02:03:38', 298486374, 'Profile', 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_resources" Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 02:03:38', '2017-03-29 02:03:38', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 02:03:38', '2017-03-29 02:03:38', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_receipt_configs" Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 02:03:38', '2017-03-29 02:03:38', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 02:03:38', '2017-03-29 02:03:38', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_charges" Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (100, 'USD', '2017-03-29 02:03:38', '2017-03-29 02:03:38', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (200, 'USD', '2017-03-29 02:03:38', '2017-03-29 02:03:38', 298486374, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_departments" Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group1', NULL, '2017-03-29 02:03:38', '2017-03-29 02:03:38', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group2', NULL, '2017-03-29 02:03:38', '2017-03-29 02:03:38', 298486374, 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_modifiers" Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("percent_ratio", "created_at", "updated_at", "id", "bill_id") VALUES (1.0, '2017-03-29 02:03:38', '2017-03-29 02:03:38', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "fixed_value_currency", "created_at", "updated_at", "id", "bill_id", "charge_id") VALUES (100, 'USD', '2017-03-29 02:03:38', '2017-03-29 02:03:38', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_profiles" Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:03:38', '2017-03-29 02:03:38', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:03:38', '2017-03-29 02:03:38', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_operators" Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 02:03:38', '2017-03-29 02:03:38', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 02:03:38', '2017-03-29 02:03:38', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_tax_groups" Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:03:38', '2017-03-29 02:03:38', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:03:38', '2017-03-29 02:03:38', 298486374) Fixture Delete (0.1ms) DELETE FROM "profiles" Fixture Insert (0.1ms) INSERT INTO "profiles" ("created_at", "updated_at", "id") VALUES ('2017-03-29 02:03:38', '2017-03-29 02:03:38', 980190962)  (87.6ms) commit transaction  (0.1ms) begin transaction ----------------------------------------- Billing::ChargeTest: test_string_protocol ----------------------------------------- Billing::Charge Load (0.3ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Plu Load (0.2ms) SELECT "billing_plus".* FROM "billing_plus" WHERE "billing_plus"."id" = ? LIMIT 1 [["id", 980190962]] Billing::TaxGroup Load (0.2ms) SELECT "billing_tax_groups".* FROM "billing_tax_groups" WHERE "billing_tax_groups"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------- Billing::ChargeTest: test_wild_class_method ------------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------ Billing::BillTest: test_charge ------------------------------ Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.2ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:03:39.206784"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:03:38.000000000 Z\nupdated_at: 2017-03-29 02:03:38.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:03:39.206784"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:03:38.000000000 Z\n- 2017-03-29 02:03:39.206784769 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:03:39.234182"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:03:38.000000000 Z\nupdated_at: 2017-03-29 02:03:38.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:03:39.234182"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:03:38.000000000 Z\n- 2017-03-29 02:03:39.234182340 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:03:39.206784"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:03:38.000000000 Z\nupdated_at: 2017-03-29 02:03:38.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:03:39.206784"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:03:38.000000000 Z\n- 2017-03-29 02:03:39.206784769 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 02:03:39.347854"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:03:38.000000000 Z\nupdated_at: 2017-03-29 02:03:39.206784769 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:03:39.347854"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 02:03:39.206784769 Z\n- 2017-03-29 02:03:39.347854402 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.3ms) INSERT INTO "billing_charges" ("price_cents", "bill_id", "value_cents", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["price_cents", 300], ["bill_id", 980190962], ["value_cents", 300], ["created_at", "2017-03-29 02:03:39.354879"], ["updated_at", "2017-03-29 02:03:39.354879"]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:03:39.354879"], ["object_changes", "---\nprice_cents:\n- 0\n- 300\nbill_id:\n- \n- 980190962\nvalue_cents:\n- 0\n- 300\ncreated_at:\n- \n- &1 2017-03-29 02:03:39.354879371 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 02:03:39.347854"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:03:38.000000000 Z\nupdated_at: 2017-03-29 02:03:39.206784769 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:03:39.347854"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 02:03:39.206784769 Z\n- 2017-03-29 02:03:39.347854402 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.3ms) rollback transaction Billing::Version Load (0.4ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction -------------------------------- Billing::BillTest: test_discount -------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:03:39.497958"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:03:38.000000000 Z\nupdated_at: 2017-03-29 02:03:38.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:03:39.497958"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:03:38.000000000 Z\n- 2017-03-29 02:03:39.497958752 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:03:39.507624"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:03:38.000000000 Z\nupdated_at: 2017-03-29 02:03:38.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:03:39.507624"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:03:38.000000000 Z\n- 2017-03-29 02:03:39.507624880 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:03:39.497958"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:03:38.000000000 Z\nupdated_at: 2017-03-29 02:03:38.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:03:39.497958"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:03:38.000000000 Z\n- 2017-03-29 02:03:39.497958752 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1 SQL (0.2ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "charge_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["fixed_value_cents", -100], ["charge_id", 298486374], ["bill_id", 980190962], ["created_at", "2017-03-29 02:03:39.623851"], ["updated_at", "2017-03-29 02:03:39.623851"]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:03:39.623851"], ["object_changes", "---\nfixed_value_cents:\n- 0\n- -100\ncharge_id:\n- \n- 298486374\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:03:39.623851745 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Modifier"]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Modifier"]]  (0.1ms) begin transaction --------------------------------- Billing::BillTest: test_summaries --------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:03:39.725270"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:03:38.000000000 Z\nupdated_at: 2017-03-29 02:03:38.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:03:39.725270"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:03:38.000000000 Z\n- 2017-03-29 02:03:39.725270344 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:03:39.736404"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:03:38.000000000 Z\nupdated_at: 2017-03-29 02:03:38.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:03:39.736404"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:03:38.000000000 Z\n- 2017-03-29 02:03:39.736404307 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:03:39.725270"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:03:38.000000000 Z\nupdated_at: 2017-03-29 02:03:38.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:03:39.725270"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:03:38.000000000 Z\n- 2017-03-29 02:03:39.725270344 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.2ms) begin transaction --------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_global_bill_modifier --------------------------------------------------------------- Billing::Modifier Load (0.3ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction -------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_modifier_per_charge -------------------------------------------------------------- Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction --------------------------------- Billing::PaymentTest: test_create --------------------------------- Billing::Payment Load (0.3ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.3ms) INSERT INTO "billing_payments" ("type", "value_cents", "payment_type_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["type", "Billing::PaymentWithType"], ["value_cents", 100], ["payment_type_id", 980190962], ["bill_id", 980190962], ["created_at", "2017-03-29 02:03:39.924117"], ["updated_at", "2017-03-29 02:03:39.924117"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:03:39.924117"], ["object_changes", "---\ntype:\n- \n- Billing::PaymentWithType\nvalue_cents:\n- 0\n- 100\npayment_type_id:\n- \n- 980190962\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:03:39.924117751 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Payment"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:03:39.956697"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:03:38.000000000 Z\nupdated_at: 2017-03-29 02:03:38.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:03:39.956697"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:03:38.000000000 Z\n- 2017-03-29 02:03:39.956697909 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:03:39.968108"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:03:38.000000000 Z\nupdated_at: 2017-03-29 02:03:38.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:03:39.968108"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:03:38.000000000 Z\n- 2017-03-29 02:03:39.968108824 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:03:39.956697"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:03:38.000000000 Z\nupdated_at: 2017-03-29 02:03:38.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:03:39.956697"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:03:38.000000000 Z\n- 2017-03-29 02:03:39.956697909 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Payment"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction ---------------------------------------------------------------------------- Billing::PaymentTest: test_should_be_instance_of_bill's_origin_payment_model ---------------------------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction --------------------------------------------------------- Billing::PaymentTest: test_should_be_single_cash_payments --------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.3ms) INSERT INTO "billing_payments" ("type", "value_cents", "payment_type_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["type", "Billing::PaymentWithType"], ["value_cents", 100], ["payment_type_id", 112846265], ["bill_id", 980190962], ["created_at", "2017-03-29 02:03:40.112032"], ["updated_at", "2017-03-29 02:03:40.112032"]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:03:40.112032"], ["object_changes", "---\ntype:\n- \n- Billing::PaymentWithType\nvalue_cents:\n- 0\n- 100\npayment_type_id:\n- \n- 112846265\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:03:40.112032479 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Payment"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:03:40.145106"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:03:38.000000000 Z\nupdated_at: 2017-03-29 02:03:38.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:03:40.145106"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:03:38.000000000 Z\n- 2017-03-29 02:03:40.145106674 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:03:40.152782"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:03:38.000000000 Z\nupdated_at: 2017-03-29 02:03:38.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:03:40.152782"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:03:38.000000000 Z\n- 2017-03-29 02:03:40.152782041 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:03:40.145106"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:03:38.000000000 Z\nupdated_at: 2017-03-29 02:03:38.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:03:40.145106"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:03:38.000000000 Z\n- 2017-03-29 02:03:40.145106674 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) rollback transaction Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Payment"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction ------------------------------------------------------------------------------ Billing::PaymentTest: test_should_have_same_fiscal_flag_as_other_bill_payments ------------------------------------------------------------------------------ Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction ----------------------- BillingTest: test_truth -----------------------  (0.1ms) rollback transaction ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (90.1ms) DROP TABLE "billing_bills"  (69.8ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar, "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar, "number" varchar, "deleted_at" datetime, "print_job_id" integer)   (0.1ms) select sqlite_version(*)  (72.8ms) CREATE INDEX "index_billing_bills_on_billable_type_and_billable_id" ON "billing_bills" ("billable_type", "billable_id")  (0.4ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'  (72.1ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (71.2ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (80.9ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (74.6ms) DROP TABLE "billing_charges"  (70.3ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar, "description" varchar, "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))  (71.2ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (74.2ms) CREATE INDEX "index_billing_charges_on_chargable_type_and_chargable_id" ON "billing_charges" ("chargable_type", "chargable_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (55.2ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (71.7ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (70.9ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (67.0ms) DROP TABLE "billing_departments"  (58.3ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "tax_group_id" integer, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (62.0ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (64.4ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (62.7ms) DROP TABLE "billing_modifiers"  (65.2ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)  (56.9ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (57.1ms) DROP TABLE "billing_op_fp_mappings"  (65.8ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar)   (65.2ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (64.3ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (64.7ms) DROP TABLE "billing_operators"  (65.3ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)  (65.3ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (73.1ms) DROP TABLE "billing_origins"  (65.0ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar, "payment_model" varchar DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar, "receipt_config_id" integer)   (73.3ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (72.4ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (71.4ms) CREATE INDEX "index_billing_origins_on_receipt_config_id" ON "billing_origins" ("receipt_config_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (71.7ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (64.5ms) DROP TABLE "billing_payment_types"  (57.6ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar, "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)   (64.4ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (63.9ms) DROP TABLE "billing_payments"  (65.0ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar, "payment_type_id" integer, "status" varchar, "name" varchar, "description" varchar, "external_token" varchar, "note" varchar, "deleted_at" datetime)  (65.0ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (63.4ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (64.1ms) DROP TABLE "billing_plus"  (65.6ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "code" varchar, "type" varchar, "banned" boolean, "deleted_at" datetime)   (64.6ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'   (63.6ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (105.7ms) DROP TABLE "billing_profiles"  (73.8ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime)  (64.6ms) DROP TABLE "billing_pt_fp_mappings"  (73.5ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (72.7ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'  (72.3ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (72.3ms) DROP TABLE "billing_receipt_configs"  (73.6ms) CREATE TABLE "billing_receipt_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "type" varchar, "name" varchar, "discount_text" varchar, "surcharge_text" varchar, "sound_signal" boolean, "open_cash_drawer" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "paper_cut" boolean, "custom_commands" boolean, "custom_commands_text" varchar)   (72.7ms) DROP TABLE "billing_reports"  (72.5ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar DEFAULT 'USD' NOT NULL, "note" text, "type" varchar, "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar, "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (73.4ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (72.5ms) DROP TABLE "billing_resources"  (81.9ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "properties" text, "banned" boolean, "type" varchar, "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)  (72.5ms) DROP TABLE "billing_tax_groups"  (73.5ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar, "deleted_at" datetime)  (72.5ms) DROP TABLE "billing_tg_fp_mappings"  (65.7ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (73.0ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'  (63.9ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (63.5ms) DROP TABLE "billing_versions"  (57.4ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar NOT NULL, "item_id" integer NOT NULL, "event" varchar NOT NULL, "whodunnit" varchar, "object" text, "created_at" datetime, "ip" varchar, "user_agent" varchar, "object_changes" text, "master_id" integer, "master_type" varchar)   (81.2ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (64.1ms) DROP TABLE "profiles"  (57.5ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)  (0.4ms) SELECT version FROM "schema_migrations" Billing::PaymentType Load (0.3ms) SELECT "billing_payment_types".* FROM "billing_payment_types"  (0.1ms) begin transaction Fixture Delete (0.1ms) DELETE FROM "billing_payment_types" Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 02:04:07', '2017-03-29 02:04:07', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 02:04:07', '2017-03-29 02:04:07', 298486374) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Cash', 't', 'f', '2017-03-29 02:04:07', '2017-03-29 02:04:07', 112846265) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Fiscal', 't', 't', '2017-03-29 02:04:07', '2017-03-29 02:04:07', 817124681) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Card', 'f', 't', '2017-03-29 02:04:07', '2017-03-29 02:04:07', 370448595) Fixture Delete (0.2ms) DELETE FROM "billing_origins" Fixture Insert (0.2ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 02:04:07', '2017-03-29 02:04:07', 980190962) Fixture Insert (0.2ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 02:04:07', '2017-03-29 02:04:07', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_plus" Fixture Insert (0.2ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:04:07', '2017-03-29 02:04:07', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:04:07', '2017-03-29 02:04:07', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_payments" Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (100, 'USD', 'Billing::PaymentWithType', '2017-03-29 02:04:07', '2017-03-29 02:04:07', 980190962, 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (200, 'USD', 'Billing::PaymentWithType', '2017-03-29 02:04:07', '2017-03-29 02:04:07', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_bills" Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id", "origin_id") VALUES ('2017-03-29 02:04:07', '2017-03-29 02:04:07', 980190962, 'Profile', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id") VALUES ('2017-03-29 02:04:07', '2017-03-29 02:04:07', 298486374, 'Profile', 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_resources" Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 02:04:07', '2017-03-29 02:04:07', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 02:04:07', '2017-03-29 02:04:07', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_receipt_configs" Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 02:04:07', '2017-03-29 02:04:07', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 02:04:07', '2017-03-29 02:04:07', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_charges" Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (100, 'USD', '2017-03-29 02:04:07', '2017-03-29 02:04:07', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (200, 'USD', '2017-03-29 02:04:07', '2017-03-29 02:04:07', 298486374, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_departments" Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group1', NULL, '2017-03-29 02:04:07', '2017-03-29 02:04:07', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group2', NULL, '2017-03-29 02:04:07', '2017-03-29 02:04:07', 298486374, 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_modifiers" Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("percent_ratio", "created_at", "updated_at", "id", "bill_id") VALUES (1.0, '2017-03-29 02:04:07', '2017-03-29 02:04:07', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "fixed_value_currency", "created_at", "updated_at", "id", "bill_id", "charge_id") VALUES (100, 'USD', '2017-03-29 02:04:07', '2017-03-29 02:04:07', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_profiles" Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:04:07', '2017-03-29 02:04:07', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:04:07', '2017-03-29 02:04:07', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_operators" Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 02:04:07', '2017-03-29 02:04:07', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 02:04:07', '2017-03-29 02:04:07', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_tax_groups" Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:04:07', '2017-03-29 02:04:07', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:04:07', '2017-03-29 02:04:07', 298486374) Fixture Delete (0.1ms) DELETE FROM "profiles" Fixture Insert (0.1ms) INSERT INTO "profiles" ("created_at", "updated_at", "id") VALUES ('2017-03-29 02:04:07', '2017-03-29 02:04:07', 980190962)  (91.5ms) commit transaction  (0.1ms) begin transaction ------------------------------ Billing::BillTest: test_charge ------------------------------ Billing::Bill Load (0.4ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.3ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.3ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.3ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:08.051101"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:07.000000000 Z\nupdated_at: 2017-03-29 02:04:07.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:08.051101"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:07.000000000 Z\n- 2017-03-29 02:04:08.051101564 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:04:08.076237"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:04:07.000000000 Z\nupdated_at: 2017-03-29 02:04:07.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:04:08.076237"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:04:07.000000000 Z\n- 2017-03-29 02:04:08.076237859 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:08.051101"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:07.000000000 Z\nupdated_at: 2017-03-29 02:04:07.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:08.051101"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:07.000000000 Z\n- 2017-03-29 02:04:08.051101564 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 02:04:08.190105"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:07.000000000 Z\nupdated_at: 2017-03-29 02:04:08.051101564 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:08.190105"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 02:04:08.051101564 Z\n- 2017-03-29 02:04:08.190105716 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.3ms) INSERT INTO "billing_charges" ("price_cents", "bill_id", "value_cents", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["price_cents", 300], ["bill_id", 980190962], ["value_cents", 300], ["created_at", "2017-03-29 02:04:08.199825"], ["updated_at", "2017-03-29 02:04:08.199825"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:04:08.199825"], ["object_changes", "---\nprice_cents:\n- 0\n- 300\nbill_id:\n- \n- 980190962\nvalue_cents:\n- 0\n- 300\ncreated_at:\n- \n- &1 2017-03-29 02:04:08.199825595 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 02:04:08.190105"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:07.000000000 Z\nupdated_at: 2017-03-29 02:04:08.051101564 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:08.190105"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 02:04:08.051101564 Z\n- 2017-03-29 02:04:08.190105716 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.3ms) rollback transaction Billing::Version Load (0.3ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction -------------------------------- Billing::BillTest: test_discount -------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:08.346844"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:07.000000000 Z\nupdated_at: 2017-03-29 02:04:07.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:08.346844"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:07.000000000 Z\n- 2017-03-29 02:04:08.346844560 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:04:08.356572"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:04:07.000000000 Z\nupdated_at: 2017-03-29 02:04:07.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:04:08.356572"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:04:07.000000000 Z\n- 2017-03-29 02:04:08.356572374 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:08.346844"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:07.000000000 Z\nupdated_at: 2017-03-29 02:04:07.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:08.346844"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:07.000000000 Z\n- 2017-03-29 02:04:08.346844560 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 298486374]]  (0.2ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1 SQL (0.3ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "charge_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["fixed_value_cents", -100], ["charge_id", 298486374], ["bill_id", 980190962], ["created_at", "2017-03-29 02:04:08.468102"], ["updated_at", "2017-03-29 02:04:08.468102"]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:04:08.468102"], ["object_changes", "---\nfixed_value_cents:\n- 0\n- -100\ncharge_id:\n- \n- 298486374\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:04:08.468102507 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Modifier"]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Modifier"]]  (0.2ms) begin transaction --------------------------------- Billing::BillTest: test_summaries --------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:08.572129"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:07.000000000 Z\nupdated_at: 2017-03-29 02:04:07.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:08.572129"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:07.000000000 Z\n- 2017-03-29 02:04:08.572129282 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:04:08.580212"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:04:07.000000000 Z\nupdated_at: 2017-03-29 02:04:07.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:04:08.580212"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:04:07.000000000 Z\n- 2017-03-29 02:04:08.580212612 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:08.572129"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:07.000000000 Z\nupdated_at: 2017-03-29 02:04:07.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:08.572129"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:07.000000000 Z\n- 2017-03-29 02:04:08.572129282 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction --------------------------------- Billing::PaymentTest: test_create --------------------------------- Billing::Payment Load (0.3ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.3ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.3ms) INSERT INTO "billing_payments" ("type", "value_cents", "payment_type_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["type", "Billing::PaymentWithType"], ["value_cents", 100], ["payment_type_id", 980190962], ["bill_id", 980190962], ["created_at", "2017-03-29 02:04:08.721342"], ["updated_at", "2017-03-29 02:04:08.721342"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:04:08.721342"], ["object_changes", "---\ntype:\n- \n- Billing::PaymentWithType\nvalue_cents:\n- 0\n- 100\npayment_type_id:\n- \n- 980190962\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:04:08.721342906 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Payment"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:08.758336"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:07.000000000 Z\nupdated_at: 2017-03-29 02:04:07.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:08.758336"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:07.000000000 Z\n- 2017-03-29 02:04:08.758336659 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:04:08.768749"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:04:07.000000000 Z\nupdated_at: 2017-03-29 02:04:07.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:04:08.768749"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:04:07.000000000 Z\n- 2017-03-29 02:04:08.768749449 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:08.758336"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:07.000000000 Z\nupdated_at: 2017-03-29 02:04:07.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:08.758336"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:07.000000000 Z\n- 2017-03-29 02:04:08.758336659 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Payment"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction ---------------------------------------------------------------------------- Billing::PaymentTest: test_should_be_instance_of_bill's_origin_payment_model ---------------------------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction --------------------------------------------------------- Billing::PaymentTest: test_should_be_single_cash_payments --------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_payments" ("type", "value_cents", "payment_type_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["type", "Billing::PaymentWithType"], ["value_cents", 100], ["payment_type_id", 112846265], ["bill_id", 980190962], ["created_at", "2017-03-29 02:04:08.920257"], ["updated_at", "2017-03-29 02:04:08.920257"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:04:08.920257"], ["object_changes", "---\ntype:\n- \n- Billing::PaymentWithType\nvalue_cents:\n- 0\n- 100\npayment_type_id:\n- \n- 112846265\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:04:08.920257393 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Payment"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:08.954211"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:07.000000000 Z\nupdated_at: 2017-03-29 02:04:07.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:08.954211"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:07.000000000 Z\n- 2017-03-29 02:04:08.954211463 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:04:08.966546"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:04:07.000000000 Z\nupdated_at: 2017-03-29 02:04:07.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:04:08.966546"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:04:07.000000000 Z\n- 2017-03-29 02:04:08.966546192 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:08.954211"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:07.000000000 Z\nupdated_at: 2017-03-29 02:04:07.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:08.954211"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:07.000000000 Z\n- 2017-03-29 02:04:08.954211463 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Payment"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction ------------------------------------------------------------------------------ Billing::PaymentTest: test_should_have_same_fiscal_flag_as_other_bill_payments ------------------------------------------------------------------------------ Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.4ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction --------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_global_bill_modifier --------------------------------------------------------------- Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction -------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_modifier_per_charge -------------------------------------------------------------- Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction ----------------------------------------- Billing::ChargeTest: test_string_protocol ----------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Plu Load (0.3ms) SELECT "billing_plus".* FROM "billing_plus" WHERE "billing_plus"."id" = ? LIMIT 1 [["id", 980190962]] Billing::TaxGroup Load (0.2ms) SELECT "billing_tax_groups".* FROM "billing_tax_groups" WHERE "billing_tax_groups"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------- Billing::ChargeTest: test_wild_class_method ------------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ----------------------- BillingTest: test_truth -----------------------  (0.1ms) rollback transaction ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (107.4ms) DROP TABLE "billing_bills"  (77.3ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar, "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar, "number" varchar, "deleted_at" datetime, "print_job_id" integer)   (0.1ms) select sqlite_version(*)  (64.6ms) CREATE INDEX "index_billing_bills_on_billable_type_and_billable_id" ON "billing_bills" ("billable_type", "billable_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'  (72.8ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (71.3ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (81.6ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (65.3ms) DROP TABLE "billing_charges"  (71.4ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar, "description" varchar, "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))  (72.6ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (64.7ms) CREATE INDEX "index_billing_charges_on_chargable_type_and_chargable_id" ON "billing_charges" ("chargable_type", "chargable_id")  (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (56.2ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (73.2ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (68.5ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (59.8ms) DROP TABLE "billing_departments"  (65.1ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "tax_group_id" integer, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (61.5ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (65.6ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (68.8ms) DROP TABLE "billing_modifiers"  (65.5ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)  (65.1ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (56.0ms) DROP TABLE "billing_op_fp_mappings"  (65.7ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar)   (73.0ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (63.9ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (57.0ms) DROP TABLE "billing_operators"  (65.4ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)  (64.9ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (73.0ms) DROP TABLE "billing_origins"  (74.0ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar, "payment_model" varchar DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar, "receipt_config_id" integer)   (57.0ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (71.3ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (71.3ms) CREATE INDEX "index_billing_origins_on_receipt_config_id" ON "billing_origins" ("receipt_config_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (71.3ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (64.1ms) DROP TABLE "billing_payment_types"  (66.1ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar, "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)   (91.1ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (301.0ms) DROP TABLE "billing_payments"  (65.1ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar, "payment_type_id" integer, "status" varchar, "name" varchar, "description" varchar, "external_token" varchar, "note" varchar, "deleted_at" datetime)  (64.6ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (63.5ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (64.1ms) DROP TABLE "billing_plus"  (65.2ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "code" varchar, "type" varchar, "banned" boolean, "deleted_at" datetime)   (64.5ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'   (63.4ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (72.7ms) DROP TABLE "billing_profiles"  (65.9ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime)  (64.7ms) DROP TABLE "billing_pt_fp_mappings"  (65.1ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (73.3ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'  (72.3ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (72.0ms) DROP TABLE "billing_receipt_configs"  (73.9ms) CREATE TABLE "billing_receipt_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "type" varchar, "name" varchar, "discount_text" varchar, "surcharge_text" varchar, "sound_signal" boolean, "open_cash_drawer" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "paper_cut" boolean, "custom_commands" boolean, "custom_commands_text" varchar)   (72.5ms) DROP TABLE "billing_reports"  (72.8ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar DEFAULT 'USD' NOT NULL, "note" text, "type" varchar, "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar, "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (73.8ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (72.8ms) DROP TABLE "billing_resources"  (73.4ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "properties" text, "banned" boolean, "type" varchar, "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)  (81.3ms) DROP TABLE "billing_tax_groups"  (65.6ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar, "deleted_at" datetime)  (72.5ms) DROP TABLE "billing_tg_fp_mappings"  (65.7ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (72.9ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'  (72.1ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (64.7ms) DROP TABLE "billing_versions"  (65.6ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar NOT NULL, "item_id" integer NOT NULL, "event" varchar NOT NULL, "whodunnit" varchar, "object" text, "created_at" datetime, "ip" varchar, "user_agent" varchar, "object_changes" text, "master_id" integer, "master_type" varchar)   (56.5ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (55.3ms) DROP TABLE "profiles"  (67.3ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)  (0.2ms) SELECT version FROM "schema_migrations" Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types"  (0.1ms) begin transaction Fixture Delete (0.1ms) DELETE FROM "billing_payment_types" Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 02:04:25', '2017-03-29 02:04:25', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 02:04:25', '2017-03-29 02:04:25', 298486374) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Cash', 't', 'f', '2017-03-29 02:04:25', '2017-03-29 02:04:25', 112846265) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Fiscal', 't', 't', '2017-03-29 02:04:25', '2017-03-29 02:04:25', 817124681) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Card', 'f', 't', '2017-03-29 02:04:25', '2017-03-29 02:04:25', 370448595) Fixture Delete (0.2ms) DELETE FROM "billing_origins" Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 02:04:25', '2017-03-29 02:04:25', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 02:04:25', '2017-03-29 02:04:25', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_plus" Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:04:25', '2017-03-29 02:04:25', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:04:25', '2017-03-29 02:04:25', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_payments" Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (100, 'USD', 'Billing::PaymentWithType', '2017-03-29 02:04:25', '2017-03-29 02:04:25', 980190962, 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (200, 'USD', 'Billing::PaymentWithType', '2017-03-29 02:04:25', '2017-03-29 02:04:25', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_bills" Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id", "origin_id") VALUES ('2017-03-29 02:04:25', '2017-03-29 02:04:25', 980190962, 'Profile', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id") VALUES ('2017-03-29 02:04:25', '2017-03-29 02:04:25', 298486374, 'Profile', 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_resources" Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 02:04:25', '2017-03-29 02:04:25', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 02:04:25', '2017-03-29 02:04:25', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_receipt_configs" Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 02:04:25', '2017-03-29 02:04:25', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 02:04:25', '2017-03-29 02:04:25', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_charges" Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (100, 'USD', '2017-03-29 02:04:25', '2017-03-29 02:04:25', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (200, 'USD', '2017-03-29 02:04:25', '2017-03-29 02:04:25', 298486374, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_departments" Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group1', NULL, '2017-03-29 02:04:25', '2017-03-29 02:04:25', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group2', NULL, '2017-03-29 02:04:25', '2017-03-29 02:04:25', 298486374, 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_modifiers" Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("percent_ratio", "created_at", "updated_at", "id", "bill_id") VALUES (1.0, '2017-03-29 02:04:25', '2017-03-29 02:04:25', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "fixed_value_currency", "created_at", "updated_at", "id", "bill_id", "charge_id") VALUES (100, 'USD', '2017-03-29 02:04:25', '2017-03-29 02:04:25', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_profiles" Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:04:25', '2017-03-29 02:04:25', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:04:25', '2017-03-29 02:04:25', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_operators" Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 02:04:25', '2017-03-29 02:04:25', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 02:04:25', '2017-03-29 02:04:25', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_tax_groups" Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:04:25', '2017-03-29 02:04:25', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:04:25', '2017-03-29 02:04:25', 298486374) Fixture Delete (0.1ms) DELETE FROM "profiles" Fixture Insert (0.1ms) INSERT INTO "profiles" ("created_at", "updated_at", "id") VALUES ('2017-03-29 02:04:25', '2017-03-29 02:04:25', 980190962)  (103.4ms) commit transaction  (0.2ms) begin transaction --------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_global_bill_modifier --------------------------------------------------------------- Billing::Modifier Load (0.3ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction -------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_modifier_per_charge -------------------------------------------------------------- Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ----------------------- BillingTest: test_truth -----------------------  (0.0ms) rollback transaction  (0.1ms) begin transaction ----------------------------------------- Billing::ChargeTest: test_string_protocol ----------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Plu Load (0.2ms) SELECT "billing_plus".* FROM "billing_plus" WHERE "billing_plus"."id" = ? LIMIT 1 [["id", 980190962]] Billing::TaxGroup Load (0.2ms) SELECT "billing_tax_groups".* FROM "billing_tax_groups" WHERE "billing_tax_groups"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.0ms) begin transaction ------------------------------------------- Billing::ChargeTest: test_wild_class_method ------------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------ Billing::BillTest: test_charge ------------------------------ Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.3ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.3ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.5ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:25.737125"], ["id", 980190962]] SQL (0.3ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:25.000000000 Z\nupdated_at: 2017-03-29 02:04:25.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:25.737125"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:25.000000000 Z\n- 2017-03-29 02:04:25.737125950 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.3ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:04:25.760140"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:04:25.000000000 Z\nupdated_at: 2017-03-29 02:04:25.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:04:25.760140"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:04:25.000000000 Z\n- 2017-03-29 02:04:25.760140554 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:25.737125"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:25.000000000 Z\nupdated_at: 2017-03-29 02:04:25.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:25.737125"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:25.000000000 Z\n- 2017-03-29 02:04:25.737125950 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 02:04:25.873416"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:25.000000000 Z\nupdated_at: 2017-03-29 02:04:25.737125950 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:25.873416"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 02:04:25.737125950 Z\n- 2017-03-29 02:04:25.873416300 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) INSERT INTO "billing_charges" ("price_cents", "bill_id", "value_cents", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["price_cents", 300], ["bill_id", 980190962], ["value_cents", 300], ["created_at", "2017-03-29 02:04:25.880176"], ["updated_at", "2017-03-29 02:04:25.880176"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:04:25.880176"], ["object_changes", "---\nprice_cents:\n- 0\n- 300\nbill_id:\n- \n- 980190962\nvalue_cents:\n- 0\n- 300\ncreated_at:\n- \n- &1 2017-03-29 02:04:25.880176776 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 02:04:25.873416"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:25.000000000 Z\nupdated_at: 2017-03-29 02:04:25.737125950 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:25.873416"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 02:04:25.737125950 Z\n- 2017-03-29 02:04:25.873416300 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.3ms) rollback transaction Billing::Version Load (0.5ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Charge"]]  (0.2ms) begin transaction -------------------------------- Billing::BillTest: test_discount -------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.4ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:26.036884"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:25.000000000 Z\nupdated_at: 2017-03-29 02:04:25.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:26.036884"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:25.000000000 Z\n- 2017-03-29 02:04:26.036884570 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:04:26.049453"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:04:25.000000000 Z\nupdated_at: 2017-03-29 02:04:25.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:04:26.049453"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:04:25.000000000 Z\n- 2017-03-29 02:04:26.049453239 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:26.036884"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:25.000000000 Z\nupdated_at: 2017-03-29 02:04:25.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:26.036884"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:25.000000000 Z\n- 2017-03-29 02:04:26.036884570 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 298486374]]  (0.2ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1 SQL (0.2ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "charge_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["fixed_value_cents", -100], ["charge_id", 298486374], ["bill_id", 980190962], ["created_at", "2017-03-29 02:04:26.173541"], ["updated_at", "2017-03-29 02:04:26.173541"]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:04:26.173541"], ["object_changes", "---\nfixed_value_cents:\n- 0\n- -100\ncharge_id:\n- \n- 298486374\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:04:26.173541497 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Modifier"]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Modifier"]]  (0.1ms) begin transaction --------------------------------- Billing::BillTest: test_summaries --------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:26.264424"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:25.000000000 Z\nupdated_at: 2017-03-29 02:04:25.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:26.264424"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:25.000000000 Z\n- 2017-03-29 02:04:26.264424241 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:04:26.273696"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:04:25.000000000 Z\nupdated_at: 2017-03-29 02:04:25.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:04:26.273696"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:04:25.000000000 Z\n- 2017-03-29 02:04:26.273696401 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:26.264424"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:25.000000000 Z\nupdated_at: 2017-03-29 02:04:25.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:26.264424"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:25.000000000 Z\n- 2017-03-29 02:04:26.264424241 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction --------------------------------- Billing::PaymentTest: test_create --------------------------------- Billing::Payment Load (0.4ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.4ms) INSERT INTO "billing_payments" ("type", "value_cents", "payment_type_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["type", "Billing::PaymentWithType"], ["value_cents", 100], ["payment_type_id", 980190962], ["bill_id", 980190962], ["created_at", "2017-03-29 02:04:26.433369"], ["updated_at", "2017-03-29 02:04:26.433369"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:04:26.433369"], ["object_changes", "---\ntype:\n- \n- Billing::PaymentWithType\nvalue_cents:\n- 0\n- 100\npayment_type_id:\n- \n- 980190962\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:04:26.433369219 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Payment"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:26.470563"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:25.000000000 Z\nupdated_at: 2017-03-29 02:04:25.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:26.470563"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:25.000000000 Z\n- 2017-03-29 02:04:26.470563307 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:04:26.480740"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:04:25.000000000 Z\nupdated_at: 2017-03-29 02:04:25.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:04:26.480740"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:04:25.000000000 Z\n- 2017-03-29 02:04:26.480740073 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:26.470563"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:25.000000000 Z\nupdated_at: 2017-03-29 02:04:25.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:26.470563"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:25.000000000 Z\n- 2017-03-29 02:04:26.470563307 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Payment"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction ---------------------------------------------------------------------------- Billing::PaymentTest: test_should_be_instance_of_bill's_origin_payment_model ---------------------------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction --------------------------------------------------------- Billing::PaymentTest: test_should_be_single_cash_payments --------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.3ms) INSERT INTO "billing_payments" ("type", "value_cents", "payment_type_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["type", "Billing::PaymentWithType"], ["value_cents", 100], ["payment_type_id", 112846265], ["bill_id", 980190962], ["created_at", "2017-03-29 02:04:26.623727"], ["updated_at", "2017-03-29 02:04:26.623727"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:04:26.623727"], ["object_changes", "---\ntype:\n- \n- Billing::PaymentWithType\nvalue_cents:\n- 0\n- 100\npayment_type_id:\n- \n- 112846265\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:04:26.623727049 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Payment"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:26.655395"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:25.000000000 Z\nupdated_at: 2017-03-29 02:04:25.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:26.655395"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:25.000000000 Z\n- 2017-03-29 02:04:26.655395276 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:04:26.666165"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:04:25.000000000 Z\nupdated_at: 2017-03-29 02:04:25.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:04:26.666165"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:04:25.000000000 Z\n- 2017-03-29 02:04:26.666165204 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.4ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:26.655395"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:25.000000000 Z\nupdated_at: 2017-03-29 02:04:25.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:26.655395"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:25.000000000 Z\n- 2017-03-29 02:04:26.655395276 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Payment"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction ------------------------------------------------------------------------------ Billing::PaymentTest: test_should_have_same_fiscal_flag_as_other_bill_payments ------------------------------------------------------------------------------ Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.0ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (112.1ms) DROP TABLE "billing_bills"  (58.1ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar, "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar, "number" varchar, "deleted_at" datetime, "print_job_id" integer)   (0.2ms) select sqlite_version(*)  (55.0ms) CREATE INDEX "index_billing_bills_on_billable_type_and_billable_id" ON "billing_bills" ("billable_type", "billable_id")  (0.4ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'  (56.0ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (63.0ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (139.4ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (65.9ms) DROP TABLE "billing_charges"  (78.0ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar, "description" varchar, "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))  (72.5ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (72.3ms) CREATE INDEX "index_billing_charges_on_chargable_type_and_chargable_id" ON "billing_charges" ("chargable_type", "chargable_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (71.6ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (72.1ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (71.0ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (67.7ms) DROP TABLE "billing_departments"  (78.5ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "tax_group_id" integer, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (72.8ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (72.4ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (71.5ms) DROP TABLE "billing_modifiers"  (73.4ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)  (65.2ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (56.4ms) DROP TABLE "billing_op_fp_mappings"  (66.0ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar)   (64.7ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (64.2ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (56.3ms) DROP TABLE "billing_operators"  (65.2ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)  (65.5ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (64.4ms) DROP TABLE "billing_origins"  (65.0ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar, "payment_model" varchar DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar, "receipt_config_id" integer)   (65.3ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (63.6ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (62.7ms) CREATE INDEX "index_billing_origins_on_receipt_config_id" ON "billing_origins" ("receipt_config_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (63.5ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (55.7ms) DROP TABLE "billing_payment_types"  (74.3ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar, "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)   (72.5ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (64.5ms) DROP TABLE "billing_payments"  (73.4ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar, "payment_type_id" integer, "status" varchar, "name" varchar, "description" varchar, "external_token" varchar, "note" varchar, "deleted_at" datetime)  (65.0ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (80.1ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (64.6ms) DROP TABLE "billing_plus"  (73.7ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "code" varchar, "type" varchar, "banned" boolean, "deleted_at" datetime)   (81.0ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'   (71.6ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (72.9ms) DROP TABLE "billing_profiles"  (65.5ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime)  (65.0ms) DROP TABLE "billing_pt_fp_mappings"  (57.3ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (56.6ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'  (72.2ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (56.5ms) DROP TABLE "billing_receipt_configs"  (57.0ms) CREATE TABLE "billing_receipt_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "type" varchar, "name" varchar, "discount_text" varchar, "surcharge_text" varchar, "sound_signal" boolean, "open_cash_drawer" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "paper_cut" boolean, "custom_commands" boolean, "custom_commands_text" varchar)   (56.0ms) DROP TABLE "billing_reports"  (72.2ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar DEFAULT 'USD' NOT NULL, "note" text, "type" varchar, "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar, "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (57.0ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (72.7ms) DROP TABLE "billing_resources"  (65.3ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "properties" text, "banned" boolean, "type" varchar, "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)  (65.0ms) DROP TABLE "billing_tax_groups"  (65.9ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar, "deleted_at" datetime)  (64.7ms) DROP TABLE "billing_tg_fp_mappings"  (65.7ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (64.7ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'  (63.5ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (81.0ms) DROP TABLE "billing_versions"  (73.5ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar NOT NULL, "item_id" integer NOT NULL, "event" varchar NOT NULL, "whodunnit" varchar, "object" text, "created_at" datetime, "ip" varchar, "user_agent" varchar, "object_changes" text, "master_id" integer, "master_type" varchar)   (73.7ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (72.7ms) DROP TABLE "profiles"  (74.0ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)  (0.3ms) SELECT version FROM "schema_migrations" Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types"  (0.1ms) begin transaction Fixture Delete (0.1ms) DELETE FROM "billing_payment_types" Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 02:04:43', '2017-03-29 02:04:43', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 02:04:43', '2017-03-29 02:04:43', 298486374) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Cash', 't', 'f', '2017-03-29 02:04:43', '2017-03-29 02:04:43', 112846265) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Fiscal', 't', 't', '2017-03-29 02:04:43', '2017-03-29 02:04:43', 817124681) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Card', 'f', 't', '2017-03-29 02:04:43', '2017-03-29 02:04:43', 370448595) Fixture Delete (0.1ms) DELETE FROM "billing_origins" Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 02:04:43', '2017-03-29 02:04:43', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 02:04:43', '2017-03-29 02:04:43', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_plus" Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:04:43', '2017-03-29 02:04:43', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:04:43', '2017-03-29 02:04:43', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_payments" Fixture Insert (0.2ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (100, 'USD', 'Billing::PaymentWithType', '2017-03-29 02:04:43', '2017-03-29 02:04:43', 980190962, 980190962, 980190962) Fixture Insert (0.2ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (200, 'USD', 'Billing::PaymentWithType', '2017-03-29 02:04:43', '2017-03-29 02:04:43', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_bills" Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id", "origin_id") VALUES ('2017-03-29 02:04:43', '2017-03-29 02:04:43', 980190962, 'Profile', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id") VALUES ('2017-03-29 02:04:43', '2017-03-29 02:04:43', 298486374, 'Profile', 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_resources" Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 02:04:43', '2017-03-29 02:04:43', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 02:04:43', '2017-03-29 02:04:43', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_receipt_configs" Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 02:04:43', '2017-03-29 02:04:43', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 02:04:43', '2017-03-29 02:04:43', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_charges" Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (100, 'USD', '2017-03-29 02:04:43', '2017-03-29 02:04:43', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (200, 'USD', '2017-03-29 02:04:43', '2017-03-29 02:04:43', 298486374, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_departments" Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group1', NULL, '2017-03-29 02:04:43', '2017-03-29 02:04:43', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group2', NULL, '2017-03-29 02:04:43', '2017-03-29 02:04:43', 298486374, 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_modifiers" Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("percent_ratio", "created_at", "updated_at", "id", "bill_id") VALUES (1.0, '2017-03-29 02:04:43', '2017-03-29 02:04:43', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "fixed_value_currency", "created_at", "updated_at", "id", "bill_id", "charge_id") VALUES (100, 'USD', '2017-03-29 02:04:43', '2017-03-29 02:04:43', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_profiles" Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:04:43', '2017-03-29 02:04:43', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:04:43', '2017-03-29 02:04:43', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_operators" Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 02:04:43', '2017-03-29 02:04:43', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 02:04:43', '2017-03-29 02:04:43', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_tax_groups" Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:04:43', '2017-03-29 02:04:43', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:04:43', '2017-03-29 02:04:43', 298486374) Fixture Delete (0.1ms) DELETE FROM "profiles" Fixture Insert (0.1ms) INSERT INTO "profiles" ("created_at", "updated_at", "id") VALUES ('2017-03-29 02:04:43', '2017-03-29 02:04:43', 980190962)  (103.9ms) commit transaction  (0.1ms) begin transaction --------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_global_bill_modifier --------------------------------------------------------------- Billing::Modifier Load (0.4ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.3ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction -------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_modifier_per_charge -------------------------------------------------------------- Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.2ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ----------------------- BillingTest: test_truth -----------------------  (0.1ms) rollback transaction  (0.2ms) begin transaction ------------------------------ Billing::BillTest: test_charge ------------------------------ Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.3ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.3ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.4ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.2ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.4ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:44.050306"], ["id", 980190962]] SQL (0.3ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:43.000000000 Z\nupdated_at: 2017-03-29 02:04:43.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:44.050306"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:43.000000000 Z\n- 2017-03-29 02:04:44.050306568 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:04:44.074223"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:04:43.000000000 Z\nupdated_at: 2017-03-29 02:04:43.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:04:44.074223"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:04:43.000000000 Z\n- 2017-03-29 02:04:44.074223368 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:44.050306"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:43.000000000 Z\nupdated_at: 2017-03-29 02:04:43.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:44.050306"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:43.000000000 Z\n- 2017-03-29 02:04:44.050306568 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 02:04:44.196409"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:43.000000000 Z\nupdated_at: 2017-03-29 02:04:44.050306568 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:44.196409"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 02:04:44.050306568 Z\n- 2017-03-29 02:04:44.196409465 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) INSERT INTO "billing_charges" ("price_cents", "bill_id", "value_cents", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["price_cents", 300], ["bill_id", 980190962], ["value_cents", 300], ["created_at", "2017-03-29 02:04:44.203042"], ["updated_at", "2017-03-29 02:04:44.203042"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:04:44.203042"], ["object_changes", "---\nprice_cents:\n- 0\n- 300\nbill_id:\n- \n- 980190962\nvalue_cents:\n- 0\n- 300\ncreated_at:\n- \n- &1 2017-03-29 02:04:44.203042115 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 02:04:44.196409"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:43.000000000 Z\nupdated_at: 2017-03-29 02:04:44.050306568 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:44.196409"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 02:04:44.050306568 Z\n- 2017-03-29 02:04:44.196409465 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.3ms) rollback transaction Billing::Version Load (0.3ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction -------------------------------- Billing::BillTest: test_discount -------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (10.6ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:44.346023"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:43.000000000 Z\nupdated_at: 2017-03-29 02:04:43.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:44.346023"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:43.000000000 Z\n- 2017-03-29 02:04:44.346023901 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:04:44.353949"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:04:43.000000000 Z\nupdated_at: 2017-03-29 02:04:43.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:04:44.353949"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:04:43.000000000 Z\n- 2017-03-29 02:04:44.353949851 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:44.346023"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:43.000000000 Z\nupdated_at: 2017-03-29 02:04:43.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:44.346023"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:43.000000000 Z\n- 2017-03-29 02:04:44.346023901 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) RELEASE SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 298486374]]  (0.2ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.0ms) SAVEPOINT active_record_1 Billing::Modifier Exists (0.3ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1 SQL (0.2ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "charge_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["fixed_value_cents", -100], ["charge_id", 298486374], ["bill_id", 980190962], ["created_at", "2017-03-29 02:04:44.456874"], ["updated_at", "2017-03-29 02:04:44.456874"]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:04:44.456874"], ["object_changes", "---\nfixed_value_cents:\n- 0\n- -100\ncharge_id:\n- \n- 298486374\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:04:44.456874825 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Modifier"]] Billing::Modifier Exists (0.3ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Modifier"]]  (0.1ms) begin transaction --------------------------------- Billing::BillTest: test_summaries --------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:44.554499"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:43.000000000 Z\nupdated_at: 2017-03-29 02:04:43.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:44.554499"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:43.000000000 Z\n- 2017-03-29 02:04:44.554499561 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:04:44.566014"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:04:43.000000000 Z\nupdated_at: 2017-03-29 02:04:43.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:04:44.566014"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:04:43.000000000 Z\n- 2017-03-29 02:04:44.566014584 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:44.554499"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:43.000000000 Z\nupdated_at: 2017-03-29 02:04:43.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:44.554499"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:43.000000000 Z\n- 2017-03-29 02:04:44.554499561 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction --------------------------------- Billing::PaymentTest: test_create --------------------------------- Billing::Payment Load (0.4ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.2ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.3ms) INSERT INTO "billing_payments" ("type", "value_cents", "payment_type_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["type", "Billing::PaymentWithType"], ["value_cents", 100], ["payment_type_id", 980190962], ["bill_id", 980190962], ["created_at", "2017-03-29 02:04:44.729540"], ["updated_at", "2017-03-29 02:04:44.729540"]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:04:44.729540"], ["object_changes", "---\ntype:\n- \n- Billing::PaymentWithType\nvalue_cents:\n- 0\n- 100\npayment_type_id:\n- \n- 980190962\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:04:44.729540728 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Payment"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:44.757024"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:43.000000000 Z\nupdated_at: 2017-03-29 02:04:43.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:44.757024"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:43.000000000 Z\n- 2017-03-29 02:04:44.757024622 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:04:44.767703"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:04:43.000000000 Z\nupdated_at: 2017-03-29 02:04:43.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:04:44.767703"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:04:43.000000000 Z\n- 2017-03-29 02:04:44.767703345 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:44.757024"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:43.000000000 Z\nupdated_at: 2017-03-29 02:04:43.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:44.757024"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:43.000000000 Z\n- 2017-03-29 02:04:44.757024622 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Payment"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction ---------------------------------------------------------------------------- Billing::PaymentTest: test_should_be_instance_of_bill's_origin_payment_model ---------------------------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction --------------------------------------------------------- Billing::PaymentTest: test_should_be_single_cash_payments --------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_payments" ("type", "value_cents", "payment_type_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["type", "Billing::PaymentWithType"], ["value_cents", 100], ["payment_type_id", 112846265], ["bill_id", 980190962], ["created_at", "2017-03-29 02:04:44.920007"], ["updated_at", "2017-03-29 02:04:44.920007"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:04:44.920007"], ["object_changes", "---\ntype:\n- \n- Billing::PaymentWithType\nvalue_cents:\n- 0\n- 100\npayment_type_id:\n- \n- 112846265\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:04:44.920007355 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Payment"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:44.955063"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:43.000000000 Z\nupdated_at: 2017-03-29 02:04:43.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:44.955063"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:43.000000000 Z\n- 2017-03-29 02:04:44.955063709 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:04:44.967651"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:04:43.000000000 Z\nupdated_at: 2017-03-29 02:04:43.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:04:44.967651"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:04:43.000000000 Z\n- 2017-03-29 02:04:44.967651834 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:04:44.955063"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:04:43.000000000 Z\nupdated_at: 2017-03-29 02:04:43.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:04:44.955063"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:04:43.000000000 Z\n- 2017-03-29 02:04:44.955063709 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Payment"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction ------------------------------------------------------------------------------ Billing::PaymentTest: test_should_have_same_fiscal_flag_as_other_bill_payments ------------------------------------------------------------------------------ Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ----------------------------------------- Billing::ChargeTest: test_string_protocol ----------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Plu Load (0.2ms) SELECT "billing_plus".* FROM "billing_plus" WHERE "billing_plus"."id" = ? LIMIT 1 [["id", 980190962]] Billing::TaxGroup Load (0.3ms) SELECT "billing_tax_groups".* FROM "billing_tax_groups" WHERE "billing_tax_groups"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------- Billing::ChargeTest: test_wild_class_method ------------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]]  (0.2ms) rollback transaction ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (117.4ms) DROP TABLE "billing_bills"  (67.5ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar, "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar, "number" varchar, "deleted_at" datetime, "print_job_id" integer)   (0.1ms) select sqlite_version(*)  (73.0ms) CREATE INDEX "index_billing_bills_on_billable_type_and_billable_id" ON "billing_bills" ("billable_type", "billable_id")  (0.5ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'  (63.4ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (72.2ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (81.4ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (77.6ms) DROP TABLE "billing_charges"  (58.4ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar, "description" varchar, "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))  (81.3ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (64.1ms) CREATE INDEX "index_billing_charges_on_chargable_type_and_chargable_id" ON "billing_charges" ("chargable_type", "chargable_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (63.9ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (81.1ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (73.2ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (75.0ms) DROP TABLE "billing_departments"  (63.5ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "tax_group_id" integer, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (64.5ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (82.9ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (70.3ms) DROP TABLE "billing_modifiers"  (73.8ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)  (73.2ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (64.5ms) DROP TABLE "billing_op_fp_mappings"  (66.1ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar)   (73.0ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (72.2ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (65.0ms) DROP TABLE "billing_operators"  (65.3ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)  (65.0ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (64.6ms) DROP TABLE "billing_origins"  (65.6ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar, "payment_model" varchar DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar, "receipt_config_id" integer)   (65.0ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (71.9ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (63.0ms) CREATE INDEX "index_billing_origins_on_receipt_config_id" ON "billing_origins" ("receipt_config_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (71.9ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (48.6ms) DROP TABLE "billing_payment_types"  (57.1ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar, "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)   (63.8ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (64.1ms) DROP TABLE "billing_payments"  (64.7ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar, "payment_type_id" integer, "status" varchar, "name" varchar, "description" varchar, "external_token" varchar, "note" varchar, "deleted_at" datetime)  (83.9ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (86.7ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (64.6ms) DROP TABLE "billing_plus"  (65.2ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "code" varchar, "type" varchar, "banned" boolean, "deleted_at" datetime)   (64.7ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'   (392.7ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (72.7ms) DROP TABLE "billing_profiles"  (65.3ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime)  (64.0ms) DROP TABLE "billing_pt_fp_mappings"  (74.3ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (64.5ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'  (88.2ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (64.5ms) DROP TABLE "billing_receipt_configs"  (65.9ms) CREATE TABLE "billing_receipt_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "type" varchar, "name" varchar, "discount_text" varchar, "surcharge_text" varchar, "sound_signal" boolean, "open_cash_drawer" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "paper_cut" boolean, "custom_commands" boolean, "custom_commands_text" varchar)   (72.5ms) DROP TABLE "billing_reports"  (73.1ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar DEFAULT 'USD' NOT NULL, "note" text, "type" varchar, "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar, "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (73.3ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (73.0ms) DROP TABLE "billing_resources"  (238.3ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "properties" text, "banned" boolean, "type" varchar, "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)  (212.9ms) DROP TABLE "billing_tax_groups"  (73.7ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar, "deleted_at" datetime)  (72.8ms) DROP TABLE "billing_tg_fp_mappings"  (65.5ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (64.2ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'  (63.9ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (64.5ms) DROP TABLE "billing_versions"  (65.3ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar NOT NULL, "item_id" integer NOT NULL, "event" varchar NOT NULL, "whodunnit" varchar, "object" text, "created_at" datetime, "ip" varchar, "user_agent" varchar, "object_changes" text, "master_id" integer, "master_type" varchar)   (57.1ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (73.0ms) DROP TABLE "profiles"  (57.4ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)  (0.7ms) SELECT version FROM "schema_migrations" Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types"  (0.1ms) begin transaction Fixture Delete (0.2ms) DELETE FROM "billing_payment_types" Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 02:05:01', '2017-03-29 02:05:01', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 02:05:01', '2017-03-29 02:05:01', 298486374) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Cash', 't', 'f', '2017-03-29 02:05:01', '2017-03-29 02:05:01', 112846265) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Fiscal', 't', 't', '2017-03-29 02:05:01', '2017-03-29 02:05:01', 817124681) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Card', 'f', 't', '2017-03-29 02:05:01', '2017-03-29 02:05:01', 370448595) Fixture Delete (0.2ms) DELETE FROM "billing_origins" Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 02:05:01', '2017-03-29 02:05:01', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 02:05:01', '2017-03-29 02:05:01', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_plus" Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:05:01', '2017-03-29 02:05:01', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:05:01', '2017-03-29 02:05:01', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_payments" Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (100, 'USD', 'Billing::PaymentWithType', '2017-03-29 02:05:01', '2017-03-29 02:05:01', 980190962, 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (200, 'USD', 'Billing::PaymentWithType', '2017-03-29 02:05:01', '2017-03-29 02:05:01', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_bills" Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id", "origin_id") VALUES ('2017-03-29 02:05:01', '2017-03-29 02:05:01', 980190962, 'Profile', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id") VALUES ('2017-03-29 02:05:01', '2017-03-29 02:05:01', 298486374, 'Profile', 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_resources" Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 02:05:01', '2017-03-29 02:05:01', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 02:05:01', '2017-03-29 02:05:01', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_receipt_configs" Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 02:05:01', '2017-03-29 02:05:01', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 02:05:01', '2017-03-29 02:05:01', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_charges" Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (100, 'USD', '2017-03-29 02:05:01', '2017-03-29 02:05:01', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (200, 'USD', '2017-03-29 02:05:01', '2017-03-29 02:05:01', 298486374, 980190962) Fixture Delete (0.2ms) DELETE FROM "billing_departments" Fixture Insert (0.2ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group1', NULL, '2017-03-29 02:05:01', '2017-03-29 02:05:01', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group2', NULL, '2017-03-29 02:05:01', '2017-03-29 02:05:01', 298486374, 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_modifiers" Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("percent_ratio", "created_at", "updated_at", "id", "bill_id") VALUES (1.0, '2017-03-29 02:05:01', '2017-03-29 02:05:01', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "fixed_value_currency", "created_at", "updated_at", "id", "bill_id", "charge_id") VALUES (100, 'USD', '2017-03-29 02:05:01', '2017-03-29 02:05:01', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_profiles" Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:05:01', '2017-03-29 02:05:01', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:05:01', '2017-03-29 02:05:01', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_operators" Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 02:05:01', '2017-03-29 02:05:01', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 02:05:01', '2017-03-29 02:05:01', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_tax_groups" Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:05:01', '2017-03-29 02:05:01', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:05:01', '2017-03-29 02:05:01', 298486374) Fixture Delete (0.1ms) DELETE FROM "profiles" Fixture Insert (0.1ms) INSERT INTO "profiles" ("created_at", "updated_at", "id") VALUES ('2017-03-29 02:05:01', '2017-03-29 02:05:01', 980190962)  (97.3ms) commit transaction  (0.1ms) begin transaction --------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_global_bill_modifier --------------------------------------------------------------- Billing::Modifier Load (0.3ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.3ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction -------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_modifier_per_charge -------------------------------------------------------------- Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ----------------------- BillingTest: test_truth -----------------------  (0.0ms) rollback transaction  (0.1ms) begin transaction ----------------------------------------- Billing::ChargeTest: test_string_protocol ----------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Plu Load (0.1ms) SELECT "billing_plus".* FROM "billing_plus" WHERE "billing_plus"."id" = ? LIMIT 1 [["id", 980190962]] Billing::TaxGroup Load (0.2ms) SELECT "billing_tax_groups".* FROM "billing_tax_groups" WHERE "billing_tax_groups"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------- Billing::ChargeTest: test_wild_class_method ------------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------ Billing::BillTest: test_charge ------------------------------ Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.3ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.2ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.5ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:05:02.304367"], ["id", 980190962]] SQL (0.3ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:01.000000000 Z\nupdated_at: 2017-03-29 02:05:01.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:02.304367"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:05:01.000000000 Z\n- 2017-03-29 02:05:02.304367846 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.3ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:05:02.326358"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:05:01.000000000 Z\nupdated_at: 2017-03-29 02:05:01.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:05:02.326358"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:05:01.000000000 Z\n- 2017-03-29 02:05:02.326358722 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:05:02.304367"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:01.000000000 Z\nupdated_at: 2017-03-29 02:05:01.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:02.304367"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:05:01.000000000 Z\n- 2017-03-29 02:05:02.304367846 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 02:05:02.438304"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:01.000000000 Z\nupdated_at: 2017-03-29 02:05:02.304367846 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:02.438304"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 02:05:02.304367846 Z\n- 2017-03-29 02:05:02.438304249 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.3ms) INSERT INTO "billing_charges" ("price_cents", "bill_id", "value_cents", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["price_cents", 300], ["bill_id", 980190962], ["value_cents", 300], ["created_at", "2017-03-29 02:05:02.445599"], ["updated_at", "2017-03-29 02:05:02.445599"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:05:02.445599"], ["object_changes", "---\nprice_cents:\n- 0\n- 300\nbill_id:\n- \n- 980190962\nvalue_cents:\n- 0\n- 300\ncreated_at:\n- \n- &1 2017-03-29 02:05:02.445599841 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 02:05:02.438304"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:01.000000000 Z\nupdated_at: 2017-03-29 02:05:02.304367846 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:02.438304"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 02:05:02.304367846 Z\n- 2017-03-29 02:05:02.438304249 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.2ms) rollback transaction Billing::Version Load (0.3ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction -------------------------------- Billing::BillTest: test_discount -------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.5ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:05:02.602870"], ["id", 980190962]] SQL (0.3ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:01.000000000 Z\nupdated_at: 2017-03-29 02:05:01.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:02.602870"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:05:01.000000000 Z\n- 2017-03-29 02:05:02.602870495 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:05:02.614507"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:05:01.000000000 Z\nupdated_at: 2017-03-29 02:05:01.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:05:02.614507"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:05:01.000000000 Z\n- 2017-03-29 02:05:02.614507211 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:05:02.602870"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:01.000000000 Z\nupdated_at: 2017-03-29 02:05:01.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:02.602870"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:05:01.000000000 Z\n- 2017-03-29 02:05:02.602870495 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 298486374]]  (0.2ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.0ms) SAVEPOINT active_record_1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1 SQL (0.2ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "charge_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["fixed_value_cents", -100], ["charge_id", 298486374], ["bill_id", 980190962], ["created_at", "2017-03-29 02:05:02.721829"], ["updated_at", "2017-03-29 02:05:02.721829"]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:05:02.721829"], ["object_changes", "---\nfixed_value_cents:\n- 0\n- -100\ncharge_id:\n- \n- 298486374\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:05:02.721829453 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Modifier"]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.2ms) rollback transaction Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Modifier"]]  (0.1ms) begin transaction --------------------------------- Billing::BillTest: test_summaries --------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:05:02.816909"], ["id", 980190962]] SQL (0.3ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:01.000000000 Z\nupdated_at: 2017-03-29 02:05:01.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:02.816909"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:05:01.000000000 Z\n- 2017-03-29 02:05:02.816909350 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:05:02.829883"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:05:01.000000000 Z\nupdated_at: 2017-03-29 02:05:01.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:05:02.829883"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:05:01.000000000 Z\n- 2017-03-29 02:05:02.829883226 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:05:02.816909"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:01.000000000 Z\nupdated_at: 2017-03-29 02:05:01.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:02.816909"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:05:01.000000000 Z\n- 2017-03-29 02:05:02.816909350 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.2ms) begin transaction --------------------------------- Billing::PaymentTest: test_create --------------------------------- Billing::Payment Load (0.3ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.2ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.3ms) INSERT INTO "billing_payments" ("type", "value_cents", "payment_type_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["type", "Billing::PaymentWithType"], ["value_cents", 100], ["payment_type_id", 980190962], ["bill_id", 980190962], ["created_at", "2017-03-29 02:05:02.985853"], ["updated_at", "2017-03-29 02:05:02.985853"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:05:02.985853"], ["object_changes", "---\ntype:\n- \n- Billing::PaymentWithType\nvalue_cents:\n- 0\n- 100\npayment_type_id:\n- \n- 980190962\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:05:02.985853600 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Payment"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:05:03.024800"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:01.000000000 Z\nupdated_at: 2017-03-29 02:05:01.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:03.024800"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:05:01.000000000 Z\n- 2017-03-29 02:05:03.024800615 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:05:03.035187"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:05:01.000000000 Z\nupdated_at: 2017-03-29 02:05:01.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:05:03.035187"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:05:01.000000000 Z\n- 2017-03-29 02:05:03.035187479 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:05:03.024800"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:01.000000000 Z\nupdated_at: 2017-03-29 02:05:01.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:03.024800"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:05:01.000000000 Z\n- 2017-03-29 02:05:03.024800615 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Payment"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction ---------------------------------------------------------------------------- Billing::PaymentTest: test_should_be_instance_of_bill's_origin_payment_model ---------------------------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction --------------------------------------------------------- Billing::PaymentTest: test_should_be_single_cash_payments --------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_payments" ("type", "value_cents", "payment_type_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["type", "Billing::PaymentWithType"], ["value_cents", 100], ["payment_type_id", 112846265], ["bill_id", 980190962], ["created_at", "2017-03-29 02:05:03.180195"], ["updated_at", "2017-03-29 02:05:03.180195"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:05:03.180195"], ["object_changes", "---\ntype:\n- \n- Billing::PaymentWithType\nvalue_cents:\n- 0\n- 100\npayment_type_id:\n- \n- 112846265\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:05:03.180195601 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Payment"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:05:03.209010"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:01.000000000 Z\nupdated_at: 2017-03-29 02:05:01.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:03.209010"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:05:01.000000000 Z\n- 2017-03-29 02:05:03.209010455 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:05:03.217685"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:05:01.000000000 Z\nupdated_at: 2017-03-29 02:05:01.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:05:03.217685"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:05:01.000000000 Z\n- 2017-03-29 02:05:03.217685937 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:05:03.209010"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:01.000000000 Z\nupdated_at: 2017-03-29 02:05:01.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:03.209010"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:05:01.000000000 Z\n- 2017-03-29 02:05:03.209010455 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Payment"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction ------------------------------------------------------------------------------ Billing::PaymentTest: test_should_have_same_fiscal_flag_as_other_bill_payments ------------------------------------------------------------------------------ Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (91.9ms) DROP TABLE "billing_bills"  (66.3ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar, "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar, "number" varchar, "deleted_at" datetime, "print_job_id" integer)   (0.2ms) select sqlite_version(*)  (64.1ms) CREATE INDEX "index_billing_bills_on_billable_type_and_billable_id" ON "billing_bills" ("billable_type", "billable_id")  (0.4ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'  (72.2ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (63.1ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (81.4ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (82.0ms) DROP TABLE "billing_charges"  (68.7ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar, "description" varchar, "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))  (72.9ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (66.1ms) CREATE INDEX "index_billing_charges_on_chargable_type_and_chargable_id" ON "billing_charges" ("chargable_type", "chargable_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.3ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (71.3ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (74.0ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (77.1ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (67.8ms) DROP TABLE "billing_departments"  (68.6ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "tax_group_id" integer, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (74.2ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (72.2ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (62.9ms) DROP TABLE "billing_modifiers"  (73.9ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)  (65.1ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (54.8ms) DROP TABLE "billing_op_fp_mappings"  (65.7ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar)   (64.9ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (64.3ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (55.9ms) DROP TABLE "billing_operators"  (73.6ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)  (65.1ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (64.6ms) DROP TABLE "billing_origins"  (65.6ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar, "payment_model" varchar DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar, "receipt_config_id" integer)   (64.8ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (64.1ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (62.6ms) CREATE INDEX "index_billing_origins_on_receipt_config_id" ON "billing_origins" ("receipt_config_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (63.5ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (55.8ms) DROP TABLE "billing_payment_types"  (66.0ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar, "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)   (72.8ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (72.0ms) DROP TABLE "billing_payments"  (73.4ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar, "payment_type_id" integer, "status" varchar, "name" varchar, "description" varchar, "external_token" varchar, "note" varchar, "deleted_at" datetime)  (73.3ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (71.5ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (56.2ms) DROP TABLE "billing_plus"  (73.5ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "code" varchar, "type" varchar, "banned" boolean, "deleted_at" datetime)   (73.0ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'   (72.1ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (72.8ms) DROP TABLE "billing_profiles"  (73.9ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime)  (72.7ms) DROP TABLE "billing_pt_fp_mappings"  (74.0ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (72.7ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'  (72.0ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (72.8ms) DROP TABLE "billing_receipt_configs"  (73.2ms) CREATE TABLE "billing_receipt_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "type" varchar, "name" varchar, "discount_text" varchar, "surcharge_text" varchar, "sound_signal" boolean, "open_cash_drawer" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "paper_cut" boolean, "custom_commands" boolean, "custom_commands_text" varchar)   (72.1ms) DROP TABLE "billing_reports"  (64.4ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar DEFAULT 'USD' NOT NULL, "note" text, "type" varchar, "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar, "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (64.9ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (64.5ms) DROP TABLE "billing_resources"  (57.4ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "properties" text, "banned" boolean, "type" varchar, "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)  (64.3ms) DROP TABLE "billing_tax_groups"  (57.4ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar, "deleted_at" datetime)  (72.7ms) DROP TABLE "billing_tg_fp_mappings"  (57.4ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (64.8ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'  (56.1ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (64.1ms) DROP TABLE "billing_versions"  (64.9ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar NOT NULL, "item_id" integer NOT NULL, "event" varchar NOT NULL, "whodunnit" varchar, "object" text, "created_at" datetime, "ip" varchar, "user_agent" varchar, "object_changes" text, "master_id" integer, "master_type" varchar)   (56.6ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (64.0ms) DROP TABLE "profiles"  (67.1ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)  (0.6ms) SELECT version FROM "schema_migrations" Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types"  (0.1ms) begin transaction Fixture Delete (0.2ms) DELETE FROM "billing_payment_types" Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 02:05:24', '2017-03-29 02:05:24', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 02:05:24', '2017-03-29 02:05:24', 298486374) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Cash', 't', 'f', '2017-03-29 02:05:24', '2017-03-29 02:05:24', 112846265) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Fiscal', 't', 't', '2017-03-29 02:05:24', '2017-03-29 02:05:24', 817124681) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Card', 'f', 't', '2017-03-29 02:05:24', '2017-03-29 02:05:24', 370448595) Fixture Delete (0.1ms) DELETE FROM "billing_origins" Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 02:05:24', '2017-03-29 02:05:24', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 02:05:24', '2017-03-29 02:05:24', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_plus" Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:05:24', '2017-03-29 02:05:24', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:05:24', '2017-03-29 02:05:24', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_payments" Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (100, 'USD', 'Billing::PaymentWithType', '2017-03-29 02:05:24', '2017-03-29 02:05:24', 980190962, 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (200, 'USD', 'Billing::PaymentWithType', '2017-03-29 02:05:24', '2017-03-29 02:05:24', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_bills" Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id", "origin_id") VALUES ('2017-03-29 02:05:24', '2017-03-29 02:05:24', 980190962, 'Profile', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id") VALUES ('2017-03-29 02:05:24', '2017-03-29 02:05:24', 298486374, 'Profile', 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_resources" Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 02:05:24', '2017-03-29 02:05:24', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 02:05:24', '2017-03-29 02:05:24', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_receipt_configs" Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 02:05:24', '2017-03-29 02:05:24', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 02:05:24', '2017-03-29 02:05:24', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_charges" Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (100, 'USD', '2017-03-29 02:05:24', '2017-03-29 02:05:24', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (200, 'USD', '2017-03-29 02:05:24', '2017-03-29 02:05:24', 298486374, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_departments" Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group1', NULL, '2017-03-29 02:05:24', '2017-03-29 02:05:24', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group2', NULL, '2017-03-29 02:05:24', '2017-03-29 02:05:24', 298486374, 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_modifiers" Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("percent_ratio", "created_at", "updated_at", "id", "bill_id") VALUES (1.0, '2017-03-29 02:05:24', '2017-03-29 02:05:24', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "fixed_value_currency", "created_at", "updated_at", "id", "bill_id", "charge_id") VALUES (100, 'USD', '2017-03-29 02:05:24', '2017-03-29 02:05:24', 298486374, 980190962, 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_profiles" Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:05:24', '2017-03-29 02:05:24', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:05:24', '2017-03-29 02:05:24', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_operators" Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 02:05:24', '2017-03-29 02:05:24', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 02:05:24', '2017-03-29 02:05:24', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_tax_groups" Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:05:24', '2017-03-29 02:05:24', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:05:24', '2017-03-29 02:05:24', 298486374) Fixture Delete (0.1ms) DELETE FROM "profiles" Fixture Insert (0.1ms) INSERT INTO "profiles" ("created_at", "updated_at", "id") VALUES ('2017-03-29 02:05:24', '2017-03-29 02:05:24', 980190962)  (95.3ms) commit transaction  (0.1ms) begin transaction --------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_global_bill_modifier --------------------------------------------------------------- Billing::Modifier Load (0.4ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction -------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_modifier_per_charge -------------------------------------------------------------- Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction --------------------------------- Billing::PaymentTest: test_create --------------------------------- Billing::Payment Load (0.3ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.2ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.4ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.3ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.4ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.4ms) INSERT INTO "billing_payments" ("type", "value_cents", "payment_type_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["type", "Billing::PaymentWithType"], ["value_cents", 100], ["payment_type_id", 980190962], ["bill_id", 980190962], ["created_at", "2017-03-29 02:05:24.722019"], ["updated_at", "2017-03-29 02:05:24.722019"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:05:24.722019"], ["object_changes", "---\ntype:\n- \n- Billing::PaymentWithType\nvalue_cents:\n- 0\n- 100\npayment_type_id:\n- \n- 980190962\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:05:24.722019126 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Payment"]] SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:05:24.766238"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:24.000000000 Z\nupdated_at: 2017-03-29 02:05:24.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:24.766238"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:05:24.000000000 Z\n- 2017-03-29 02:05:24.766238147 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:05:24.780205"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:05:24.000000000 Z\nupdated_at: 2017-03-29 02:05:24.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:05:24.780205"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:05:24.000000000 Z\n- 2017-03-29 02:05:24.780205189 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:05:24.766238"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:24.000000000 Z\nupdated_at: 2017-03-29 02:05:24.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:24.766238"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:05:24.000000000 Z\n- 2017-03-29 02:05:24.766238147 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Payment"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction ---------------------------------------------------------------------------- Billing::PaymentTest: test_should_be_instance_of_bill's_origin_payment_model ---------------------------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction --------------------------------------------------------- Billing::PaymentTest: test_should_be_single_cash_payments --------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.3ms) INSERT INTO "billing_payments" ("type", "value_cents", "payment_type_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["type", "Billing::PaymentWithType"], ["value_cents", 100], ["payment_type_id", 112846265], ["bill_id", 980190962], ["created_at", "2017-03-29 02:05:24.933954"], ["updated_at", "2017-03-29 02:05:24.933954"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:05:24.933954"], ["object_changes", "---\ntype:\n- \n- Billing::PaymentWithType\nvalue_cents:\n- 0\n- 100\npayment_type_id:\n- \n- 112846265\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:05:24.933954583 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Payment"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:05:24.967462"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:24.000000000 Z\nupdated_at: 2017-03-29 02:05:24.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:24.967462"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:05:24.000000000 Z\n- 2017-03-29 02:05:24.967462752 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:05:24.975306"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:05:24.000000000 Z\nupdated_at: 2017-03-29 02:05:24.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:05:24.975306"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:05:24.000000000 Z\n- 2017-03-29 02:05:24.975306286 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:05:24.967462"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:24.000000000 Z\nupdated_at: 2017-03-29 02:05:24.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:24.967462"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:05:24.000000000 Z\n- 2017-03-29 02:05:24.967462752 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Payment"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction ------------------------------------------------------------------------------ Billing::PaymentTest: test_should_have_same_fiscal_flag_as_other_bill_payments ------------------------------------------------------------------------------ Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.2ms) begin transaction ------------------------------ Billing::BillTest: test_charge ------------------------------ Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.2ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:05:25.184599"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:24.000000000 Z\nupdated_at: 2017-03-29 02:05:24.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:25.184599"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:05:24.000000000 Z\n- 2017-03-29 02:05:25.184599004 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:05:25.192988"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:05:24.000000000 Z\nupdated_at: 2017-03-29 02:05:24.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:05:25.192988"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:05:24.000000000 Z\n- 2017-03-29 02:05:25.192988362 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:05:25.184599"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:24.000000000 Z\nupdated_at: 2017-03-29 02:05:24.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:25.184599"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:05:24.000000000 Z\n- 2017-03-29 02:05:25.184599004 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 02:05:25.316902"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:24.000000000 Z\nupdated_at: 2017-03-29 02:05:25.184599004 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:25.316902"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 02:05:25.184599004 Z\n- 2017-03-29 02:05:25.316902147 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.3ms) INSERT INTO "billing_charges" ("price_cents", "bill_id", "value_cents", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["price_cents", 300], ["bill_id", 980190962], ["value_cents", 300], ["created_at", "2017-03-29 02:05:25.324315"], ["updated_at", "2017-03-29 02:05:25.324315"]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:05:25.324315"], ["object_changes", "---\nprice_cents:\n- 0\n- 300\nbill_id:\n- \n- 980190962\nvalue_cents:\n- 0\n- 300\ncreated_at:\n- \n- &1 2017-03-29 02:05:25.324315931 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 02:05:25.316902"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:24.000000000 Z\nupdated_at: 2017-03-29 02:05:25.184599004 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:25.316902"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 02:05:25.184599004 Z\n- 2017-03-29 02:05:25.316902147 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction -------------------------------- Billing::BillTest: test_discount -------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.0ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:05:25.449531"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:24.000000000 Z\nupdated_at: 2017-03-29 02:05:24.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:25.449531"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:05:24.000000000 Z\n- 2017-03-29 02:05:25.449531716 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:05:25.460990"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:05:24.000000000 Z\nupdated_at: 2017-03-29 02:05:24.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:05:25.460990"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:05:24.000000000 Z\n- 2017-03-29 02:05:25.460990576 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:05:25.449531"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:24.000000000 Z\nupdated_at: 2017-03-29 02:05:24.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:25.449531"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:05:24.000000000 Z\n- 2017-03-29 02:05:25.449531716 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 298486374]]  (0.2ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.0ms) SAVEPOINT active_record_1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1 SQL (0.2ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "charge_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["fixed_value_cents", -100], ["charge_id", 298486374], ["bill_id", 980190962], ["created_at", "2017-03-29 02:05:25.567376"], ["updated_at", "2017-03-29 02:05:25.567376"]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:05:25.567376"], ["object_changes", "---\nfixed_value_cents:\n- 0\n- -100\ncharge_id:\n- \n- 298486374\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:05:25.567376093 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Modifier"]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.3ms) rollback transaction Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Modifier"]]  (0.2ms) begin transaction --------------------------------- Billing::BillTest: test_summaries --------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:05:25.672042"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:24.000000000 Z\nupdated_at: 2017-03-29 02:05:24.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:25.672042"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:05:24.000000000 Z\n- 2017-03-29 02:05:25.672042468 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:05:25.682472"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:05:24.000000000 Z\nupdated_at: 2017-03-29 02:05:24.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:05:25.682472"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:05:24.000000000 Z\n- 2017-03-29 02:05:25.682472378 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:05:25.672042"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:05:24.000000000 Z\nupdated_at: 2017-03-29 02:05:24.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:05:25.672042"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:05:24.000000000 Z\n- 2017-03-29 02:05:25.672042468 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.2ms) begin transaction ----------------------------------------- Billing::ChargeTest: test_string_protocol ----------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Plu Load (0.2ms) SELECT "billing_plus".* FROM "billing_plus" WHERE "billing_plus"."id" = ? LIMIT 1 [["id", 980190962]] Billing::TaxGroup Load (0.4ms) SELECT "billing_tax_groups".* FROM "billing_tax_groups" WHERE "billing_tax_groups"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------- Billing::ChargeTest: test_wild_class_method ------------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ----------------------- BillingTest: test_truth -----------------------  (0.1ms) rollback transaction ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (101.1ms) DROP TABLE "billing_bills"  (130.3ms) CREATE TABLE "billing_bills" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "billable_id" integer, "billable_type" varchar, "created_at" datetime, "updated_at" datetime, "charges_sum_cents" integer DEFAULT 0 NOT NULL, "charges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "discounts_sum_cents" integer DEFAULT 0 NOT NULL, "discounts_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "total_cents" integer DEFAULT 0 NOT NULL, "total_currency" varchar DEFAULT 'USD' NOT NULL, "balance_cents" integer DEFAULT 0 NOT NULL, "balance_currency" varchar DEFAULT 'USD' NOT NULL, "surcharges_sum_cents" integer DEFAULT 0 NOT NULL, "surcharges_sum_currency" varchar DEFAULT 'USD' NOT NULL, "origin_id" integer, "extface_job_id" integer, "report_id" integer, "autofin" boolean DEFAULT 't', "finalized_at" datetime, "name" varchar, "number" varchar, "deleted_at" datetime, "print_job_id" integer)   (0.2ms) select sqlite_version(*)  (114.4ms) CREATE INDEX "index_billing_bills_on_billable_type_and_billable_id" ON "billing_bills" ("billable_type", "billable_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'  (72.1ms) CREATE INDEX "index_billing_bills_on_extface_job_id" ON "billing_bills" ("extface_job_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (112.8ms) CREATE INDEX "index_billing_bills_on_origin_id" ON "billing_bills" ("origin_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_origin_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_extface_job_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_bills_on_billable_type_and_billable_id' AND type='index'   (122.8ms) CREATE INDEX "index_billing_bills_on_report_id" ON "billing_bills" ("report_id")  (344.9ms) DROP TABLE "billing_charges"  (120.8ms) CREATE TABLE "billing_charges" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "chargable_id" integer, "chargable_type" varchar, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "name" varchar, "description" varchar, "origin_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime, "revenue_at" datetime, "qty" decimal(6,3), "tax_ratio" decimal(6,3))  (84.1ms) CREATE INDEX "index_billing_charges_on_bill_id" ON "billing_charges" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (118.7ms) CREATE INDEX "index_billing_charges_on_chargable_type_and_chargable_id" ON "billing_charges" ("chargable_type", "chargable_id")  (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (80.2ms) CREATE INDEX "index_billing_charges_on_deleted_at" ON "billing_charges" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'   (112.9ms) CREATE INDEX "index_billing_charges_on_origin_id" ON "billing_charges" ("origin_id")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_origin_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_origin_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_deleted_at' AND type='index'  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_chargable_type_and_chargable_id' AND type='index'   (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_charges_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_charges_on_bill_id' AND type='index'  (111.1ms) CREATE INDEX "index_billing_charges_on_revenue_at" ON "billing_charges" ("revenue_at")  (115.9ms) DROP TABLE "billing_departments"  (63.6ms) CREATE TABLE "billing_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "tax_group_id" integer, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)   (81.4ms) CREATE INDEX "index_billing_departments_on_deleted_at" ON "billing_departments" ("deleted_at")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_departments_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_departments_on_deleted_at' AND type='index'   (124.2ms) CREATE INDEX "index_billing_departments_on_tax_group_id" ON "billing_departments" ("tax_group_id")  (79.2ms) DROP TABLE "billing_modifiers"  (114.7ms) CREATE TABLE "billing_modifiers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "charge_id" integer, "percent_ratio" decimal(6,3), "created_at" datetime, "updated_at" datetime, "fixed_value_cents" integer DEFAULT 0 NOT NULL, "fixed_value_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)  (57.1ms) CREATE INDEX "index_billing_modifiers_on_bill_id" ON "billing_modifiers" ("bill_id")  (89.4ms) DROP TABLE "billing_op_fp_mappings"  (98.7ms) CREATE TABLE "billing_op_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "operator_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime, "pwd" varchar)   (106.5ms) CREATE INDEX "index_billing_op_fp_mappings_on_extface_driver_id" ON "billing_op_fp_mappings" ("extface_driver_id")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'   (97.6ms) CREATE INDEX "index_billing_op_fp_mappings_on_operator_id" ON "billing_op_fp_mappings" ("operator_id")  (89.4ms) DROP TABLE "billing_operators"  (98.3ms) CREATE TABLE "billing_operators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "type" varchar, "created_at" datetime, "updated_at" datetime, "number" integer, "banned" boolean, "deleted_at" datetime)  (98.1ms) CREATE INDEX "index_billing_operators_on_deleted_at" ON "billing_operators" ("deleted_at")  (106.0ms) DROP TABLE "billing_origins"  (106.7ms) CREATE TABLE "billing_origins" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "fiscal_device_id" integer, "banned" boolean, "deleted_at" datetime, "type" varchar, "payment_model" varchar DEFAULT 'Billing::PaymentWithType', "transfer_device_id" integer, "print_device_id" integer, "print_header" varchar, "print_footer" varchar, "receipt_config_id" integer)   (114.6ms) CREATE INDEX "index_billing_origins_on_deleted_at" ON "billing_origins" ("deleted_at")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'   (105.6ms) CREATE INDEX "index_billing_origins_on_fiscal_device_id" ON "billing_origins" ("fiscal_device_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (112.8ms) CREATE INDEX "index_billing_origins_on_receipt_config_id" ON "billing_origins" ("receipt_config_id")  (0.3ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_receipt_config_id' AND type='index'  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'   (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_origins_on_deleted_at' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_origins_on_deleted_at' AND type='index'  (79.7ms) CREATE INDEX "index_billing_origins_on_transfer_device_id" ON "billing_origins" ("transfer_device_id")  (56.4ms) DROP TABLE "billing_payment_types"  (82.3ms) CREATE TABLE "billing_payment_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "cash" boolean, "fiscal" boolean, "created_at" datetime, "updated_at" datetime, "type" varchar, "master_id" integer, "number" integer, "banned" boolean, "deleted_at" datetime, "print_copy" boolean)   (114.4ms) CREATE INDEX "index_billing_payment_types_on_deleted_at" ON "billing_payment_types" ("deleted_at")  (113.8ms) DROP TABLE "billing_payments"  (56.8ms) CREATE TABLE "billing_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bill_id" integer, "value_cents" integer DEFAULT 0 NOT NULL, "value_currency" varchar DEFAULT 'USD' NOT NULL, "created_at" datetime, "updated_at" datetime, "type" varchar, "payment_type_id" integer, "status" varchar, "name" varchar, "description" varchar, "external_token" varchar, "note" varchar, "deleted_at" datetime)  (123.2ms) CREATE INDEX "index_billing_payments_on_bill_id" ON "billing_payments" ("bill_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_payments_on_bill_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_payments_on_bill_id' AND type='index'  (113.5ms) CREATE INDEX "index_billing_payments_on_deleted_at" ON "billing_payments" ("deleted_at")  (106.0ms) DROP TABLE "billing_plus"  (73.5ms) CREATE TABLE "billing_plus" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "tax_group_id" integer, "department_id" integer, "number" integer, "price_cents" integer DEFAULT 0 NOT NULL, "price_currency" varchar DEFAULT 'USD' NOT NULL, "code" varchar, "type" varchar, "banned" boolean, "deleted_at" datetime)   (106.1ms) CREATE INDEX "index_billing_plus_on_department_id" ON "billing_plus" ("department_id")  (0.2ms)  SELECT sql FROM sqlite_master WHERE name='index_billing_plus_on_department_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_plus_on_department_id' AND type='index'   (88.7ms) CREATE INDEX "index_billing_plus_on_tax_group_id" ON "billing_plus" ("tax_group_id")  (64.6ms) DROP TABLE "billing_profiles"  (123.4ms) CREATE TABLE "billing_profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime)  (72.6ms) DROP TABLE "billing_pt_fp_mappings"  (82.4ms) CREATE TABLE "billing_pt_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payment_type_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (81.1ms) CREATE INDEX "index_billing_pt_fp_mappings_on_extface_driver_id" ON "billing_pt_fp_mappings" ("extface_driver_id")  (0.2ms) SELECT sql FROM sqlite_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'  (64.1ms) CREATE INDEX "index_billing_pt_fp_mappings_on_payment_type_id" ON "billing_pt_fp_mappings" ("payment_type_id")  (56.6ms) DROP TABLE "billing_receipt_configs"  (106.4ms) CREATE TABLE "billing_receipt_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "type" varchar, "name" varchar, "discount_text" varchar, "surcharge_text" varchar, "sound_signal" boolean, "open_cash_drawer" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "paper_cut" boolean, "custom_commands" boolean, "custom_commands_text" varchar)   (114.3ms) DROP TABLE "billing_reports"  (81.2ms) CREATE TABLE "billing_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "origin_id" integer, "payments_sum_cents" integer DEFAULT 0 NOT NULL, "payments_sum_currency" varchar DEFAULT 'USD' NOT NULL, "payments_cash_cents" integer DEFAULT 0 NOT NULL, "payments_cash_currency" varchar DEFAULT 'USD' NOT NULL, "payments_fiscal_cents" integer DEFAULT 0 NOT NULL, "payments_fiscal_currency" varchar DEFAULT 'USD' NOT NULL, "note" text, "type" varchar, "created_at" datetime, "updated_at" datetime, "extface_job_id" integer, "f_period_from" date, "f_period_to" date, "zeroing" boolean, "f_operation" varchar, "f_amount_cents" integer DEFAULT 0 NOT NULL, "f_amount_currency" varchar DEFAULT 'USD' NOT NULL, "deleted_at" datetime)   (320.3ms) CREATE INDEX "index_billing_reports_on_origin_id" ON "billing_reports" ("origin_id")  (228.9ms) DROP TABLE "billing_resources"  (114.4ms) CREATE TABLE "billing_resources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "master_id" integer, "name" varchar, "properties" text, "banned" boolean, "type" varchar, "created_at" datetime, "updated_at" datetime, "deleted_at" datetime)  (105.6ms) DROP TABLE "billing_tax_groups"  (106.8ms) CREATE TABLE "billing_tax_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime, "updated_at" datetime, "master_id" integer, "number" integer, "percent_ratio" decimal(6,3), "banned" boolean, "type" varchar, "deleted_at" datetime)  (113.6ms) DROP TABLE "billing_tg_fp_mappings"  (114.9ms) CREATE TABLE "billing_tg_fp_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tax_group_id" integer, "extface_driver_id" integer, "mapping" integer, "created_at" datetime, "updated_at" datetime)  (89.6ms) CREATE INDEX "index_billing_tg_fp_mappings_on_extface_driver_id" ON "billing_tg_fp_mappings" ("extface_driver_id")  (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'  (212.8ms) CREATE INDEX "index_billing_tg_fp_mappings_on_tax_group_id" ON "billing_tg_fp_mappings" ("tax_group_id")  (159.9ms) DROP TABLE "billing_versions"  (134.7ms) CREATE TABLE "billing_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "item_type" varchar NOT NULL, "item_id" integer NOT NULL, "event" varchar NOT NULL, "whodunnit" varchar, "object" text, "created_at" datetime, "ip" varchar, "user_agent" varchar, "object_changes" text, "master_id" integer, "master_type" varchar)   (114.3ms) CREATE INDEX "index_billing_versions_on_item_type_and_item_id" ON "billing_versions" ("item_type", "item_id")  (113.7ms) DROP TABLE "profiles"  (114.8ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)  (0.6ms) SELECT version FROM "schema_migrations" Billing::PaymentType Load (0.2ms) SELECT "billing_payment_types".* FROM "billing_payment_types"  (0.1ms) begin transaction Fixture Delete (0.1ms) DELETE FROM "billing_payment_types" Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 02:46:23', '2017-03-29 02:46:23', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('MyString', 'f', 'f', '2017-03-29 02:46:23', '2017-03-29 02:46:23', 298486374) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Cash', 't', 'f', '2017-03-29 02:46:23', '2017-03-29 02:46:23', 112846265) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Fiscal', 't', 't', '2017-03-29 02:46:23', '2017-03-29 02:46:23', 817124681) Fixture Insert (0.1ms) INSERT INTO "billing_payment_types" ("name", "cash", "fiscal", "created_at", "updated_at", "id") VALUES ('Card', 'f', 't', '2017-03-29 02:46:23', '2017-03-29 02:46:23', 370448595) Fixture Delete (0.1ms) DELETE FROM "billing_origins" Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 02:46:23', '2017-03-29 02:46:23', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_origins" ("name", "payment_model", "created_at", "updated_at", "id") VALUES ('MyString', 'Billing::PaymentWithType', '2017-03-29 02:46:23', '2017-03-29 02:46:23', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_plus" Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:46:23', '2017-03-29 02:46:23', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_plus" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:46:23', '2017-03-29 02:46:23', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_payments" Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (100, 'USD', 'Billing::PaymentWithType', '2017-03-29 02:46:23', '2017-03-29 02:46:23', 980190962, 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_payments" ("value_cents", "value_currency", "type", "created_at", "updated_at", "id", "bill_id", "payment_type_id") VALUES (200, 'USD', 'Billing::PaymentWithType', '2017-03-29 02:46:23', '2017-03-29 02:46:23', 298486374, 980190962, 980190962) Fixture Delete (0.2ms) DELETE FROM "billing_bills" Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id", "origin_id") VALUES ('2017-03-29 02:46:23', '2017-03-29 02:46:23', 980190962, 'Profile', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_bills" ("created_at", "updated_at", "id", "billable_type", "billable_id") VALUES ('2017-03-29 02:46:23', '2017-03-29 02:46:23', 298486374, 'Profile', 980190962) Fixture Delete (0.1ms) DELETE FROM "billing_resources" Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 02:46:23', '2017-03-29 02:46:23', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_resources" ("name", "properties", "type", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', NULL, '2017-03-29 02:46:23', '2017-03-29 02:46:23', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_receipt_configs" Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 02:46:23', '2017-03-29 02:46:23', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_receipt_configs" ("master_id", "type", "name", "discount_text", "surcharge_text", "sound_signal", "open_cash_drawer", "created_at", "updated_at", "id") VALUES (1, NULL, 'MyString', 'MyString', 'MyString', 'f', 'f', '2017-03-29 02:46:23', '2017-03-29 02:46:23', 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_charges" Fixture Insert (0.2ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (100, 'USD', '2017-03-29 02:46:23', '2017-03-29 02:46:23', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_charges" ("price_cents", "price_currency", "created_at", "updated_at", "id", "bill_id") VALUES (200, 'USD', '2017-03-29 02:46:23', '2017-03-29 02:46:23', 298486374, 980190962) Fixture Delete (0.2ms) DELETE FROM "billing_departments" Fixture Insert (0.2ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group1', NULL, '2017-03-29 02:46:23', '2017-03-29 02:46:23', 980190962, 980190962) Fixture Insert (0.2ms) INSERT INTO "billing_departments" ("name", "type", "created_at", "updated_at", "id", "tax_group_id") VALUES ('Group2', NULL, '2017-03-29 02:46:23', '2017-03-29 02:46:23', 298486374, 298486374) Fixture Delete (0.2ms) DELETE FROM "billing_modifiers" Fixture Insert (0.2ms) INSERT INTO "billing_modifiers" ("percent_ratio", "created_at", "updated_at", "id", "bill_id") VALUES (1.0, '2017-03-29 02:46:23', '2017-03-29 02:46:23', 980190962, 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "fixed_value_currency", "created_at", "updated_at", "id", "bill_id", "charge_id") VALUES (100, 'USD', '2017-03-29 02:46:23', '2017-03-29 02:46:23', 298486374, 980190962, 980190962) Fixture Delete (0.2ms) DELETE FROM "billing_profiles" Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:46:23', '2017-03-29 02:46:23', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_profiles" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:46:23', '2017-03-29 02:46:23', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_operators" Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 02:46:23', '2017-03-29 02:46:23', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_operators" ("master_id", "name", "type", "created_at", "updated_at", "id") VALUES (1, 'MyString', NULL, '2017-03-29 02:46:23', '2017-03-29 02:46:23', 298486374) Fixture Delete (0.1ms) DELETE FROM "billing_tax_groups" Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:46:23', '2017-03-29 02:46:23', 980190962) Fixture Insert (0.1ms) INSERT INTO "billing_tax_groups" ("name", "created_at", "updated_at", "id") VALUES ('MyString', '2017-03-29 02:46:23', '2017-03-29 02:46:23', 298486374) Fixture Delete (0.1ms) DELETE FROM "profiles" Fixture Insert (0.1ms) INSERT INTO "profiles" ("created_at", "updated_at", "id") VALUES ('2017-03-29 02:46:23', '2017-03-29 02:46:23', 980190962)  (88.5ms) commit transaction  (0.2ms) begin transaction ----------------------------------------- Billing::ChargeTest: test_string_protocol ----------------------------------------- Billing::Charge Load (0.3ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Plu Load (0.2ms) SELECT "billing_plus".* FROM "billing_plus" WHERE "billing_plus"."id" = ? LIMIT 1 [["id", 980190962]] Billing::TaxGroup Load (0.2ms) SELECT "billing_tax_groups".* FROM "billing_tax_groups" WHERE "billing_tax_groups"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------- Billing::ChargeTest: test_wild_class_method ------------------------------------------- Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]]  (0.2ms) rollback transaction  (0.2ms) begin transaction ------------------------------ Billing::BillTest: test_charge ------------------------------ Billing::Bill Load (0.3ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.3ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.3ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.2ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.3ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.2ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.3ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:46:23.579789"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:46:23.000000000 Z\nupdated_at: 2017-03-29 02:46:23.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:46:23.579789"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:46:23.000000000 Z\n- 2017-03-29 02:46:23.579789237 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:46:23.600114"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:46:23.000000000 Z\nupdated_at: 2017-03-29 02:46:23.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:46:23.600114"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:46:23.000000000 Z\n- 2017-03-29 02:46:23.600114318 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:46:23.579789"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:46:23.000000000 Z\nupdated_at: 2017-03-29 02:46:23.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:46:23.579789"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:46:23.000000000 Z\n- 2017-03-29 02:46:23.579789237 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 02:46:23.703877"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:46:23.000000000 Z\nupdated_at: 2017-03-29 02:46:23.579789237 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:46:23.703877"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 02:46:23.579789237 Z\n- 2017-03-29 02:46:23.703877251 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.3ms) INSERT INTO "billing_charges" ("price_cents", "bill_id", "value_cents", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["price_cents", 300], ["bill_id", 980190962], ["value_cents", 300], ["created_at", "2017-03-29 02:46:23.713934"], ["updated_at", "2017-03-29 02:46:23.713934"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:46:23.713934"], ["object_changes", "---\nprice_cents:\n- 0\n- 300\nbill_id:\n- \n- 980190962\nvalue_cents:\n- 0\n- 300\ncreated_at:\n- \n- &1 2017-03-29 02:46:23.713934164 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 600], ["surcharges_sum_cents", 600], ["total_cents", 1200], ["balance_cents", -900], ["updated_at", "2017-03-29 02:46:23.703877"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:46:23.000000000 Z\nupdated_at: 2017-03-29 02:46:23.579789237 Z\ncharges_sum_cents: 300\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 300\npayments_sum_currency: USD\ntotal_cents: 600\ntotal_currency: USD\nbalance_cents: -300\nbalance_currency: USD\nsurcharges_sum_cents: 300\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:46:23.703877"], ["object_changes", "---\ncharges_sum_cents:\n- 300\n- 600\nsurcharges_sum_cents:\n- 300\n- 600\ntotal_cents:\n- 600\n- 1200\nbalance_cents:\n- -300\n- -900\nupdated_at:\n- 2017-03-29 02:46:23.579789237 Z\n- 2017-03-29 02:46:23.703877251 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.2ms) rollback transaction Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction -------------------------------- Billing::BillTest: test_discount -------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:46:23.848789"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:46:23.000000000 Z\nupdated_at: 2017-03-29 02:46:23.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:46:23.848789"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:46:23.000000000 Z\n- 2017-03-29 02:46:23.848789710 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:46:23.859339"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:46:23.000000000 Z\nupdated_at: 2017-03-29 02:46:23.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:46:23.859339"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:46:23.000000000 Z\n- 2017-03-29 02:46:23.859339201 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:46:23.848789"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:46:23.000000000 Z\nupdated_at: 2017-03-29 02:46:23.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:46:23.848789"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:46:23.000000000 Z\n- 2017-03-29 02:46:23.848789710 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) RELEASE SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 298486374]]  (0.2ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.0ms) SAVEPOINT active_record_1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1 SQL (0.2ms) INSERT INTO "billing_modifiers" ("fixed_value_cents", "charge_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["fixed_value_cents", -100], ["charge_id", 298486374], ["bill_id", 980190962], ["created_at", "2017-03-29 02:46:23.969494"], ["updated_at", "2017-03-29 02:46:23.969494"]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:46:23.969494"], ["object_changes", "---\nfixed_value_cents:\n- 0\n- -100\ncharge_id:\n- \n- 298486374\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:46:23.969494308 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Modifier"]] Billing::Modifier Exists (0.3ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 298486374 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."id" != 980190963 AND "billing_modifiers"."charge_id" = 298486374) LIMIT 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]]  (0.3ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]] Billing::Version Load (0.2ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Modifier"]]  (0.1ms) begin transaction --------------------------------- Billing::BillTest: test_summaries --------------------------------- Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:46:24.084656"], ["id", 980190962]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:46:23.000000000 Z\nupdated_at: 2017-03-29 02:46:23.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:46:24.084656"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:46:23.000000000 Z\n- 2017-03-29 02:46:24.084656541 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.1ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:46:24.099389"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:46:23.000000000 Z\nupdated_at: 2017-03-29 02:46:23.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:46:24.099389"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:46:23.000000000 Z\n- 2017-03-29 02:46:24.099389596 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:46:24.084656"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:46:23.000000000 Z\nupdated_at: 2017-03-29 02:46:23.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:46:24.084656"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:46:23.000000000 Z\n- 2017-03-29 02:46:24.084656541 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 298486374], ["item_type", "Billing::Charge"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction --------------------------------- Billing::PaymentTest: test_create --------------------------------- Billing::Payment Load (0.3ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.2ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.4ms) INSERT INTO "billing_payments" ("type", "value_cents", "payment_type_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["type", "Billing::PaymentWithType"], ["value_cents", 100], ["payment_type_id", 980190962], ["bill_id", 980190962], ["created_at", "2017-03-29 02:46:24.274371"], ["updated_at", "2017-03-29 02:46:24.274371"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:46:24.274371"], ["object_changes", "---\ntype:\n- \n- Billing::PaymentWithType\nvalue_cents:\n- 0\n- 100\npayment_type_id:\n- \n- 980190962\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:46:24.274371762 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Payment"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:46:24.313327"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:46:23.000000000 Z\nupdated_at: 2017-03-29 02:46:23.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:46:24.313327"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:46:23.000000000 Z\n- 2017-03-29 02:46:24.313327691 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:46:24.323467"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:46:23.000000000 Z\nupdated_at: 2017-03-29 02:46:23.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:46:24.323467"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:46:23.000000000 Z\n- 2017-03-29 02:46:24.323467010 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.1ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:46:24.313327"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:46:23.000000000 Z\nupdated_at: 2017-03-29 02:46:23.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:46:24.313327"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:46:23.000000000 Z\n- 2017-03-29 02:46:24.313327691 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Payment"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction ---------------------------------------------------------------------------- Billing::PaymentTest: test_should_be_instance_of_bill's_origin_payment_model ---------------------------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction --------------------------------------------------------- Billing::PaymentTest: test_should_be_single_cash_payments --------------------------------------------------------- Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]] SQL (0.3ms) INSERT INTO "billing_payments" ("type", "value_cents", "payment_type_id", "bill_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["type", "Billing::PaymentWithType"], ["value_cents", 100], ["payment_type_id", 112846265], ["bill_id", 980190962], ["created_at", "2017-03-29 02:46:24.477491"], ["updated_at", "2017-03-29 02:46:24.477491"]] SQL (0.2ms) INSERT INTO "billing_versions" ("event", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2017-03-29 02:46:24.477491"], ["object_changes", "---\ntype:\n- \n- Billing::PaymentWithType\nvalue_cents:\n- 0\n- 100\npayment_type_id:\n- \n- 112846265\nbill_id:\n- \n- 980190962\ncreated_at:\n- \n- &1 2017-03-29 02:46:24.477491672 Z\nupdated_at:\n- \n- *1\nid:\n- \n- 980190963\n"], ["item_id", 980190963], ["item_type", "Billing::Payment"]] SQL (0.2ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:46:24.507415"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:46:23.000000000 Z\nupdated_at: 2017-03-29 02:46:23.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:46:24.507415"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:46:23.000000000 Z\n- 2017-03-29 02:46:24.507415677 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]] SQL (0.2ms) UPDATE "billing_charges" SET "value_cents" = ?, "updated_at" = ? WHERE "billing_charges"."id" = ? [["value_cents", 200], ["updated_at", "2017-03-29 02:46:24.515996"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbill_id: 980190962\nchargable_id: \nchargable_type: \nprice_cents: 100\nprice_currency: USD\ncreated_at: 2017-03-29 02:46:23.000000000 Z\nupdated_at: 2017-03-29 02:46:23.000000000 Z\nname: \ndescription: \norigin_id: \nvalue_cents: 0\nvalue_currency: USD\ndeleted_at: \nrevenue_at: \nqty: \ntax_ratio: \n"], ["created_at", "2017-03-29 02:46:24.515996"], ["object_changes", "---\nvalue_cents:\n- 0\n- 200\nupdated_at:\n- 2017-03-29 02:46:23.000000000 Z\n- 2017-03-29 02:46:24.515996286 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Charge"]] SQL (0.4ms) UPDATE "billing_bills" SET "charges_sum_cents" = ?, "surcharges_sum_cents" = ?, "payments_sum_cents" = ?, "total_cents" = ?, "balance_cents" = ?, "updated_at" = ? WHERE "billing_bills"."id" = ? [["charges_sum_cents", 300], ["surcharges_sum_cents", 300], ["payments_sum_cents", 300], ["total_cents", 600], ["balance_cents", -300], ["updated_at", "2017-03-29 02:46:24.507415"], ["id", 980190962]] SQL (0.1ms) INSERT INTO "billing_versions" ("event", "object", "created_at", "object_changes", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980190962\nbillable_id: 980190962\nbillable_type: Profile\ncreated_at: 2017-03-29 02:46:23.000000000 Z\nupdated_at: 2017-03-29 02:46:23.000000000 Z\ncharges_sum_cents: 0\ncharges_sum_currency: USD\ndiscounts_sum_cents: 0\ndiscounts_sum_currency: USD\npayments_sum_cents: 0\npayments_sum_currency: USD\ntotal_cents: 0\ntotal_currency: USD\nbalance_cents: 0\nbalance_currency: USD\nsurcharges_sum_cents: 0\nsurcharges_sum_currency: USD\norigin_id: 980190962\nextface_job_id: \nreport_id: \nautofin: true\nfinalized_at: \nname: \nnumber: \ndeleted_at: \nprint_job_id: \n"], ["created_at", "2017-03-29 02:46:24.507415"], ["object_changes", "---\ncharges_sum_cents:\n- 0\n- 300\nsurcharges_sum_cents:\n- 0\n- 300\npayments_sum_cents:\n- 0\n- 300\ntotal_cents:\n- 0\n- 600\nbalance_cents:\n- 0\n- -300\nupdated_at:\n- 2017-03-29 02:46:23.000000000 Z\n- 2017-03-29 02:46:24.507415677 Z\n"], ["item_id", 980190962], ["item_type", "Billing::Bill"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 112846265]]  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) rollback transaction Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190963], ["item_type", "Billing::Payment"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Bill"]] Billing::Version Load (0.1ms) SELECT "billing_versions".* FROM "billing_versions" WHERE "billing_versions"."item_id" = ? AND "billing_versions"."item_type" = ? ORDER BY "billing_versions"."created_at" ASC, "billing_versions"."id" ASC [["item_id", 980190962], ["item_type", "Billing::Charge"]]  (0.1ms) begin transaction ------------------------------------------------------------------------------ Billing::PaymentTest: test_should_have_same_fiscal_flag_as_other_bill_payments ------------------------------------------------------------------------------ Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 817124681]]  (0.1ms) SAVEPOINT active_record_1 Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."bill_id" = ? [["bill_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 298486374]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."charge_id" = ? LIMIT 1 [["charge_id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."bill_id" = ? [["bill_id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Payment Load (0.1ms) SELECT "billing_payments".* FROM "billing_payments" WHERE "billing_payments"."bill_id" = ? [["bill_id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::PaymentType Load (0.1ms) SELECT "billing_payment_types".* FROM "billing_payment_types" WHERE "billing_payment_types"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Origin Load (0.1ms) SELECT "billing_origins".* FROM "billing_origins" WHERE "billing_origins"."id" = ? LIMIT 1 [["id", 980190962]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction ----------------------- BillingTest: test_truth -----------------------  (0.1ms) rollback transaction  (0.1ms) begin transaction --------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_global_bill_modifier --------------------------------------------------------------- Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.0ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.2ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction -------------------------------------------------------------- Billing::ModifierTest: test_allow_only_one_modifier_per_charge -------------------------------------------------------------- Billing::Modifier Load (0.2ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Load (0.1ms) SELECT "billing_modifiers".* FROM "billing_modifiers" WHERE "billing_modifiers"."id" = ? LIMIT 1 [["id", 298486374]]  (0.1ms) SAVEPOINT active_record_1 Billing::Bill Load (0.1ms) SELECT "billing_bills".* FROM "billing_bills" WHERE "billing_bills"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Charge Load (0.1ms) SELECT "billing_charges".* FROM "billing_charges" WHERE "billing_charges"."id" = ? LIMIT 1 [["id", 980190962]] Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."charge_id" = 980190962 AND "billing_modifiers"."bill_id" = 980190962) LIMIT 1 Billing::Modifier Exists (0.1ms) SELECT 1 AS one FROM "billing_modifiers" WHERE ("billing_modifiers"."bill_id" = 980190962 AND "billing_modifiers"."charge_id" = 980190962) LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction