2 |
2.01 ms |
SELECT t0.id AS id_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.confirmation_number AS confirmation_number_4, t0.status AS status_5, t0.period_start AS period_start_6, t0.period_end AS period_end_7, t0.period_length AS period_length_8, t0.vatrate AS vatrate_9, t0.price_without_tax AS price_without_tax_10, t0.object AS object_11, t0.path AS path_12, t0.price AS price_13, t0.payment_recurrence AS payment_recurrence_14, t0.new_organization_legal_name AS new_organization_legal_name_15, t0.new_organization_vatid AS new_organization_vatid_16, t0.is_new_organization AS is_new_organization_17, t0.is_prescriber AS is_prescriber_18, t0.total_paid AS total_paid_19, t0.new_organization_user_email AS new_organization_user_email_20, t0.is_sent AS is_sent_21, t0.sent_date AS sent_date_22, t0.sent_to AS sent_to_23, t0.number AS number_24, t0.total_refund AS total_refund_25, t0.is_canceled AS is_canceled_26, t0.discount_without_tax AS discount_without_tax_27, t0.discount_without_tax_percent AS discount_without_tax_percent_28, t0.is_imported AS is_imported_29, t0.is_domiciliation AS is_domiciliation_30, t0.payment_url AS payment_url_31, t0.reference AS reference_32, t0.remaining_to_pay AS remaining_to_pay_33, t0.total_refunded_payment AS total_refunded_payment_34, t0.marge AS marge_35, t0.is_new_organization_prescribed AS is_new_organization_prescribed_36, t0.is_not_in_prescriber AS is_not_in_prescriber_37, t0.new_prescriber_legal_name AS new_prescriber_legal_name_38, t0.new_prescriber_vatid AS new_prescriber_vatid_39, t0.new_prescriber_user_email AS new_prescriber_user_email_40, t0.is_attached_to_prescriber AS is_attached_to_prescriber_41, t0.invoice_type AS invoice_type_42, t0.reference_stripe AS reference_stripe_43, t0.new_organization_phone_number AS new_organization_phone_number_44, t0.payment_deadline AS payment_deadline_45, t0.is_template AS is_template_46, t0.unique_key AS unique_key_47, t0.is_paid_by_stripe AS is_paid_by_stripe_48, t0.is_pack_invoice AS is_pack_invoice_49, t0.sync_billing_report AS sync_billing_report_50, t0.external_id AS external_id_51, t0.organization_id AS organization_id_52, t0.user_id AS user_id_53, t0.new_organization_address_id AS new_organization_address_id_54, t55.id AS id_56, t55.created_at AS created_at_57, t55.updated_at AS updated_at_58, t55.status AS status_59, t55.vatrate AS vatrate_60, t55.price_without_tax AS price_without_tax_61, t55.object AS object_62, t55.path AS path_63, t55.price AS price_64, t55.new_organization_legal_name AS new_organization_legal_name_65, t55.new_organization_vatid AS new_organization_vatid_66, t55.is_new_organization AS is_new_organization_67, t55.is_prescriber AS is_prescriber_68, t55.new_organization_user_email AS new_organization_user_email_69, t55.is_sent AS is_sent_70, t55.sent_date AS sent_date_71, t55.sent_to AS sent_to_72, t55.number AS number_73, t55.is_canceled AS is_canceled_74, t55.discount_without_tax AS discount_without_tax_75, t55.discount_without_tax_percent AS discount_without_tax_percent_76, t55.invoice_is_generated AS invoice_is_generated_77, t55.payment_url AS payment_url_78, t55.is_generate AS is_generate_79, t55.marge AS marge_80, t55.new_organization_phone_number AS new_organization_phone_number_81, t55.is_new_organization_prescribed AS is_new_organization_prescribed_82, t55.is_not_in_prescriber AS is_not_in_prescriber_83, t55.new_prescriber_legal_name AS new_prescriber_legal_name_84, t55.new_prescriber_vatid AS new_prescriber_vatid_85, t55.new_prescriber_user_email AS new_prescriber_user_email_86, t55.is_attached_to_prescriber AS is_attached_to_prescriber_87, t55.is_paid_by_stripe AS is_paid_by_stripe_88, t55.organization_id AS organization_id_89, t55.new_organization_address_id AS new_organization_address_id_90, t55.invoice_id AS invoice_id_91, t55.prescriber_id AS prescriber_id_92, t55.new_prescriber_address_id AS new_prescriber_address_id_93, t55.discount_code_id AS discount_code_id_94, t0.prescriber_id AS prescriber_id_95, t0.new_prescriber_address_id AS new_prescriber_address_id_96, t97.id AS id_98, t97.created_at AS created_at_99, t97.updated_at AS updated_at_100, t97.is_done AS is_done_101, t97.comment AS comment_102, t97.npai AS npai_103, t97.price_without_tax AS price_without_tax_104, t97.tracking_number AS tracking_number_105, t97.price AS price_106, t97.days_keep AS days_keep_107, t97.organization_id AS organization_id_108, t97.invoice_id AS invoice_id_109, t0.invoice_parent_id AS invoice_parent_id_110, t111.id AS id_112, t111.created_at AS created_at_113, t111.updated_at AS updated_at_114, t111.confirmation_number AS confirmation_number_115, t111.status AS status_116, t111.period_start AS period_start_117, t111.period_end AS period_end_118, t111.period_length AS period_length_119, t111.vatrate AS vatrate_120, t111.price_without_tax AS price_without_tax_121, t111.object AS object_122, t111.path AS path_123, t111.price AS price_124, t111.payment_recurrence AS payment_recurrence_125, t111.new_organization_legal_name AS new_organization_legal_name_126, t111.new_organization_vatid AS new_organization_vatid_127, t111.is_new_organization AS is_new_organization_128, t111.is_prescriber AS is_prescriber_129, t111.total_paid AS total_paid_130, t111.new_organization_user_email AS new_organization_user_email_131, t111.is_sent AS is_sent_132, t111.sent_date AS sent_date_133, t111.sent_to AS sent_to_134, t111.number AS number_135, t111.total_refund AS total_refund_136, t111.is_canceled AS is_canceled_137, t111.discount_without_tax AS discount_without_tax_138, t111.discount_without_tax_percent AS discount_without_tax_percent_139, t111.is_imported AS is_imported_140, t111.is_domiciliation AS is_domiciliation_141, t111.payment_url AS payment_url_142, t111.reference AS reference_143, t111.remaining_to_pay AS remaining_to_pay_144, t111.total_refunded_payment AS total_refunded_payment_145, t111.marge AS marge_146, t111.is_new_organization_prescribed AS is_new_organization_prescribed_147, t111.is_not_in_prescriber AS is_not_in_prescriber_148, t111.new_prescriber_legal_name AS new_prescriber_legal_name_149, t111.new_prescriber_vatid AS new_prescriber_vatid_150, t111.new_prescriber_user_email AS new_prescriber_user_email_151, t111.is_attached_to_prescriber AS is_attached_to_prescriber_152, t111.invoice_type AS invoice_type_153, t111.reference_stripe AS reference_stripe_154, t111.new_organization_phone_number AS new_organization_phone_number_155, t111.payment_deadline AS payment_deadline_156, t111.is_template AS is_template_157, t111.unique_key AS unique_key_158, t111.is_paid_by_stripe AS is_paid_by_stripe_159, t111.is_pack_invoice AS is_pack_invoice_160, t111.sync_billing_report AS sync_billing_report_161, t111.external_id AS external_id_162, t111.organization_id AS organization_id_163, t111.user_id AS user_id_164, t111.new_organization_address_id AS new_organization_address_id_165, t111.prescriber_id AS prescriber_id_166, t111.new_prescriber_address_id AS new_prescriber_address_id_167, t111.invoice_parent_id AS invoice_parent_id_168, t111.discount_code_id AS discount_code_id_169, t0.discount_code_id AS discount_code_id_170 FROM invoice t0 LEFT JOIN quote t55 ON t55.invoice_id = t0.id LEFT JOIN letter_forward t97 ON t97.invoice_id = t0.id LEFT JOIN invoice t111 ON t111.invoice_parent_id = t0.id WHERE t0.organization_id = ?
SELECT
t0.id AS id_1,
t0.created_at AS created_at_2,
t0.updated_at AS updated_at_3,
t0.confirmation_number AS confirmation_number_4,
t0.status AS status_5,
t0.period_start AS period_start_6,
t0.period_end AS period_end_7,
t0.period_length AS period_length_8,
t0.vatrate AS vatrate_9,
t0.price_without_tax AS price_without_tax_10,
t0.object AS object_11,
t0.path AS path_12,
t0.price AS price_13,
t0.payment_recurrence AS payment_recurrence_14,
t0.new_organization_legal_name AS new_organization_legal_name_15,
t0.new_organization_vatid AS new_organization_vatid_16,
t0.is_new_organization AS is_new_organization_17,
t0.is_prescriber AS is_prescriber_18,
t0.total_paid AS total_paid_19,
t0.new_organization_user_email AS new_organization_user_email_20,
t0.is_sent AS is_sent_21,
t0.sent_date AS sent_date_22,
t0.sent_to AS sent_to_23,
t0.number AS number_24,
t0.total_refund AS total_refund_25,
t0.is_canceled AS is_canceled_26,
t0.discount_without_tax AS discount_without_tax_27,
t0.discount_without_tax_percent AS discount_without_tax_percent_28,
t0.is_imported AS is_imported_29,
t0.is_domiciliation AS is_domiciliation_30,
t0.payment_url AS payment_url_31,
t0.reference AS reference_32,
t0.remaining_to_pay AS remaining_to_pay_33,
t0.total_refunded_payment AS total_refunded_payment_34,
t0.marge AS marge_35,
t0.is_new_organization_prescribed AS is_new_organization_prescribed_36,
t0.is_not_in_prescriber AS is_not_in_prescriber_37,
t0.new_prescriber_legal_name AS new_prescriber_legal_name_38,
t0.new_prescriber_vatid AS new_prescriber_vatid_39,
t0.new_prescriber_user_email AS new_prescriber_user_email_40,
t0.is_attached_to_prescriber AS is_attached_to_prescriber_41,
t0.invoice_type AS invoice_type_42,
t0.reference_stripe AS reference_stripe_43,
t0.new_organization_phone_number AS new_organization_phone_number_44,
t0.payment_deadline AS payment_deadline_45,
t0.is_template AS is_template_46,
t0.unique_key AS unique_key_47,
t0.is_paid_by_stripe AS is_paid_by_stripe_48,
t0.is_pack_invoice AS is_pack_invoice_49,
t0.sync_billing_report AS sync_billing_report_50,
t0.external_id AS external_id_51,
t0.organization_id AS organization_id_52,
t0.user_id AS user_id_53,
t0.new_organization_address_id AS new_organization_address_id_54,
t55.id AS id_56,
t55.created_at AS created_at_57,
t55.updated_at AS updated_at_58,
t55.status AS status_59,
t55.vatrate AS vatrate_60,
t55.price_without_tax AS price_without_tax_61,
t55.object AS object_62,
t55.path AS path_63,
t55.price AS price_64,
t55.new_organization_legal_name AS new_organization_legal_name_65,
t55.new_organization_vatid AS new_organization_vatid_66,
t55.is_new_organization AS is_new_organization_67,
t55.is_prescriber AS is_prescriber_68,
t55.new_organization_user_email AS new_organization_user_email_69,
t55.is_sent AS is_sent_70,
t55.sent_date AS sent_date_71,
t55.sent_to AS sent_to_72,
t55.number AS number_73,
t55.is_canceled AS is_canceled_74,
t55.discount_without_tax AS discount_without_tax_75,
t55.discount_without_tax_percent AS discount_without_tax_percent_76,
t55.invoice_is_generated AS invoice_is_generated_77,
t55.payment_url AS payment_url_78,
t55.is_generate AS is_generate_79,
t55.marge AS marge_80,
t55.new_organization_phone_number AS new_organization_phone_number_81,
t55.is_new_organization_prescribed AS is_new_organization_prescribed_82,
t55.is_not_in_prescriber AS is_not_in_prescriber_83,
t55.new_prescriber_legal_name AS new_prescriber_legal_name_84,
t55.new_prescriber_vatid AS new_prescriber_vatid_85,
t55.new_prescriber_user_email AS new_prescriber_user_email_86,
t55.is_attached_to_prescriber AS is_attached_to_prescriber_87,
t55.is_paid_by_stripe AS is_paid_by_stripe_88,
t55.organization_id AS organization_id_89,
t55.new_organization_address_id AS new_organization_address_id_90,
t55.invoice_id AS invoice_id_91,
t55.prescriber_id AS prescriber_id_92,
t55.new_prescriber_address_id AS new_prescriber_address_id_93,
t55.discount_code_id AS discount_code_id_94,
t0.prescriber_id AS prescriber_id_95,
t0.new_prescriber_address_id AS new_prescriber_address_id_96,
t97.id AS id_98,
t97.created_at AS created_at_99,
t97.updated_at AS updated_at_100,
t97.is_done AS is_done_101,
t97.comment AS comment_102,
t97.npai AS npai_103,
t97.price_without_tax AS price_without_tax_104,
t97.tracking_number AS tracking_number_105,
t97.price AS price_106,
t97.days_keep AS days_keep_107,
t97.organization_id AS organization_id_108,
t97.invoice_id AS invoice_id_109,
t0.invoice_parent_id AS invoice_parent_id_110,
t111.id AS id_112,
t111.created_at AS created_at_113,
t111.updated_at AS updated_at_114,
t111.confirmation_number AS confirmation_number_115,
t111.status AS status_116,
t111.period_start AS period_start_117,
t111.period_end AS period_end_118,
t111.period_length AS period_length_119,
t111.vatrate AS vatrate_120,
t111.price_without_tax AS price_without_tax_121,
t111.object AS object_122,
t111.path AS path_123,
t111.price AS price_124,
t111.payment_recurrence AS payment_recurrence_125,
t111.new_organization_legal_name AS new_organization_legal_name_126,
t111.new_organization_vatid AS new_organization_vatid_127,
t111.is_new_organization AS is_new_organization_128,
t111.is_prescriber AS is_prescriber_129,
t111.total_paid AS total_paid_130,
t111.new_organization_user_email AS new_organization_user_email_131,
t111.is_sent AS is_sent_132,
t111.sent_date AS sent_date_133,
t111.sent_to AS sent_to_134,
t111.number AS number_135,
t111.total_refund AS total_refund_136,
t111.is_canceled AS is_canceled_137,
t111.discount_without_tax AS discount_without_tax_138,
t111.discount_without_tax_percent AS discount_without_tax_percent_139,
t111.is_imported AS is_imported_140,
t111.is_domiciliation AS is_domiciliation_141,
t111.payment_url AS payment_url_142,
t111.reference AS reference_143,
t111.remaining_to_pay AS remaining_to_pay_144,
t111.total_refunded_payment AS total_refunded_payment_145,
t111.marge AS marge_146,
t111.is_new_organization_prescribed AS is_new_organization_prescribed_147,
t111.is_not_in_prescriber AS is_not_in_prescriber_148,
t111.new_prescriber_legal_name AS new_prescriber_legal_name_149,
t111.new_prescriber_vatid AS new_prescriber_vatid_150,
t111.new_prescriber_user_email AS new_prescriber_user_email_151,
t111.is_attached_to_prescriber AS is_attached_to_prescriber_152,
t111.invoice_type AS invoice_type_153,
t111.reference_stripe AS reference_stripe_154,
t111.new_organization_phone_number AS new_organization_phone_number_155,
t111.payment_deadline AS payment_deadline_156,
t111.is_template AS is_template_157,
t111.unique_key AS unique_key_158,
t111.is_paid_by_stripe AS is_paid_by_stripe_159,
t111.is_pack_invoice AS is_pack_invoice_160,
t111.sync_billing_report AS sync_billing_report_161,
t111.external_id AS external_id_162,
t111.organization_id AS organization_id_163,
t111.user_id AS user_id_164,
t111.new_organization_address_id AS new_organization_address_id_165,
t111.prescriber_id AS prescriber_id_166,
t111.new_prescriber_address_id AS new_prescriber_address_id_167,
t111.invoice_parent_id AS invoice_parent_id_168,
t111.discount_code_id AS discount_code_id_169,
t0.discount_code_id AS discount_code_id_170
FROM
invoice t0
LEFT JOIN quote t55 ON t55.invoice_id = t0.id
LEFT JOIN letter_forward t97 ON t97.invoice_id = t0.id
LEFT JOIN invoice t111 ON t111.invoice_parent_id = t0.id
WHERE
t0.organization_id = ?
SELECT t0.id AS id_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.confirmation_number AS confirmation_number_4, t0.status AS status_5, t0.period_start AS period_start_6, t0.period_end AS period_end_7, t0.period_length AS period_length_8, t0.vatrate AS vatrate_9, t0.price_without_tax AS price_without_tax_10, t0.object AS object_11, t0.path AS path_12, t0.price AS price_13, t0.payment_recurrence AS payment_recurrence_14, t0.new_organization_legal_name AS new_organization_legal_name_15, t0.new_organization_vatid AS new_organization_vatid_16, t0.is_new_organization AS is_new_organization_17, t0.is_prescriber AS is_prescriber_18, t0.total_paid AS total_paid_19, t0.new_organization_user_email AS new_organization_user_email_20, t0.is_sent AS is_sent_21, t0.sent_date AS sent_date_22, t0.sent_to AS sent_to_23, t0.number AS number_24, t0.total_refund AS total_refund_25, t0.is_canceled AS is_canceled_26, t0.discount_without_tax AS discount_without_tax_27, t0.discount_without_tax_percent AS discount_without_tax_percent_28, t0.is_imported AS is_imported_29, t0.is_domiciliation AS is_domiciliation_30, t0.payment_url AS payment_url_31, t0.reference AS reference_32, t0.remaining_to_pay AS remaining_to_pay_33, t0.total_refunded_payment AS total_refunded_payment_34, t0.marge AS marge_35, t0.is_new_organization_prescribed AS is_new_organization_prescribed_36, t0.is_not_in_prescriber AS is_not_in_prescriber_37, t0.new_prescriber_legal_name AS new_prescriber_legal_name_38, t0.new_prescriber_vatid AS new_prescriber_vatid_39, t0.new_prescriber_user_email AS new_prescriber_user_email_40, t0.is_attached_to_prescriber AS is_attached_to_prescriber_41, t0.invoice_type AS invoice_type_42, t0.reference_stripe AS reference_stripe_43, t0.new_organization_phone_number AS new_organization_phone_number_44, t0.payment_deadline AS payment_deadline_45, t0.is_template AS is_template_46, t0.unique_key AS unique_key_47, t0.is_paid_by_stripe AS is_paid_by_stripe_48, t0.is_pack_invoice AS is_pack_invoice_49, t0.sync_billing_report AS sync_billing_report_50, t0.external_id AS external_id_51, t0.organization_id AS organization_id_52, t0.user_id AS user_id_53, t0.new_organization_address_id AS new_organization_address_id_54, t55.id AS id_56, t55.created_at AS created_at_57, t55.updated_at AS updated_at_58, t55.status AS status_59, t55.vatrate AS vatrate_60, t55.price_without_tax AS price_without_tax_61, t55.object AS object_62, t55.path AS path_63, t55.price AS price_64, t55.new_organization_legal_name AS new_organization_legal_name_65, t55.new_organization_vatid AS new_organization_vatid_66, t55.is_new_organization AS is_new_organization_67, t55.is_prescriber AS is_prescriber_68, t55.new_organization_user_email AS new_organization_user_email_69, t55.is_sent AS is_sent_70, t55.sent_date AS sent_date_71, t55.sent_to AS sent_to_72, t55.number AS number_73, t55.is_canceled AS is_canceled_74, t55.discount_without_tax AS discount_without_tax_75, t55.discount_without_tax_percent AS discount_without_tax_percent_76, t55.invoice_is_generated AS invoice_is_generated_77, t55.payment_url AS payment_url_78, t55.is_generate AS is_generate_79, t55.marge AS marge_80, t55.new_organization_phone_number AS new_organization_phone_number_81, t55.is_new_organization_prescribed AS is_new_organization_prescribed_82, t55.is_not_in_prescriber AS is_not_in_prescriber_83, t55.new_prescriber_legal_name AS new_prescriber_legal_name_84, t55.new_prescriber_vatid AS new_prescriber_vatid_85, t55.new_prescriber_user_email AS new_prescriber_user_email_86, t55.is_attached_to_prescriber AS is_attached_to_prescriber_87, t55.is_paid_by_stripe AS is_paid_by_stripe_88, t55.organization_id AS organization_id_89, t55.new_organization_address_id AS new_organization_address_id_90, t55.invoice_id AS invoice_id_91, t55.prescriber_id AS prescriber_id_92, t55.new_prescriber_address_id AS new_prescriber_address_id_93, t55.discount_code_id AS discount_code_id_94, t0.prescriber_id AS prescriber_id_95, t0.new_prescriber_address_id AS new_prescriber_address_id_96, t97.id AS id_98, t97.created_at AS created_at_99, t97.updated_at AS updated_at_100, t97.is_done AS is_done_101, t97.comment AS comment_102, t97.npai AS npai_103, t97.price_without_tax AS price_without_tax_104, t97.tracking_number AS tracking_number_105, t97.price AS price_106, t97.days_keep AS days_keep_107, t97.organization_id AS organization_id_108, t97.invoice_id AS invoice_id_109, t0.invoice_parent_id AS invoice_parent_id_110, t111.id AS id_112, t111.created_at AS created_at_113, t111.updated_at AS updated_at_114, t111.confirmation_number AS confirmation_number_115, t111.status AS status_116, t111.period_start AS period_start_117, t111.period_end AS period_end_118, t111.period_length AS period_length_119, t111.vatrate AS vatrate_120, t111.price_without_tax AS price_without_tax_121, t111.object AS object_122, t111.path AS path_123, t111.price AS price_124, t111.payment_recurrence AS payment_recurrence_125, t111.new_organization_legal_name AS new_organization_legal_name_126, t111.new_organization_vatid AS new_organization_vatid_127, t111.is_new_organization AS is_new_organization_128, t111.is_prescriber AS is_prescriber_129, t111.total_paid AS total_paid_130, t111.new_organization_user_email AS new_organization_user_email_131, t111.is_sent AS is_sent_132, t111.sent_date AS sent_date_133, t111.sent_to AS sent_to_134, t111.number AS number_135, t111.total_refund AS total_refund_136, t111.is_canceled AS is_canceled_137, t111.discount_without_tax AS discount_without_tax_138, t111.discount_without_tax_percent AS discount_without_tax_percent_139, t111.is_imported AS is_imported_140, t111.is_domiciliation AS is_domiciliation_141, t111.payment_url AS payment_url_142, t111.reference AS reference_143, t111.remaining_to_pay AS remaining_to_pay_144, t111.total_refunded_payment AS total_refunded_payment_145, t111.marge AS marge_146, t111.is_new_organization_prescribed AS is_new_organization_prescribed_147, t111.is_not_in_prescriber AS is_not_in_prescriber_148, t111.new_prescriber_legal_name AS new_prescriber_legal_name_149, t111.new_prescriber_vatid AS new_prescriber_vatid_150, t111.new_prescriber_user_email AS new_prescriber_user_email_151, t111.is_attached_to_prescriber AS is_attached_to_prescriber_152, t111.invoice_type AS invoice_type_153, t111.reference_stripe AS reference_stripe_154, t111.new_organization_phone_number AS new_organization_phone_number_155, t111.payment_deadline AS payment_deadline_156, t111.is_template AS is_template_157, t111.unique_key AS unique_key_158, t111.is_paid_by_stripe AS is_paid_by_stripe_159, t111.is_pack_invoice AS is_pack_invoice_160, t111.sync_billing_report AS sync_billing_report_161, t111.external_id AS external_id_162, t111.organization_id AS organization_id_163, t111.user_id AS user_id_164, t111.new_organization_address_id AS new_organization_address_id_165, t111.prescriber_id AS prescriber_id_166, t111.new_prescriber_address_id AS new_prescriber_address_id_167, t111.invoice_parent_id AS invoice_parent_id_168, t111.discount_code_id AS discount_code_id_169, t0.discount_code_id AS discount_code_id_170 FROM invoice t0 LEFT JOIN quote t55 ON t55.invoice_id = t0.id LEFT JOIN letter_forward t97 ON t97.invoice_id = t0.id LEFT JOIN invoice t111 ON t111.invoice_parent_id = t0.id WHERE t0.organization_id = 27889;
|