SET @germanLanguageId = (SELECT id FROM language WHERE name = 'Deutsch');
SET @versionId = 0x0FA91CE3E96A4BC2BE4BD9CE752C3425;
SET @salesChannelStorefrontId = (SELECT sc.id FROM sales_channel sc INNER JOIN sales_channel_translation sct ON sc.id = sct.sales_channel_id WHERE sct.name = 'Storefront');
SET @defaultTaxId = (SELECT id FROM tax WHERE tax_rate = 19.00 LIMIT 1);

INSERT INTO `customer` (email, `id`, customer_group_id, default_payment_method_id, language_id, default_billing_address_id, default_shipping_address_id, customer_number, first_name, last_name, active, guest, order_count, created_at, sales_channel_id, salutation_id, password) VALUES
('debtor2@example.com', 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, (SELECT id FROM customer_group WHERE display_gross = 0 ORDER BY id DESC LIMIT 1), (SELECT id FROM payment_method where active = 1 LIMIT 1), @germanLanguageId, 0x00BCD5B03167423699473BF08FFAE015, 0x00BCD5B03167423699473BF08FFAE016, '2324', 'Max', 'Mustermann', 1, 0, 0, NOW(), @salesChannelStorefrontId, (SELECT id FROM salutation WHERE salutation_key = 'mr'), '$2y$10$18yNn.r/GWMkXXPQUFQWSuA49WitfuW4ckdrD4kKLMpjmPDiTSG/6')
  ,('debtor@example.com', 0xCFBD5018D38D41D8ADCA10D94FC8BDD7, (SELECT id FROM customer_group WHERE display_gross = 0 ORDER BY id DESC LIMIT 1), (SELECT id FROM payment_method where active = 1 LIMIT 1), @germanLanguageId, 0x00BCD5B03167423699473BF08FFAE002, 0x00BCD5B03167423699473BF08FFAE003, '1324', 'Max', 'Mustermann', 1, 0, 0, NOW(), @salesChannelStorefrontId, (SELECT id FROM salutation WHERE salutation_key = 'mr'), '$2y$10$18yNn.r/GWMkXXPQUFQWSuA49WitfuW4ckdrD4kKLMpjmPDiTSG/6')
  ,('contact1@example.com', 0xCFBD5018D38D41D8ADCA10D94FC8BDD8, (SELECT id FROM customer_group WHERE display_gross = 0 ORDER BY id DESC LIMIT 1), (SELECT id FROM payment_method where active = 1 LIMIT 1), @germanLanguageId, 0x00BCD5B03167423699473BF08FFAE002, 0x00BCD5B03167423699473BF08FFAE003, '3234', 'Max', 'Contact1', 1, 0, 0, NOW(), @salesChannelStorefrontId, (SELECT id FROM salutation WHERE salutation_key = 'mr'), '$2y$10$18yNn.r/GWMkXXPQUFQWSuA49WitfuW4ckdrD4kKLMpjmPDiTSG/6')
  ,('contact2@example.com', 0xCFBD5018D38D41D8ADCA10D94FC8BDE1, (SELECT id FROM customer_group WHERE display_gross = 0 ORDER BY id DESC LIMIT 1), (SELECT id FROM payment_method where active = 1  LIMIT 1), @germanLanguageId, 0x00BCD5B03167423699473BF08FFAE002, 0x00BCD5B03167423699473BF08FFAE003, '4234', 'Max', 'Contact2', 1, 0, 0, NOW(), @salesChannelStorefrontId, (SELECT id FROM salutation WHERE salutation_key = 'mr'), '$2y$10$18yNn.r/GWMkXXPQUFQWSuA49WitfuW4ckdrD4kKLMpjmPDiTSG/6')
  ,('contact3@example.com', 0xCFBD5018D38D41D8ADCA10D94FC8BDE2, (SELECT id FROM customer_group WHERE display_gross = 0 ORDER BY id DESC LIMIT 1), (SELECT id FROM payment_method where active = 1 LIMIT 1), @germanLanguageId, 0x00BCD5B03167423699473BF08FFAE002, 0x00BCD5B03167423699473BF08FFAE003, '5234', 'Max', 'Contact3', 1, 0, 0, NOW(), @salesChannelStorefrontId, (SELECT id FROM salutation WHERE salutation_key = 'mr'), '$2y$10$18yNn.r/GWMkXXPQUFQWSuA49WitfuW4ckdrD4kKLMpjmPDiTSG/6')
  ,('contact11@example.com', 0xCFBD5018D38D41D8ADCA10D94FC8BDE3, (SELECT id FROM customer_group WHERE display_gross = 0 ORDER BY id DESC LIMIT 1), (SELECT id FROM payment_method where active = 1 LIMIT 1), @germanLanguageId, 0x00BCD5B03167423699473BF08FFAE015, 0x00BCD5B03167423699473BF08FFAE016, '6234', 'Max', 'Contact11', 1, 0, 0, NOW(), @salesChannelStorefrontId, (SELECT id FROM salutation WHERE salutation_key = 'mr'), '$2y$10$18yNn.r/GWMkXXPQUFQWSuA49WitfuW4ckdrD4kKLMpjmPDiTSG/6')
  ,('salesrepresentative@example.com', 0xCFBD5018D38D41D8ADCA10D94FC8BDDA, (SELECT id FROM customer_group WHERE display_gross = 0 ORDER BY id DESC LIMIT 1), (SELECT id FROM payment_method where active = 1 LIMIT 1), @germanLanguageId, 0x00BCD5B03167423699473BF08FFAE041, 0x00BCD5B03167423699473BF08FFAE041, '7234', 'Max', 'Sales representative', 1, 0, 0, NOW(), @salesChannelStorefrontId, (SELECT id FROM salutation WHERE salutation_key = 'mr'), '$2y$10$18yNn.r/GWMkXXPQUFQWSuA49WitfuW4ckdrD4kKLMpjmPDiTSG/6')
;

INSERT INTO b2b_customer_data (customer_id, is_debtor, is_sales_representative, created_at) VALUES
(0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 1, 0, NOW())
,(0xCFBD5018D38D41D8ADCA10D94FC8BDD7, 1, 0, NOW())
,(0xCFBD5018D38D41D8ADCA10D94FC8BDD8, 0, 0, NOW())
,(0xCFBD5018D38D41D8ADCA10D94FC8BDE1, 0, 0, NOW())
,(0xCFBD5018D38D41D8ADCA10D94FC8BDE2, 0, 0, NOW())
,(0xCFBD5018D38D41D8ADCA10D94FC8BDE3, 0, 0, NOW())
,(0xCFBD5018D38D41D8ADCA10D94FC8BDDA, 0, 1, NOW())
;

INSERT INTO `customer_address` (id, customer_id, company, department, title, first_name, last_name, street, zipcode, city, phone_number, country_id, country_state_id, salutation_id, additional_address_line1, additional_address_line2, custom_fields, created_at, updated_at) VALUES
(0x00BCD5B03167423699473BF08FFAE002, 0xCFBD5018D38D41D8ADCA10D94FC8BDD7, 'Debtor 1 GmbH', 'Purchasing', null, 'Max', 'Mustermann', 'Musterstr. 1', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE003, 0xCFBD5018D38D41D8ADCA10D94FC8BDD7, 'Debtor 2 GmbH', 'Purchasing', null, 'Max', 'Kundengruppe-Netto', 'Musterstr. 2', '55555', 'Musterstadt', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE004, 0xCFBD5018D38D41D8ADCA10D94FC8BDD7, 'Debtor 3 GmbH', 'Ankauf', null, 'Max', 'Mustermann', 'Musterstr. 3', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE005, 0xCFBD5018D38D41D8ADCA10D94FC8BDD7, 'Debtor 4 GmbH', 'Ankauf', null, 'Max', 'Mustermann', 'Musterstr. 4', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE006, 0xCFBD5018D38D41D8ADCA10D94FC8BDD7, 'Debtor 5 GmbH', 'Ankauf', null, 'Max', 'Mustermann', 'Musterstr. 5', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE007, 0xCFBD5018D38D41D8ADCA10D94FC8BDD7, 'Debtor 6 GmbH', 'Ankauf', null, 'Max', 'Mustermann', 'Musterstr. 6', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE008, 0xCFBD5018D38D41D8ADCA10D94FC8BDD7, 'Debtor 7 GmbH', 'Ankauf', null, 'Max', 'Mustermann', 'Musterstr. 7a', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE009, 0xCFBD5018D38D41D8ADCA10D94FC8BDD7, 'Debtor 8 GmbH', 'Ankauf', null, 'Max', 'Mustermann', 'Musterstr. 7b', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE010, 0xCFBD5018D38D41D8ADCA10D94FC8BDD7, 'Debtor 9 GmbH', 'Ankauf', null, 'Max', 'Mustermann', 'Musterstr. 8', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE011, 0xCFBD5018D38D41D8ADCA10D94FC8BDD7, 'Debtor 10 GmbH', 'Ankauf', null, 'Max', 'Mustermann', 'Musterstr. 9', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE012, 0xCFBD5018D38D41D8ADCA10D94FC8BDD7, 'Debtor 11 GmbH', 'Ankauf', null, 'Max', 'Mustermann', 'Musterstr. 10', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE013, 0xCFBD5018D38D41D8ADCA10D94FC8BDD7, 'Debtor 12 GmbH', 'Ankauf', null, 'Max', 'Mustermann', 'Musterstr. 11', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE014, 0xCFBD5018D38D41D8ADCA10D94FC8BDD7, 'Debtor 13 GmbH', 'Purchasing', null, 'Max', 'Mustermann', 'Musterstr. 12', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE015, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 14 GmbH', 'Purchasing', null, 'Max', 'Mustermann', 'Max-Musterstr. 1', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE016, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 15 GmbH', 'Purchasing', null, 'Max', 'Kundengruppe-Netto', 'Max-Musterstr. 2', '55555', 'Musterstadt', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE017, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 16 GmbH', 'Ankauf', null, 'Max', 'Mustermann', 'Max-Musterstr. 3', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE018, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 17 GmbH', 'Ankauf', null, 'Max', 'Mustermann', 'Max-Musterstr. 4', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE019, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 18 GmbH', 'Ankauf', null, 'Max', 'Mustermann', 'Max-Musterstr. 5', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE020, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 19 GmbH', 'Ankauf', null, 'Max', 'Mustermann', 'Max-Musterstr. 6', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE021, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 20 GmbH', 'Ankauf', null, 'Max', 'Mustermann', 'Max-Musterstr. 7a', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE022, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 21 GmbH', 'Ankauf', null, 'Max', 'Mustermann', 'Max-Musterstr. 7b', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE023, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 22 GmbH', 'Ankauf', null, 'Max', 'Mustermann', 'Max-Musterstr. 8', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE024, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 23 GmbH', 'Ankauf', null, 'Max', 'Mustermann', 'Max-Musterstr. 9', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE025, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 24 GmbH', 'Ankauf', null, 'Max', 'Mustermann', 'Max-Musterstr. 10', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE026, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 25 GmbH', 'Ankauf', null, 'Max', 'Mustermann', 'Max-Musterstr. 11', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE027, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 26 GmbH', 'Purchasing', null, 'Max', 'Mustermann', 'Max-Musterstr. 12', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE028, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 27 GmbH', 'Purchasing', null, 'Sarah', 'Mustermann', 'Sarah-Musterstr. 1', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mrs'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE029, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 28 GmbH', 'Purchasing', null, 'Sarah', 'Kundengruppe-Netto', 'Sarah-Musterstr. 2', '55555', 'Musterstadt', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mrs'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE030, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 29 GmbH', 'Ankauf', null, 'Sarah', 'Mustermann', 'Sarah-Musterstr. 3', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mrs'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE031, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 30 GmbH', 'Ankauf', null, 'Sarah', 'Mustermann', 'Sarah-Musterstr. 4', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mrs'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE032, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 31 GmbH', 'Ankauf', null, 'Sarah', 'Mustermann', 'Sarah-Musterstr. 5', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mrs'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE033, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 32 GmbH', 'Ankauf', null, 'Sarah', 'Mustermann', 'Sarah-Musterstr. 6', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mrs'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE034, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 33 GmbH', 'Ankauf', null, 'Sarah', 'Mustermann', 'Sarah-Musterstr. 7a', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mrs'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE035, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 34 GmbH', 'Ankauf', null, 'Sarah', 'Mustermann', 'Sarah-Musterstr. 7b', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mrs'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE036, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 35 GmbH', 'Ankauf', null, 'Sarah', 'Mustermann', 'Sarah-Musterstr. 8', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mrs'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE037, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 36 GmbH', 'Ankauf', null, 'Sarah', 'Mustermann', 'Sarah-Musterstr. 9', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mrs'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE038, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 37 GmbH', 'Ankauf', null, 'Sarah', 'Mustermann', 'Sarah-Musterstr. 10', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mrs'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE039, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 38 GmbH', 'Ankauf', null, 'Sarah', 'Mustermann', 'Sarah-Musterstr. 11', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mrs'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE040, 0xCFBD5018D38D41D8ADCA10D94FC8BDD6, 'Debtor 39 GmbH', 'Purchasing', null, 'Sarah', 'Mustermann', 'Sarah-Musterstr. 12', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mrs'), null, null, null, NOW(), null)
,(0x00BCD5B03167423699473BF08FFAE041, 0xCFBD5018D38D41D8ADCA10D94FC8BDDA, 'SR 1 GmbH', 'Sales', null, 'Sales', 'Representative', 'Sales-Musterstr. 12', '55555', 'Musterhausen', '05555 / 555555', (SELECT id FROM country WHERE iso3 = 'DEU'), null, (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, null, null, NOW(), null)
;

INSERT INTO b2b_store_front_auth (`id`, `context_owner_id`, `provider_key`, `provider_context`) VALUES
(1, 1, 'Shopware\\B2B\\Debtor\\Framework\\DebtorRepositoryInterface', LOWER(HEX(0xCFBD5018D38D41D8ADCA10D94FC8BDD7)))
,(2, 1, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 11)
,(3, 1, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 22)
,(4, 1, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 33)
,(5, 1, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 44)
,(6, 1, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 55)
,(7, 1, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 66)
,(8, 1, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 77)
,(9, 1, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 88)
,(10, 1, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 99)
,(30, 30, 'Shopware\\B2B\\Debtor\\Framework\\DebtorRepositoryInterface', LOWER(HEX(0xCFBD5018D38D41D8ADCA10D94FC8BDD6)))
,(32, 30, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 101)
,(33, 30, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 102)
,(34, 30, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 103)
,(35, 30, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 104)
,(36, 30, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 105)
,(37, 30, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 106)
,(38, 30, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 107)
,(39, 30, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 108)
,(41, 30, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 109)
,(42, 30, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 115)
,(43, 30, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 116)
,(44, 1, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 117)
,(45, 1, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 118)
,(46, 1, 'Shopware\\B2B\\Contact\\Framework\\ContactRepository', 119)
;

INSERT INTO b2b_customer_address_data (address_id, b2b_type, created_at) VALUES
(0x00BCD5B03167423699473BF08FFAE002,'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE003, 'shipping', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE004, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE005, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE006, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE007, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE008, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE009, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE010, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE011, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE012, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE013, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE014, 'shipping', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE015, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE016, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE017, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE018, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE019, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE020, 'shipping', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE021, 'shipping', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE022, 'shipping', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE023, 'shipping', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE024, 'shipping', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE025, 'shipping', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE026, 'shipping', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE027, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE028, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE029, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE030, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE031, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE032, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE033, 'billing', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE034, 'shipping', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE035, 'shipping', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE036, 'shipping', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE037, 'shipping', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE038, 'shipping', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE039, 'shipping', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE040, 'shipping', NOW())
  ,(0x00BCD5B03167423699473BF08FFAE041, null, NOW())
;

INSERT INTO b2b_debtor_contact (id,password,encoder,email,active,`language`,title,salutation,firstname,lastname,department,context_owner_id, auth_id) VALUES
(11,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact1@example.com',1,(select id from language limit 1),null,'mr','Tom','Contact1',null,1, 2)
  ,(22,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact2@example.com',1,(select id from language limit 1),null,'mr','Tom','Contact2',null,1, 3)
  ,(33,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact3@example.com',1,(select id from language limit 1),null,'mr','Max','Contact3',null,1, 4)
  ,(44,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact4@example.com',1,(select id from language limit 1),null,'mr','Max','Contact4',null,1, 5)
  ,(55,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact5@example.com',1,(select id from language limit 1),null,'mr','Max','Contact5',null,1, 6)
  ,(66,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact6@example.com',1,(select id from language limit 1),null,'mr','Max','Contact6',null,1, 7)
  ,(77,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact7@example.com',1,(select id from language limit 1),null,'mr','Max','Contact7',null,1, 8)
  ,(88,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact8@example.com',1,(select id from language limit 1),null,'mr','Max','Contact8',null,1, 9)
  ,(99,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact9@example.com',0,(select id from language limit 1),null,'mr','Max','Contact9',null,1, 10)
  ,(101,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact11@example.com',1,(select id from language limit 1),null,'mr','Max','Contact11',null,30, 32)
  ,(102,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact12@example.com',1,(select id from language limit 1),null,'mr','Max','Contact12',null,30, 33)
  ,(103,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact13@example.com',1,(select id from language limit 1),null,'mr','Max','Contact13',null,30, 34)
  ,(104,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact14@example.com',1,(select id from language limit 1),null,'mr','Max','Contact14',null,30, 35)
  ,(105,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact15@example.com',1,(select id from language limit 1),null,'mr','Max','Contact15',null,30, 36)
  ,(106,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact16@example.com',1,(select id from language limit 1),null,'mr','Max','Contact16',null,30, 37)
  ,(107,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact17@example.com',1,(select id from language limit 1),null,'mr','Max','Contact17',null,30, 38)
  ,(108,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact18@example.com',1,(select id from language limit 1),null,'mr','Max','Contact18',null,30, 39)
  ,(109,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact19@example.com',1,(select id from language limit 1),null,'mr','Max','Contact19',null,30, 41)
  ,(115,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact20@example.com',1,(select id from language limit 1),null,'mr','Max','Contact20',null,30, 42)
  ,(116,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact21@example.com',0,(select id from language limit 1),null,'mr','Max','Contact21',null,30, 43)
  ,(117,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact22@example.com',0,(select id from language limit 1),null,'mr','Max','Contact22',null,1, 44)
  ,(118,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact23@example.com',0,(select id from language limit 1),null,'mr','Max','Contact23',null,1, 45)
  ,(119,'$2y$10$uERrYD.PZfr6R4kg12RdVuyPyoBJ/no8Il/oHeGpO5TPrt5kvZRxi','platform','contact24@example.com',0,(select id from language limit 1),null,'mr','Max','Contact24',null,1, 46)
;

INSERT INTO b2b_role (id, `name`, `context_owner_id`, `left`, `right`, `level`) VALUES
(  5,'root',  1,  1, 24, 0)
 ,( 66,'All listing routes ',1,  2,  3, 1)
 ,( 70,'All listings and detail routes',1,  4,  5, 1)
 ,( 73,'All routes',1,  6,  7, 1)
 ,( 72,'All listings, details and updates', 1,  8,  9, 1)
 ,(147,'All listings, details, updates and assigns',1, 10, 11, 1)
 ,(150,'All Shipping Addresses',1, 12, 13, 1)
 ,(152,'All Billing Addresses', 1, 14, 15, 1)
 ,(157,'1/2 Billing Addresses', 1, 16, 17, 1)
 ,(158,'All contingents',1, 18, 19, 1)
 ,(162,'Most Budgets',  1, 20, 21, 1)
 ,(163,'All contacts',  1, 22, 23, 1)
 ,(  8,'root', 30,  1, 26, 0)
 ,(149,'All listing routes',30,  2,  3, 1)
 ,(148,'All listings and detail routes',30,  4,  5, 1)
 ,(144,'All Routes',30,  6,  7, 1)
 ,(145,'All listings, details and updates',30,  8,  9, 1)
 ,(146,'All listings, details, updates and assigns',30, 10, 11, 1)
 ,(151,'All Shipping Addresses',30, 12, 13, 1)
 ,(153,'All Billing Addresses',30, 14, 15, 1)
 ,(154,'1/2 Shipping Addresses',30, 16, 17, 1)
 ,(156,'1/2 Billing Addresses',30, 18, 19, 1)
 ,(159,'All Quarter Contingents',  30, 20, 21, 1)
 ,(160,'All Month Contingents',30, 22, 23, 1)
 ,(161,'All Day Contingents',  30, 24, 25, 1)
;

INSERT INTO b2b_role_contact (id,role_id,debtor_contact_id) VALUES
(117, 70, 22)
 ,(36, 72, 44)
 ,(100, 73, 11)
 ,(89, 73, 55)
 ,(103, 144, 101)
 ,(108, 148, 102)
 ,(111, 148, 103)
 ,(106, 150, 11)
 ,(105, 151, 101)
 ,(107, 152, 11)
 ,(104, 153, 101)
 ,(110, 154, 102)
 ,(113, 154, 103)
 ,(109, 156, 102)
 ,(112, 156, 103)
 ,(118, 157, 22)
 ,(116, 158, 11)
 ,(114, 159, 103)
 ,(115, 161, 103)
 ,(119, 162, 11)
 ,(120, 163, 11)
;

INSERT INTO b2b_acl_role_address (id,entity_id,referenced_entity_id,grantable) VALUES
(22,150,0x00BCD5B03167423699473BF08FFAE003,1)
,(21,151,0x00BCD5B03167423699473BF08FFAE020,1)
,(20,151,0x00BCD5B03167423699473BF08FFAE021,1)
,(19,151,0x00BCD5B03167423699473BF08FFAE022,1)
,(18,151,0x00BCD5B03167423699473BF08FFAE023,1)
,(17,151,0x00BCD5B03167423699473BF08FFAE024,1)
,(16,151,0x00BCD5B03167423699473BF08FFAE025,1)
,(15,151,0x00BCD5B03167423699473BF08FFAE026,1)
,(13,151,0x00BCD5B03167423699473BF08FFAE027,1)
,(12,151,0x00BCD5B03167423699473BF08FFAE036,1)
,(14,151,0x00BCD5B03167423699473BF08FFAE037,1)
,(11,151,0x00BCD5B03167423699473BF08FFAE038,1)
,(10,151,0x00BCD5B03167423699473BF08FFAE039,1)
,(9,151,0x00BCD5B03167423699473BF08FFAE040,1)
,(8,151,0x00BCD5B03167423699473BF08FFAE041,1)
,(34,152,0x00BCD5B03167423699473BF08FFAE002,1)
,(33,152,0x00BCD5B03167423699473BF08FFAE004,1)
,(32,152,0x00BCD5B03167423699473BF08FFAE005,1)
,(31,152,0x00BCD5B03167423699473BF08FFAE006,1)
,(30,152,0x00BCD5B03167423699473BF08FFAE007,1)
,(29,152,0x00BCD5B03167423699473BF08FFAE008,1)
,(28,152,0x00BCD5B03167423699473BF08FFAE009,1)
,(25,152,0x00BCD5B03167423699473BF08FFAE010,1)
,(26,152,0x00BCD5B03167423699473BF08FFAE011,1)
,(24,152,0x00BCD5B03167423699473BF08FFAE028,1)
,(27,152,0x00BCD5B03167423699473BF08FFAE012,1)
,(23,152,0x00BCD5B03167423699473BF08FFAE013,1)
,(46,153,0x00BCD5B03167423699473BF08FFAE014,1)
,(45,153,0x00BCD5B03167423699473BF08FFAE015,1)
,(44,153,0x00BCD5B03167423699473BF08FFAE016,1)
,(42,153,0x00BCD5B03167423699473BF08FFAE017,1)
,(41,153,0x00BCD5B03167423699473BF08FFAE018,1)
,(43,153,0x00BCD5B03167423699473BF08FFAE028,1)
,(40,153,0x00BCD5B03167423699473BF08FFAE029,1)
,(39,153,0x00BCD5B03167423699473BF08FFAE030,1)
,(38,153,0x00BCD5B03167423699473BF08FFAE031,1)
,(37,153,0x00BCD5B03167423699473BF08FFAE032,1)
,(36,153,0x00BCD5B03167423699473BF08FFAE033,1)
,(35,153,0x00BCD5B03167423699473BF08FFAE034,1)
,(52,154,0x00BCD5B03167423699473BF08FFAE036,1)
,(51,154,0x00BCD5B03167423699473BF08FFAE037,1)
,(50,154,0x00BCD5B03167423699473BF08FFAE038,1)
,(49,154,0x00BCD5B03167423699473BF08FFAE039,1)
,(48,154,0x00BCD5B03167423699473BF08FFAE040,1)
,(47,154,0x00BCD5B03167423699473BF08FFAE041,1)
,(64,156,0x00BCD5B03167423699473BF08FFAE029,1)
,(63,156,0x00BCD5B03167423699473BF08FFAE030,1)
,(62,156,0x00BCD5B03167423699473BF08FFAE031,1)
,(61,156,0x00BCD5B03167423699473BF08FFAE032,1)
,(60,156,0x00BCD5B03167423699473BF08FFAE033,1)
,(59,156,0x00BCD5B03167423699473BF08FFAE034,1)
,(57,157,0x00BCD5B03167423699473BF08FFAE009,1)
,(56,157,0x00BCD5B03167423699473BF08FFAE010,1)
,(55,157,0x00BCD5B03167423699473BF08FFAE011,1)
,(58,157,0x00BCD5B03167423699473BF08FFAE028,1)
,(53,157,0x00BCD5B03167423699473BF08FFAE012,1)
,(54,157,0x00BCD5B03167423699473BF08FFAE013,1)
;

INSERT INTO b2b_acl_role_route_privilege (entity_id,referenced_entity_id,grantable)
(SELECT 144 AS entity_id, id AS referenced_entity_id, 1 AS grantable FROM b2b_acl_route_privilege) UNION
(SELECT 73 AS entity_id, id AS referenced_entity_id, 1 AS grantable FROM b2b_acl_route_privilege) UNION
(SELECT 66 AS entity_id, id AS referenced_entity_id, 1 AS grantable FROM b2b_acl_route_privilege WHERE privilege_type LIKE 'list') UNION
(SELECT 149 AS entity_id, id AS referenced_entity_id, 1 AS grantable FROM b2b_acl_route_privilege WHERE privilege_type LIKE 'list') UNION
(SELECT 70 AS entity_id, id AS referenced_entity_id, 1 AS grantable FROM b2b_acl_route_privilege WHERE privilege_type LIKE 'list' OR privilege_type LIKE 'detail') UNION
(SELECT 148 AS entity_id, id AS referenced_entity_id, 1 AS grantable FROM b2b_acl_route_privilege WHERE privilege_type LIKE 'list' OR privilege_type LIKE 'detail') UNION
(SELECT 72 AS entity_id, id AS referenced_entity_id, 1 AS grantable FROM b2b_acl_route_privilege WHERE privilege_type LIKE 'list' OR privilege_type LIKE 'detail' OR privilege_type LIKE 'update') UNION
(SELECT 145 AS entity_id, id AS referenced_entity_id, 1 AS grantable FROM b2b_acl_route_privilege WHERE privilege_type LIKE 'list' OR privilege_type LIKE 'detail' OR privilege_type LIKE 'update') UNION
(SELECT 146 AS entity_id, id AS referenced_entity_id, 1 AS grantable FROM b2b_acl_route_privilege WHERE privilege_type LIKE 'list' OR privilege_type LIKE 'detail' OR privilege_type LIKE 'update' OR privilege_type LIKE 'assign') UNION
(SELECT 147 AS entity_id, id AS referenced_entity_id, 1 AS grantable FROM b2b_acl_route_privilege WHERE privilege_type LIKE 'list' OR privilege_type LIKE 'detail' OR privilege_type LIKE 'update' OR privilege_type LIKE 'assign')
;

INSERT INTO b2b_acl_role_contact (entity_id,referenced_entity_id,grantable) (
  SELECT *, 1 AS grantable FROM (
    (SELECT 163 AS entity_id, id AS referenced_entity_id FROM b2b_debtor_contact)
    UNION DISTINCT
    (SELECT role_id AS entity_id, debtor_contact_id AS referenced_entity_id FROM b2b_role_contact)
  ) AS role_contact
);

INSERT INTO `b2b_contingent_group` (`id`, `context_owner_id`, `name`, `description`) VALUES
 (6, 30, 'Distribution', 'Distribution 251')
,(7, 30, 'Purchasing', 'Purchasing 251')
,(17, 1, '2 Items, 2 Orders and 2.000 € a day', '2 Items, 2 Orders and 2.000 € a day')
,(19, 1, '10.000 € each month', '10.000 € each month')
,(20, 30, '10.000 € each month', '10.000 € each month')
,(21, 1, '10 Orders each month', '10 Orders each month')
,(22, 30, '2 Items', '2 Items a day')
,(23, 30, '2 Orders', '2 Orders a day')
,(24, 30, '1337 € ', '1337 € a day')
,(25, 30, '5 Items', '5 Items each Week')
,(26, 30, '5 Orders', '5 Orders each Week')
,(27, 30, '5.000 € ', '5.000 € each Week ')
,(28, 30, '15 Items', '15 Items im Quarter')
,(29, 30, '15 Orders', '15 Orders im Quarter')
,(30, 30, '15.000 €', '15.000 € im Quarter')
;

INSERT INTO `b2b_contingent_group_rule` (`id`, `contingent_group_id`, `type`) VALUES
 (29, 17, 'OrderAmount')
,(30, 17, 'OrderItemQuantity')
,(31, 17, 'OrderQuantity')
,(35, 19, 'OrderAmount')
,(36, 20, 'OrderAmount')
,(37, 21, 'OrderQuantity')
,(38, 22, 'OrderItemQuantity')
,(39, 23, 'OrderQuantity')
,(40, 24, 'OrderAmount')
,(41, 25, 'OrderItemQuantity')
,(42, 26, 'OrderQuantity')
,(43, 27, 'OrderAmount')
,(44, 28, 'OrderItemQuantity')
,(45, 29, 'OrderQuantity')
,(46, 30, 'OrderAmount')
,(47, 19, 'Category')
;

INSERT INTO `b2b_contingent_group_rule_time_restriction` (`contingent_rule_id`, `time_restriction`, `value`, `currency_factor`) VALUES
 (29, 'DAYOFYEAR', 2000.00, 1)
,(30, 'DAYOFYEAR', 2.00, 1)
,(31, 'DAYOFYEAR', 2.00, 1)
,(35, 'MONTH', 10000.00, 1)
,(36, 'MONTH', 10000.00, 1)
,(37, 'MONTH', 10.00, 1)
,(38, 'DAYOFYEAR', 2.00, 1)
,(39, 'DAYOFYEAR', 2.00, 1)
,(40, 'DAYOFYEAR', 1337.00, 1)
,(41, 'YEARWEEK', 5.00, 1)
,(42, 'YEARWEEK', 5.00, 1)
,(43, 'YEARWEEK', 5000.00, 1)
,(44, 'QUARTER', 15.00, 1)
,(45, 'QUARTER', 15.00, 1)
,(46, 'QUARTER', 15000.00, 1)
;

INSERT INTO `b2b_contingent_group_rule_category` (`contingent_rule_id`, `category_id`) VALUES
 (47, (SELECT `id` FROM `category` WHERE `parent_id` IS NOT NULL AND `level` = 2 LIMIT 1))
;

INSERT INTO `b2b_role_contingent_group` (`id`, `role_id`, `contingent_group_id`) VALUES
 (3, 158, 19)
,(4, 158, 17)
,(6, 158, 21)
,(7, 159, 28)
,(8, 159, 29)
,(9, 159, 30)
,(13, 160, 20)
,(15, 161, 22)
,(14, 161, 23)
,(16, 161, 24)
;

INSERT INTO `b2b_acl_role_contingent_group` (`id`, `entity_id`, `referenced_entity_id`, `grantable`) VALUES
 (1, 158, 19, 1)
,(2, 159, 28, 1)
,(3, 159, 29, 1)
,(4, 159, 30, 1)
,(5, 160, 20, 0)
,(7, 161, 22, 0)
,(6, 161, 23, 0)
,(8, 161, 24, 0)
,(9, 158, 17, 1)
,(11, 158, 21, 1)
;

INSERT INTO `b2b_contact_contingent_group` VALUES
 (106, 22, 17)
,(105, 101, 28)
,(103, 101, 29)
,(104, 101, 30)
,(102, 102, 22)
,(101, 102, 23)
,(100, 102, 24)
;

INSERT INTO `b2b_acl_contact_address` VALUES
 (7, 22, 0x00BCD5B03167423699473BF08FFAE003, 0)
;

INSERT INTO `b2b_acl_contact_contingent_group` VALUES
 (13, 22, 17, 0)
,(12, 101, 28, 1)
,(10, 101, 29, 1)
,(11, 101, 30, 1)
,(9, 102, 22, 0)
,(8, 102, 23, 0)
,(7, 102, 24, 0)
;

INSERT INTO `order` (id, version_id, state_id, order_number, currency_id, language_id, currency_factor, sales_channel_id, billing_address_id, billing_address_version_id, price, order_date_time, shipping_costs, deep_link_code, custom_fields, created_at, updated_at) VALUES
(0xDD09717EB8AA4613B274543B95B1B187,  @versionId, (SELECT sms.id FROM state_machine sm INNER JOIN state_machine_state sms ON sm.id = sms.state_machine_id WHERE sm.technical_name = 'order.state' AND sms.technical_name = 'open'), '10060', (SELECT id FROM currency WHERE iso_code = 'EUR'), @germanLanguageId, 1, @salesChannelStorefrontId, 0xC1CF1C3C65E04666A8D60710FE179829, @versionId, '{"netPrice": 338.66, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "taxStatus": "gross", "totalPrice": 403, "positionPrice": 403, "calculatedTaxes": [{"tax": 64.34, "price": 403, "taxRate": 19, "extensions": []}]}', '2019-08-20 00:00:00', '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 0, "totalPrice": 0, "calculatedTaxes": [{"tax": 0, "price": 0, "taxRate": 19, "extensions": []}]}', 'Rf5OAhtX5_4MR9SQaJGvsvW-VsNws0Pk', '{"b2b_auth_id":"2"}', NOW(), null)
# ,(0xDD09717EB8AA4613B274543B95B1B188,  @versionId, (SELECT sms.id FROM state_machine sm INNER JOIN state_machine_state sms ON sm.id = sms.state_machine_id WHERE sm.technical_name = 'order.state' AND sms.technical_name = 'orderclearance_open'), '10061', (SELECT id FROM currency WHERE iso_code = 'EUR'), @germanLanguageId, 1, @salesChannelStorefrontId, 0xC1CF1C3C65E04666A8D60710FE179829, @versionId, '{"netPrice": 338.66, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "taxStatus": "gross", "totalPrice": 403, "positionPrice": 403, "calculatedTaxes": [{"tax": 64.34, "price": 403, "taxRate": 19, "extensions": []}]}', '2019-08-20 00:00:00', '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 0, "totalPrice": 0, "calculatedTaxes": [{"tax": 0, "price": 0, "taxRate": 19, "extensions": []}]}', 'Rf5OAhtX5_4MR9SQaJGvsvW-VsNws1Pk', '{"b2b_auth_id":"2"}', NOW(), null)
# ,(0xDD09717EB8AA4613B274543B95B1B189,  @versionId, (SELECT sms.id FROM state_machine sm INNER JOIN state_machine_state sms ON sm.id = sms.state_machine_id WHERE sm.technical_name = 'order.state' AND sms.technical_name = 'orderclearance_denied'), '10062', (SELECT id FROM currency WHERE iso_code = 'EUR'), @germanLanguageId, 1, @salesChannelStorefrontId, 0xC1CF1C3C65E04666A8D60710FE179829, @versionId, '{"netPrice": 338.66, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "taxStatus": "gross", "totalPrice": 403, "positionPrice": 403, "calculatedTaxes": [{"tax": 64.34, "price": 403, "taxRate": 19, "extensions": []}]}', '2019-08-20 00:00:00', '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 0, "totalPrice": 0, "calculatedTaxes": [{"tax": 0, "price": 0, "taxRate": 19, "extensions": []}]}', 'Rf5OAhtX5_4MR9SQaJGvsvW-VsNws2Pk', '{"b2b_auth_id":"2"}', NOW(), null)
,(0xDD09717EB8AA4613B274543B95B1B190,  @versionId, (SELECT sms.id FROM state_machine sm INNER JOIN state_machine_state sms ON sm.id = sms.state_machine_id WHERE sm.technical_name = 'order.state' AND sms.technical_name = 'open'), '10063', (SELECT id FROM currency WHERE iso_code = 'EUR'), @germanLanguageId, 1, @salesChannelStorefrontId, 0xC1CF1C3C65E04666A8D60710FE179829, @versionId, '{"netPrice": 338.66, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "taxStatus": "gross", "totalPrice": 403, "positionPrice": 403, "calculatedTaxes": [{"tax": 64.34, "price": 403, "taxRate": 19, "extensions": []}]}', '2019-08-20 00:00:00', '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 0, "totalPrice": 0, "calculatedTaxes": [{"tax": 0, "price": 0, "taxRate": 19, "extensions": []}]}', 'Rf5OAhtX5_4MR9SQaJGvsvW-VsNws3Pk', '{"b2b_auth_id":"2"}', NOW(), null)
,(0xDD09717EB8AA4613B274543B95B1B191,  @versionId, (SELECT sms.id FROM state_machine sm INNER JOIN state_machine_state sms ON sm.id = sms.state_machine_id WHERE sm.technical_name = 'order.state' AND sms.technical_name = 'open'), '10064', (SELECT id FROM currency WHERE iso_code = 'EUR'), @germanLanguageId, 1, @salesChannelStorefrontId, 0xC1CF1C3C65E04666A8D60710FE179829, @versionId, '{"netPrice": 338.66, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "taxStatus": "gross", "totalPrice": 403, "positionPrice": 403, "calculatedTaxes": [{"tax": 64.34, "price": 403, "taxRate": 19, "extensions": []}]}', '2019-08-20 00:00:00', '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 0, "totalPrice": 0, "calculatedTaxes": [{"tax": 0, "price": 0, "taxRate": 19, "extensions": []}]}', 'Rf5OAhtX5_4MR9SQaJGvsvW-VsNws4Pk', '{"b2b_auth_id":"2"}', DATE_ADD(DATE_ADD(NOW(), INTERVAL -1 YEAR), INTERVAL -4 DAY), null)
,(0xDD09717EB8AA4613B274543B95B1B192,  @versionId, (SELECT sms.id FROM state_machine sm INNER JOIN state_machine_state sms ON sm.id = sms.state_machine_id WHERE sm.technical_name = 'order.state' AND sms.technical_name = 'open'), '10065', (SELECT id FROM currency WHERE iso_code = 'EUR'), @germanLanguageId, 1, @salesChannelStorefrontId, 0xC1CF1C3C65E04666A8D60710FE179829, @versionId, '{"netPrice": 338.66, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "taxStatus": "gross", "totalPrice": 403, "positionPrice": 403, "calculatedTaxes": [{"tax": 64.34, "price": 403, "taxRate": 19, "extensions": []}]}', '2019-08-20 00:00:00', '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 0, "totalPrice": 0, "calculatedTaxes": [{"tax": 0, "price": 0, "taxRate": 19, "extensions": []}]}', 'Rf5OAhtX5_4MR9SQaJGvsvW-VsNws5Pk', '{"b2b_auth_id":"2"}', DATE_ADD(DATE_ADD(NOW(), INTERVAL -1 MONTH), INTERVAL -2 DAY), null)
,(0xDD09717EB8AA4613B274543B95B1B193,  @versionId, (SELECT sms.id FROM state_machine sm INNER JOIN state_machine_state sms ON sm.id = sms.state_machine_id WHERE sm.technical_name = 'order.state' AND sms.technical_name = 'open'), '10066', (SELECT id FROM currency WHERE iso_code = 'EUR'), @germanLanguageId, 1, @salesChannelStorefrontId, 0xC1CF1C3C65E04666A8D60710FE179829, @versionId, '{"netPrice": 338.66, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "taxStatus": "gross", "totalPrice": 403, "positionPrice": 403, "calculatedTaxes": [{"tax": 64.34, "price": 403, "taxRate": 19, "extensions": []}]}', '2019-08-20 00:00:00', '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 0, "totalPrice": 0, "calculatedTaxes": [{"tax": 0, "price": 0, "taxRate": 19, "extensions": []}]}', 'Rf5OAhtX5_4MR9SQaJGvsvW-VsNws6Pk', '{"b2b_auth_id":"2"}', DATE_ADD(NOW(), INTERVAL -3 MONTH), null)
;

INSERT INTO order_transaction (id, version_id, order_id, order_version_id, state_id, payment_method_id, amount, custom_fields, created_at, updated_at) VALUES
(0x6F6CEC67850A46A991D881FFB2CCCC86, @versionId, 0xDD09717EB8AA4613B274543B95B1B187, @versionId, (SELECT sms.id FROM state_machine sm INNER JOIN state_machine_state sms ON sm.id = sms.state_machine_id WHERE sm.technical_name = 'order_transaction.state' AND sms.technical_name = 'open'), (SELECT id FROM payment_method LIMIT 1), '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 403, "totalPrice": 403, "calculatedTaxes": [{"tax": 64.34, "price": 403, "taxRate": 19, "extensions": []}]}', null, NOW(), null)
,(0x6F6CEC67850A46A991D881FFB2CCCC89, @versionId, 0xDD09717EB8AA4613B274543B95B1B190, @versionId, (SELECT sms.id FROM state_machine sm INNER JOIN state_machine_state sms ON sm.id = sms.state_machine_id WHERE sm.technical_name = 'order_transaction.state' AND sms.technical_name = 'paid'), (SELECT id FROM payment_method LIMIT 1), '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 403, "totalPrice": 403, "calculatedTaxes": [{"tax": 64.34, "price": 403, "taxRate": 19, "extensions": []}]}', null, NOW(), null)
,(0x6F6CEC67850A46A991D881FFB2CCCC90, @versionId, 0xDD09717EB8AA4613B274543B95B1B191, @versionId, (SELECT sms.id FROM state_machine sm INNER JOIN state_machine_state sms ON sm.id = sms.state_machine_id WHERE sm.technical_name = 'order_transaction.state' AND sms.technical_name = 'open'), (SELECT id FROM payment_method LIMIT 1), '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 403, "totalPrice": 403, "calculatedTaxes": [{"tax": 64.34, "price": 403, "taxRate": 19, "extensions": []}]}', null, DATE_ADD(DATE_ADD(NOW(), INTERVAL -1 YEAR), INTERVAL -4 DAY), null)
,(0x6F6CEC67850A46A991D881FFB2CCCC91, @versionId, 0xDD09717EB8AA4613B274543B95B1B192, @versionId, (SELECT sms.id FROM state_machine sm INNER JOIN state_machine_state sms ON sm.id = sms.state_machine_id WHERE sm.technical_name = 'order_transaction.state' AND sms.technical_name = 'open'), (SELECT id FROM payment_method WHERE handler_identifier = 'Shopware\\Core\\Checkout\\Payment\\Cart\\PaymentHandler\\PrePayment'), '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 403, "totalPrice": 403, "calculatedTaxes": [{"tax": 64.34, "price": 403, "taxRate": 19, "extensions": []}]}', null, DATE_ADD(DATE_ADD(NOW(), INTERVAL -1 MONTH), INTERVAL -2 DAY), null)
,(0x6F6CEC67850A46A991D881FFB2CCCC92, @versionId, 0xDD09717EB8AA4613B274543B95B1B193, @versionId, (SELECT sms.id FROM state_machine sm INNER JOIN state_machine_state sms ON sm.id = sms.state_machine_id WHERE sm.technical_name = 'order_transaction.state' AND sms.technical_name = 'paid'), (SELECT id FROM payment_method LIMIT 1), '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 403, "totalPrice": 403, "calculatedTaxes": [{"tax": 64.34, "price": 403, "taxRate": 19, "extensions": []}]}', null, DATE_ADD(NOW(), INTERVAL -3 MONTH), null)
;

INSERT INTO order_line_item (id, version_id, order_id, order_version_id, parent_id, parent_version_id, identifier, referenced_id, label, description, cover_id, quantity, type, payload, price_definition, price, stackable, removable, good, custom_fields, created_at, updated_at) VALUES
(0x7282473D4E9941A3BE1E39995E9C20AF, @versionId, 0xDD09717EB8AA4613B274543B95B1B187, @versionId, null, @versionId, HEX((SELECT id FROM product WHERE active = 1 LIMIT 1)), HEX((SELECT id FROM product WHERE active = 1 LIMIT 1)), 'product Name', null, null, 1, 'product', '{"tags": null, "categories": ["3d944603a8884ac0a3e2ec58083e27b9", "4e0c8421c58c4058a9736790902d22c4", "d9636a347cce4d2d90117841e787c6e9"], "properties": ["0607048968104391a422df384624498e", "09280388dc2d40cfa9fc323bf1ba328e", "0a6f2cd6fbbd4caeab6c2721dec075ae", "10d700daf9de4d3e8e220aae38c69180", "196d63f217984b51ab0535052a66acc0", "2128dd1601c84a0cb606395d4a6e41ec", "2bf26487d77441a696a68323cb96e6f7", "2d22b46c371d4ab9b55fa3b299ac2e1a", "31cc5fcf0fcb4b5e8116a58807887de7", "33163d22fe24485e84b09a9d112873be", "3553f980050b4c7baea41e6fe298a86c", "3a8866969cc44349b96c46ed4103e098", "3b9099a5f31d44e5b576b9c91e901283", "3eb129fc09064ba7b1149bff0409095d", "3ff544c93ca34ac19e1022c518f42365", "4029c7872f2d4921b52c27b087189709", "447a357f4b9448adaeda274ac49c7b35", "4f5ccf64c16f4210869a4e4131276b4f", "4fa11b79a5a143e48178e654f94b832d", "50c4b866cc1c4c12833b06f72d11bb60", "ee8b81e65f8c4f4b9b038f8db975efc7", "ef9d4f5f786a4bc99c2291e9b411b6d2", "fc2c563ed2d7464f995e2874bc6fa961", "fc525ea50c9c4cb8823805a071566f87"], "productNumber": "SW10022"}', '{"type": "quantity", "price": 403, "quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "precision": 2, "isCalculated": true}', '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 403, "totalPrice": 403, "calculatedTaxes": [{"tax": 64.34, "price": 403, "taxRate": 19, "extensions": []}]}', 1, 1, 1, null, NOW(), null)
,(0x7282473D4E9941A3BE1E39995E9C20B3, @versionId, 0xDD09717EB8AA4613B274543B95B1B190, @versionId, null, @versionId, HEX((SELECT id FROM product WHERE active = 1 LIMIT 1)), HEX((SELECT id FROM product WHERE active = 1 LIMIT 1)), 'product Name', null, null, 1, 'product', '{"tags": null, "categories": ["3d944603a8884ac0a3e2ec58083e27b9", "4e0c8421c58c4058a9736790902d22c4", "d9636a347cce4d2d90117841e787c6e9"], "properties": ["0607048968104391a422df384624498e", "09280388dc2d40cfa9fc323bf1ba328e", "0a6f2cd6fbbd4caeab6c2721dec075ae", "10d700daf9de4d3e8e220aae38c69180", "196d63f217984b51ab0535052a66acc0", "2128dd1601c84a0cb606395d4a6e41ec", "2bf26487d77441a696a68323cb96e6f7", "2d22b46c371d4ab9b55fa3b299ac2e1a", "31cc5fcf0fcb4b5e8116a58807887de7", "33163d22fe24485e84b09a9d112873be", "3553f980050b4c7baea41e6fe298a86c", "3a8866969cc44349b96c46ed4103e098", "3b9099a5f31d44e5b576b9c91e901283", "3eb129fc09064ba7b1149bff0409095d", "3ff544c93ca34ac19e1022c518f42365", "4029c7872f2d4921b52c27b087189709", "447a357f4b9448adaeda274ac49c7b35", "4f5ccf64c16f4210869a4e4131276b4f", "4fa11b79a5a143e48178e654f94b832d", "50c4b866cc1c4c12833b06f72d11bb60", "ee8b81e65f8c4f4b9b038f8db975efc7", "ef9d4f5f786a4bc99c2291e9b411b6d2", "fc2c563ed2d7464f995e2874bc6fa961", "fc525ea50c9c4cb8823805a071566f87"], "productNumber": "SW10022"}', '{"type": "quantity", "price": 403, "quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "precision": 2, "isCalculated": true}', '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 403, "totalPrice": 403, "calculatedTaxes": [{"tax": 64.34, "price": 403, "taxRate": 19, "extensions": []}]}', 1, 1, 1, null, NOW(), null)
,(0x7282473D4E9941A3BE1E39995E9C20B4, @versionId, 0xDD09717EB8AA4613B274543B95B1B191, @versionId, null, @versionId, HEX((SELECT id FROM product WHERE active = 1 LIMIT 1)), HEX((SELECT id FROM product WHERE active = 1 LIMIT 1)), 'product Name', null, null, 1, 'product', '{"tags": null, "categories": ["3d944603a8884ac0a3e2ec58083e27b9", "4e0c8421c58c4058a9736790902d22c4", "d9636a347cce4d2d90117841e787c6e9"], "properties": ["0607048968104391a422df384624498e", "09280388dc2d40cfa9fc323bf1ba328e", "0a6f2cd6fbbd4caeab6c2721dec075ae", "10d700daf9de4d3e8e220aae38c69180", "196d63f217984b51ab0535052a66acc0", "2128dd1601c84a0cb606395d4a6e41ec", "2bf26487d77441a696a68323cb96e6f7", "2d22b46c371d4ab9b55fa3b299ac2e1a", "31cc5fcf0fcb4b5e8116a58807887de7", "33163d22fe24485e84b09a9d112873be", "3553f980050b4c7baea41e6fe298a86c", "3a8866969cc44349b96c46ed4103e098", "3b9099a5f31d44e5b576b9c91e901283", "3eb129fc09064ba7b1149bff0409095d", "3ff544c93ca34ac19e1022c518f42365", "4029c7872f2d4921b52c27b087189709", "447a357f4b9448adaeda274ac49c7b35", "4f5ccf64c16f4210869a4e4131276b4f", "4fa11b79a5a143e48178e654f94b832d", "50c4b866cc1c4c12833b06f72d11bb60", "ee8b81e65f8c4f4b9b038f8db975efc7", "ef9d4f5f786a4bc99c2291e9b411b6d2", "fc2c563ed2d7464f995e2874bc6fa961", "fc525ea50c9c4cb8823805a071566f87"], "productNumber": "SW10022"}', '{"type": "quantity", "price": 403, "quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "precision": 2, "isCalculated": true}', '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 403, "totalPrice": 403, "calculatedTaxes": [{"tax": 64.34, "price": 403, "taxRate": 19, "extensions": []}]}', 1, 1, 1, null, DATE_ADD(DATE_ADD(NOW(), INTERVAL -1 YEAR), INTERVAL -4 DAY), null)
,(0x7282473D4E9941A3BE1E39995E9C20B5, @versionId, 0xDD09717EB8AA4613B274543B95B1B192, @versionId, null, @versionId, HEX((SELECT id FROM product WHERE active = 1 LIMIT 1)), HEX((SELECT id FROM product WHERE active = 1 LIMIT 1)), 'product Name', null, null, 1, 'product', '{"tags": null, "categories": ["3d944603a8884ac0a3e2ec58083e27b9", "4e0c8421c58c4058a9736790902d22c4", "d9636a347cce4d2d90117841e787c6e9"], "properties": ["0607048968104391a422df384624498e", "09280388dc2d40cfa9fc323bf1ba328e", "0a6f2cd6fbbd4caeab6c2721dec075ae", "10d700daf9de4d3e8e220aae38c69180", "196d63f217984b51ab0535052a66acc0", "2128dd1601c84a0cb606395d4a6e41ec", "2bf26487d77441a696a68323cb96e6f7", "2d22b46c371d4ab9b55fa3b299ac2e1a", "31cc5fcf0fcb4b5e8116a58807887de7", "33163d22fe24485e84b09a9d112873be", "3553f980050b4c7baea41e6fe298a86c", "3a8866969cc44349b96c46ed4103e098", "3b9099a5f31d44e5b576b9c91e901283", "3eb129fc09064ba7b1149bff0409095d", "3ff544c93ca34ac19e1022c518f42365", "4029c7872f2d4921b52c27b087189709", "447a357f4b9448adaeda274ac49c7b35", "4f5ccf64c16f4210869a4e4131276b4f", "4fa11b79a5a143e48178e654f94b832d", "50c4b866cc1c4c12833b06f72d11bb60", "ee8b81e65f8c4f4b9b038f8db975efc7", "ef9d4f5f786a4bc99c2291e9b411b6d2", "fc2c563ed2d7464f995e2874bc6fa961", "fc525ea50c9c4cb8823805a071566f87"], "productNumber": "SW10022"}', '{"type": "quantity", "price": 403, "quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "precision": 2, "isCalculated": true}', '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 403, "totalPrice": 403, "calculatedTaxes": [{"tax": 64.34, "price": 403, "taxRate": 19, "extensions": []}]}', 1, 1, 1, null, DATE_ADD(DATE_ADD(NOW(), INTERVAL -1 MONTH), INTERVAL -2 DAY), null)
,(0x7282473D4E9941A3BE1E39995E9C20B6, @versionId, 0xDD09717EB8AA4613B274543B95B1B193, @versionId, null, @versionId, HEX((SELECT id FROM product WHERE active = 1 LIMIT 1)), HEX((SELECT id FROM product WHERE active = 1 LIMIT 1)), 'product Name', null, null, 1, 'product', '{"tags": null, "categories": ["3d944603a8884ac0a3e2ec58083e27b9", "4e0c8421c58c4058a9736790902d22c4", "d9636a347cce4d2d90117841e787c6e9"], "properties": ["0607048968104391a422df384624498e", "09280388dc2d40cfa9fc323bf1ba328e", "0a6f2cd6fbbd4caeab6c2721dec075ae", "10d700daf9de4d3e8e220aae38c69180", "196d63f217984b51ab0535052a66acc0", "2128dd1601c84a0cb606395d4a6e41ec", "2bf26487d77441a696a68323cb96e6f7", "2d22b46c371d4ab9b55fa3b299ac2e1a", "31cc5fcf0fcb4b5e8116a58807887de7", "33163d22fe24485e84b09a9d112873be", "3553f980050b4c7baea41e6fe298a86c", "3a8866969cc44349b96c46ed4103e098", "3b9099a5f31d44e5b576b9c91e901283", "3eb129fc09064ba7b1149bff0409095d", "3ff544c93ca34ac19e1022c518f42365", "4029c7872f2d4921b52c27b087189709", "447a357f4b9448adaeda274ac49c7b35", "4f5ccf64c16f4210869a4e4131276b4f", "4fa11b79a5a143e48178e654f94b832d", "50c4b866cc1c4c12833b06f72d11bb60", "ee8b81e65f8c4f4b9b038f8db975efc7", "ef9d4f5f786a4bc99c2291e9b411b6d2", "fc2c563ed2d7464f995e2874bc6fa961", "fc525ea50c9c4cb8823805a071566f87"], "productNumber": "SW10022"}', '{"type": "quantity", "price": 403, "quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "precision": 2, "isCalculated": true}', '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 403, "totalPrice": 403, "calculatedTaxes": [{"tax": 64.34, "price": 403, "taxRate": 19, "extensions": []}]}', 1, 1, 1, null, DATE_ADD(NOW(), INTERVAL -3 MONTH), null)
;

INSERT INTO order_customer (id, version_id, customer_id, order_id, order_version_id, email, salutation_id, first_name, last_name, title, customer_number, custom_fields, created_at, updated_at) VALUES
(0x871A930F642248AC8407D3A9C42437FB, @versionId, 0xCFBD5018D38D41D8ADCA10D94FC8BDD7, 0xDD09717EB8AA4613B274543B95B1B187, @versionId, 'debtor@example.com', (SELECT id FROM salutation WHERE salutation_key = 'mr'), 'Max', 'Mustermann', null, '1324', null, NOW(), null)
,(0x871A930F642248AC8407D3A9C42437A3, @versionId, 0xCFBD5018D38D41D8ADCA10D94FC8BDD7, 0xDD09717EB8AA4613B274543B95B1B190, @versionId, 'debtor@example.com', (SELECT id FROM salutation WHERE salutation_key = 'mr'), 'Max', 'Mustermann', null, '1324', null, NOW(), null)
,(0x871A930F642248AC8407D3A9C42437A4, @versionId, 0xCFBD5018D38D41D8ADCA10D94FC8BDD7, 0xDD09717EB8AA4613B274543B95B1B191, @versionId, 'debtor@example.com', (SELECT id FROM salutation WHERE salutation_key = 'mr'), 'Max', 'Mustermann', null, '1324', null, DATE_ADD(DATE_ADD(NOW(), INTERVAL -1 YEAR), INTERVAL -4 DAY), null)
,(0x871A930F642248AC8407D3A9C42437A5, @versionId, 0xCFBD5018D38D41D8ADCA10D94FC8BDD7, 0xDD09717EB8AA4613B274543B95B1B192, @versionId, 'debtor@example.com', (SELECT id FROM salutation WHERE salutation_key = 'mr'), 'Max', 'Mustermann', null, '1324', null, DATE_ADD(DATE_ADD(NOW(), INTERVAL -1 MONTH), INTERVAL -2 DAY), null)
,(0x871A930F642248AC8407D3A9C42437A6, @versionId, 0xCFBD5018D38D41D8ADCA10D94FC8BDD7, 0xDD09717EB8AA4613B274543B95B1B193, @versionId, 'debtor@example.com', (SELECT id FROM salutation WHERE salutation_key = 'mr'), 'Max', 'Mustermann', null, '1324', null, DATE_ADD(NOW(), INTERVAL -3 MONTH), null)
;

INSERT INTO order_address (id, version_id, country_id, country_state_id, order_id, order_version_id, company, department, salutation_id, title, first_name, last_name, street, zipcode, city, vat_id, phone_number, additional_address_line1, additional_address_line2, custom_fields, created_at, updated_at) VALUES
(0x53521A8AF3A64E35A5982C527DE83C8B, @versionId, (SELECT id FROM country WHERE iso3 = 'DEU'), null, 0xDD09717EB8AA4613B274543B95B1B187, @versionId, 'Debtor 1 GmbH', 'Purchasing', (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, 'Max', 'Mustermann', 'Musterstr. 12', '55555', 'Musterhausen', null, '05555 / 555555', null, null, null, NOW(), null)
 ,(0xC1CF1C3C65E04666A8D60710FE179829, @versionId, (SELECT id FROM country WHERE iso3 = 'DEU'), null, 0xDD09717EB8AA4613B274543B95B1B187, @versionId, 'Debtor 1 GmbH', 'Purchasing', (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, 'Max', 'Mustermann', 'Musterstr. 1', '55555', 'Musterhausen', null, '05555 / 555555', null, null, null, NOW(), null)
 ,(0x53521A8AF3A64E35A5982C527DE83C83, @versionId, (SELECT id FROM country WHERE iso3 = 'DEU'), null, 0xDD09717EB8AA4613B274543B95B1B190, @versionId, 'Debtor 1 GmbH', 'Purchasing', (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, 'Max', 'Mustermann', 'Musterstr. 12', '55555', 'Musterhausen', null, '05555 / 555555', null, null, null, NOW(), null)
 ,(0xC1CF1C3C65E04666A8D60710FE179832, @versionId, (SELECT id FROM country WHERE iso3 = 'DEU'), null, 0xDD09717EB8AA4613B274543B95B1B190, @versionId, 'Debtor 1 GmbH', 'Purchasing', (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, 'Max', 'Mustermann', 'Musterstr. 1', '55555', 'Musterhausen', null, '05555 / 555555', null, null, null, NOW(), null)
 ,(0x53521A8AF3A64E35A5982C527DE83C84, @versionId, (SELECT id FROM country WHERE iso3 = 'DEU'), null, 0xDD09717EB8AA4613B274543B95B1B191, @versionId, 'Debtor 1 GmbH', 'Purchasing', (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, 'Max', 'Mustermann', 'Musterstr. 12', '55555', 'Musterhausen', null, '05555 / 555555', null, null, null, DATE_ADD(DATE_ADD(NOW(), INTERVAL -1 YEAR), INTERVAL -4 DAY), null)
 ,(0xC1CF1C3C65E04666A8D60710FE179833, @versionId, (SELECT id FROM country WHERE iso3 = 'DEU'), null, 0xDD09717EB8AA4613B274543B95B1B191, @versionId, 'Debtor 1 GmbH', 'Purchasing', (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, 'Max', 'Mustermann', 'Musterstr. 1', '55555', 'Musterhausen', null, '05555 / 555555', null, null, null, DATE_ADD(DATE_ADD(NOW(), INTERVAL -1 YEAR), INTERVAL -4 DAY), null)
 ,(0x53521A8AF3A64E35A5982C527DE83C85, @versionId, (SELECT id FROM country WHERE iso3 = 'DEU'), null, 0xDD09717EB8AA4613B274543B95B1B192, @versionId, 'Debtor 1 GmbH', 'Purchasing', (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, 'Max', 'Mustermann', 'Musterstr. 12', '55555', 'Musterhausen', null, '05555 / 555555', null, null, null, DATE_ADD(DATE_ADD(NOW(), INTERVAL -1 MONTH), INTERVAL -2 DAY), null)
 ,(0xC1CF1C3C65E04666A8D60710FE179834, @versionId, (SELECT id FROM country WHERE iso3 = 'DEU'), null, 0xDD09717EB8AA4613B274543B95B1B192, @versionId, 'Debtor 1 GmbH', 'Purchasing', (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, 'Max', 'Mustermann', 'Musterstr. 1', '55555', 'Musterhausen', null, '05555 / 555555', null, null, null, DATE_ADD(DATE_ADD(NOW(), INTERVAL -1 MONTH), INTERVAL -2 DAY), null)
 ,(0x53521A8AF3A64E35A5982C527DE83C86, @versionId, (SELECT id FROM country WHERE iso3 = 'DEU'), null, 0xDD09717EB8AA4613B274543B95B1B193, @versionId, 'Debtor 1 GmbH', 'Purchasing', (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, 'Max', 'Mustermann', 'Musterstr. 12', '55555', 'Musterhausen', null, '05555 / 555555', null, null, null, DATE_ADD(NOW(), INTERVAL -3 MONTH), null)
 ,(0xC1CF1C3C65E04666A8D60710FE179825, @versionId, (SELECT id FROM country WHERE iso3 = 'DEU'), null, 0xDD09717EB8AA4613B274543B95B1B193, @versionId, 'Debtor 1 GmbH', 'Purchasing', (SELECT id FROM salutation WHERE salutation_key = 'mr'), null, 'Max', 'Mustermann', 'Musterstr. 1', '55555', 'Musterhausen', null, '05555 / 555555', null, null, null, DATE_ADD(NOW(), INTERVAL -3 MONTH), null)
;

INSERT INTO order_delivery (id, version_id, order_id, order_version_id, state_id, shipping_order_address_id, shipping_order_address_version_id, shipping_method_id, tracking_codes, shipping_date_earliest, shipping_date_latest, shipping_costs, custom_fields, created_at, updated_at) VALUES
(0x6C7F566380104C95A7A8E53052BA1210, @versionId, 0xDD09717EB8AA4613B274543B95B1B187, @versionId, (SELECT sms.id FROM state_machine sm INNER JOIN state_machine_state sms ON sm.id = sms.state_machine_id WHERE sm.technical_name = 'order_delivery.state' AND sms.technical_name = 'open'), 0x53521A8AF3A64E35A5982C527DE83C8B, @versionId, (SELECT id FROM shipping_method WHERE active = 1 LIMIT 1), '{}', DATE_FORMAT(NOW(), '%Y-%m-%d'), DATE_FORMAT(DATE_ADD(NOW(), INTERVAL +2 DAY), '%Y-%m-%d'), '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 0, "totalPrice": 0, "calculatedTaxes": [{"tax": 0, "price": 0, "taxRate": 19, "extensions": []}]}', null, NOW(), null)
,(0x6C7F566380104C95A7A8E53052BA1213, @versionId, 0xDD09717EB8AA4613B274543B95B1B190, @versionId, (SELECT sms.id FROM state_machine sm INNER JOIN state_machine_state sms ON sm.id = sms.state_machine_id WHERE sm.technical_name = 'order_delivery.state' AND sms.technical_name = 'shipped'), 0x53521A8AF3A64E35A5982C527DE83C83, @versionId, (SELECT id FROM shipping_method WHERE active = 1 LIMIT 1), '{}', DATE_FORMAT(NOW(), '%Y-%m-%d'), DATE_FORMAT(DATE_ADD(NOW(), INTERVAL +2 DAY), '%Y-%m-%d'), '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 0, "totalPrice": 0, "calculatedTaxes": [{"tax": 0, "price": 0, "taxRate": 19, "extensions": []}]}', null, NOW(), null)
,(0x6C7F566380104C95A7A8E53052BA1214, @versionId, 0xDD09717EB8AA4613B274543B95B1B191, @versionId, (SELECT sms.id FROM state_machine sm INNER JOIN state_machine_state sms ON sm.id = sms.state_machine_id WHERE sm.technical_name = 'order_delivery.state' AND sms.technical_name = 'open'), 0x53521A8AF3A64E35A5982C527DE83C84, @versionId, (SELECT id FROM shipping_method WHERE active = 1 LIMIT 1), '{}', DATE_FORMAT(DATE_ADD(DATE_ADD(NOW(), INTERVAL -1 YEAR), INTERVAL -4 DAY), '%Y-%m-%d'), DATE_FORMAT(DATE_ADD(DATE_ADD(DATE_ADD(NOW(), INTERVAL -1 YEAR), INTERVAL -4 DAY), INTERVAL +2 DAY), '%Y-%m-%d'), '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 0, "totalPrice": 0, "calculatedTaxes": [{"tax": 0, "price": 0, "taxRate": 19, "extensions": []}]}', null, DATE_ADD(DATE_ADD(NOW(), INTERVAL -1 YEAR), INTERVAL -4 DAY), null)
,(0x6C7F566380104C95A7A8E53052BA1215, @versionId, 0xDD09717EB8AA4613B274543B95B1B192, @versionId, (SELECT sms.id FROM state_machine sm INNER JOIN state_machine_state sms ON sm.id = sms.state_machine_id WHERE sm.technical_name = 'order_delivery.state' AND sms.technical_name = 'shipped'), 0x53521A8AF3A64E35A5982C527DE83C85, @versionId, (SELECT id FROM shipping_method WHERE active = 1 LIMIT 1), '{}', DATE_FORMAT(DATE_ADD(DATE_ADD(NOW(), INTERVAL -1 MONTH), INTERVAL -2 DAY), '%Y-%m-%d'), DATE_FORMAT(DATE_ADD(DATE_ADD(DATE_ADD(NOW(), INTERVAL -1 MONTH), INTERVAL -2 DAY), INTERVAL +2 DAY), '%Y-%m-%d'), '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 0, "totalPrice": 0, "calculatedTaxes": [{"tax": 0, "price": 0, "taxRate": 19, "extensions": []}]}', null, DATE_ADD(DATE_ADD(NOW(), INTERVAL -1 MONTH), INTERVAL -2 DAY), null)
,(0x6C7F566380104C95A7A8E53052BA1216, @versionId, 0xDD09717EB8AA4613B274543B95B1B193, @versionId, (SELECT sms.id FROM state_machine sm INNER JOIN state_machine_state sms ON sm.id = sms.state_machine_id WHERE sm.technical_name = 'order_delivery.state' AND sms.technical_name = 'open'), 0x53521A8AF3A64E35A5982C527DE83C86, @versionId, (SELECT id FROM shipping_method WHERE active = 1 LIMIT 1), '{}', DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -3 MONTH), '%Y-%m-%d'), DATE_FORMAT(DATE_ADD(DATE_ADD(NOW(), INTERVAL -3 MONTH), INTERVAL +2 DAY), '%Y-%m-%d'), '{"quantity": 1, "taxRules": [{"taxRate": 19, "extensions": [], "percentage": 100}], "unitPrice": 0, "totalPrice": 0, "calculatedTaxes": [{"tax": 0, "price": 0, "taxRate": 19, "extensions": []}]}', null, DATE_ADD(NOW(), INTERVAL -3 MONTH), null)
;

INSERT INTO `b2b_line_item_list` (`id`, `context_owner_id`, `amount_net`, `amount`) VALUES
(4, 1, 354.16, 421.45),
(5, 1, 43.6,51.88),
(6, 1, 298.62, 355.35),
(7, 1, 102.43, 121.89),
(28, 1, 354.16, 421.45);

INSERT INTO `b2b_order_context` (`id`, `ordernumber`, `list_id`, `created_at`, `cleared_at`, `shipping_address_id`, `billing_address_id`, `payment_id`, `shipping_id`, `comment`, `order_reference`, `device_type`, `auth_id`, `state`, `cleared_by`) VALUES
(1, '20006', 4, NOW(), NOW(), 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, (SELECT id FROM payment_method LIMIT 1), (SELECT id FROM shipping_method LIMIT 1), 'comment', 'order reference', 'desktop', 1, "open", 1)
,(2, '20021', 5, DATE_ADD(DATE_ADD(NOW(), INTERVAL -1 YEAR), INTERVAL -4 DAY), DATE_ADD(NOW(), INTERVAL -4 DAY), 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, (SELECT id FROM payment_method LIMIT 1), (SELECT id FROM shipping_method LIMIT 1), '', null, 'desktop', 2, "open", 4)
,(3, '20022', 6, DATE_ADD(DATE_ADD(NOW(), INTERVAL -1 MONTH), INTERVAL -2 DAY), DATE_ADD(DATE_ADD(NOW(), INTERVAL -1 MONTH), INTERVAL -2 DAY), 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, (SELECT id FROM payment_method LIMIT 1), (SELECT id FROM shipping_method LIMIT 1), '', null, 'desktop', 3, "open", 1)
,(4, '20023', 7, DATE_ADD(NOW(), INTERVAL -3 MONTH), DATE_ADD(NOW(), INTERVAL -2 MONTH), 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, 5, 9, '', null, 'desktop', 2, "open", 2)
;

INSERT INTO `b2b_line_item_reference` (`id`, `reference_number`, `quantity`, `comment`, `list_id`, `amount_net`, `amount`, `mode`, `order_list_name`) VALUES
(4, 'SW10001', 8, '', 4, 33.571428571429, 39.95, 0, 'Monthly Office requirements'),
(5, 'SW10002', 5, '', 4, 16.798319327731, 19.99, 0, 'Bathroom supply'),
(6, 'SHIPPINGDISCOUNT', 1, '', 4, -1.68, -2.00, 4, ''),
(7, 'SW10003', 2, '',  5, 21, 24.99, 0, ''),
(8, 'SHIPPINGDISCOUNT', 1, '', 5, -1.68, -2.00, 4, ''),
(9, 'SW10006', 9, '', 6, 30.210084033613, 35.95, 0, ''),
(10, 'SW10004', 2, '',6, 12.563025210084, 14.95, 0, ''),
(11, 'SHIPPINGDISCOUNT', 1, '', 6, -1.68, -2.00, 4, ''),
(12, 'SW100025211', 1, '', 7, 100.83193277311, 119.99, 0, ''),
(13, 'SHIPPINGDISCOUNT', 1, '', 7, -1.68, -200, 4, ''),
(14, 'SW10001', 8, '', 28, 33.571428571429, 39.95, 0, 'Monthly Office requirements'),
(15, 'SW10002', 5, '', 28, 16.798319327731, 19.99, 0, 'Bathroom supply'),
(16, 'SW10003', 1, '', 28, 16.798319327731, 19.99, 4, '');

INSERT INTO product (id, version_id, product_number, stock, max_purchase, min_purchase, purchase_steps, is_closeout, price, restock_time, shipping_free, tax_id, created_at) VALUES
(0x2A7A666380104C95A7A8E53052CA1234, @versionId, 'SW10001', 100, 40, 1, 1, 0, '{\"cb7d2554b0ce847cd82f3ac9bd1c0dfca\": {\"net\": 670.5882352941177, \"gross\": 798, \"linked\": true, \"currencyId\": \"b7d2554b0ce847cd82f3ac9bd1c0dfca\"}}', 3, 0, @defaultTaxId, NOW())
 ,(0x2A7A666380104C95A7A8E53052CA1235, @versionId, 'SW10002', 100, 40, 1, 1, 0, '{\"cb7d2554b0ce847cd82f3ac9bd1c0dfca\": {\"net\": 31.09, \"gross\": 37, \"linked\": true, \"currencyId\": \"b7d2554b0ce847cd82f3ac9bd1c0dfca\"}}', 3, 0, @defaultTaxId, NOW())
 ,(0x2A7A666380104C95A7A8E53052CA1236, @versionId, 'SW10003', 100, 40, 1, 1, 0, '{\"cb7d2554b0ce847cd82f3ac9bd1c0dfca\": {\"net\": 31.09, \"gross\": 37, \"linked\": true, \"currencyId\": \"b7d2554b0ce847cd82f3ac9bd1c0dfca\"}}', 3, 0, @defaultTaxId, NOW())
 ,(0x2A7A666380104C95A7A8E53052CA1237, @versionId, 'SW10009', 12, null, 1, 1, 0, '{\"cb7d2554b0ce847cd82f3ac9bd1c0dfca\": {\"net\": 21, \"gross\": 24.99, \"linked\": true, \"currencyId\": \"b7d2554b0ce847cd82f3ac9bd1c0dfca\"}}', 3, 0, @defaultTaxId, NOW())
;

INSERT INTO product_translation (product_id, product_version_id, language_id, `name`, created_at) VALUES
(0x2A7A666380104C95A7A8E53052CA1234, @versionId, @germanLanguageId, 'Testartikel 1', NOW())
  ,(0x2A7A666380104C95A7A8E53052CA1234, @versionId, (SELECT id FROM language WHERE name = 'English'), 'Test product 1', NOW())
  ,(0x2A7A666380104C95A7A8E53052CA1235, @versionId, @germanLanguageId, 'Testartikel 2', NOW())
  ,(0x2A7A666380104C95A7A8E53052CA1235, @versionId, (SELECT id FROM language WHERE name = 'English'), 'Test product 2', NOW())
  ,(0x2A7A666380104C95A7A8E53052CA1236, @versionId, @germanLanguageId, 'Testartikel 3', NOW())
  ,(0x2A7A666380104C95A7A8E53052CA1236, @versionId, (SELECT id FROM language WHERE name = 'English'), 'Test product 3', NOW())
  ,(0x2A7A666380104C95A7A8E53052CA1237, @versionId, @germanLanguageId, 'Special Finish Lagerkorn X.O. 32%', NOW())
  ,(0x2A7A666380104C95A7A8E53052CA1237, @versionId, (SELECT id FROM language WHERE name = 'English'), 'Special Finish Lagerkorn X.O. 32%', NOW())
;

INSERT INTO product_visibility (id, product_id, product_version_id, sales_channel_id, visibility, created_at, updated_at) VALUES
(0x3E8B666380104C95A7A8E53052DD1200, 0x2A7A666380104C95A7A8E53052CA1234, @versionId, @salesChannelStorefrontId, 30, NOW(), NOW())
  ,(0x3E8B666380104C95A7A8E53052DD1201, 0x2A7A666380104C95A7A8E53052CA1235, @versionId, @salesChannelStorefrontId, 30, NOW(), NOW())
  ,(0x3E8B666380104C95A7A8E53052DD1202, 0x2A7A666380104C95A7A8E53052CA1236, @versionId, @salesChannelStorefrontId, 30, NOW(), NOW())
  ,(0x3E8B666380104C95A7A8E53052DD1203, 0x2A7A666380104C95A7A8E53052CA1237, @versionId, @salesChannelStorefrontId, 30, NOW(), NOW())
;

INSERT INTO product_category (product_id, product_version_id, category_id, category_version_id) VALUES
(0x2A7A666380104C95A7A8E53052CA1234, @versionId, (SELECT id FROM category LIMIT 1), @versionId)
,(0x2A7A666380104C95A7A8E53052CA1235, @versionId, (SELECT id FROM category LIMIT 1), @versionId)
,(0x2A7A666380104C95A7A8E53052CA1236, @versionId, (SELECT id FROM category LIMIT 1), @versionId)
,(0x2A7A666380104C95A7A8E53052CA1237, @versionId, (SELECT id FROM category LIMIT 1), @versionId)
;

INSERT INTO `b2b_line_item_list` (`id`, `context_owner_id`, `amount_net`, `amount`) VALUES
(8, 1, 4589.18, 5461.12),
(9, 1, 22.6, 26.89),
(10, 1, 2665.85, 3172.35),
(11, 1, 4589.18, 5461.12),
(12, 1, 4589.18, 5461.12),
(13, 1, 4589.18, 5461.12),
(14, 1, 4589.18, 5461.12),
(15, 1, 4589.18, 5461.12)
,(16, 1, 4589.18, 5461.12)
,(17, 1, 16.76, 19.95)
,(18, 1, 16.76, 19.95)
,(19, 1, 16.76, 19.95)
,(20, 1, 16.76, 19.95)
,(21, 1, 16.76, 19.95)
,(22, 1, 16.76, 19.95)
,(23, 1, 16.76, 19.95)
,(24, 1, 16.76, 19.95)
,(25, 1, 16.76, 19.95)
,(26, 1, 16.76, 19.95)
,(27, 1, 16.76, 19.95)
;

INSERT INTO `b2b_line_item_reference` (`id`, `reference_number`, `quantity`, `comment`, `list_id`, `amount_net`, `amount`, `mode`) VALUES
(17, 'SHIPPINGDISCOUNT', 1, '', 9, -1.68, -2.00, 4)
,(18, 'SW10003', 1, '', 10, 84.025210084034, 99.99, 0)
,(19, 'SW10004', 8, '', 10, 268.89915966387, 319.99, 0)
,(20, 'SW10005', 1, '', 10, 17.638655462185, 20.99, 0)
,(21, 'SW10006', 2, '', 10, 74.789915966387, 89.00, 0)
,(22, 'SW10007', 1, '', 10, 12.605042016807, 15.00, 0)
,(23, 'SW10008', 1, '', 10, 245, 291.55, 0)
,(24, 'SHIPPINGDISCOUNT', 1, '', 10, -1.68, -2.00, 4)
,(25, 'sw-payment-absolute', 1, '', 10, 4.2, 5.00, 4)
,(26, 'SW10001', 78, '', 11, 58.81512605042, 69.99, 0)
,(27, 'SHIPPINGDISCOUNT', 1, '', 11, -1.68, -2.00, 4)
,(28, 'SW10001', 78, '', 12, 58.81512605042, 69.99, 0)
,(29, 'SHIPPINGDISCOUNT', 1, '', 12, -1.68, -2.00, 4)
,(30, 'SW10001', 78, '', 13, 58.81512605042, 69.99, 0)
,(31, 'SHIPPINGDISCOUNT', 1, '', 13, -1.68, -2.00, 4)
,(36, 'SW10001', 78, '', 16, 58.81512605042, 69.99, 0)
,(37, 'SHIPPINGDISCOUNT', 1, '', 16, -1.68, -2.00, 4)
,(32, 'SW10001', 78, '', 14, 58.81512605042, 69.99, 0)
,(33, 'SHIPPINGDISCOUNT', 1, '', 14, -1.68, -2.00, 4)
,(34, 'SW10001', 78, '', 15, 58.81512605042, 69.99, 0)
,(35, 'SHIPPINGDISCOUNT', 1, '', 15, -1.68, -2.00, 4)
;

 INSERT INTO `b2b_line_item_reference` (`id`, `reference_number`, `quantity`, `comment`, `list_id`, `mode`, `amount_net`, `amount`, `order_list_name`, `discount_amount`, `discount_amount_net`, `discount_currency_factor`) VALUES
(705, 'SW10009', 1, '', 17, 0, 16.764705882353, 19.95, null, 19.95, 16.764705882353, 1)
,(706, 'SW10009', 1, '', 18, 0, 16.764705882353, 19.95, null, 19.95, 16.764705882353, 1)
,(707, 'SW10009', 1, '', 19, 0, 16.764705882353, 19.95, null, 19.95, 16.764705882353, 1)
,(708, 'SW10009', 1, '', 20, 0, 16.764705882353, 19.95, null, 19.95, 16.764705882353, 1)
,(709, 'SW10009', 1, '', 21, 0, 16.764705882353, 19.95, null, 19.95, 16.764705882353, 1)
,(710, 'SW10009', 1, '', 22, 0, 16.764705882353, 19.95, null, 19.95, 16.764705882353, 1)
,(711, 'SW10009', 1, '', 23, 0, 16.764705882353, 19.95, null, 19.95, 16.764705882353, 1)
,(712, 'SW10009', 1, '', 24, 0, 16.764705882353, 19.95, null, 19.95, 16.764705882353, 1)
,(713, 'SW10009', 1, '', 25, 0, 16.764705882353, 19.95, null, 19.95, 16.764705882353, 1)
,(714, 'SW10009', 1, '', 26, 0, 16.764705882353, 19.95, null, 19.95, 16.764705882353, 1)
,(715, 'SW10009', 1, '', 27, 0, 16.764705882353, 19.95, null, 19.95, 16.764705882353, 1)
;

INSERT INTO `b2b_order_context` (`id`, `list_id`, `ordernumber`, `created_at`, `cleared_at`, `budget_id`, `declined_at`, `shipping_address_id`, `billing_address_id`, `payment_id`, `shipping_id`, `state`, `comment`, `device_type`, `order_reference`, `requested_delivery_date`, `auth_id`, `shipping_amount`, `shipping_amount_net`) VALUES
(15, 17, null, NOW(), null, null, null, 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, null, 9, 'in_progress', '', 'desktop', null, null, 1, 3.9, 3.28)
,(16, 18, null, NOW(), null, null, null, 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, null, 9, 'in_progress', '', 'desktop', null, null, 1, 3.9, 3.28)
,(17, 19, null, Date_ADD(NOW(), INTERVAL -15 DAY), null, null, null, 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, null, 9, 'in_progress', '', 'desktop', null, null, 1, 3.9, 3.28)
,(18, 20, null, DATE_ADD(Now(), INTERVAL -1 HOUR), null, null, null, 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, null, 9, 'in_progress', '', 'desktop', null, null, 1, 3.9, 3.28)
,(19, 21, null, DATE_ADD(Now(), INTERVAL -1 HOUR), null, null, null, 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, null, 9, 'in_progress', '', 'desktop', null, null, 1, 3.9, 3.28)
,(20, 22, null, DATE_ADD(Now(), INTERVAL -1 HOUR), null, null, null, 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, null, 9, 'in_progress', '', 'desktop', null, null, 1, 3.9, 3.28)
,(21, 23, null, DATE_ADD(Now(), INTERVAL -2 HOUR), null, null, null, 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, null, 9, 'in_progress', '', 'desktop', null, null, 1, 3.9, 3.28)
,(22, 24, null, DATE_ADD(Now(), INTERVAL -2 HOUR), null, null, null, 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, null, 9, 'in_progress', '', 'desktop', null, null, 1, 3.9, 3.28)
,(23, 25, null, DATE_ADD(Now(), INTERVAL -2 HOUR), NOW(), null, null, 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, null, 9, 'in_progress', '', 'desktop', null, null, 1, 3.9, 3.28)
,(24, 26, null, DATE_ADD(Now(), INTERVAL -2 HOUR), NOW(), null, null, 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, null, 9, 'in_progress', '', 'desktop', null, null, 1, 3.9, 3.28)
,(25, 27, null, DATE_ADD(Now(), INTERVAL -2 HOUR), NOW(), null, null, 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, null, 9, 'in_progress', '', 'desktop', null, null, 1, 3.9, 3.28)
;

INSERT INTO `b2b_offer` (`id`, `created_at`, `expired_at`, `changed_user_at`, `changed_admin_at`, `changed_status_at`, `accepted_user_at`, `accepted_admin_at`, `converted_at`, `email`, `debtor_email`, `declined_user_at`, `declined_admin_at`, `discount_amount_net`, `discount_amount`, `order_context_id`, `auth_id`, `list_id`, `currency_factor`, `discount_value_net`) VALUES
(1, NOW(), null, null, null, null, null, null, null, 'contact1@example.com', 'debtor@example.com', null, null, 8.05, 19.95, 15, 1, 17, 1, 10)
,(2, Now(), Date_ADD(NOW(), INTERVAL 15 DAY), null, null, null, null, null, null, 'contact1@example.com', 'debtor@example.com', null, null, 8.05, 19.95, 16, 1, 18, 1, 10)
,(3, Date_ADD(NOW(), INTERVAL -15 DAY), Date_ADD(NOW(), INTERVAL -10 DAY), null, null, null, null, null, null, 'contact1@example.com', 'debtor@example.com', null, null, 8.05, 19.95, 17, 1, 19, 1, 10)
,(4, DATE_ADD(Now(), INTERVAL -1 HOUR), null, NOW(), null, NOW(), NOW(), null, null, 'contact1@example.com', 'debtor@example.com', null, null, 8.05, 19.95, 18, 1, 20, 1, 10)
,(5, DATE_ADD(Now(), INTERVAL -1 HOUR), null, null, null, NOW(), null, null, null, 'contact1@example.com', 'debtor@example.com', NOW(), null, 8.05, 19.95, 19, 1, 21, 1, 10)
,(6, DATE_ADD(Now(), INTERVAL -1 HOUR), null, null, null, NOW(), null, null, null, 'contact1@example.com', 'debtor@example.com', null, NOW(), 8.05, 19.95, 20, 1, 22, 1, 10)
,(7, DATE_ADD(Now(), INTERVAL -2 HOUR), null, DATE_ADD(Now(), INTERVAL -2 HOUR), DATE_ADD(Now(), INTERVAL -1 HOUR), NOW(), null, NOW(), null, 'contact1@example.com', 'debtor@example.com', null, null, 8.05, 19.95, 21, 1, 23, 1, 10)
,(8, DATE_ADD(Now(), INTERVAL -2 HOUR), null, DATE_ADD(Now(), INTERVAL -2 HOUR), null, NOW(), DATE_ADD(Now(), INTERVAL -1 HOUR), NOW(), null, 'contact1@example.com', 'debtor@example.com', null, null, 8.05, 19.95, 22, 1, 24, 1, 10)
,(9, DATE_ADD(Now(), INTERVAL -2 HOUR), null, DATE_ADD(Now(), INTERVAL -2 HOUR), null, NOW(), DATE_ADD(Now(), INTERVAL -1 HOUR), NOW(), Now(), 'contact1@example.com', 'debtor@example.com', null, null, 8.05, 19.95, 23, 1, 25, 1, 10)
,(10, DATE_ADD(Now(), INTERVAL -1 HOUR), null, NOW(), null, null, null, null, null, 'contact1@example.com', 'debtor@example.com', null, null, 8.05, 19.95, 24, 1, 26, 1, 10)
,(11, DATE_ADD(Now(), INTERVAL -1 HOUR), null, null, NOW(), null, null, null, null, 'contact1@example.com', 'debtor@example.com', null, NOW(), 8.05, 19.95, 25, 1, 27, 1, 10)
;

INSERT INTO `b2b_budget` (`id`, `identifier`, `name`, `context_owner_id`, `owner_id`, `amount`, `refresh_type`, `active`, `currency_factor`, `fiscal_year`) VALUES
(1, 'ENT-1005', 'NoRenewal', 1, 2, 500, 'none', 0, 1, '2016-01-01')
,(2, 'ENT-1008', 'Monthly', 1, 2, 600, 'monthly', 1, 1, '2016-01-01')
,(3, 'ENT-10028','Yearly', 1, 2, 400, 'yearly', 1, 1, '2016-01-01')
,(4, 'Invisible1','Debtor only', 1, null, 40000000, 'yearly', 1, 1, '2016-01-01')
;

INSERT INTO `b2b_budget_transaction` (`id`, `budget_id`, `auth_id`, `refresh_group`, `amount`) VALUES
(1, 1, 2, 0, 450)
,(2, 2, 2, 201611, 450)
,(3, 2, 2, 201611, 10)
,(4, 2, 2, 201612, 600)
,(5, 2, 2, 201750, 450)
;

INSERT INTO `b2b_acl_role_budget` (`id`, `entity_id`, `referenced_entity_id`, `grantable`) VALUES
(1, 162, 1, 1)
,(2, 162, 2, 0)
,(3, 162, 3, 1)
;

INSERT INTO `b2b_order_context` (`id`, `list_id`, `ordernumber`, `created_at`, `shipping_address_id`, `billing_address_id`, `payment_id`, `shipping_id`, `state`, `comment`, `order_reference`, `device_type`, `requested_delivery_date`, `auth_id`,`budget_id`) VALUES
(5, 8, null, DATE_ADD(NOW(), INTERVAL -1 HOUR), 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, null, (SELECT id FROM shipping_method LIMIT 1),  "orderclearance_denied", 'comment', 'order reference', 'desktop', null, 4, 1),
(6, 9, null, DATE_ADD(NOW(), INTERVAL -5 HOUR), 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, null, (SELECT id FROM shipping_method LIMIT 1), "orderclearance_denied", '', null, 'desktop', null, 4, 1),
(7, 10, null, DATE_ADD(DATE_ADD(DATE_ADD(NOW(), INTERVAL -7 DAY), INTERVAL -5 HOUR), INTERVAL +35 MINUTE), 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, null, (SELECT id FROM shipping_method LIMIT 1),"orderclearance_denied", '', null, 'desktop', null, 4, 1),
(8, 11, null, DATE_ADD(DATE_ADD(DATE_ADD(NOW(), INTERVAL -7 DAY), INTERVAL -10 HOUR), INTERVAL +66 MINUTE), 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, null, (SELECT id FROM shipping_method LIMIT 1), "orderclearance_denied", '', null, 'desktop', null, 4, 1),
(9, 12, null, DATE_ADD(DATE_ADD(DATE_ADD(NOW(), INTERVAL -15 DAY), INTERVAL -13 HOUR), INTERVAL +42 MINUTE), 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, null, (SELECT id FROM shipping_method LIMIT 1), "orderclearance_denied", '', null, 'desktop', null, 4, 1),
(10, 13, null, DATE_ADD(DATE_ADD(DATE_ADD(NOW(), INTERVAL -15 DAY), INTERVAL -35 HOUR), INTERVAL +15 MINUTE), 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, null, (SELECT id FROM shipping_method LIMIT 1), "orderclearance_denied", '', null, 'desktop', null, 4, 1),
(11, 14, null, DATE_ADD(DATE_ADD(DATE_ADD(NOW(), INTERVAL -38 DAY), INTERVAL -42 HOUR), INTERVAL +12 MINUTE), 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, null, (SELECT id FROM shipping_method LIMIT 1), "orderclearance_denied", '', null, 'desktop', null, 4, 1),
(12, 15, null, DATE_ADD(DATE_ADD(DATE_ADD(NOW(), INTERVAL -40 DAY), INTERVAL -44 HOUR), INTERVAL +11 MINUTE), 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, null, (SELECT id FROM shipping_method LIMIT 1), "orderclearance_denied", '', null, 'desktop', null, 4, 1),
(13, 16, null, DATE_ADD(DATE_ADD(DATE_ADD(NOW(), INTERVAL -42 DAY), INTERVAL -56 HOUR), INTERVAL +5 MINUTE), 0x00BCD5B03167423699473BF08FFAE014, 0x00BCD5B03167423699473BF08FFAE008, null, (SELECT id FROM shipping_method LIMIT 1), "orderclearance_denied", '', null, 'desktop', null, 4, 1);

INSERT INTO b2b_audit_log_author (hash, salutation, title, firstname, lastname, email, is_api)
VALUES
('a804b81a0c49fce89e95e1110985ed8f', 'mr', null, 'Tom', 'Contact1', 'contact1@example.com', 0),
('c2b6a5abf5355c920150c7c12d46af03', 'mr', null, 'Tom', 'Contact2', 'contact2@example.com', 1);

INSERT INTO `b2b_audit_log` (`id`, `log_value`, `log_type`, `event_date`, `author_hash`)
VALUES
(5, 'O:63:\"Shopware\\B2B\\AuditLog\\Framework\\AuditLogValueOrderCommentEntity\":2:{s:8:\"oldValue\";s:0:\"\";s:8:\"newValue\";s:9:\"Kommentar\";}',
 'Shopware\\B2B\\AuditLog\\Framework\\AuditLogValueOrderCommentEntity', '2017-03-06 11:16:11', 'a804b81a0c49fce89e95e1110985ed8f'),
(6, 'O:67:\"Shopware\\B2B\\AuditLog\\Framework\\AuditLogValueLineItemQuantityEntity\":4:{s:11:\"orderNumber\";s:7:\"SW10072\";s:11:\"productName\";s:16:\"Schlüsselkasten\";s:8:\"oldValue\";i:78;s:8:\"newValue\";i:75;}',
 'Shopware\\B2B\\AuditLog\\Framework\\AuditLogValueLineItemQuantityEntity', '2017-03-06 11:18:25', 'a804b81a0c49fce89e95e1110985ed8f'),
(7, 'O:66:\"Shopware\\B2B\\AuditLog\\Framework\\AuditLogValueLineItemCommentEntity\":4:{s:11:\"orderNumber\";s:7:\"SW10072\";s:11:\"productName\";s:16:\"Schlüsselkasten\";s:8:\"oldValue\";s:0:\"\";s:8:\"newValue\";s:12:\"item comment\";}',
 'Shopware\\B2B\\AuditLog\\Framework\\AuditLogValueLineItemCommentEntity', '2017-03-06 11:18:31', 'a804b81a0c49fce89e95e1110985ed8f'),
(8, 'O:65:\"Shopware\\B2B\\AuditLog\\Framework\\AuditLogValueLineItemRemoveEntity\":4:{s:11:\"orderNumber\";s:16:\"SHIPPINGDISCOUNT\";s:11:\"productName\";s:9:\"NOT FOUND\";s:8:\"oldValue\";i:15;s:8:\"newValue\";N;}',
 'Shopware\\B2B\\AuditLog\\Framework\\AuditLogValueLineItemRemoveEntity', '2017-03-06 11:20:40', 'a804b81a0c49fce89e95e1110985ed8f'),
(9, 'O:55:\"Shopware\\B2B\\AuditLog\\Framework\\AuditLogValueDiffEntity\":2:{s:8:\"oldValue\";s:2:\"-2\";s:8:\"newValue\";s:1:\"0\";}',
 'Shopware\\B2B\\AuditLog\\Framework\\AuditLogValueDiffEntity', '2017-03-06 11:22:32', 'a804b81a0c49fce89e95e1110985ed8f'),
(10, 'O:66:\"Shopware\\B2B\\AuditLog\\Framework\\AuditLogValueLineItemCommentEntity\":4:{s:11:\"orderNumber\";s:7:\"SW10067\";s:11:\"productName\";s:19:\"Kommode Shabby Chic\";s:8:\"oldValue\";s:0:\"\";s:8:\"newValue\";s:12:\"item comment\";}',
 'Shopware\\B2B\\AuditLog\\Framework\\AuditLogValueLineItemCommentEntity', '2017-03-06 15:07:24', 'a804b81a0c49fce89e95e1110985ed8f');

INSERT INTO `b2b_audit_log_index` (`audit_log_id`, `reference_table`, `reference_id`) VALUES
(5, 'b2b_order_context', 1)
,(6, 'b2b_order_context', 1)
,(7, 'b2b_order_context', 1)
,(8, 'b2b_order_context', 1)
,(9, 'b2b_order_context', 1)
,(10, 'b2b_order_context', 1)
;

INSERT INTO `b2b_line_item_list` (`id`, `context_owner_id`, `amount_net`, `amount`) VALUES
(400, 1, 354.16, 421.45)
,(500, 1, 43.6,51.88)
,(502, 1, 2184.87394958, 2600)
,(503, 1, 0, 0)
;

INSERT INTO `b2b_line_item_reference` (`id`, `reference_number`, `quantity`, `comment`, `list_id`, `amount_net`, `amount`, `mode`, `sort`) VALUES
(400, 'SW10001', 8, '', 400, 33.571428571429, 39.95, 0, 0)
,(500, 'SW10002', 5, '', 400, 16.798319327731, 19.99, 0, 1)
,(700, 'SW10003', 2, '',  500, 21, 24.99, 0, 0)
;

INSERT INTO `b2b_order_list` (`id`, `name`, `list_id`, `context_owner_id`) VALUES
(1, 'Monthly Office requirements', 400, 1)
,(2, 'Bathroom supply', 500, 1)
,(3, 'B2B list', 502, 1)
,(4, 'Empty list', 503, 1)
;

INSERT INTO `b2b_sales_representative_clients` (`sales_representative_id`, `client_id`) VALUES
(0xCFBD5018D38D41D8ADCA10D94FC8BDDA, 1)
,(0xCFBD5018D38D41D8ADCA10D94FC8BDDA, 2)
,(0xCFBD5018D38D41D8ADCA10D94FC8BDDA, 30)
;

INSERT INTO b2b_store_front_auth (provider_key, provider_context, context_owner_id)
SELECT "Shopware\\B2B\\Contact\\Framework\\ContactRepository" AS provider_key,
contact.id AS provider_context,
contact.context_owner_id AS context_owner_id
FROM b2b_debtor_contact contact
 LEFT JOIN b2b_store_front_auth auth ON auth.provider_context = CAST(contact.id as char character set utf8mb4) COLLATE utf8mb4_unicode_ci
WHERE auth.id IS null;

INSERT INTO `b2b_acl_role_role` (entity_id, referenced_entity_id, grantable) VALUES
(66, 66, 1)
,(66, 144, 1)
,(66, 145, 1)
,(66, 146, 1)
,(66, 147, 1)
,(66, 149, 1)
,(66, 150, 1)
,(66, 151, 1)
,(70, 70, 0)
,(72, 72, 0)
,(73, 73, 0)
,(144, 144, 0)
,(145, 145, 0)
,(146, 146, 0)
,(147, 147, 0)
,(149, 149, 0)
,(150, 150, 0)
,(151, 151, 0)
,(152, 152, 0)
,(153, 153, 0)
,(154, 154, 0)
,(156, 156, 0)
,(158, 158, 0)
,(159, 159, 0)
,(160, 160, 0)
,(161, 161, 0)
,(162, 162, 0)
,(163, 163, 0)
;

INSERT INTO `b2b_acl_contact_role` (entity_id, referenced_entity_id, grantable) VALUES
(11, 66, 0)
 ,(11, 70, 0)
 ,(11, 72, 0)
 ,(11, 144, 0)
 ,(11, 145, 0)
 ,(11, 146, 0)
 ,(11, 147, 0)
 ,(11, 149, 0)
 ,(11, 150, 0)
 ,(11, 151, 0)
 ,(11, 152, 0)
 ,(11, 153, 0)
 ,(11, 154, 0)
 ,(11, 156, 0)
 ,(11, 158, 0)
 ,(11, 159, 0)
 ,(11, 160, 0)
 ,(11, 161, 0)
 ,(11, 162, 0)
 ,(11, 163, 0)
 ,(22, 150, 0)
 ,(22, 151, 0)
 ,(22, 152, 0)
 ,(22, 153, 0)
 ,(22, 154, 0)
 ,(22, 156, 0)
 ,(22, 158, 0)
 ,(22, 159, 0)
 ,(22, 160, 0)
 ,(22, 161, 0)
 ,(22, 162, 0)
 ,(22, 163, 0)
;

INSERT INTO `b2b_order_number` (id, custom_ordernumber, product_id, product_version_id, context_owner_id, created_at) VALUES
 (1, 'ME10001', (SELECT id FROM product WHERE active = 1 LIMIT 1), @versionId, 1, NOW())
,(2, 'ME10170', (SELECT id FROM product WHERE active = 1 LIMIT 1, 1), @versionId, 1, NOW())
;

UPDATE `currency` SET
  `iso_code` = 'B2B',
  `symbol` = '$$$$$$',
  `factor` = '2'
WHERE
`iso_code` = 'USD';

UPDATE `currency_translation` SET `short_name` = 'B2B', `name` = 'B2B-Dollar' WHERE `short_name` = 'USD';

UPDATE b2b_store_front_auth contact_auth
    RIGHT JOIN b2b_store_front_auth debtor_auth ON contact_auth.context_owner_id = debtor_auth.id
    INNER JOIN customer debtor_customer on hex(debtor_customer.id) = debtor_auth.provider_context
    INNER JOIN b2b_debtor_contact ON b2b_debtor_contact.auth_id = contact_auth.id
    INNER JOIN customer contact_customer ON contact_customer.email = b2b_debtor_contact.email AND debtor_customer.sales_channel_id = contact_customer.sales_channel_id
SET contact_auth.customer_id = contact_customer.id
WHERE contact_auth.customer_id IS NULL;

UPDATE `b2b_store_front_auth`
SET `customer_id` = UNHEX(provider_context)
WHERE id = context_owner_id;