INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1921, 0, 'opencell.admin', NULL, 'XJR', now(), NULL, 'Jar', 'Jar', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1922, 0, 'opencell.admin', NULL, 'XJT', now(), NULL, 'Jutebag', 'Jutebag', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1923, 0, 'opencell.admin', NULL, 'XJY', now(), NULL, 'Jerrican, cylindrical', 'Jerrican, cylindrical', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1924, 0, 'opencell.admin', NULL, 'XKG', now(), NULL, 'Keg', 'Keg', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1925, 0, 'opencell.admin', NULL, 'XKI', now(), NULL, 'Kit', 'Kit', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1926, 0, 'opencell.admin', NULL, 'XLE', now(), NULL, 'Luggage', 'Luggage', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1927, 0, 'opencell.admin', NULL, 'XLG', now(), NULL, 'Log', 'Log', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1928, 0, 'opencell.admin', NULL, 'XLT', now(), NULL, 'Lot', 'Lot', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1929, 0, 'opencell.admin', NULL, 'XLU', now(), NULL, 'Lug', 'Lug', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1930, 0, 'opencell.admin', NULL, 'XLV', now(), NULL, 'Liftvan', 'Liftvan', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1931, 0, 'opencell.admin', NULL, 'XLZ', now(), NULL, 'Logs, in bundle/bunch/truss', 'Logs, in bundle/bunch/truss', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1932, 0, 'opencell.admin', NULL, 'XMA', now(), NULL, 'Crate, metal', 'Crate, metal', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1933, 0, 'opencell.admin', NULL, 'XMB', now(), NULL, 'Bag, multiply', 'Bag, multiply', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1934, 0, 'opencell.admin', NULL, 'XMC', now(), NULL, 'Crate, milk', 'Crate, milk', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1935, 0, 'opencell.admin', NULL, 'XME', now(), NULL, 'Container, metal', 'Container, metal', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1936, 0, 'opencell.admin', NULL, 'XMR', now(), NULL, 'Receptacle, metal ', 'Receptacle, metal ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2087, 0, 'opencell.admin', NULL, 'XWB', now(), NULL, 'Wickerbottle ', 'Wickerbottle ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1937, 0, 'opencell.admin', NULL, 'XMS', now(), NULL, 'Sack, multi-wall ', 'Sack, multi-wall ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1938, 0, 'opencell.admin', NULL, 'XMT', now(), NULL, 'Mat', 'Mat', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1939, 0, 'opencell.admin', NULL, 'XMW', now(), NULL, 'Receptacle, plastic wrapped ', 'Receptacle, plastic wrapped ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1940, 0, 'opencell.admin', NULL, 'XMX', now(), NULL, 'Matchbox ', 'Matchbox ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1941, 0, 'opencell.admin', NULL, 'XNA', now(), NULL, 'Not available', 'Not available', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1942, 0, 'opencell.admin', NULL, 'XNE', now(), NULL, 'Unpacked or unpackaged ', 'Unpacked or unpackaged ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1943, 0, 'opencell.admin', NULL, 'XNF', now(), NULL, 'Unpacked or unpackaged, single unit', 'Unpacked or unpackaged, single unit', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1944, 0, 'opencell.admin', NULL, 'XNG', now(), NULL, 'Unpacked or unpackaged, multiple units', 'Unpacked or unpackaged, multiple units', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1945, 0, 'opencell.admin', NULL, 'XNS', now(), NULL, 'Nest ', 'Nest ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1946, 0, 'opencell.admin', NULL, 'XNT', now(), NULL, 'Net', 'Net', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1947, 0, 'opencell.admin', NULL, 'XNU', now(), NULL, 'Net, tube, plastic ', 'Net, tube, plastic ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1948, 0, 'opencell.admin', NULL, 'XNV', now(), NULL, 'Net, tube, textile ', 'Net, tube, textile ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1949, 0, 'opencell.admin', NULL, 'XO1', now(), NULL, 'Two sided cage on wheels with fixing strap', 'Two sided cage on wheels with fixing strap', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1950, 0, 'opencell.admin', NULL, 'XO2', now(), NULL, 'Trolley', 'Trolley', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1951, 0, 'opencell.admin', NULL, 'XO3', now(), NULL, 'Oneway pallet ISO 0 - 1/2 EURO Pallet', 'Oneway pallet ISO 0 - 1/2 EURO Pallet', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1952, 0, 'opencell.admin', NULL, 'XO4', now(), NULL, 'Oneway pallet ISO 1 - 1/1 EURO Pallet', 'Oneway pallet ISO 1 - 1/1 EURO Pallet', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1953, 0, 'opencell.admin', NULL, 'XO5', now(), NULL, 'Oneway pallet ISO 2 - 2/1 EURO Pallet', 'Oneway pallet ISO 2 - 2/1 EURO Pallet', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1954, 0, 'opencell.admin', NULL, 'XO6', now(), NULL, 'Pallet with exceptional dimensions', 'Pallet with exceptional dimensions', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1955, 0, 'opencell.admin', NULL, 'XO7', now(), NULL, 'Wooden pallet  40 cm x 80 cm', 'Wooden pallet  40 cm x 80 cm', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1956, 0, 'opencell.admin', NULL, 'XO8', now(), NULL, 'Plastic pallet SRS 60 cm x 80 cm', 'Plastic pallet SRS 60 cm x 80 cm', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1957, 0, 'opencell.admin', NULL, 'XO9', now(), NULL, 'Plastic pallet SRS 80 cm x 120 cm', 'Plastic pallet SRS 80 cm x 120 cm', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1958, 0, 'opencell.admin', NULL, 'XOA', now(), NULL, 'Pallet, CHEP 40 cm x 60 cm', 'Pallet, CHEP 40 cm x 60 cm', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1959, 0, 'opencell.admin', NULL, 'XOB', now(), NULL, 'Pallet, CHEP 80 cm x 120 cm', 'Pallet, CHEP 80 cm x 120 cm', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1960, 0, 'opencell.admin', NULL, 'XOC', now(), NULL, 'Pallet, CHEP 100 cm x 120 cm', 'Pallet, CHEP 100 cm x 120 cm', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1961, 0, 'opencell.admin', NULL, 'XOD', now(), NULL, 'Pallet, AS 4068-1993', 'Pallet, AS 4068-1993', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1962, 0, 'opencell.admin', NULL, 'XOE', now(), NULL, 'Pallet, ISO T11', 'Pallet, ISO T11', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1963, 0, 'opencell.admin', NULL, 'XOF', now(), NULL, 'Platform, unspecified weight or dimension', 'Platform, unspecified weight or dimension', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1964, 0, 'opencell.admin', NULL, 'XOG', now(), NULL, 'Pallet ISO 0 - 1/2 EURO Pallet', 'Pallet ISO 0 - 1/2 EURO Pallet', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1965, 0, 'opencell.admin', NULL, 'XOH', now(), NULL, 'Pallet ISO 1 - 1/1 EURO Pallet', 'Pallet ISO 1 - 1/1 EURO Pallet', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1966, 0, 'opencell.admin', NULL, 'XOI', now(), NULL, 'Pallet ISO 2  2/1 EURO Pallet', 'Pallet ISO 2  2/1 EURO Pallet', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1967, 0, 'opencell.admin', NULL, 'XOJ', now(), NULL, '1/4 EURO Pallet', '1/4 EURO Pallet', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1968, 0, 'opencell.admin', NULL, 'XOK', now(), NULL, 'Block', 'Block', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1969, 0, 'opencell.admin', NULL, 'XOL', now(), NULL, '1/8 EURO Pallet', '1/8 EURO Pallet', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1970, 0, 'opencell.admin', NULL, 'XOM', now(), NULL, 'Synthetic pallet ISO 1', 'Synthetic pallet ISO 1', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1971, 0, 'opencell.admin', NULL, 'XON', now(), NULL, 'Synthetic pallet ISO 2', 'Synthetic pallet ISO 2', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1972, 0, 'opencell.admin', NULL, 'XOP', now(), NULL, 'Wholesaler pallet', 'Wholesaler pallet', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1973, 0, 'opencell.admin', NULL, 'XOQ', now(), NULL, 'Pallet 80 X 100 cm', 'Pallet 80 X 100 cm', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1974, 0, 'opencell.admin', NULL, 'XOR', now(), NULL, 'Pallet 60 X 100 cm', 'Pallet 60 X 100 cm', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1975, 0, 'opencell.admin', NULL, 'XOS', now(), NULL, 'Oneway pallet', 'Oneway pallet', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1976, 0, 'opencell.admin', NULL, 'XOT', now(), NULL, 'Octabin', 'Octabin', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1977, 0, 'opencell.admin', NULL, 'XOU', now(), NULL, 'Container, outer', 'Container, outer', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1978, 0, 'opencell.admin', NULL, 'XOV', now(), NULL, 'Returnable pallet', 'Returnable pallet', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1979, 0, 'opencell.admin', NULL, 'XOW', now(), NULL, 'Large bag, pallet sized', 'Large bag, pallet sized', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1980, 0, 'opencell.admin', NULL, 'XOX', now(), NULL, 'A wheeled pallet with raised rim (81 x 67 x 135)', 'A wheeled pallet with raised rim (81 x 67 x 135)', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1981, 0, 'opencell.admin', NULL, 'XOY', now(), NULL, 'A Wheeled pallet with raised rim (81 x 72 x 135)', 'A Wheeled pallet with raised rim (81 x 72 x 135)', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1982, 0, 'opencell.admin', NULL, 'XOZ', now(), NULL, 'Wheeled pallet with raised rim ( 81 x 60 x 16)', 'Wheeled pallet with raised rim ( 81 x 60 x 16)', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1983, 0, 'opencell.admin', NULL, 'XP1', now(), NULL, 'CHEP pallet 60 cm x 80 cm ', 'CHEP pallet 60 cm x 80 cm ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1984, 0, 'opencell.admin', NULL, 'XP2', now(), NULL, 'Pan', 'Pan', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1985, 0, 'opencell.admin', NULL, 'XP3', now(), NULL, 'LPR pallet 60 cm x 80 cm', 'LPR pallet 60 cm x 80 cm', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1986, 0, 'opencell.admin', NULL, 'XP4', now(), NULL, 'LPR pallet 80 cm x 120 cm', 'LPR pallet 80 cm x 120 cm', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1987, 0, 'opencell.admin', NULL, 'XPA', now(), NULL, 'Packet ', 'Packet ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1988, 0, 'opencell.admin', NULL, 'XPB', now(), NULL, 'Pallet, box Combined open-ended box and pallet', 'Pallet, box Combined open-ended box and pallet', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1989, 0, 'opencell.admin', NULL, 'XPC', now(), NULL, 'Parcel ', 'Parcel ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1990, 0, 'opencell.admin', NULL, 'XPD', now(), NULL, 'Pallet, modular, collars 80cms * 100cms ', 'Pallet, modular, collars 80cms * 100cms ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1991, 0, 'opencell.admin', NULL, 'XPE', now(), NULL, 'Pallet, modular, collars 80cms * 120cms ', 'Pallet, modular, collars 80cms * 120cms ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1992, 0, 'opencell.admin', NULL, 'XPF', now(), NULL, 'Pen ', 'Pen ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1993, 0, 'opencell.admin', NULL, 'XPG', now(), NULL, 'Plate', 'Plate', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1994, 0, 'opencell.admin', NULL, 'XPH', now(), NULL, 'Pitcher', 'Pitcher', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1995, 0, 'opencell.admin', NULL, 'XPI', now(), NULL, 'Pipe ', 'Pipe ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1996, 0, 'opencell.admin', NULL, 'XPJ', now(), NULL, 'Punnet', 'Punnet', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1997, 0, 'opencell.admin', NULL, 'XPK', now(), NULL, 'Package', 'Package', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1998, 0, 'opencell.admin', NULL, 'XPL', now(), NULL, 'Pail ', 'Pail ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-1999, 0, 'opencell.admin', NULL, 'XPN', now(), NULL, 'Plank', 'Plank', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2000, 0, 'opencell.admin', NULL, 'XPO', now(), NULL, 'Pouch', 'Pouch', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2001, 0, 'opencell.admin', NULL, 'XPP', now(), NULL, 'Piece', 'Piece', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2002, 0, 'opencell.admin', NULL, 'XPR', now(), NULL, 'Receptacle, plastic ', 'Receptacle, plastic ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2003, 0, 'opencell.admin', NULL, 'XPT', now(), NULL, 'Pot', 'Pot', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2004, 0, 'opencell.admin', NULL, 'XPU', now(), NULL, 'Tray ', 'Tray ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2005, 0, 'opencell.admin', NULL, 'XPV', now(), NULL, 'Pipes, in bundle/bunch/truss ', 'Pipes, in bundle/bunch/truss ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2006, 0, 'opencell.admin', NULL, 'XPX', now(), NULL, 'Pallet ', 'Pallet ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2007, 0, 'opencell.admin', NULL, 'XPY', now(), NULL, 'Plates, in bundle/bunch/truss', 'Plates, in bundle/bunch/truss', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2008, 0, 'opencell.admin', NULL, 'XPZ', now(), NULL, 'Planks, in bundle/bunch/truss', 'Planks, in bundle/bunch/truss', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2009, 0, 'opencell.admin', NULL, 'XQA', now(), NULL, 'Drum, steel, non-removable head', 'Drum, steel, non-removable head', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2010, 0, 'opencell.admin', NULL, 'XQB', now(), NULL, 'Drum, steel, removable head', 'Drum, steel, removable head', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2011, 0, 'opencell.admin', NULL, 'XQC', now(), NULL, 'Drum, aluminium, non-removable head', 'Drum, aluminium, non-removable head', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2012, 0, 'opencell.admin', NULL, 'XQD', now(), NULL, 'Drum, aluminium, removable head', 'Drum, aluminium, removable head', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2013, 0, 'opencell.admin', NULL, 'XQF', now(), NULL, 'Drum, plastic, non-removable head', 'Drum, plastic, non-removable head', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2014, 0, 'opencell.admin', NULL, 'XQG', now(), NULL, 'Drum, plastic, removable head', 'Drum, plastic, removable head', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2015, 0, 'opencell.admin', NULL, 'XQH', now(), NULL, 'Barrel, wooden, bung type', 'Barrel, wooden, bung type', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2016, 0, 'opencell.admin', NULL, 'XQJ', now(), NULL, 'Barrel, wooden, removable head ', 'Barrel, wooden, removable head ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2017, 0, 'opencell.admin', NULL, 'XQK', now(), NULL, 'Jerrican, steel, non-removable head', 'Jerrican, steel, non-removable head', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2018, 0, 'opencell.admin', NULL, 'XQL', now(), NULL, 'Jerrican, steel, removable head', 'Jerrican, steel, removable head', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2019, 0, 'opencell.admin', NULL, 'XQM', now(), NULL, 'Jerrican, plastic, non-removable head', 'Jerrican, plastic, non-removable head', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2020, 0, 'opencell.admin', NULL, 'XQN', now(), NULL, 'Jerrican, plastic, removable head', 'Jerrican, plastic, removable head', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2021, 0, 'opencell.admin', NULL, 'XQP', now(), NULL, 'Box, wooden, natural wood, ordinary', 'Box, wooden, natural wood, ordinary', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2022, 0, 'opencell.admin', NULL, 'XQQ', now(), NULL, 'Box, wooden, natural wood, with sift proof walls', 'Box, wooden, natural wood, with sift proof walls', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2023, 0, 'opencell.admin', NULL, 'XQR', now(), NULL, 'Box, plastic, expanded ', 'Box, plastic, expanded ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2024, 0, 'opencell.admin', NULL, 'XQS', now(), NULL, 'Box, plastic, solid', 'Box, plastic, solid', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2025, 0, 'opencell.admin', NULL, 'XRD', now(), NULL, 'Rod', 'Rod', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2026, 0, 'opencell.admin', NULL, 'XRG', now(), NULL, 'Ring ', 'Ring ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2027, 0, 'opencell.admin', NULL, 'XRJ', now(), NULL, 'Rack, clothing hanger', 'Rack, clothing hanger', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2028, 0, 'opencell.admin', NULL, 'XRK', now(), NULL, 'Rack ', 'Rack ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2029, 0, 'opencell.admin', NULL, 'XRL', now(), NULL, 'Reel ', 'Reel ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2030, 0, 'opencell.admin', NULL, 'XRO', now(), NULL, 'Roll ', 'Roll ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2031, 0, 'opencell.admin', NULL, 'XRT', now(), NULL, 'Rednet ', 'Rednet ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2032, 0, 'opencell.admin', NULL, 'XRZ', now(), NULL, 'Rods, in bundle/bunch/truss', 'Rods, in bundle/bunch/truss', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2033, 0, 'opencell.admin', NULL, 'XSA', now(), NULL, 'Sack ', 'Sack ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2034, 0, 'opencell.admin', NULL, 'XSB', now(), NULL, 'Slab', 'Slab', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2035, 0, 'opencell.admin', NULL, 'XSC', now(), NULL, 'Crate, shallow ', 'Crate, shallow ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2036, 0, 'opencell.admin', NULL, 'XSD', now(), NULL, 'Spindle', 'Spindle', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2037, 0, 'opencell.admin', NULL, 'XSE', now(), NULL, 'Sea-chest', 'Sea-chest', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2038, 0, 'opencell.admin', NULL, 'XSH', now(), NULL, 'Sachet ', 'Sachet ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2039, 0, 'opencell.admin', NULL, 'XSI', now(), NULL, 'Skid ', 'Skid ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2040, 0, 'opencell.admin', NULL, 'XSK', now(), NULL, 'Case, skeleton ', 'Case, skeleton ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2041, 0, 'opencell.admin', NULL, 'XSL', now(), NULL, 'Slipsheet ', 'Slipsheet ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2042, 0, 'opencell.admin', NULL, 'XSM', now(), NULL, 'Sheetmetal ', 'Sheetmetal ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2043, 0, 'opencell.admin', NULL, 'XSO', now(), NULL, 'Spool ', 'Spool ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2044, 0, 'opencell.admin', NULL, 'XSP', now(), NULL, 'Sheet, plastic wrapping', 'Sheet, plastic wrapping', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2045, 0, 'opencell.admin', NULL, 'XSS', now(), NULL, 'Case, steel', 'Case, steel', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2046, 0, 'opencell.admin', NULL, 'XST', now(), NULL, 'Sheet', 'Sheet', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2047, 0, 'opencell.admin', NULL, 'XSU', now(), NULL, 'Suitcase ', 'Suitcase ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2048, 0, 'opencell.admin', NULL, 'XSV', now(), NULL, 'Envelope, steel', 'Envelope, steel', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2049, 0, 'opencell.admin', NULL, 'XSW', now(), NULL, 'Shrinkwrapped  ', 'Shrinkwrapped  ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2050, 0, 'opencell.admin', NULL, 'XSX', now(), NULL, 'Set', 'Set', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2051, 0, 'opencell.admin', NULL, 'XSY', now(), NULL, 'Sleeve', 'Sleeve', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2052, 0, 'opencell.admin', NULL, 'XSZ', now(), NULL, 'Sheets, in bundle/bunch/truss', 'Sheets, in bundle/bunch/truss', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2053, 0, 'opencell.admin', NULL, 'XT1', now(), NULL, 'Tablet', 'Tablet', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2054, 0, 'opencell.admin', NULL, 'XTB', now(), NULL, 'Tub', 'Tub', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2055, 0, 'opencell.admin', NULL, 'XTC', now(), NULL, 'Tea-chest', 'Tea-chest', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2056, 0, 'opencell.admin', NULL, 'XTD', now(), NULL, 'Tube, collapsible', 'Tube, collapsible', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2057, 0, 'opencell.admin', NULL, 'XTE', now(), NULL, 'Tyre', 'Tyre', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2058, 0, 'opencell.admin', NULL, 'XTG', now(), NULL, 'Tank container, generic', 'Tank container, generic', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2059, 0, 'opencell.admin', NULL, 'XTI', now(), NULL, 'Tierce', 'Tierce', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2060, 0, 'opencell.admin', NULL, 'XTK', now(), NULL, 'Tank, rectangular', 'Tank, rectangular', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2061, 0, 'opencell.admin', NULL, 'XTL', now(), NULL, 'Tub, with lid', 'Tub, with lid', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2062, 0, 'opencell.admin', NULL, 'XTN', now(), NULL, 'Tin', 'Tin', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2063, 0, 'opencell.admin', NULL, 'XTO', now(), NULL, 'Tun', 'Tun', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2064, 0, 'opencell.admin', NULL, 'XTR', now(), NULL, 'Trunk', 'Trunk', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2065, 0, 'opencell.admin', NULL, 'XTS', now(), NULL, 'Truss', 'Truss', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2066, 0, 'opencell.admin', NULL, 'XTT', now(), NULL, 'Bag, tote', 'Bag, tote', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2067, 0, 'opencell.admin', NULL, 'XTU', now(), NULL, 'Tube ', 'Tube ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2068, 0, 'opencell.admin', NULL, 'XTV', now(), NULL, 'Tube, with nozzle ', 'Tube, with nozzle ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2069, 0, 'opencell.admin', NULL, 'XTW', now(), NULL, 'Pallet, triwall', 'Pallet, triwall', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2070, 0, 'opencell.admin', NULL, 'XTY', now(), NULL, 'Tank, cylindrical', 'Tank, cylindrical', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2071, 0, 'opencell.admin', NULL, 'XTZ', now(), NULL, 'Tubes, in bundle/bunch/truss ', 'Tubes, in bundle/bunch/truss ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2072, 0, 'opencell.admin', NULL, 'XUC', now(), NULL, 'Uncaged ', 'Uncaged ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2073, 0, 'opencell.admin', NULL, 'XUN', now(), NULL, 'Unit', 'Unit', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2074, 0, 'opencell.admin', NULL, 'XVA', now(), NULL, 'Vat', 'Vat', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2075, 0, 'opencell.admin', NULL, 'XVG', now(), NULL, 'Bulk, gas (at 1031 mbar and 15°C)', 'Bulk, gas (at 1031 mbar and 15°C)', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2076, 0, 'opencell.admin', NULL, 'XVI', now(), NULL, 'Vial ', 'Vial ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2077, 0, 'opencell.admin', NULL, 'XVK', now(), NULL, 'Vanpack ', 'Vanpack ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2078, 0, 'opencell.admin', NULL, 'XVL', now(), NULL, 'Bulk, liquid ', 'Bulk, liquid ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2079, 0, 'opencell.admin', NULL, 'XVN', now(), NULL, 'Vehicle', 'Vehicle', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2080, 0, 'opencell.admin', NULL, 'XVO', now(), NULL, 'Bulk, solid, large particles (nodules) ', 'Bulk, solid, large particles (nodules) ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2081, 0, 'opencell.admin', NULL, 'XVP', now(), NULL, 'Vacuum-packed', 'Vacuum-packed', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2082, 0, 'opencell.admin', NULL, 'XVQ', now(), NULL, 'Bulk, liquefied gas (at abnormal temperature/pressure) ', 'Bulk, liquefied gas (at abnormal temperature/pressure) ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2083, 0, 'opencell.admin', NULL, 'XVR', now(), NULL, 'Bulk, solid, granular particles (grains) ', 'Bulk, solid, granular particles (grains) ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2084, 0, 'opencell.admin', NULL, 'XVS', now(), NULL, 'Bulk, scrap metal', 'Bulk, scrap metal', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2085, 0, 'opencell.admin', NULL, 'XVY', now(), NULL, 'Bulk, solid, fine particles (powders)', 'Bulk, solid, fine particles (powders)', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2086, 0, 'opencell.admin', NULL, 'XWA', now(), NULL, 'Intermediate bulk container', 'Intermediate bulk container', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2088, 0, 'opencell.admin', NULL, 'XWC', now(), NULL, 'Intermediate bulk container, steel ', 'Intermediate bulk container, steel ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2089, 0, 'opencell.admin', NULL, 'XWD', now(), NULL, 'Intermediate bulk container, aluminium ', 'Intermediate bulk container, aluminium ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2090, 0, 'opencell.admin', NULL, 'XWF', now(), NULL, 'Intermediate bulk container, metal ', 'Intermediate bulk container, metal ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2091, 0, 'opencell.admin', NULL, 'XWG', now(), NULL, 'Intermediate bulk container, steel, pressurised > 10 kpa', 'Intermediate bulk container, steel, pressurised > 10 kpa', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2092, 0, 'opencell.admin', NULL, 'XWH', now(), NULL, 'Intermediate bulk container, aluminium, pressurised > 10 kpa', 'Intermediate bulk container, aluminium, pressurised > 10 kpa', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2093, 0, 'opencell.admin', NULL, 'XWJ', now(), NULL, 'Intermediate bulk container, metal, pressure 10 kpa ', 'Intermediate bulk container, metal, pressure 10 kpa ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2094, 0, 'opencell.admin', NULL, 'XWK', now(), NULL, 'Intermediate bulk container, steel, liquid ', 'Intermediate bulk container, steel, liquid ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2095, 0, 'opencell.admin', NULL, 'XWL', now(), NULL, 'Intermediate bulk container, aluminium, liquid ', 'Intermediate bulk container, aluminium, liquid ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2096, 0, 'opencell.admin', NULL, 'XWM', now(), NULL, 'Intermediate bulk container, metal, liquid ', 'Intermediate bulk container, metal, liquid ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2097, 0, 'opencell.admin', NULL, 'XWN', now(), NULL, 'Intermediate bulk container, woven plastic, without coat/liner ', 'Intermediate bulk container, woven plastic, without coat/liner ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2098, 0, 'opencell.admin', NULL, 'XWP', now(), NULL, 'Intermediate bulk container, woven plastic, coated ', 'Intermediate bulk container, woven plastic, coated ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2099, 0, 'opencell.admin', NULL, 'XWQ', now(), NULL, 'Intermediate bulk container, woven plastic, with liner ', 'Intermediate bulk container, woven plastic, with liner ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2100, 0, 'opencell.admin', NULL, 'XWR', now(), NULL, 'Intermediate bulk container, woven plastic, coated and liner ', 'Intermediate bulk container, woven plastic, coated and liner ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2101, 0, 'opencell.admin', NULL, 'XWS', now(), NULL, 'Intermediate bulk container, plastic film', 'Intermediate bulk container, plastic film', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2102, 0, 'opencell.admin', NULL, 'XWT', now(), NULL, 'Intermediate bulk container, textile with out coat/liner ', 'Intermediate bulk container, textile with out coat/liner ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2103, 0, 'opencell.admin', NULL, 'XWU', now(), NULL, 'Intermediate bulk container, natural wood, with inner liner', 'Intermediate bulk container, natural wood, with inner liner', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2104, 0, 'opencell.admin', NULL, 'XWV', now(), NULL, 'Intermediate bulk container, textile, coated ', 'Intermediate bulk container, textile, coated ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2105, 0, 'opencell.admin', NULL, 'XWW', now(), NULL, 'Intermediate bulk container, textile, with liner ', 'Intermediate bulk container, textile, with liner ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2106, 0, 'opencell.admin', NULL, 'XWX', now(), NULL, 'Intermediate bulk container, textile, coated and liner ', 'Intermediate bulk container, textile, coated and liner ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2107, 0, 'opencell.admin', NULL, 'XWY', now(), NULL, 'Intermediate bulk container, plywood, with inner liner ', 'Intermediate bulk container, plywood, with inner liner ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2108, 0, 'opencell.admin', NULL, 'XWZ', now(), NULL, 'Intermediate bulk container, reconstituted wood, with inner liner', 'Intermediate bulk container, reconstituted wood, with inner liner', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2109, 0, 'opencell.admin', NULL, 'XXA', now(), NULL, 'Bag, woven plastic, without inner coat/liner ', 'Bag, woven plastic, without inner coat/liner ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2110, 0, 'opencell.admin', NULL, 'XXB', now(), NULL, 'Bag, woven plastic, sift proof ', 'Bag, woven plastic, sift proof ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2111, 0, 'opencell.admin', NULL, 'XXC', now(), NULL, 'Bag, woven plastic, water resistant', 'Bag, woven plastic, water resistant', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2112, 0, 'opencell.admin', NULL, 'XXD', now(), NULL, 'Bag, plastics film ', 'Bag, plastics film ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2113, 0, 'opencell.admin', NULL, 'XXF', now(), NULL, 'Bag, textile, without inner coat/liner ', 'Bag, textile, without inner coat/liner ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2114, 0, 'opencell.admin', NULL, 'XXG', now(), NULL, 'Bag, textile, sift proof ', 'Bag, textile, sift proof ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2115, 0, 'opencell.admin', NULL, 'XXH', now(), NULL, 'Bag, textile, water resistant', 'Bag, textile, water resistant', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2116, 0, 'opencell.admin', NULL, 'XXJ', now(), NULL, 'Bag, paper, multi-wall ', 'Bag, paper, multi-wall ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2117, 0, 'opencell.admin', NULL, 'XXK', now(), NULL, 'Bag, paper, multi-wall, water resistant', 'Bag, paper, multi-wall, water resistant', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2118, 0, 'opencell.admin', NULL, 'XYA', now(), NULL, 'Composite packaging, plastic receptacle in steel drum', 'Composite packaging, plastic receptacle in steel drum', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2119, 0, 'opencell.admin', NULL, 'XYB', now(), NULL, 'Composite packaging, plastic receptacle in steel crate box', 'Composite packaging, plastic receptacle in steel crate box', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2120, 0, 'opencell.admin', NULL, 'XYC', now(), NULL, 'Composite packaging, plastic receptacle in aluminium drum', 'Composite packaging, plastic receptacle in aluminium drum', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2121, 0, 'opencell.admin', NULL, 'XYD', now(), NULL, 'Composite packaging, plastic receptacle in aluminium crate', 'Composite packaging, plastic receptacle in aluminium crate', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2122, 0, 'opencell.admin', NULL, 'XYF', now(), NULL, 'Composite packaging, plastic receptacle in wooden box', 'Composite packaging, plastic receptacle in wooden box', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2123, 0, 'opencell.admin', NULL, 'XYG', now(), NULL, 'Composite packaging, plastic receptacle in plywood drum', 'Composite packaging, plastic receptacle in plywood drum', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2124, 0, 'opencell.admin', NULL, 'XYH', now(), NULL, 'Composite packaging, plastic receptacle in plywood box ', 'Composite packaging, plastic receptacle in plywood box ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2125, 0, 'opencell.admin', NULL, 'XYJ', now(), NULL, 'Composite packaging, plastic receptacle in fibre drum', 'Composite packaging, plastic receptacle in fibre drum', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2126, 0, 'opencell.admin', NULL, 'XYK', now(), NULL, 'Composite packaging, plastic receptacle in fibreboard box', 'Composite packaging, plastic receptacle in fibreboard box', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2127, 0, 'opencell.admin', NULL, 'XYL', now(), NULL, 'Composite packaging, plastic receptacle in plastic drum', 'Composite packaging, plastic receptacle in plastic drum', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2128, 0, 'opencell.admin', NULL, 'XYM', now(), NULL, 'Composite packaging, plastic receptacle in solid plastic box', 'Composite packaging, plastic receptacle in solid plastic box', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2129, 0, 'opencell.admin', NULL, 'XYN', now(), NULL, 'Composite packaging, glass receptacle in steel drum', 'Composite packaging, glass receptacle in steel drum', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2130, 0, 'opencell.admin', NULL, 'XYP', now(), NULL, 'Composite packaging, glass receptacle in steel crate box', 'Composite packaging, glass receptacle in steel crate box', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2131, 0, 'opencell.admin', NULL, 'XYQ', now(), NULL, 'Composite packaging, glass receptacle in aluminium drum', 'Composite packaging, glass receptacle in aluminium drum', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2132, 0, 'opencell.admin', NULL, 'XYR', now(), NULL, 'Composite packaging, glass receptacle in aluminium crate', 'Composite packaging, glass receptacle in aluminium crate', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2133, 0, 'opencell.admin', NULL, 'XYS', now(), NULL, 'Composite packaging, glass receptacle in wooden box', 'Composite packaging, glass receptacle in wooden box', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2134, 0, 'opencell.admin', NULL, 'XYT', now(), NULL, 'Composite packaging, glass receptacle in plywood drum', 'Composite packaging, glass receptacle in plywood drum', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2135, 0, 'opencell.admin', NULL, 'XYV', now(), NULL, 'Composite packaging, glass receptacle in wickerwork hamper', 'Composite packaging, glass receptacle in wickerwork hamper', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2136, 0, 'opencell.admin', NULL, 'XYW', now(), NULL, 'Composite packaging, glass receptacle in fibre drum', 'Composite packaging, glass receptacle in fibre drum', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2137, 0, 'opencell.admin', NULL, 'XYX', now(), NULL, 'Composite packaging, glass receptacle in fibreboard box ', 'Composite packaging, glass receptacle in fibreboard box ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2138, 0, 'opencell.admin', NULL, 'XYY', now(), NULL, 'Composite packaging, glass receptacle in expandable plastic pack', 'Composite packaging, glass receptacle in expandable plastic pack', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2139, 0, 'opencell.admin', NULL, 'XYZ', now(), NULL, 'Composite packaging, glass receptacle in solid plastic pack', 'Composite packaging, glass receptacle in solid plastic pack', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2140, 0, 'opencell.admin', NULL, 'XZA', now(), NULL, 'Intermediate bulk container, paper, multi-wall ', 'Intermediate bulk container, paper, multi-wall ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2141, 0, 'opencell.admin', NULL, 'XZB', now(), NULL, 'Bag, large ', 'Bag, large ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2142, 0, 'opencell.admin', NULL, 'XZC', now(), NULL, 'Intermediate bulk container, paper, multi-wall, water resistant', 'Intermediate bulk container, paper, multi-wall, water resistant', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2143, 0, 'opencell.admin', NULL, 'XZD', now(), NULL, 'Intermediate bulk container, rigid plastic, with structural equipment, solids', 'Intermediate bulk container, rigid plastic, with structural equipment, solids', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2144, 0, 'opencell.admin', NULL, 'XZF', now(), NULL, 'Intermediate bulk container, rigid plastic, freestanding, solids', 'Intermediate bulk container, rigid plastic, freestanding, solids', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2145, 0, 'opencell.admin', NULL, 'XZG', now(), NULL, 'Intermediate bulk container, rigid plastic, with structural equipment, pressurised', 'Intermediate bulk container, rigid plastic, with structural equipment, pressurised', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2146, 0, 'opencell.admin', NULL, 'XZH', now(), NULL, 'Intermediate bulk container, rigid plastic, freestanding, pressurised', 'Intermediate bulk container, rigid plastic, freestanding, pressurised', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2147, 0, 'opencell.admin', NULL, 'XZJ', now(), NULL, 'Intermediate bulk container, rigid plastic, with structural equipment, liquids ', 'Intermediate bulk container, rigid plastic, with structural equipment, liquids ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2148, 0, 'opencell.admin', NULL, 'XZK', now(), NULL, 'Intermediate bulk container, rigid plastic, freestanding, liquids', 'Intermediate bulk container, rigid plastic, freestanding, liquids', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2149, 0, 'opencell.admin', NULL, 'XZL', now(), NULL, 'Intermediate bulk container, composite, rigid plastic, solids', 'Intermediate bulk container, composite, rigid plastic, solids', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2150, 0, 'opencell.admin', NULL, 'XZM', now(), NULL, 'Intermediate bulk container, composite, flexible plastic, solids', 'Intermediate bulk container, composite, flexible plastic, solids', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2151, 0, 'opencell.admin', NULL, 'XZN', now(), NULL, 'Intermediate bulk container, composite, rigid plastic, pressurised ', 'Intermediate bulk container, composite, rigid plastic, pressurised ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2152, 0, 'opencell.admin', NULL, 'XZP', now(), NULL, 'Intermediate bulk container, composite, flexible plastic, pressurised', 'Intermediate bulk container, composite, flexible plastic, pressurised', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2153, 0, 'opencell.admin', NULL, 'XZQ', now(), NULL, 'Intermediate bulk container, composite, rigid plastic, liquids', 'Intermediate bulk container, composite, rigid plastic, liquids', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2154, 0, 'opencell.admin', NULL, 'XZR', now(), NULL, 'Intermediate bulk container, composite, flexible plastic, liquids ', 'Intermediate bulk container, composite, flexible plastic, liquids ', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2155, 0, 'opencell.admin', NULL, 'XZS', now(), NULL, 'Intermediate bulk container, composite', 'Intermediate bulk container, composite', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2156, 0, 'opencell.admin', NULL, 'XZT', now(), NULL, 'Intermediate bulk container, fibreboard', 'Intermediate bulk container, fibreboard', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2157, 0, 'opencell.admin', NULL, 'XZU', now(), NULL, 'Intermediate bulk container, flexible', 'Intermediate bulk container, flexible', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2158, 0, 'opencell.admin', NULL, 'XZV', now(), NULL, 'Intermediate bulk container, metal, other than steel', 'Intermediate bulk container, metal, other than steel', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2159, 0, 'opencell.admin', NULL, 'XZW', now(), NULL, 'Intermediate bulk container, natural wood', 'Intermediate bulk container, natural wood', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2160, 0, 'opencell.admin', NULL, 'XZX', now(), NULL, 'Intermediate bulk container, plywood', 'Intermediate bulk container, plywood', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2161, 0, 'opencell.admin', NULL, 'XZY', now(), NULL, 'Intermediate bulk container, reconstituted wood', 'Intermediate bulk container, reconstituted wood', NULL, 1, NULL);

INSERT INTO public.CAT_UNIT_OF_MEASURE (id,version,creator,updater,code,created,updated,symbol,description,description_i18n,multiplicator,parent_id) VALUES (-2162, 0, 'opencell.admin', NULL, 'XZZ', now(), NULL, 'Mutually defined ', 'Mutually defined ', NULL, 1, NULL);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-13957_20230213', 'houdad', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4001, '9:59b5224986ac3f25d04e614f866e3359', 'sql', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::INTRD-4724_20220201::TarikRabeh
INSERT INTO ar_occ_template (id, version, created, creator, accounting_code_id, account_code_client_side, code, description, occ_category, journal_id, manual_creation_enabled, contra_accounting_code_id, accounting_scheme_id) VALUES (-51, 0, NOW(), 'opencell.admin', (SELECT id FROM billing_accounting_code WHERE code = '512010000'), 165000000, 'CRD_SD', 'Credit for Security deposit transfer', 'CREDIT', (SELECT id FROM journal WHERE code = 'MSC'), '0', (SELECT id FROM billing_accounting_code WHERE code = '411000000'), (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'));

INSERT INTO ar_occ_template (id, version, created, creator, accounting_code_id, account_code_client_side, code, description, occ_category, journal_id, manual_creation_enabled, contra_accounting_code_id, accounting_scheme_id) VALUES (-52, 0, NOW(), 'opencell.admin', (SELECT id FROM billing_accounting_code WHERE code = '701010000'), 41100000, 'DEB_SD', 'Debit for Security deposit transfer', 'DEBIT', (SELECT id FROM journal WHERE code = 'BAN'), '0', (SELECT id FROM billing_accounting_code WHERE code = '411000000'), (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'));

INSERT INTO ar_occ_template (id, version, created, accounting_code_id, account_code_client_side, code, description, occ_category, journal_id, creator, manual_creation_enabled, contra_accounting_code_id, accounting_scheme_id) VALUES (-53, 0, NOW(), (SELECT id FROM billing_accounting_code WHERE code = '411000000'), 512010000, 'REF_SD', 'Refund of Security deposit transfer', 'DEBIT', (SELECT id FROM journal WHERE code = 'BAN'), 'opencell.admin', '0', (SELECT id FROM billing_accounting_code WHERE code = '511011000'), (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'));

INSERT INTO billing_seq_invoice (id, version, code, description, sequence_size, created, creator) VALUES (-6, 0, 'SECURITY_DEPOSIT', 'Security Deposit', 9, NOW(), 'opencell.admin');

INSERT INTO billing_invoice_type (id, version, created, creator, code, description, description_i18n, invoice_sequence_id, occ_template_id, uuid, vat_payment_option_id, invoice_code_type_id, invoice_subject_code) VALUES (-6, 0, NOW(), 'opencell.admin', 'SECURITY_DEPOSIT', 'Security deposit', '{"FRA":"Dépôt de garantie","ENG":"Security deposit"}', -6, -52, 'InvoiceType-SECURITY_DEPOSIT', '1', '30', (SELECT id FROM untdid_4451_invoice_subject_code where code = 'IND'));

INSERT INTO billing_invoice_cat (id, code, description, created, creator, uuid, version) VALUES ('-4', 'ICAT_SECURITY_DEPOSIT', 'Security Deposit”', NOW(), 'opencell.admin', 'billing_invoice_cat_icat_security_deposit', 0);

INSERT INTO billing_invoice_sub_cat (id, invoice_category_id, version, code, description, created, creator, uuid) VALUES ('-4', '-4', 0, 'ISCAT_SECURITY_DEPOSIT', 'ISCAT_SECURITY_DEPOSIT', NOW(), 'opencell.admin', 'billing_invoice_sub_cat_iscat_security_deposit');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-4724_20220201', 'TarikRabeh', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4003, '9:41029a95ea309405fbcc253167283a80', 'insert tableName=ar_occ_template; insert tableName=ar_occ_template; insert tableName=ar_occ_template; insert tableName=billing_seq_invoice; insert tableName=billing_invoice_type; insert tableName=billing_invoice_cat; insert tableName=billing_invoi...', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::INTRD-5089_20220215::TarikRabeh
INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-5089_20220215', 'TarikRabeh', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4005, '9:d41d8cd98f00b204e9800998ecf8427e', 'empty', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#INTRD-5344_2022-02_25::hichamELHALOUI
INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-5344_2022-02_25', 'hichamELHALOUI', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4007, '9:d41d8cd98f00b204e9800998ecf8427e', 'empty', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#INTRD-5888_2022-03_23::hichamELHALOUI
INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-5888_2022-03_23', 'hichamELHALOUI', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4009, '9:d41d8cd98f00b204e9800998ecf8427e', 'empty', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::INTRD-5997_20220330::HichamELHALOUI
INSERT INTO ar_occ_template (id, version, created, code, description, occ_category, journal_id, creator, accounting_code_id, contra_accounting_code_id, contra_accounting_code2_id, accounting_scheme_id) VALUES (-60, 0, NOW(), 'PAY_CASH', 'Payment - cash', 'CREDIT', '-2', 'opencell.admin', (SELECT id FROM billing_accounting_code WHERE code='411000000'), (SELECT id FROM billing_accounting_code WHERE code='531100000'), (SELECT id FROM billing_accounting_code WHERE code='419100000'), (SELECT id FROM ar_accounting_scheme WHERE code = 'Payment entry scheme'));

INSERT INTO ar_occ_template (id, version, created, code, description, occ_category, journal_id, creator, accounting_code_id, contra_accounting_code_id, contra_accounting_code2_id, accounting_scheme_id) VALUES (-61, 0, NOW(), 'PAY_WIRE', 'Payment - wiretransfer', 'CREDIT', '-2', 'opencell.admin', (SELECT id FROM billing_accounting_code WHERE code='411000000'), (SELECT id FROM billing_accounting_code WHERE code='512000000'), (SELECT id FROM billing_accounting_code WHERE code='419100000'), (SELECT id FROM ar_accounting_scheme WHERE code = 'Payment entry scheme'));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-5997_20220330', 'HichamELHALOUI', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4011, '9:eb2d29626df16b1ce0b3aaa2b3b3766e', 'insert tableName=ar_occ_template; insert tableName=ar_occ_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#INTRD-6341_20220406::aelmalki
UPDATE ar_occ_template SET accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Invoice and Credit Note'), contra_accounting_code2_id = (SELECT id FROM billing_accounting_code WHERE code='445710000'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code='701000000') WHERE code IN ('INV_STD', 'INV_CRN');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-6341_20220406', 'aelmalki', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4013, '9:46fdda853fee2b7da162a0354c23b77d', 'update tableName=ar_occ_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#INTRD-11745_20221130_build::TarikFA.
INSERT INTO ar_occ_template (id, version, created, code, description, occ_category, manual_creation_enabled, contra_accounting_code_id, contra_accounting_code2_id, accounting_scheme_id, account_code_client_side, journal_id, accounting_code_id) VALUES (-26, 0, NOW(), 'ADJ_REF', 'Refundable adjustment', 'CREDIT', '0', (SELECT id FROM billing_accounting_code WHERE code='701000000'), (SELECT id FROM billing_accounting_code WHERE code='445710000'), (SELECT id FROM ar_accounting_scheme WHERE code='Invoice and Credit Note'), '701000000', '-1', '-6');

INSERT INTO ar_occ_template (id, version, created, code, description, occ_category, manual_creation_enabled, contra_accounting_code_id, contra_accounting_code2_id, accounting_scheme_id, account_code_client_side, journal_id, accounting_code_id) VALUES (-27, 0, NOW(), 'ADJ_INV', 'Adjustment on invoice', 'CREDIT', '0', (SELECT id FROM billing_accounting_code WHERE code='701000000'), (SELECT id FROM billing_accounting_code WHERE code='445710000'), (SELECT id FROM ar_accounting_scheme WHERE code='Invoice and Credit Note'), '701000000', '-1', '-6');

INSERT INTO billing_invoice_type (id, version, created, creator, code, description, description_i18n, invoice_sequence_id, occ_template_id, matching_auto, uuid, invoice_accountable, vat_payment_option_id, invoice_code_type_id, invoice_subject_code, occ_templ_negative_id) VALUES (-7, 0, NOW(), 'OPENCELL.ADMIN', 'ADJ_REF', 'Refundable credit note', '{"FRA":"Avoir remboursable","ENG":"Refundable credit note"}', (SELECT id from billing_seq_invoice where code = 'ADJ'), '-26', 0, 'InvoiceType-ADJ-REF', '1', '1', '19', (SELECT id FROM untdid_4451_invoice_subject_code where code = 'IND'), (SELECT id FROM ar_occ_template WHERE code = 'INV_STD'));

INSERT INTO billing_invoice_type (id, version, created, creator, code, description, description_i18n, invoice_sequence_id, occ_template_id, matching_auto, uuid, invoice_accountable, vat_payment_option_id, invoice_code_type_id, invoice_subject_code, occ_templ_negative_id) VALUES (-8, 0, NOW(), 'OPENCELL.ADMIN', 'ADJ_INV', 'Credit note on invoice', '{"FRA":"Avoir sur facture","ENG":"Credit note on invoice"}', (SELECT id from billing_seq_invoice where code = 'ADJ'), '-27', 0, 'InvoiceType-ADJ-INV', '1', '1', '19', (SELECT id FROM untdid_4451_invoice_subject_code where code = 'IND'), (SELECT id FROM ar_occ_template WHERE code = 'INV_STD'));

INSERT INTO billing_invoice_type_applies_to (invoice_type_id, applies_to_id) VALUES (-8, -1);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-11745_20221130_build', 'TarikFA.', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4015, '9:6ceb3921b1909da9668ed400925b2af0', 'insert tableName=ar_occ_template; insert tableName=ar_occ_template; insert tableName=billing_invoice_type; insert tableName=billing_invoice_type; insert tableName=billing_invoice_type_applies_to', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#INTRD-12024_20221202_build::aeljaouhari
INSERT INTO billing_seq_invoice (id, version, code, description, sequence_size, created, creator) VALUES (-9, 0, 'COMMERCIAL_ORDER', 'Commercial order', 9, NOW(), 'opencell.admin');

INSERT INTO billing_invoice_type (id, version, created, creator, code, description, description_i18n, invoice_sequence_id, occ_template_id, uuid, vat_payment_option_id, prefix_el, billing_template_name_el, invoice_code_type_id, invoice_subject_code) VALUES (-9, 0, NOW(), 'opencell.admin', 'COMMERCIAL_ORDER', 'Commercial order', '{"FRA":"Commande","ENG":"Commercial order"}', -9, -25, 'InvoiceType-COMMERCIAL_ORDER', '1', 'ORDER_', 'commercial_order_new', (select id from untdid_1001_invoice_code_type uict where code = '220'), (select id from untdid_4451_invoice_subject_code where code = 'ORI'));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-12024_20221202_build', 'aeljaouhari', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4017, '9:22bcfbbbb06e0fe9af12fd3baa9aacca', 'insert tableName=billing_seq_invoice; insert tableName=billing_invoice_type', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::INTRD-15222_20230424::aelmalki
INSERT INTO billing_invoice_type_applies_to (invoice_type_id, applies_to_id) VALUES ((select id from billing_invoice_type where code = 'ADJ'), (select id from billing_invoice_type where code = 'COMMERCIAL_ORDER'));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-15222_20230424', 'aelmalki', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4019, '9:fa6de6c8eb65b6b87dfea3792e0e10b8', 'insert tableName=billing_invoice_type_applies_to', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#OUTRD-49_20220913::HamzaBiadi
INSERT INTO meveo_job_instance (id, version, disabled, created, job_category, job_template, code, creator, job_speed, cluster_behavior, verbose_report, cf_values) VALUES (nextval('meveo_job_instance_seq'), 0, 0, NOW(), 'MEDIATION', 'FlatFileProcessingJob', 'massImportUserAccountJob', 'opencell.admin', 'NORMAL', 'LIMIT_TO_SINGLE_NODE', 1, '{"nbRuns": [{"long": 1}], "oneFilePerJob": [{"boolean": false}], "waitingMillis": [{"long": 0}], "FlatFileProcessingJob_inputDir": [{"string": "/imports/massImport/userAccount/input"}], "FlatFileProcessingJob_outputDir": [{"string": "/imports/massImport/userAccount/output"}], "FlatFileProcessingJob_rejectDir": [{"string": "/imports/massImport/userAccount/reject"}], "FlatFileProcessingJob_archiveDir": [{"string": "/imports/massImport/userAccount/archive"}], "FlatFileProcessingJob_errorAction": [{"string": "CONTINUE"}], "FlatFileProcessingJob_mappingConf": [{"string": "<beanio\r\n        xmlns=\"http://www.beanio.org/2012/03\"\r\n        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n        xsi:schemaLocation=\"http://www.beanio.org/2012/03 http://www.beanio.org/2012/03/mapping.xsd\">\r\n    <stream name=\"record\" format=\"csv\">\r\n        <parser>\r\n            <property name=\"delimiter\" value=\";\"/>\r\n            <property name=\"comments\" value=\"END\"/>\r\n            <property name=\"multilineEnabled\" value=\"true\"/>\r\n        </parser>\r\n        <record name=\"header\" minOccurs=\"1\" maxOccurs=\"1\" class=\"map\">\r\n            <field name=\"OC_ENTITY\" ignore=\"true\" />\r\n            <field name=\"OC_ACTION\" ignore=\"true\" />\r\n            <field name=\"OC_BILLINGACCOUNT_CODE\" ignore=\"true\"/>\r\n          \t<field name=\"OC_PARENT_UA_CODE\" ignore=\"true\"/>\r\n            <field name=\"OC_USERACCOUNT_CODE\" ignore=\"true\"/>\r\n            <field name=\"OC_USERACCOUNT_ DESCRIPTION\" ignore=\"true\"/>\r\n            <field name=\"OC_UA_DATE\" ignore=\"true\"/>\r\n            <field name=\"OC_UA_REGISTRATION\" ignore=\"true\"/>\r\n            <field name=\"OC_UA_TVANUMBER\" ignore=\"true\"/>\r\n            <field name=\"OC_UA_TITLE\" ignore=\"true\"/>\r\n            <field name=\"OC_UA_FNAME\" ignore=\"true\"/>\r\n            <field name=\"OC_UA_LNAME\" ignore=\"true\"/>\r\n            <field name=\"OC_UA_ORGANIZATION\" ignore=\"true\"/>\r\n        </record>\r\n        <record name=\"details\" minOccurs=\"1\" maxOccurs=\"unbounded\" class=\"map\">\r\n            <field name=\"OC_ENTITY\" required=\"true\"/>\r\n            <field name=\"OC_ACTION\" required=\"true\"/>\r\n            <field name=\"OC_BILLINGACCOUNT_CODE\"/>\r\n          \t<field name=\"OC_PARENT_UA_CODE\"/>\r\n            <field name=\"OC_USERACCOUNT_CODE\"/>\r\n            <field name=\"OC_USERACCOUNT_ DESCRIPTION\"/>\r\n            <field name=\"OC_UA_DATE\"/>\r\n            <field name=\"OC_UA_REGISTRATION\"/>\r\n            <field name=\"OC_UA_TVANUMBER\"/>\r\n            <field name=\"OC_UA_TITLE\"/>\r\n            <field name=\"OC_UA_FNAME\"/>\r\n            <field name=\"OC_UA_LNAME\" required=\"true\"/>\r\n            <field name=\"OC_UA_ORGANIZATION\"/>\r\n            <field name=\"OC_CFS\" type=\"String\" collection=\"list\" minOccurs=\"0\" maxOccurs=\"unbounded\" />\r\n        </record>\r\n    </stream>\r\n</beanio>\r\n"}], "FlatFileProcessingJob_scriptsFlow": [{"string": "org.meveo.service.script.UserAccountImportScript"}], "FlatFileProcessingJob_formatTransfo": [{"string": "None"}], "FlatFileProcessingJob_originFilename": [{"string": "origin_filename"}], "FlatFileProcessingJob_nbLinesToProcess": [{"long": 1}], "FlatFileProcessingJob_fileNameExtension": [{"string": "csv"}], "FlatFileProcessingJob_recordVariableName": [{"string": "record"}]}');

INSERT INTO meveo_job_instance (id, version, disabled, created, job_category, job_template, code, creator, job_speed, cluster_behavior, verbose_report, following_job_id, cf_values) VALUES (nextval('meveo_job_instance_seq'), 0, 0, NOW(), 'MEDIATION', 'FlatFileProcessingJob', 'massImportBillingAccountJob', 'opencell.admin', 'NORMAL', 'LIMIT_TO_SINGLE_NODE', 1, (SELECT id from meveo_job_instance where code = 'massImportUserAccountJob'), '{"nbRuns": [{"long": 1}], "oneFilePerJob": [{"boolean": false}], "waitingMillis": [{"long": 0}], "FlatFileProcessingJob_inputDir": [{"string": "/imports/massImport/billingAccount/input"}], "FlatFileProcessingJob_outputDir": [{"string": "/imports/massImport/billingAccount/output"}], "FlatFileProcessingJob_rejectDir": [{"string": "/imports/massImport/billingAccount/reject"}], "FlatFileProcessingJob_archiveDir": [{"string": "/imports/massImport/billingAccount/archive"}], "FlatFileProcessingJob_errorAction": [{"string": "CONTINUE"}], "FlatFileProcessingJob_mappingConf": [{"string": "<beanio\r\n        xmlns=\"http://www.beanio.org/2012/03\"\r\n        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n        xsi:schemaLocation=\"http://www.beanio.org/2012/03 http://www.beanio.org/2012/03/mapping.xsd\">\r\n    <stream name=\"record\" format=\"csv\">\r\n        <parser>\r\n            <property name=\"delimiter\" value=\";\"/>\r\n            <property name=\"comments\" value=\"END\"/>\r\n            <property name=\"multilineEnabled\" value=\"true\"/>\r\n        </parser>\r\n        <record name=\"header\" minOccurs=\"1\" maxOccurs=\"1\" class=\"map\">\r\n            <field name=\"OC_ENTITY\" ignore=\"true\" />\r\n            <field name=\"OC_ACTION\" ignore=\"true\" />\r\n            <field name=\"OC_CUSTOMERACCOUNT_CODE\" ignore=\"true\" />\r\n            <field name=\"OC_BILLINGACCOUNT_CODE\" ignore=\"true\" />\r\n            <field name=\"OC_BILLINGACCOUNT_DESCRIPTION\" ignore=\"true\" />\r\n            <field name=\"OC_BILLINGACCOUNT_BC\" ignore=\"true\" />\r\n            <field name=\"OC_BILLINGACCOUNT_COUNTRY\" ignore=\"true\" />\r\n            <field name=\"OC_BILLINGACCOUNT_LANGUAGE\" ignore=\"true\" />\r\n            <field name=\"OC_BILLINGACCOUNT_CURRENCY\" ignore=\"true\" />\r\n            <field name=\"OC_BILLINGACCOUNT_TAXCAT\" ignore=\"true\" />\r\n            <field name=\"OC_BA_DATE\" ignore=\"true\" />\r\n            <field name=\"OC_BA_REGISTRATION\" ignore=\"true\" />\r\n            <field name=\"OC_BA_TVANUMBER\" ignore=\"true\" />\r\n            <field name=\"OC_BA_TITLE\" ignore=\"true\" />\r\n            <field name=\"OC_BA_FNAME\" ignore=\"true\" />\r\n            <field name=\"OC_BA_LNAME\" ignore=\"true\" />\r\n            <field name=\"OC_BA_ORGANIZATION\" ignore=\"true\" />\r\n            <field name=\"OC_BA_EBILL\" ignore=\"true\" />\r\n            <field name=\"OC_BA_EBILLEMAIL\" ignore=\"true\" />\r\n            <field name=\"OC_BA_EBILLEMAILS\" ignore=\"true\" />\r\n            <field name=\"OC_BA_ADDRESS\" ignore=\"true\" />\r\n            <field name=\"OC_BA_ZIPCODE\" ignore=\"true\" />\r\n            <field name=\"OC_BA_CITY\" ignore=\"true\" />\r\n            <field name=\"OC_BA_STATE\" ignore=\"true\" />\r\n            <field name=\"OC_BA_COUNTRY\" ignore=\"true\" />\r\n        </record>\r\n        <record name=\"details\" minOccurs=\"1\" maxOccurs=\"unbounded\" class=\"map\">\r\n            <field name=\"OC_ENTITY\" required=\"true\"/>\r\n            <field name=\"OC_ACTION\" required=\"true\"/>\r\n            <field name=\"OC_CUSTOMERACCOUNT_CODE\" />\r\n            <field name=\"OC_BILLINGACCOUNT_CODE\" />\r\n            <field name=\"OC_BILLINGACCOUNT_DESCRIPTION\" />\r\n            <field name=\"OC_BILLINGACCOUNT_BC\" required=\"true\"/>\r\n            <field name=\"OC_BILLINGACCOUNT_COUNTRY\" required=\"true\"/>\r\n            <field name=\"OC_BILLINGACCOUNT_LANGUAGE\" required=\"true\"/>\r\n            <field name=\"OC_BILLINGACCOUNT_CURRENCY\" />\r\n            <field name=\"OC_BILLINGACCOUNT_TAXCAT\" />\r\n            <field name=\"OC_BA_DATE\" />\r\n            <field name=\"OC_BA_REGISTRATION\" />\r\n            <field name=\"OC_BA_TVANUMBER\" />\r\n            <field name=\"OC_BA_TITLE\" />\r\n            <field name=\"OC_BA_FNAME\" />\r\n            <field name=\"OC_BA_LNAME\" required=\"true\"/>\r\n            <field name=\"OC_BA_ORGANIZATION\" />\r\n            <field name=\"OC_BA_EBILL\" />\r\n            <field name=\"OC_BA_EBILLEMAIL\" />\r\n            <field name=\"OC_BA_EBILLEMAILS\" />\r\n            <field name=\"OC_BA_ADDRESS\" />\r\n            <field name=\"OC_BA_ZIPCODE\" />\r\n            <field name=\"OC_BA_CITY\" />\r\n            <field name=\"OC_BA_STATE\" />\r\n            <field name=\"OC_BA_COUNTRY\" />\r\n            <field name=\"OC_CFS\" type=\"String\" collection=\"list\" minOccurs=\"0\" maxOccurs=\"unbounded\" />\r\n        </record>\r\n    </stream>\r\n</beanio>\r\n"}], "FlatFileProcessingJob_scriptsFlow": [{"string": "org.meveo.service.script.BillingAccountImportScript"}], "FlatFileProcessingJob_formatTransfo": [{"string": "None"}], "FlatFileProcessingJob_originFilename": [{"string": "origin_filename"}], "FlatFileProcessingJob_nbLinesToProcess": [{"long": 1}], "FlatFileProcessingJob_fileNameExtension": [{"string": "csv"}], "FlatFileProcessingJob_recordVariableName": [{"string": "record"}]}');

INSERT INTO meveo_job_instance (id, version, disabled, created, job_category, job_template, code, creator, job_speed, cluster_behavior, verbose_report, following_job_id, cf_values) VALUES (nextval('meveo_job_instance_seq'), 0, 0, NOW(), 'MEDIATION', 'FlatFileProcessingJob', 'massImportPaymentMethodJob', 'opencell.admin', 'NORMAL', 'LIMIT_TO_SINGLE_NODE', 1, (SELECT id from meveo_job_instance where code = 'massImportBillingAccountJob'), '{"nbRuns": [{"long": 1}], "oneFilePerJob": [{"boolean": false}], "waitingMillis": [{"long": 0}], "FlatFileProcessingJob_inputDir": [{"string": "/imports/massImport/paymentMethod/input"}], "FlatFileProcessingJob_outputDir": [{"string": "/imports/massImport/paymentMethod/output"}], "FlatFileProcessingJob_rejectDir": [{"string": "/imports/massImport/paymentMethod/reject"}], "FlatFileProcessingJob_archiveDir": [{"string": "/imports/massImport/paymentMethod/archive"}], "FlatFileProcessingJob_errorAction": [{"string": "CONTINUE"}], "FlatFileProcessingJob_mappingConf": [{"string": "<beanio\r\n        xmlns=\"http://www.beanio.org/2012/03\"\r\n        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n        xsi:schemaLocation=\"http://www.beanio.org/2012/03 http://www.beanio.org/2012/03/mapping.xsd\">\r\n    <stream name=\"record\" format=\"csv\">\r\n        <parser>\r\n            <property name=\"delimiter\" value=\";\"/>\r\n            <property name=\"comments\" value=\"END\"/>\r\n            <property name=\"multilineEnabled\" value=\"true\"/>\r\n        </parser>\r\n        <record name=\"header\" minOccurs=\"1\" maxOccurs=\"1\" class=\"map\">\r\n            <field name=\"OC_ENTITY\" ignore=\"true\"/>\r\n            <field name=\"OC_ACTION\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_TYPE\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_PREFERRED\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_ALIAS\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_CA\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_cardType\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_monthExpiration\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_yearExpiration\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_tokenId\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_cardNumber\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_issueNumber\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_userId\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_email\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_referenceDocumentCode\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_bankCode\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_branchCode\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_accountNumber\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_key\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_iban\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_bic\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_accountOwner\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_bankName\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_bankId\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_issuerNumber\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_issuerName\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_ics\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_mandateIdentification\" ignore=\"true\"/>\r\n            <field name=\"OC_PMT_mandateDate\" ignore=\"true\"/>\r\n        </record>\r\n        <record name=\"details\" minOccurs=\"1\" maxOccurs=\"unbounded\" class=\"map\">\r\n            <field name=\"OC_ENTITY\" required=\"true\"/>\r\n            <field name=\"OC_ACTION\" required=\"true\"/>\r\n            <field name=\"OC_PMT_TYPE\" required=\"true\"/>\r\n            <field name=\"OC_PMT_PREFERRED\"/>\r\n            <field name=\"OC_PMT_ALIAS\"/>\r\n            <field name=\"OC_PMT_CA\"/>\r\n            <field name=\"OC_PMT_cardType\"/>\r\n            <field name=\"OC_PMT_monthExpiration\"/>\r\n            <field name=\"OC_PMT_yearExpiration\"/>\r\n            <field name=\"OC_PMT_tokenId\"/>\r\n            <field name=\"OC_PMT_cardNumber\"/>\r\n            <field name=\"OC_PMT_issueNumber\"/>\r\n            <field name=\"OC_PMT_userId\"/>\r\n            <field name=\"OC_PMT_email\"/>\r\n            <field name=\"OC_PMT_referenceDocumentCode\"/>\r\n            <field name=\"OC_PMT_bankCode\" />\r\n            <field name=\"OC_PMT_branchCode\" />\r\n            <field name=\"OC_PMT_accountNumber\" />\r\n            <field name=\"OC_PMT_key\" />\r\n            <field name=\"OC_PMT_iban\" />\r\n            <field name=\"OC_PMT_bic\" />\r\n            <field name=\"OC_PMT_accountOwner\"/>\r\n            <field name=\"OC_PMT_bankName\"/>\r\n            <field name=\"OC_PMT_bankId\"/>\r\n            <field name=\"OC_PMT_issuerNumber\"/>\r\n            <field name=\"OC_PMT_issuerName\"/>\r\n            <field name=\"OC_PMT_ics\"/>\r\n            <field name=\"OC_PMT_mandateIdentification\"/>\r\n            <field name=\"OC_PMT_mandateDate\"/>\r\n            <field name=\"OC_CFS\" type=\"String\" collection=\"list\" minOccurs=\"0\" maxOccurs=\"unbounded\" />\r\n        </record>\r\n    </stream>\r\n</beanio>\r\n"}], "FlatFileProcessingJob_scriptsFlow": [{"string": "org.meveo.service.script.PaymentMethodImportScript"}], "FlatFileProcessingJob_formatTransfo": [{"string": "None"}], "FlatFileProcessingJob_originFilename": [{"string": "origin_filename"}], "FlatFileProcessingJob_nbLinesToProcess": [{"long": 1}], "FlatFileProcessingJob_fileNameExtension": [{"string": "csv"}], "FlatFileProcessingJob_recordVariableName": [{"string": "record"}]}');

INSERT INTO meveo_job_instance (id, version, disabled, created, job_category, job_template, code, creator, job_speed, cluster_behavior, verbose_report, following_job_id, cf_values) VALUES (nextval('meveo_job_instance_seq'), 0, 0, NOW(), 'MEDIATION', 'FlatFileProcessingJob', 'massImportCustomerAccountJob', 'opencell.admin', 'NORMAL', 'LIMIT_TO_SINGLE_NODE', 1, (SELECT id from meveo_job_instance where code = 'massImportPaymentMethodJob'), '{"nbRuns": [{"long": 1}], "oneFilePerJob": [{"boolean": false}], "waitingMillis": [{"long": 0}], "FlatFileProcessingJob_inputDir": [{"string": "/imports/massImport/customerAccount/input"}], "FlatFileProcessingJob_outputDir": [{"string": "/imports/massImport/customerAccount/output"}], "FlatFileProcessingJob_rejectDir": [{"string": "/imports/massImport/customerAccount/reject"}], "FlatFileProcessingJob_archiveDir": [{"string": "/imports/massImport/customerAccount/archive"}], "FlatFileProcessingJob_errorAction": [{"string": "CONTINUE"}], "FlatFileProcessingJob_mappingConf": [{"string": "<beanio\r\n        xmlns=\"http://www.beanio.org/2012/03\"\r\n        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n        xsi:schemaLocation=\"http://www.beanio.org/2012/03 http://www.beanio.org/2012/03/mapping.xsd\">\r\n    <stream name=\"record\" format=\"csv\">\r\n        <parser>\r\n            <property name=\"delimiter\" value=\";\" />\r\n            <property name=\"comments\" value=\"END\" />\r\n            <property name=\"multilineEnabled\" value=\"true\" />\r\n        </parser>\r\n        <record name=\"header\" minOccurs=\"1\" maxOccurs=\"1\" class=\"map\">\r\n            <field name=\"OC_ENTITY\" ignore=\"true\"/>\r\n            <field name=\"OC_ACTION\" ignore=\"true\"/>\r\n            <field name=\"OC_CUSTOMER_CODE\" ignore=\"true\"/>\r\n            <field name=\"OC_CUSTOMERACCOUNT_CODE\" ignore=\"true\"/>\r\n            <field name=\"OC_CUSTOMERACCOUNT_CURRENCY\" ignore=\"true\"/>\r\n            <field name=\"OC_CUSTOMERACCOUNT_PAYTERM\" ignore=\"true\"/>\r\n            <field name=\"OC_CUSTOMERACCOUNT_CREDCAT\" ignore=\"true\"/>\r\n            <field name=\"OC_CUSTOMERACCOUNT_LANG\" ignore=\"true\"/>\r\n        </record>\r\n        <record name=\"details\" minOccurs=\"1\" maxOccurs=\"unbounded\" class=\"map\">\r\n            <field name=\"OC_ENTITY\" required=\"true\"/>\r\n            <field name=\"OC_ACTION\" required=\"true\"/>\r\n            <field name=\"OC_CUSTOMER_CODE\" required=\"true\"/>\r\n            <field name=\"OC_CUSTOMERACCOUNT_CODE\" required=\"true\"/>\r\n            <field name=\"OC_CUSTOMERACCOUNT_CURRENCY\" required=\"true\"/>\r\n            <field name=\"OC_CUSTOMERACCOUNT_PAYTERM\"/>\r\n            <field name=\"OC_CUSTOMERACCOUNT_CREDCAT\" required=\"true\"/>\r\n            <field name=\"OC_CUSTOMERACCOUNT_LANG\" required=\"true\"/>\r\n            <field name=\"OC_CFS\" type=\"String\" collection=\"list\" minOccurs=\"0\" maxOccurs=\"unbounded\" />\r\n        </record>\r\n    </stream>\r\n</beanio>"}], "FlatFileProcessingJob_scriptsFlow": [{"string": "org.meveo.service.script.CustomerAccountImportScript"}], "FlatFileProcessingJob_formatTransfo": [{"string": "None"}], "FlatFileProcessingJob_originFilename": [{"string": "origin_filename"}], "FlatFileProcessingJob_nbLinesToProcess": [{"long": 1}], "FlatFileProcessingJob_fileNameExtension": [{"string": "csv"}], "FlatFileProcessingJob_recordVariableName": [{"string": "record"}]}');

INSERT INTO meveo_job_instance (id, version, disabled, created, job_category, job_template, code, creator, job_speed, cluster_behavior, verbose_report, following_job_id, cf_values) VALUES (nextval('meveo_job_instance_seq'), 0, 0, NOW(), 'MEDIATION', 'FlatFileProcessingJob', 'massImportCustomerJob', 'opencell.admin', 'NORMAL', 'LIMIT_TO_SINGLE_NODE', 1, (SELECT id from meveo_job_instance where code = 'massImportCustomerAccountJob'), '{"nbRuns": [{"long": 1}], "oneFilePerJob": [{"boolean": false}], "waitingMillis": [{"long": 0}], "FlatFileProcessingJob_inputDir": [{"string": "/imports/massImport/customer/input"}], "FlatFileProcessingJob_outputDir": [{"string": "/imports/massImport/customer/output"}], "FlatFileProcessingJob_rejectDir": [{"string": "/imports/massImport/customer/reject"}], "FlatFileProcessingJob_archiveDir": [{"string": "/imports/massImport/customer/archive"}], "FlatFileProcessingJob_errorAction": [{"string": "CONTINUE"}], "FlatFileProcessingJob_mappingConf": [{"string": "<beanio\r\n        xmlns=\"http://www.beanio.org/2012/03\"\r\n        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n        xsi:schemaLocation=\"http://www.beanio.org/2012/03 http://www.beanio.org/2012/03/mapping.xsd\">\r\n    <stream name=\"record\" format=\"csv\">\r\n        <parser>\r\n            <property name=\"delimiter\" value=\";\" />\r\n            <property name=\"comments\" value=\"END\" />\r\n            <property name=\"multilineEnabled\" value=\"true\" />\r\n        </parser>\r\n        <record name=\"header\" minOccurs=\"1\" maxOccurs=\"1\" class=\"map\">\r\n            <field name=\"OC_ENTITY\" ignore=\"true\"/>\r\n            <field name=\"OC_ACTION\" ignore=\"true\"/>\r\n            <field name=\"OC_CUSTOMER_CODE\" ignore=\"true\"/>\r\n            <field name=\"OC_CUSTOMER_DESCRIPTION\" ignore=\"true\"/>\r\n            <field name=\"OC_CU_REGISTRATION\" ignore=\"true\"/>\r\n            <field name=\"OC_CU_TVANUMBER\" ignore=\"true\"/>\r\n            <field name=\"OC_CUSTOMER_SELLER\" ignore=\"true\"/>\r\n            <field name=\"OC_CU_CATEGORY\" ignore=\"true\"/>\r\n            <field name=\"OC_CU_IS_COMPANY\" ignore=\"true\"/>\r\n            <field name=\"OC_CU_TITLE\" ignore=\"true\"/>\r\n            <field name=\"OC_CU_FIRST_NAME\" ignore=\"true\"/>\r\n            <field name=\"OC_CU_LAST_NAME\" ignore=\"true\"/>\r\n        </record>\r\n        <record name=\"details\" minOccurs=\"1\" maxOccurs=\"unbounded\" class=\"map\">\r\n            <field name=\"OC_ENTITY\" required=\"true\"/>\r\n            <field name=\"OC_ACTION\" required=\"true\"/>\r\n            <field name=\"OC_CUSTOMER_CODE\" required=\"true\"/>\r\n            <field name=\"OC_CUSTOMER_DESCRIPTION\"/>\r\n            <field name=\"OC_CU_REGISTRATION\"/>\r\n            <field name=\"OC_CU_TVANUMBER\" />\r\n            <field name=\"OC_CUSTOMER_SELLER\" />\r\n            <field name=\"OC_CU_CATEGORY\" />\r\n            <field name=\"OC_CU_IS_COMPANY\" />\r\n            <field name=\"OC_CU_TITLE\" />\r\n            <field name=\"OC_CU_FIRST_NAME\" />\r\n            <field name=\"OC_CU_LAST_NAME\" />\r\n            <field name=\"OC_CFS\" type=\"String\" collection=\"list\" minOccurs=\"0\" maxOccurs=\"unbounded\" />\r\n        </record>\r\n    </stream>\r\n</beanio>\r\n"}], "FlatFileProcessingJob_scriptsFlow": [{"string": "org.meveo.service.script.CustomerImportScript"}], "FlatFileProcessingJob_formatTransfo": [{"string": "None"}], "FlatFileProcessingJob_originFilename": [{"string": "origin_filename"}], "FlatFileProcessingJob_nbLinesToProcess": [{"long": 1}], "FlatFileProcessingJob_fileNameExtension": [{"string": "csv"}], "FlatFileProcessingJob_recordVariableName": [{"string": "record"}]}');

INSERT INTO com_message_template (media, id, version, created, code, tag_start, tag_end, subject, htmlcontent) VALUES ('EMAIL', nextval('com_msg_tmpl_seq'), '0', NOW(), 'MASS_IMPORT_ISSUES_EMAIL', '#{', '}', 'Your import had a few issues : #{job}', '<font face="Arial, Verdana">Your import of&nbsp;<b>#{entityName}</b>&nbsp;was not a 100% success and some records were not created. Please review the rejection file.');

INSERT INTO com_message_template (media, id, version, created, code, tag_start, tag_end, subject, htmlcontent) VALUES ('EMAIL', nextval('com_msg_tmpl_seq'), '0', NOW(), 'MASS_IMPORT_FAILURE_EMAIL', '#{', '}', 'Your import has failed : #{job}', '<font face="Arial, Verdana">Import process of&nbsp;<b>#{entityName}</b>&nbsp;has failed. Please check the rejection file for more details. If this persists, please contact&nbsp;</font>your integrator or our support team.');

INSERT INTO com_message_template (media, id, version, created, code, tag_start, tag_end, subject, htmlcontent) VALUES ('EMAIL', nextval('com_msg_tmpl_seq'), '0', NOW(), 'MASS_IMPORT_SUCCESS_EMAIL', '#{', '}', 'Your import was a success : #{job}', '<font face="Arial, Verdana">Your import of&nbsp;<b>#{entityName}</b>&nbsp;that started&nbsp;<b>#{date}</b>&nbsp;at&nbsp;<b>#{time}&nbsp;</b>has been&nbsp;</font>processed successfully.');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#OUTRD-49_20220913', 'HamzaBiadi', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4021, '9:af29ec8b6a4bc00a4d252bae8ee48808', 'insert tableName=meveo_job_instance; insert tableName=meveo_job_instance; insert tableName=meveo_job_instance; insert tableName=meveo_job_instance; insert tableName=meveo_job_instance; insert tableName=com_message_template; insert tableName=com_me...', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#OUTRD-49-SUB_20220914::HamzaBiadi
INSERT INTO meveo_job_instance (id, version, disabled, created, job_category, job_template, code, creator, job_speed, cluster_behavior, verbose_report, cf_values) VALUES (nextval('meveo_job_instance_seq'), 0, 0, NOW(), 'MEDIATION', 'FlatFileProcessingJob', 'massImportAccessPoint', 'opencell.admin', 'NORMAL', 'LIMIT_TO_SINGLE_NODE', 1, '{"nbRuns":[{"long":1}],
                "waitingMillis":[{"long":0}],
                "oneFilePerJob":[{"boolean":false}],
                "FlatFileProcessingJob_inputDir":[{"string":"/imports/massImport/accessPoint/input"}],
	            "FlatFileProcessingJob_archiveDir":[{"string":"/imports/massImport/accessPoint/archive"}],
                "FlatFileProcessingJob_rejectDir":[{"string":"/imports/massImport/accessPoint/reject"}],
	            "FlatFileProcessingJob_outputDir":[{"string":"/imports/massImport/accessPoint/output"}],
	            "FlatFileProcessingJob_fileNameExtension":[{"string":"csv"}],
	            "FlatFileProcessingJob_nbLinesToProcess":[{"long":1}],
	            "FlatFileProcessingJob_mappingConf":[{"string":"<beanio\r\n\txmlns=\"http://www.beanio.org/2012/03\"\r\n\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n  xsi:schemaLocation=\"http://www.beanio.org/2012/03 http://www.beanio.org/2012/03/mapping.xsd\">\r\n\t<stream name=\"record\" format=\"csv\">\r\n\t\t<parser>\r\n\t\t\t<property name=\"delimiter\" value=\";\" />\r\n\t\t\t<property name=\"comments\" value=\"END\" />\r\n\t\t\t<property name=\"multilineEnabled\" value=\"true\" />\r\n\t\t</parser>\r\n\t\t<record name=\"header\" minOccurs=\"1\" maxOccurs=\"1\" class=\"map\">\r\n\t\t\t<field name=\"OC_ENTITY*\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_ACTION*\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_SUBSCRIPTION_CODE*\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_ACCESSPOINT_CODE*\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_ACCESSPOINT_STARTDATE\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_ACCESSPOINT_ENDDATE\" ignore=\"true\"/>\r\n\t\t</record>\r\n\t\t<record name=\"details\" minOccurs=\"1\" maxOccurs=\"unbounded\" class=\"map\">\r\n\t\t\t<field name=\"OC_ENTITY\" required=\"true\"/>\r\n\t\t\t<field name=\"OC_ACTION\" required=\"true\"/>\r\n\t\t\t<field name=\"OC_SUBSCRIPTION_CODE\" required=\"true\"/>\r\n\t\t\t<field name=\"OC_ACCESSPOINT_CODE\"/>\r\n\t\t\t<field name=\"OC_ACCESSPOINT_STARTDATE\"/>\r\n\t\t\t<field name=\"OC_ACCESSPOINT_ENDDATE\" />\r\n          \t<field name=\"OC_CFS\" type=\"String\" collection=\"list\" minOccurs=\"0\" maxOccurs=\"unbounded\" />\r\n\t\t</record>\r\n\t</stream>\r\n</beanio>"}],
                "FlatFileProcessingJob_scriptsFlow":[{"string":"org.meveo.service.script.AccessPointImportScript"}],
                "FlatFileProcessingJob_recordVariableName":[{"string":"record"}],
                "FlatFileProcessingJob_originFilename":[{"string":"origin_filename"}],
                "FlatFileProcessingJob_formatTransfo":[{"string":"None"}],
                "FlatFileProcessingJob_errorAction":[{"string":"CONTINUE"}]}');

INSERT INTO meveo_job_instance (id, version, disabled, created, job_category, job_template, code, creator, job_speed, cluster_behavior, verbose_report, following_job_id, cf_values) VALUES (nextval('meveo_job_instance_seq'), 0, 0, NOW(), 'MEDIATION', 'FlatFileProcessingJob', 'massImportAttributeInstance', 'opencell.admin', 'NORMAL', 'LIMIT_TO_SINGLE_NODE', 1, (SELECT id from meveo_job_instance where code = 'massImportAccessPoint'), '{"nbRuns":[{"long":1}],
                "waitingMillis":[{"long":0}],
                "oneFilePerJob":[{"boolean":false}],
                "FlatFileProcessingJob_inputDir":[{"string":"/imports/massImport/attributeInstance/input"}],
	            "FlatFileProcessingJob_archiveDir":[{"string":"/imports/massImport/attributeInstance/archive"}],
                "FlatFileProcessingJob_rejectDir":[{"string":"/imports/massImport/attributeInstance/reject"}],
	            "FlatFileProcessingJob_outputDir":[{"string":"/imports/massImport/attributeInstance/output"}],
	            "FlatFileProcessingJob_fileNameExtension":[{"string":"csv"}],
	            "FlatFileProcessingJob_nbLinesToProcess":[{"long":1}],
	            "FlatFileProcessingJob_mappingConf":[{"string":"<beanio\r\n\txmlns=\"http://www.beanio.org/2012/03\"\r\n\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n  xsi:schemaLocation=\"http://www.beanio.org/2012/03 http://www.beanio.org/2012/03/mapping.xsd\">\r\n\t<stream name=\"record\" format=\"csv\">\r\n\t\t<parser>\r\n\t\t\t<property name=\"delimiter\" value=\";\" />\r\n\t\t\t<property name=\"comments\" value=\"END\" />\r\n\t\t\t<property name=\"multilineEnabled\" value=\"true\" />\r\n\t\t</parser>\r\n\t\t<record name=\"header\" minOccurs=\"1\" maxOccurs=\"1\" class=\"map\">\r\n\t\t\t<field name=\"OC_ENTITY*\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_ACTION*\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_SUBSCRIPTION_CODE*\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_SERVICE_INSTANCE_CODE*\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_SI_ATTRIB_CODE*\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_SI_ATTRIB_VALUE\" ignore=\"true\"/>\r\n\t\t</record>\r\n\t\t<record name=\"details\" minOccurs=\"1\" maxOccurs=\"unbounded\" class=\"map\">\r\n\t\t\t<field name=\"OC_ENTITY\" required=\"true\"/>\r\n\t\t\t<field name=\"OC_ACTION\" required=\"true\"/>\r\n\t\t\t<field name=\"OC_SUBSCRIPTION_CODE\" required=\"true\"/>\r\n\t\t\t<field name=\"OC_SERVICE_INSTANCE_CODE\"/>\r\n\t\t\t<field name=\"OC_SI_ATTRIB_CODE\"/>\r\n\t\t\t<field name=\"OC_SI_ATTRIB_VALUE\" />\r\n          \t<field name=\"OC_CFS\" type=\"String\" collection=\"list\" minOccurs=\"0\" maxOccurs=\"unbounded\" />\r\n\t\t</record>\r\n\t</stream>\r\n</beanio>"}],
                "FlatFileProcessingJob_scriptsFlow":[{"string":"org.meveo.service.script.AttributeInstanceImportScript"}],
                "FlatFileProcessingJob_recordVariableName":[{"string":"record"}],
                "FlatFileProcessingJob_originFilename":[{"string":"origin_filename"}],
                "FlatFileProcessingJob_formatTransfo":[{"string":"None"}],
                "FlatFileProcessingJob_errorAction":[{"string":"CONTINUE"}]}');

INSERT INTO meveo_job_instance (id, version, disabled, created, job_category, job_template, code, creator, job_speed, cluster_behavior, verbose_report, following_job_id, cf_values) VALUES (nextval('meveo_job_instance_seq'), 0, 0, NOW(), 'MEDIATION', 'FlatFileProcessingJob', 'massImportServiceInstanceJob', 'opencell.admin', 'NORMAL', 'LIMIT_TO_SINGLE_NODE', 1, (SELECT id from meveo_job_instance where code = 'massImportAttributeInstance'), '{"nbRuns":[{"long":1}],
                "waitingMillis":[{"long":0}],
                "oneFilePerJob":[{"boolean":false}],
                "FlatFileProcessingJob_inputDir":[{"string":"/imports/massImport/serviceInstance/input"}],
	            "FlatFileProcessingJob_archiveDir":[{"string":"/imports/massImport/serviceInstance/archive"}],
                "FlatFileProcessingJob_rejectDir":[{"string":"/imports/massImport/serviceInstance/reject"}],
	            "FlatFileProcessingJob_outputDir":[{"string":"/imports/massImport/serviceInstance/output"}],
	            "FlatFileProcessingJob_fileNameExtension":[{"string":"csv"}],
	            "FlatFileProcessingJob_nbLinesToProcess":[{"long":1}],
	            "FlatFileProcessingJob_mappingConf":[{"string":"<beanio\r\n\txmlns=\"http://www.beanio.org/2012/03\"\r\n\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n  xsi:schemaLocation=\"http://www.beanio.org/2012/03 http://www.beanio.org/2012/03/mapping.xsd\">\r\n\t<stream name=\"record\" format=\"csv\">\r\n\t\t<parser>\r\n\t\t\t<property name=\"delimiter\" value=\";\" />\r\n\t\t\t<property name=\"comments\" value=\"END\" />\r\n\t\t\t<property name=\"multilineEnabled\" value=\"true\" />\r\n\t\t</parser>\r\n\t\t<record name=\"header\" minOccurs=\"1\" maxOccurs=\"1\" class=\"map\">\r\n\t\t\t<field name=\"OC_ENTITY*\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_ACTION*\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_SUBSCRIPTION_CODE*\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_SI_CODE*\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_SI_DESC\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_PRODUCT_CODE*\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_PRODUCT_QTY\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_PRODUCT_DELIV_DT\" ignore=\"true\"/>\r\n\t\t</record>\r\n\t\t<record name=\"details\" minOccurs=\"1\" maxOccurs=\"unbounded\" class=\"map\">\r\n\t\t\t<field name=\"OC_ENTITY\" required=\"true\"/>\r\n\t\t\t<field name=\"OC_ACTION\" required=\"true\"/>\r\n\t\t\t<field name=\"OC_SUBSCRIPTION_CODE\" required=\"true\"/>\r\n\t\t\t<field name=\"OC_SI_CODE\"/>\r\n\t\t\t<field name=\"OC_SI_DESC\"/>\r\n\t\t\t<field name=\"OC_PRODUCT_CODE\" />\r\n\t\t\t<field name=\"OC_PRODUCT_QTY\" />\r\n\t\t\t<field name=\"OC_PRODUCT_DELIV_DT\" />\r\n          \t<field name=\"OC_CFS\" type=\"String\" collection=\"list\" minOccurs=\"0\" maxOccurs=\"unbounded\" />\r\n\t\t</record>\r\n\t</stream>\r\n</beanio>"}],
                "FlatFileProcessingJob_scriptsFlow":[{"string":"org.meveo.service.script.ServiceInstanceImportScript"}],
                "FlatFileProcessingJob_recordVariableName":[{"string":"record"}],
                "FlatFileProcessingJob_originFilename":[{"string":"origin_filename"}],
                "FlatFileProcessingJob_formatTransfo":[{"string":"None"}],
                "FlatFileProcessingJob_errorAction":[{"string":"CONTINUE"}]}');

INSERT INTO meveo_job_instance (id, version, disabled, created, job_category, job_template, code, creator, job_speed, cluster_behavior, verbose_report, following_job_id, cf_values) VALUES (nextval('meveo_job_instance_seq'), 0, 0, NOW(), 'MEDIATION', 'FlatFileProcessingJob', 'massImportSubscriptionJob', 'opencell.admin', 'NORMAL', 'LIMIT_TO_SINGLE_NODE', 1, (SELECT id from meveo_job_instance where code = 'massImportServiceInstanceJob'), '{"nbRuns":[{"long":1}],
                "waitingMillis":[{"long":0}],
                "oneFilePerJob":[{"boolean":false}],
                "FlatFileProcessingJob_inputDir":[{"string":"/imports/massImport/subscription/input"}],
	            "FlatFileProcessingJob_archiveDir":[{"string":"/imports/massImport/subscription/archive"}],
                "FlatFileProcessingJob_rejectDir":[{"string":"/imports/massImport/subscription/reject"}],
	            "FlatFileProcessingJob_outputDir":[{"string":"/imports/massImport/subscription/output"}],
	            "FlatFileProcessingJob_fileNameExtension":[{"string":"csv"}],
	            "FlatFileProcessingJob_nbLinesToProcess":[{"long":1}],
	            "FlatFileProcessingJob_mappingConf":[{"string":"<beanio\r\n\txmlns=\"http://www.beanio.org/2012/03\"\r\n\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n  xsi:schemaLocation=\"http://www.beanio.org/2012/03 http://www.beanio.org/2012/03/mapping.xsd\">\r\n\t<stream name=\"record\" format=\"csv\">\r\n\t\t<parser>\r\n\t\t\t<property name=\"delimiter\" value=\";\" />\r\n\t\t\t<property name=\"comments\" value=\"END\" />\r\n\t\t\t<property name=\"multilineEnabled\" value=\"true\" />\r\n\t\t</parser>\r\n\t\t<record name=\"header\" minOccurs=\"1\" maxOccurs=\"1\" class=\"map\">\r\n\t\t\t<field name=\"OC_ENTITY*\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_ACTION*\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_USERACCOUNT_CODE*\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_SUBSCRIPTION_CODE*\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_STATUS\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_SUBSCRIPTION_DESCRIPTION\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_OFFER_CODE*\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_SELLER_CODE*\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_SUBSCRIPTION_DATE\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_ENDAGREEMENTDATE\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_TERMINATIONDATE\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_SUB_BC*\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_SUB_INITTERMTYPE\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_SUB_DURATIONTYPE\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_SUB_INITTERMLENGTH\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_SUB_INITTERMUNIT\"  ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_SUB_ENDTERMACTION\"  ignore=\"true\" />\r\n\t\t\t<field name=\"OC_SUB_TERMINATIONREASON\"  ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_SUB_EBILL\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_SUB_EBILLEMAIL\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_SUB_EBILLEMAILS\" ignore=\"true\"/>\r\n\t\t</record>\r\n\t\t<record name=\"details\" minOccurs=\"1\" maxOccurs=\"unbounded\" class=\"map\">\r\n\t\t\t<field name=\"OC_ENTITY\" required=\"true\"/>\r\n\t\t\t<field name=\"OC_ACTION\" required=\"true\"/>\r\n\t\t\t<field name=\"OC_USERACCOUNT_CODE\" required=\"true\"/>\r\n\t\t\t<field name=\"OC_SUBSCRIPTION_CODE\"/>\r\n\t\t\t<field name=\"OC_STATUS\"/>\r\n\t\t\t<field name=\"OC_SUBSCRIPTION_DESCRIPTION\" />\r\n\t\t\t<field name=\"OC_OFFER_CODE\" />\r\n\t\t\t<field name=\"OC_SELLER_CODE\" />\r\n\t\t\t<field name=\"OC_SUBSCRIPTION_DATE\" />\r\n\t\t\t<field name=\"OC_ENDAGREEMENTDATE\" />\r\n\t\t\t<field name=\"OC_TERMINATIONDATE\" />\r\n\t\t\t<field name=\"OC_SUB_BC\" />\r\n\t\t\t<field name=\"OC_SUB_INITTERMTYPE\" />\r\n\t\t\t<field name=\"OC_SUB_DURATIONTYPE\" />\r\n\t\t\t<field name=\"OC_SUB_INITTERMLENGTH\" />\r\n\t\t\t<field name=\"OC_SUB_INITTERMUNIT\" />\r\n\t\t\t<field name=\"OC_SUB_ENDTERMACTION\" />\r\n\t\t\t<field name=\"OC_SUB_TERMINATIONREASON\" />\r\n\t\t\t<field name=\"OC_SUB_EBILL\" />\r\n\t\t\t<field name=\"OC_SUB_EBILLEMAIL\" />\r\n\t\t\t<field name=\"OC_SUB_EBILLEMAILS\" />\r\n          \t<field name=\"OC_CFS\" type=\"String\" collection=\"list\" minOccurs=\"0\" maxOccurs=\"unbounded\" />\r\n\t\t</record>\r\n\t</stream>\r\n</beanio>"}],
                "FlatFileProcessingJob_scriptsFlow":[{"string":"org.meveo.service.script.SubscriptionMassImportScript"}],
                "FlatFileProcessingJob_recordVariableName":[{"string":"record"}],
                "FlatFileProcessingJob_originFilename":[{"string":"origin_filename"}],
                "FlatFileProcessingJob_formatTransfo":[{"string":"None"}],
                "FlatFileProcessingJob_errorAction":[{"string":"CONTINUE"}]}');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#OUTRD-49-SUB_20220914', 'HamzaBiadi', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4023, '9:a2dce161de1cf9d839a7c0081f9db62a', 'insert tableName=meveo_job_instance; insert tableName=meveo_job_instance; insert tableName=meveo_job_instance; insert tableName=meveo_job_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#OUTRD-53_20220930::Ilham-Chafik
INSERT INTO meveo_script_instance (id, code, created, creator, version, src_type) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.ImportJobNotificationScript', NOW(), 'opencell.admin', 0, 'JAVA_CLASS');

INSERT INTO adm_notification (id, created, code, class_name_filter, event_type_filter, event_expression_filter, version, creator, disabled, script_instance_id) VALUES (nextval('adm_notification_seq'), NOW(), 'OC_MASS_IMPORT_NOTIFICATION', 'org.meveo.model.jobs.JobExecutionResultImpl', 'STARTED', '#{event.jobInstance.code.toLowerCase().startsWith(''massimport'')}', '0', 'opencell.admin', '1', (SELECT id from meveo_script_instance where code = 'org.meveo.service.script.ImportJobNotificationScript'));

INSERT INTO adm_notif_job (id, job_instance_id) VALUES ((SELECT id from adm_notification where code = 'OC_MASS_IMPORT_NOTIFICATION'), (SELECT id from meveo_job_instance where code = 'massImportCustomerJob'));

INSERT INTO adm_notification_params (notification_id, params, params_key) VALUES ((SELECT id from adm_notification where code = 'OC_MASS_IMPORT_NOTIFICATION'), 'customer', 'category');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#OUTRD-53_20220930', 'Ilham-Chafik', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4025, '9:525b72b2dc533413660f5b441950d4f4', 'insert tableName=meveo_script_instance; insert tableName=adm_notification; insert tableName=adm_notif_job; insert tableName=adm_notification_params', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#277_20210622::TarikFA.
INSERT INTO public.meveo_script_instance (id, version, disabled, created, code, description, src_type, script) VALUES (-31, 0, 0, now(), 'org.meveo.service.quote.script.QuoteValidationScript', 'quote validation', 'JAVA_CLASS', null);

INSERT INTO public.meveo_script_instance (id, version, disabled, created, code, description, src_type, script) VALUES (-32, 0, 0, now(), 'org.meveo.service.quote.script.OrderAdvancementScript', 'order advancemnt script', 'JAVA_CLASS', null);

INSERT INTO adm_notification (id, version, disabled, created, code, class_name_filter, event_expression_filter, event_type_filter, creator, script_instance_id, uuid, priority, run_async, save_successful_notif) VALUES ('-11', '0', '0', NOW(), 'NOTIF_QUOTE_VALIDATION', 'org.meveo.model.cpq.CpqQuote', '#{event.status == ''ACCEPTED'' }', 'STATUS_UPDATED', 'opencell.admin', '-31', 'GENERIC_UUID_CPQUOTE', '0', '0', '1');

INSERT INTO adm_notification_params (notification_id, params, params_key) VALUES ('-11', '#{event}', 'cpqQuote');

INSERT INTO adm_script_notification (id) VALUES ('-11');

INSERT INTO adm_notification (id, version, disabled, created, code, class_name_filter, event_type_filter, creator, script_instance_id, uuid, priority, run_async, save_successful_notif) VALUES ('-12', '0', '0', NOW(), 'NOTIF_ORDER_ADVANCEMENT', 'org.meveo.model.cpq.commercial.CommercialOrder', 'ADVT_RATE_INCREASED', 'opencell.admin', '-32', 'GENERIC_UUID_ORDER', '0', '0', '1');

INSERT INTO adm_notification_params (notification_id, params, params_key) VALUES ('-12', '#{event}', 'commercialOrder');

INSERT INTO adm_script_notification (id) VALUES ('-12');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#277_20210622', 'TarikFA.', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4027, '9:058449aa02bab58011045a93df06c3f4', 'sql; sql; insert tableName=adm_notification; insert tableName=adm_notification_params; insert tableName=adm_script_notification; insert tableName=adm_notification; insert tableName=adm_notification_params; insert tableName=adm_script_notification', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::J215_20210708::Mohammed_ELAZZOUZI
INSERT INTO meveo_script_instance (id, version, code, src_type, description, created) VALUES (-43, 0, 'org.meveo.service.script.ServiceImportScript', 'JAVA_CLASS', 'script processor to import service instances]', NOW());

INSERT INTO meveo_script_instance (id, version, code, src_type, description, created) VALUES (-44, 0, 'org.meveo.service.script.AccessImportScript', 'JAVA_CLASS', 'script processor to import access points', NOW());

INSERT INTO meveo_script_instance (id, version, code, src_type, description, created) VALUES (-45, 0, 'org.meveo.service.script.SubscriptionImportScript', 'JAVA_CLASS', 'script processor to import subscriptions', NOW());

INSERT INTO meveo_job_instance (id, version, disabled, created, updated, code, description, job_category, job_template, parametres, creator, updater, timerentity_id, following_job_id, uuid, run_on_nodes, cluster_behavior, cf_values, verbose_report) VALUES (-46, 0, 0, NOW(), NOW(), 'importServicesJob', 'importServicesJob', 'MEDIATION', 'FlatFileProcessingJob', NULL, 'opencell.admin', 'opencell.admin', NULL, NULL, 'importServicesJob', NULL, 'LIMIT_TO_SINGLE_NODE', '{"oneFilePerJob":[{"boolean":false}],
                "FlatFileProcessingJob_outputDir":[{"string":"/imports/services/outputs"}],
                "FlatFileProcessingJob_mappingConf":[{"string":"<beanio xmlns=\"http://www.beanio.org/2012/03\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n  xsi:schemaLocation=\"http://www.beanio.org/2012/03 http://www.beanio.org/2012/03/mapping.xsd\">\r\n\t<stream name=\"record\" format=\"csv\">\r\n\t\t<parser>\r\n\t\t\t<property name=\"delimiter\" value=\",\" />\r\n\t\t\t<property name=\"comments\" value=\"END\" />\r\n          \t<property name=\"multilineEnabled\" value=\"true\" />\r\n\t\t</parser>\r\n\t\t<record name=\"header\" minOccurs=\"1\" maxOccurs=\"1\" class=\"map\">\r\n\t\t\t<field name=\"OC_ENTITY\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_ACTION\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_Subscription_code\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_ServiceInstance_code\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_ServiceInstance_description\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_ServiceInstance_quantity\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_ServiceInstance_subscriptionDate\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_ServiceInstance_rateUntilDate\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_ServiceInstance_endAgreementDate\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_terminationDate\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_terminationReason\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_MATRICE_APPEL_SORTANT_PPC_ZONE\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_MATRICE_APPEL_SORTANT_PRIXMINUTE_ZONE\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_PRIX_NRC\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_MAP_PRIX_CHATS_PALIER\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_PRIX_SMS_ENTRANT\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_MATRICE_PRIX_NRC_REACH\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_MATRICE_COUTPARUNITE_APPEL_ENTRANT\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_MAP_PRIX_LICENCE\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_MATRICE_PRIX_SMS_SORTANT_ZONE\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_PRIX_UNITAIRE_OPTION\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_MATRICE_PRIX_REC_REACH\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_PRIX_REC\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_MATRICE_COUT_APPEL_ENTRANT\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_MAP_PRIX_EMAILS_PALIER\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_MAP_PRIX_HITS_PALIER\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_PRIX_TRANCHE_STOCKAGE_GO\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_TAILLE_TRANCHE_STOCKAGE_GO\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_STOCKAGE_EMAILS_GO_INCLUS\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_MAP_MIN_FACTURATION\" ignore=\"true\"/>\r\n\t\t</record>\r\n\t\t<record name=\"details\" minOccurs=\"1\" maxOccurs=\"unbounded\" class=\"map\">\r\n\t\t\t<field name=\"OC_ENTITY\" required=\"false\"/>\r\n\t\t\t<field name=\"OC_ACTION\" required=\"false\"/>\r\n\t\t\t<field name=\"OC_Subscription_code\" required=\"false\"/>\r\n\t\t\t<field name=\"OC_ServiceInstance_code\" required=\"false\"/>\r\n\t\t\t<field name=\"OC_ServiceInstance_description\" required=\"false\"/>\r\n\t\t\t<field name=\"OC_ServiceInstance_quantity\" required=\"false\"/>\r\n\t\t\t<field name=\"OC_ServiceInstance_subscriptionDate\" required=\"false\"/>\r\n\t\t\t<field name=\"OC_ServiceInstance_rateUntilDate\" required=\"false\"/>\r\n\t\t\t<field name=\"OC_terminationDate\" required=\"false\"/>\r\n\t\t\t<field name=\"OC_terminationReason\" required=\"false\"/>\r\n\t\t\t<field name=\"OC_ServiceInstance_endAgreementDate\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_MATRICE_APPEL_SORTANT_PPC_ZONE\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_MATRICE_APPEL_SORTANT_PRIXMINUTE_ZONE\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_PRIX_NRC\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_MAP_PRIX_CHATS_PALIER\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_PRIX_SMS_ENTRANT\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_MATRICE_PRIX_NRC_REACH\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_MATRICE_COUTPARUNITE_APPEL_ENTRANT\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_MAP_PRIX_LICENCE\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_MATRICE_PRIX_SMS_SORTANT_ZONE\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_PRIX_UNITAIRE_OPTION\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_MATRICE_PRIX_REC_REACH\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_PRIX_REC\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_MATRICE_COUT_APPEL_ENTRANT\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_MAP_PRIX_EMAILS_PALIER\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_MAP_PRIX_HITS_PALIER\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_PRIX_TRANCHE_STOCKAGE_GO\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_TAILLE_TRANCHE_STOCKAGE_GO\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_STOCKAGE_EMAILS_GO_INCLUS\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_MAP_MIN_FACTURATION\" required=\"false\"/>\r\n\t\t</record>\r\n\t</stream>\r\n</beanio>"}],
                "FlatFileProcessingJob_recordVariableName":[{"string":"record"}],
                "FlatFileProcessingJob_errorAction":[{"string":"CONTINUE"}],
                "FlatFileProcessingJob_originFilename":[{"string":"origin_filename"}],
                "FlatFileProcessingJob_archiveDir":[{"string":"/imports/services/archives"}],
                "FlatFileProcessingJob_inputDir":[{"string":"/imports/services/inputs"}],
                "waitingMillis":[{"long":0}],
                "FlatFileProcessingJob_nbLinesToProcess":[{"long":1}],
                "FlatFileProcessingJob_formatTransfo":[{"string":"None"}],
                "FlatFileProcessingJob_rejectDir":[{"string":"/imports/services/rejects"}],
                "nbRuns":[{"long":1}],
                "FlatFileProcessingJob_scriptsFlow":[{"string":"org.meveo.service.script.ServiceImportScript"}]}', '1');

INSERT INTO meveo_job_instance (id, version, disabled, created, updated, code, description, job_category, job_template, parametres, creator, updater, timerentity_id, following_job_id, uuid, run_on_nodes, cluster_behavior, cf_values, verbose_report) VALUES (-47, 0, 0, NOW(), NOW(), 'importSubscriptionsJob', 'importSubscriptionsJob', 'MEDIATION', 'FlatFileProcessingJob', NULL, 'opencell.admin', 'opencell.admin', NULL, NULL, 'importSubscriptionsJob', NULL, 'LIMIT_TO_SINGLE_NODE', '{"oneFilePerJob":[{"boolean":false}],
                "FlatFileProcessingJob_outputDir":[{"string":"/imports/subscriptions/outputs"}],
                "FlatFileProcessingJob_mappingConf":[{"string":"<beanio\r\n\txmlns=\"http://www.beanio.org/2012/03\"\r\n\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n  xsi:schemaLocation=\"http://www.beanio.org/2012/03 http://www.beanio.org/2012/03/mapping.xsd\">\r\n\t<stream name=\"record\" format=\"csv\">\r\n\t\t<parser>\r\n\t\t\t<property name=\"delimiter\" value=\",\" />\r\n\t\t\t<property name=\"comments\" value=\"END\" />\r\n\t\t\t<property name=\"multilineEnabled\" value=\"true\" />\r\n\t\t</parser>\r\n\t\t<record name=\"header\" minOccurs=\"1\" maxOccurs=\"1\" class=\"map\">\r\n\t\t\t<field name=\"OC_ENTITY\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_ACTION\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_subscription_code\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_subscription_description\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_userAccount_code\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_offer_code\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_seller_code\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_subscriptionDate\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_endAgreementDate\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_terminationDate\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_subscriptionTerminationReason_code\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_NUM_REACH\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_PAYS_NUM\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_TYPE_NUM\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_NIVEAU_NUM\" ignore=\"true\"/>\r\n\t\t\t<field name=\"CF_CF_NUM_COMMANDE_SUB\" ignore=\"true\"/>\r\n\t\t</record>\r\n\t\t<record name=\"details\" minOccurs=\"1\" maxOccurs=\"unbounded\" class=\"map\">\r\n\t\t\t<field name=\"OC_ENTITY\" required=\"true\"/>\r\n\t\t\t<field name=\"OC_ACTION\" required=\"true\"/>\r\n\t\t\t<field name=\"OC_subscription_code\" required=\"true\"/>\r\n\t\t\t<field name=\"OC_subscription_description\" required=\"false\"/>\r\n\t\t\t<field name=\"OC_userAccount_code\" required=\"false\"/>\r\n\t\t\t<field name=\"OC_offer_code\" required=\"false\"/>\r\n\t\t\t<field name=\"OC_seller_code\" required=\"false\"/>\r\n\t\t\t<field name=\"OC_subscriptionDate\" required=\"false\"/>\r\n\t\t\t<field name=\"OC_endAgreementDate\" required=\"false\"/>\r\n\t\t\t<field name=\"OC_terminationDate\" required=\"false\"/>\r\n\t\t\t<field name=\"OC_subscriptionTerminationReason_code\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_NUM_REACH\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_PAYS_NUM\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_TYPE_NUM\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_NIVEAU_NUM\" required=\"false\"/>\r\n\t\t\t<field name=\"CF_CF_NUM_COMMANDE_SUB\" required=\"false\"/>\r\n\r\n\t\t</record>\r\n\t</stream>\r\n</beanio>"}],
                "FlatFileProcessingJob_recordVariableName":[{"string":"record"}],
                "FlatFileProcessingJob_errorAction":[{"string":"CONTINUE"}],
                "FlatFileProcessingJob_originFilename":[{"string":"origin_filename"}],
                "FlatFileProcessingJob_archiveDir":[{"string":"/imports/subscriptions/archives"}],
                "FlatFileProcessingJob_inputDir":[{"string":"/imports/subscriptions/inputs"}],
                "waitingMillis":[{"long":0}],"FlatFileProcessingJob_nbLinesToProcess":[{"long":1}],
                "FlatFileProcessingJob_formatTransfo":[{"string":"None"}],"FlatFileProcessingJob_rejectDir":[{"string":"/imports/subscriptions/rejects"}],
                "nbRuns":[{"long":1}],"FlatFileProcessingJob_scriptsFlow":[{"string":"org.meveo.service.script.SubscriptionImportScript"}]}', '1');

INSERT INTO meveo_job_instance (id, version, disabled, created, updated, code, description, job_category, job_template, parametres, creator, updater, timerentity_id, following_job_id, uuid, run_on_nodes, cluster_behavior, cf_values, verbose_report) VALUES (-48, 0, 0, NOW(), NOW(), 'importAccesPointsJob', 'importAccesPointsJob', 'MEDIATION', 'FlatFileProcessingJob', NULL, 'opencell.admin', 'opencell.admin', NULL, NULL, 'importAccesPointsJob', NULL, 'LIMIT_TO_SINGLE_NODE', '{"oneFilePerJob":[{"boolean":false}],
                "FlatFileProcessingJob_outputDir":[{"string":"/imports/accessPoints/outputs"}],
                "FlatFileProcessingJob_mappingConf":[{"string":"<beanio\r\n\txmlns=\"http://www.beanio.org/2012/03\"\r\n\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n  xsi:schemaLocation=\"http://www.beanio.org/2012/03 http://www.beanio.org/2012/03/mapping.xsd\">\r\n\t<stream name=\"record\" format=\"csv\">\r\n\t\t<parser>\r\n\t\t\t<property name=\"delimiter\" value=\",\" />\r\n\t\t\t<property name=\"comments\" value=\"END\" />\r\n\t\t\t<property name=\"multilineEnabled\" value=\"true\" />\r\n\t\t</parser>\r\n\t\t<record name=\"header\" minOccurs=\"1\" maxOccurs=\"1\" class=\"map\">\r\n\t\t\t<field name=\"OC_ENTITY\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_ACTION\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_Subscription_code\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_accessPoint_code\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_accessPoint_startDate\" ignore=\"true\"/>\r\n\t\t\t<field name=\"OC_accessPoint_endDate\" ignore=\"true\"/>\r\n\t\t</record>\r\n\t\t<record name=\"details\" minOccurs=\"1\" maxOccurs=\"unbounded\" class=\"map\">\r\n\t\t\t<field name=\"OC_ENTITY\" required=\"true\"/>\r\n\t\t\t<field name=\"OC_ACTION\" required=\"true\"/>\r\n\t\t\t<field name=\"OC_Subscription_code\" required=\"true\"/>\r\n\t\t\t<field name=\"OC_accessPoint_code\" required=\"true\"/>\r\n\t\t\t<field name=\"OC_accessPoint_startDate\" required=\"true\"/>\r\n\t\t\t<field name=\"OC_accessPoint_endDate\" required=\"true\"/>\r\n\t\t</record>\r\n\t</stream>\r\n</beanio>"}],
                "FlatFileProcessingJob_recordVariableName":[{"string":"record"}],
                "FlatFileProcessingJob_errorAction":[{"string":"CONTINUE"}],
                "FlatFileProcessingJob_originFilename":[{"string":"origin_filename"}],
                "FlatFileProcessingJob_archiveDir":[{"string":"/imports/accessPoints/archives"}],
                "FlatFileProcessingJob_inputDir":[{"string":"/imports/accessPoints/inputs"}],
                "waitingMillis":[{"long":0}],
                "FlatFileProcessingJob_nbLinesToProcess":[{"long":1}],
                "FlatFileProcessingJob_formatTransfo":[{"string":"None"}],
                "FlatFileProcessingJob_rejectDir":[{"string":"/imports/accessPoints/rejects"}],
                "nbRuns":[{"long":1}],
                "FlatFileProcessingJob_scriptsFlow":[{"string":"org.meveo.service.script.AccessImportScript"}]}', '1');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('J215_20210708', 'Mohammed_ELAZZOUZI', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4029, '9:031890a54eb74e767c9c14883d283e82', 'insert tableName=meveo_script_instance; insert tableName=meveo_script_instance; insert tableName=meveo_script_instance; insert tableName=meveo_job_instance; insert tableName=meveo_job_instance; insert tableName=meveo_job_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::1589_20210930::YoussefIZEM
INSERT INTO meveo_script_instance (id, version, code, src_type, description, created) VALUES (-55, 0, 'org.meveo.service.script.ProcessCustomerPaymentsFileScript', 'JAVA_CLASS', 'Process customer payments file script', NOW());

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('1589_20210930', 'YoussefIZEM', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4031, '9:f2207bae68116ee40c3ecaaeaedddd9a', 'insert tableName=meveo_script_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::INTRD-3765_07012022::hichamElHaloui
INSERT INTO public.meveo_script_instance (id, version, disabled, created, code, description, src_type, script) VALUES (-23, 0, 0, now(), 'org.meveo.service.script.DeleteCustomersScript', 'DeleteCustomersScript', 'JAVA_CLASS', null);

INSERT INTO meveo_job_instance (id, version, disabled, created, updated, code, description, job_category, job_template, parametres, creator, updater, timerentity_id, following_job_id, uuid, run_on_nodes, cluster_behavior, cf_values, verbose_report) VALUES (-26, 0, 0, NOW(), NOW(), 'DeleteCustomersScript_JOB', 'DeleteCustomersScript_JOB', 'MEDIATION', 'FlatFileProcessingJob', NULL, 'opencell.admin', 'opencell.admin', NULL, NULL, 'DeleteCustomersScript_JOB', NULL, 'LIMIT_TO_SINGLE_NODE', '{"FlatFileProcessingJob_mappingConf":[{"string":"<beanio xmlns=\"http://www.beanio.org/2012/03\" \r\n      xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n      xsi:schemaLocation=\"http://www.beanio.org/2012/03 http://www.beanio.org/2012/03/mapping.xsd\">\r\n      <stream name=\"RECORD\" format=\"csv\" strict=\"true\">\r\n        <parser>\r\n          <property name=\"delimiter\" value=\";\" />\r\n        </parser>     \r\n        <record name=\"customer\"  minOccurs=\"1\" maxOccurs=\"unbounded\" class=\"map\">  \r\n           <field name=\"customerCode\" minOccurs=\"0\" position=\"0\" />\r\n           <field name=\"noCheck\" minOccurs=\"0\" position=\"1\"/>\r\n        </record> \r\n      </stream>\r\n    </beanio>"}]
                        ,"FlatFileProcessingJob_recordVariableName":[{"string":"RECORD"}]
                        ,"FlatFileProcessingJob_errorAction":[{"string":"CONTINUE"}]
                        ,"FlatFileProcessingJob_fileNameExtension":[{"string":"csv"}]
                        ,"FlatFileProcessingJob_scriptsFlow":[{"string":"org.meveo.service.script.DeleteCustomersScript"}]
                        ,"FlatFileProcessingJob_inputDir":[{"string":"/batch/customer/delete"}]}', '1');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-3765_07012022', 'hichamElHaloui', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4033, '9:58481730038b61269f6a3a7b19bf4c52', 'sql; insert tableName=meveo_job_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::INTRD_1985_20210923_script::TarikFA.
INSERT INTO meveo_script_instance (id, code, created, creator, version, src_type) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.OrderValidationScript', NOW(), 'OPENCELL.ADMIN', 1, 'JAVA_CLASS');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD_1985_20210923_script', 'TarikFA.', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4035, '9:fb9f1ed1cc75620572d8dfc96d8b585e', 'insert tableName=meveo_script_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::INTRD-12266_20221214_rebuild::aeljaouhari
INSERT INTO meveo_script_instance (id, code, created, creator, version, src_type, description, description_i18n, script_instance_cat_id) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.validation.ValidateCreditCategoryScript', NOW(), 'OPENCELL.ADMIN', 1, 'JAVA_CLASS', 'The customer''s (customer account actually) credit category must not be in the provided list for the rule to pass. If customer''s credit category is in the list, the rule will fail. If credit category list is empty, then rule will be ignored.', '{"ENG":"<p>The customer''s (customer account actually) credit category must not be in the provided list for the rule to pass.</p><p>If customer''s credit category is in the list, the rule will fail.</p><p>If credit category list is empty, then rule will be ignored.</p>","FRA":"<p>Le catégorie de crédit du client (customer account) ne doit pas être dans la liste fournie pour que la règle passe.</p><p>Si la catégorie de crédit du client est dans la liste, la règle va échouer.</p><p>Si la liste de catégories de crédit est vide, la règle sera ignorée.</p>"}', (SELECT id FROM meveo_script_instance_cat WHERE code='INVOICE_VALIDATION'));

INSERT INTO meveo_script_parameter (id, version, code, description_i18n, class_name, mandatory, values_separator, collection, script_instance_id) VALUES (nextval('meveo_script_parameter_seq'), 0, 'CheckCreditCategory', '{"FRA":"Catégories de crédit interdites","ENG":"Forbidden credit categories"}', 'org.meveo.model.payments.CreditCategory', 0, '\|', 1, (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.validation.ValidateCreditCategoryScript'));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-12266_20221214_rebuild', 'aeljaouhari', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4037, '9:42eddcafab86c3a59dcef254ae1658b5', 'insert tableName=meveo_script_instance; insert tableName=meveo_script_parameter', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::INTRD-12267_20221219_rebuild::aeljaouhari
INSERT INTO meveo_script_instance (id, code, created, creator, version, src_type, description, description_i18n, script_instance_cat_id) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.validation.ValidateCustomerAgeScript', NOW(), 'OPENCELL.ADMIN', 1, 'JAVA_CLASS', 'The invoice’s customer (Customer/Group, Customer Account/Payer, Billing account) age is compared to a provided number of days. Age is computed at invoice date.', '{"ENG":"<p>The invoice’s customer (Customer/Group, Customer Account/Payer, Billing account) age is compared to a provided number of days.</p><p>Age is computed at invoice date.</p>","FRA":"<p>L’âge du client (Customer/Groupe, Customer Account/Compte payeur, Billing account/Compte de facturation) est comparé au nombre de jours indiqué.</p><p>L''âge est calculé à la date de facture.</p>"}', (SELECT id FROM meveo_script_instance_cat WHERE code='INVOICE_VALIDATION'));

INSERT INTO meveo_script_parameter (id, version, code, description_i18n, class_name, mandatory, default_value, allowed_values, values_separator, collection, script_instance_id) VALUES (nextval('meveo_script_parameter_seq'), 0, 'referenceDate', '{"FRA":"Date à tester","ENG":"Date to test"}', 'java.lang.String', 1, 'Billling Account subscription', 'Customer creation|Customer Account creation|Billing Account creation|Billing Account subscription', '\|', 0, (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.validation.ValidateCustomerAgeScript'));

INSERT INTO meveo_script_parameter (id, version, code, description_i18n, class_name, default_value, mandatory, allowed_values, values_separator, collection, script_instance_id) VALUES (nextval('meveo_script_parameter_seq'), 0, 'operator', '{"FRA":"Operateur de comparaison","ENG":"Comparison operator"}', 'java.lang.String', '>', 1, '<|≤|=|≠|>|≥', '\|', 0, (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.validation.ValidateCustomerAgeScript'));

INSERT INTO meveo_script_parameter (id, version, code, description_i18n, class_name, default_value, mandatory, values_separator, collection, script_instance_id) VALUES (nextval('meveo_script_parameter_seq'), 0, 'age', '{"FRA":"Âge en jour","ENG":"Age in days"}', 'java.lang.Integer', '30', 1, '\|', 0, (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.validation.ValidateCustomerAgeScript'));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-12267_20221219_rebuild', 'aeljaouhari', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4039, '9:2929615f2d8fdc2cc818b8711f2e5a96', 'insert tableName=meveo_script_instance; insert tableName=meveo_script_parameter; insert tableName=meveo_script_parameter; insert tableName=meveo_script_parameter', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::INTRD-12268_20221221_rebuild::aeljaouhari
INSERT INTO meveo_script_instance (id, code, created, creator, version, src_type, description, description_i18n, script_instance_cat_id) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.validation.ValidateSubscriptionAgeScript', NOW(), 'OPENCELL.ADMIN', 1, 'JAVA_CLASS', 'The invoice’s subscriptions age is compared to a provided number of days. Age is computed at invoice date.', '{"ENG":"<p>The invoice’s subscriptions age is compared to a provided number of days.</p><p>Age is computed at invoice date.</p>","FRA":"<p>L’âge de la souscription est comparé au nombre de jours indiqué.</p><p>L''âge est calculé à la date de facture.</p>"}', (SELECT id FROM meveo_script_instance_cat WHERE code='INVOICE_VALIDATION'));

INSERT INTO meveo_script_parameter (id, version, code, description_i18n, class_name, mandatory, default_value, allowed_values, values_separator, collection, script_instance_id) VALUES (nextval('meveo_script_parameter_seq'), 0, 'referenceDate', '{"FRA":"Date à tester","ENG":"Date to test"}', 'java.lang.String', 1, 'Subscription date', 'Subscription creation|Subscription date', '\|', 0, (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.validation.ValidateSubscriptionAgeScript'));

INSERT INTO meveo_script_parameter (id, version, code, description_i18n, class_name, default_value, mandatory, allowed_values, values_separator, collection, script_instance_id) VALUES (nextval('meveo_script_parameter_seq'), 0, 'operator', '{"FRA":"Operateur de comparaison","ENG":"Comparison operator"}', 'java.lang.String', '>', 1, '<|≤|=|≠|>|≥', '\|', 0, (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.validation.ValidateSubscriptionAgeScript'));

INSERT INTO meveo_script_parameter (id, version, code, description_i18n, class_name, default_value, mandatory, values_separator, collection, script_instance_id) VALUES (nextval('meveo_script_parameter_seq'), 0, 'age', '{"FRA":"Âge en jour","ENG":"Age in days"}', 'java.lang.Integer', '30', 1, '\|', 0, (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.validation.ValidateSubscriptionAgeScript'));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-12268_20221221_rebuild', 'aeljaouhari', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4041, '9:3b8310c10176df594bf1c9a36bdafbe0', 'insert tableName=meveo_script_instance; insert tableName=meveo_script_parameter; insert tableName=meveo_script_parameter; insert tableName=meveo_script_parameter', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#OUTRD-3_20221006-scripts::MohamedChaouki
INSERT INTO meveo_script_instance (id, code, created, creator, version, src_type) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.CdrFlatFileImportScript', NOW(), 'opencell.admin', 0, 'JAVA_CLASS');

INSERT INTO meveo_script_instance (id, code, created, creator, version, src_type) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.CdrJsonImportScript', NOW(), 'opencell.admin', 0, 'JAVA_CLASS');

INSERT INTO meveo_script_instance (id, code, created, creator, version, src_type) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.CdrCsvImportScript', NOW(), 'opencell.admin', 0, 'JAVA_CLASS');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#OUTRD-3_20221006-scripts', 'MohamedChaouki', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4043, '9:785610db34d92807e4ab6bcd3527b2e1', 'insert tableName=meveo_script_instance; insert tableName=meveo_script_instance; insert tableName=meveo_script_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#OUTRD-3_20221006-jobs::MohamedChaouki
INSERT INTO meveo_job_instance (id, version, disabled, created, job_category, job_template, code, creator, job_speed, cluster_behavior, verbose_report, cf_values) VALUES (nextval('meveo_job_instance_seq'), 0, 0, NOW(), 'MEDIATION', 'FlatFileProcessingJob', 'CsvImportCDR', 'opencell.admin', 'NORMAL', 'LIMIT_TO_SINGLE_NODE', 1, '{"nbRuns": [{"long": 1}], "oneFilePerJob": [{"boolean": false}], "waitingMillis": [{"long": 0}], "FlatFileProcessingJob_inputDir": [{"string": "/imports/cdr/csv/input"}], "FlatFileProcessingJob_outputDir": [{"string": "/imports/cdr/csv/output"}], "FlatFileProcessingJob_rejectDir": [{"string": "/imports/cdr/csv/reject"}], "FlatFileProcessingJob_archiveDir": [{"string": "/imports/cdr/csv/archive"}], "FlatFileProcessingJob_errorAction": [{"string": "CONTINUE"}], "FlatFileProcessingJob_mappingConf": [{"string": "<beanio\r\n        xmlns=\"http://www.beanio.org/2012/03\"\r\n        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n        xsi:schemaLocation=\"http://www.beanio.org/2012/03 http://www.beanio.org/2012/03/mapping.xsd\">\r\n    <stream name=\"record\" format=\"csv\">\r\n        <parser>\r\n            <property name=\"delimiter\" value=\";\" />\r\n            <property name=\"comments\" value=\"END\" />\r\n            <property name=\"multilineEnabled\" value=\"true\" />\r\n        </parser>\r\n  <record name=\"header\" minOccurs=\"1\" maxOccurs=\"1\" class=\"map\">\r\n  <field name=\"OC_CDR_DATE\" ignore=\"true\"/>\r\n  <field name=\"OC_QANTITY\" ignore=\"true\"/>\r\n  <field name=\"OC_AC\" ignore=\"true\"/>\r\n  <field name=\"OC_PARAMETER_1\" ignore=\"true\"/>\r\n <field name=\"OC_PARAMETER_2\" ignore=\"true\"/>\r\n  <field name=\"OC_PARAMETER_3\" ignore=\"true\"/>\r\n <field name=\"OC_PARAMETER_4\" ignore=\"true\"/>\r\n   <field name=\"OC_PARAMETER_5\" ignore=\"true\"/>\r\n  <field name=\"OC_PARAMETER_6\" ignore=\"true\"/>\r\n  <field name=\"OC_PARAMETER_7\" ignore=\"true\"/>\r\n  <field name=\"OC_PARAMETER_8\" ignore=\"true\"/>\r\n   <field name=\"OC_PARAMETER_9\" ignore=\"true\"/>\r\n  <field name=\"OC_DATE_PARAM_1\" ignore=\"true\"/>\r\n   <field name=\"OC_DATE_PARAM_2\" ignore=\"true\"/>\r\n  <field name=\"OC_DATE_PARAM_3\" ignore=\"true\"/>\r\n   <field name=\"OC_DATE_PARAM_4\" ignore=\"true\"/>\r\n  <field name=\"OC_DATE_PARAM_5\" ignore=\"true\"/>\r\n  <field name=\"OC_DECIMAL_PARAM_1\" ignore=\"true\"/>\r\n  <field name=\"OC_DECIMAL_PARAM_2\" ignore=\"true\"/>\r\n   <field name=\"OC_DECIMAL_PARAM_3\" ignore=\"true\"/>\r\n   <field name=\"OC_DECIMAL_PARAM_4\" ignore=\"true\"/>\r\n   <field name=\"OC_DECIMAL_PARAM_5\" ignore=\"true\"/>\r\n  <field name=\"OC_EXTRA_PARAM\" ignore=\"true\"/>\r\n  </record>\r\n  <record name=\"details\" minOccurs=\"1\" maxOccurs=\"unbounded\" class=\"map\">\r\n  <field name=\"OC_CDR_DATE\" required=\"true\"/>\r\n  <field name=\"OC_QANTITY\" required=\"true\"/>\r\n  <field name=\"OC_AC\" required=\"true\"/>\r\n   <field name=\"OC_PARAMETER_1\"/>\r\n  <field name=\"OC_PARAMETER_2\"/>\r\n  <field name=\"OC_PARAMETER_3\" />\r\n   <field name=\"OC_PARAMETER_4\" />\r\n  <field name=\"OC_PARAMETER_5\" />\r\n  <field name=\"OC_PARAMETER_6\" />\r\n  <field name=\"OC_PARAMETER_7\" />\r\n <field name=\"OC_PARAMETER_8\" />\r\n <field name=\"OC_PARAMETER_9\" />\r\n  <field name=\"OC_DATE_PARAM_1\"/>\r\n  <field name=\"OC_DATE_PARAM_2\"/>\r\n <field name=\"OC_DATE_PARAM_3\" />\r\n  <field name=\"OC_DATE_PARAM_4\" />\r\n  <field name=\"OC_DATE_PARAM_5\" />\r\n   <field name=\"OC_DECIMAL_PARAM_1\"/>\r\n  <field name=\"OC_DECIMAL_PARAM_2\"/>\r\n <field name=\"OC_DECIMAL_PARAM_3\" />\r\n <field name=\"OC_DECIMAL_PARAM_4\" />\r\n  <field name=\"OC_DECIMAL_PARAM_5\" />\r\n  <field name=\"OC_EXTRA_PARAM\" />\r\n  </record>\r\n  </stream>\r\n  </beanio>\r\n"}], "FlatFileProcessingJob_scriptsFlow": [{"string": "org.meveo.service.script.CdrCsvImportScript"}], "FlatFileProcessingJob_formatTransfo": [{"string": "None"}], "FlatFileProcessingJob_originFilename": [{"string": "origin_filename"}], "FlatFileProcessingJob_nbLinesToProcess": [{"long": 1}], "FlatFileProcessingJob_fileNameExtension": [{"string": "csv"}], "FlatFileProcessingJob_recordVariableName": [{"string": "record"}]}');

INSERT INTO meveo_job_instance (id, version, disabled, created, updated, uuid, code, description, job_category, job_template, parametres, creator, updater, timerentity_id, cf_values) VALUES (nextval('meveo_job_instance_seq'), 0, 0, NOW(), NULL, 'FlatFileImportCDR', 'FlatFileImportCDR', 'FlatFileImportCDR', 'MEDIATION', 'ScriptingJob', NULL, 'opencell.admin', NULL, NULL, '{"ScriptingJob_script":[{"entity":{"classname":"org.meveo.model.scripts.ScriptInstance","code":"org.meveo.service.script.CdrFlatFileImportScript","id":-30}}],"ScriptingJob_TransactionType":[{"string":"REQUIRES_NEW"}]}');

INSERT INTO meveo_job_instance (id, version, disabled, created, updated, uuid, code, description, job_category, job_template, parametres, creator, updater, timerentity_id, cf_values) VALUES (nextval('meveo_job_instance_seq'), 0, 0, NOW(), NULL, 'JsonImportCDR', 'JsonImportCDR', 'JsonImportCDR', 'MEDIATION', 'ScriptingJob', NULL, 'opencell.admin', NULL, NULL, '{"ScriptingJob_script":[{"entity":{"classname":"org.meveo.model.scripts.ScriptInstance","code":"org.meveo.service.script.CdrJsonImportScript","id":-30}}],"ScriptingJob_TransactionType":[{"string":"REQUIRES_NEW"}]}');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#OUTRD-3_20221006-jobs', 'MohamedChaouki', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4045, '9:e31951836aec909b5402e9918857cca1', 'insert tableName=meveo_job_instance; insert tableName=meveo_job_instance; insert tableName=meveo_job_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#OUTRD-49_20220913-scripts::HamzaBiadi
INSERT INTO meveo_script_instance (id, code, created, creator, version, src_type) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.CustomerImportScript', NOW(), 'opencell.admin', 0, 'JAVA_CLASS');

INSERT INTO meveo_script_instance (id, code, created, creator, version, src_type) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.CustomerAccountImportScript', NOW(), 'opencell.admin', 0, 'JAVA_CLASS');

INSERT INTO meveo_script_instance (id, code, created, creator, version, src_type) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.PaymentMethodImportScript', NOW(), 'opencell.admin', 0, 'JAVA_CLASS');

INSERT INTO meveo_script_instance (id, code, created, creator, version, src_type) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.BillingAccountImportScript', NOW(), 'opencell.admin', 0, 'JAVA_CLASS');

INSERT INTO meveo_script_instance (id, code, created, creator, version, src_type) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.UserAccountImportScript', NOW(), 'opencell.admin', 0, 'JAVA_CLASS');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#OUTRD-49_20220913-scripts', 'HamzaBiadi', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4047, '9:05e05014efa039c3ecba913040fbd007', 'insert tableName=meveo_script_instance; insert tableName=meveo_script_instance; insert tableName=meveo_script_instance; insert tableName=meveo_script_instance; insert tableName=meveo_script_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#OUTRD-49-SUB_20220914-scripts::HamzaBiadi
INSERT INTO meveo_script_instance (id, code, created, creator, version, src_type) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.SubscriptionMassImportScript', NOW(), 'opencell.admin', 0, 'JAVA_CLASS');

INSERT INTO meveo_script_instance (id, code, created, creator, version, src_type) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.ServiceInstanceImportScript', NOW(), 'opencell.admin', 0, 'JAVA_CLASS');

INSERT INTO meveo_script_instance (id, code, created, creator, version, src_type) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.AttributeInstanceImportScript', NOW(), 'opencell.admin', 0, 'JAVA_CLASS');

INSERT INTO meveo_script_instance (id, code, created, creator, version, src_type) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.AccessPointImportScript', NOW(), 'opencell.admin', 0, 'JAVA_CLASS');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#OUTRD-49-SUB_20220914-scripts', 'HamzaBiadi', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4049, '9:210692be024fe7fcf62a8c6f2ca43a18', 'insert tableName=meveo_script_instance; insert tableName=meveo_script_instance; insert tableName=meveo_script_instance; insert tableName=meveo_script_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::INTRD_11783_20221201_compate_invoice_amount::a.rouaguebe
INSERT INTO meveo_script_instance (id, code, created, creator, version, src_type, description, description_i18n, script_instance_cat_id) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.CompareInvoiceAmountScript', NOW(), 'OPENCELL.ADMIN', 1, 'JAVA_CLASS', 'Invoice amount will be compared to provided amount using the selected operator.', '{"FRA":"Le montant de la facture sera comparé au montant indiqué en utilisant l’opérateur sélectionné.", "EN": "Invoice amount will be compared to provided amount using the selected operator."}', (SELECT id FROM meveo_script_instance_cat WHERE code='INVOICE_VALIDATION'));

INSERT INTO meveo_script_parameter (id, version, code, script_instance_id, description_i18n, class_name, default_value, mandatory, allowed_values, values_separator, collection) VALUES (nextval('meveo_script_parameter_seq'), 0, 'withOrWithoutTax', (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.CompareInvoiceAmountScript'), '{"FRA":"Montant à tester","ENG":"Amount to test"}', 'java.lang.String', 'without tax', 1, 'without tax|with tax', '\|', 0);

INSERT INTO meveo_script_parameter (id, version, code, script_instance_id, description_i18n, class_name, default_value, mandatory, allowed_values, values_separator, collection) VALUES (nextval('meveo_script_parameter_seq'), 0, 'operator', (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.CompareInvoiceAmountScript'), '{"FRA":"Operateur de comparaison","ENG":"Comparison operator"}', 'java.lang.String', '>', 1, '<|≤|=|≠|>|≥', '\|', 0);

INSERT INTO meveo_script_parameter (id, version, code, script_instance_id, description_i18n, class_name, default_value, mandatory, values_separator, collection) VALUES (nextval('meveo_script_parameter_seq'), 0, 'value', (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.CompareInvoiceAmountScript'), '{"FRA":"Valeur","ENG":"Value"}', 'java.math.BigDecimal', '0', 1, '\|', 0);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD_11783_20221201_compate_invoice_amount', 'a.rouaguebe', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4051, '9:8b5786694eb14235b5897310b6a90723', 'insert tableName=meveo_script_instance; insert tableName=meveo_script_parameter; insert tableName=meveo_script_parameter; insert tableName=meveo_script_parameter', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::INTRD_12001_20221205_rebuild::TarikFA.
INSERT INTO meveo_script_instance (id, code, created, creator, version, src_type, description, description_i18n, script_instance_cat_id) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.CompareOfferAmountScript', NOW(), 'OPENCELL.ADMIN', 1, 'JAVA_CLASS', 'Amount invoiced for each offer in the list will be compared to the provided value using the selected operator If offer list is empty, then rule will be ignored. Only offer actually present on invoice will be tested.', '{"FRA":"<p>Le montant facturé pour chacune des offres dans la liste sera comparé à la valeur indiquée, en utilisant l’opérateur sélectionné.</p><p>Si la liste des offres est vide, alors la règle sera ignorée.</p><p>Seules les offres effectivement présentes sur la facture seront testées.</p>","ENG":"<p>Amount invoiced for each offer in the list will be compared to the provided value using the selected operator</p><p>If offer list is empty, then rule will be ignored.</p><p>Only offer actually present on invoice will be tested.</p>"}', (SELECT id FROM meveo_script_instance_cat WHERE code='INVOICE_VALIDATION'));

INSERT INTO meveo_script_parameter (id, version, code, description_i18n, class_name, mandatory, values_separator, collection, script_instance_id) VALUES (nextval('meveo_script_parameter_seq'), 0, 'offers', '{"FRA":"Offres à vérifier","ENG":"Offers to check"}', 'org.meveo.model.catalog.OfferTemplate', 0, '\|', 1, (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.CompareOfferAmountScript'));

INSERT INTO meveo_script_parameter (id, version, code, description_i18n, class_name, default_value, mandatory, allowed_values, values_separator, collection, script_instance_id) VALUES (nextval('meveo_script_parameter_seq'), 0, 'withOrWithoutTax', '{"FRA":"Montant à tester","ENG":"Amount to test"}', 'java.lang.String', 'without tax', 1, 'without tax|with tax', '\|', 0, (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.CompareOfferAmountScript'));

INSERT INTO meveo_script_parameter (id, version, code, description_i18n, class_name, default_value, mandatory, allowed_values, values_separator, collection, script_instance_id) VALUES (nextval('meveo_script_parameter_seq'), 0, 'operator', '{"FRA":"Operateur de comparaison","ENG":"Comparison operator"}', 'java.lang.String', '>', 1, '<|≤|=|≠|>|≥', '\|', 0, (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.CompareOfferAmountScript'));

INSERT INTO meveo_script_parameter (id, version, code, description_i18n, class_name, default_value, mandatory, values_separator, collection, script_instance_id) VALUES (nextval('meveo_script_parameter_seq'), 0, 'value', '{"FRA":"Valeur","ENG":"Value"}', 'java.math.BigDecimal', '0', 1, '\|', 0, (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.CompareOfferAmountScript'));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD_12001_20221205_rebuild', 'TarikFA.', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4053, '9:7c8fd4001329cbb75d93428412e55526', 'insert tableName=meveo_script_instance; insert tableName=meveo_script_parameter; insert tableName=meveo_script_parameter; insert tableName=meveo_script_parameter; insert tableName=meveo_script_parameter', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::INTRD-12103_20221215_rebuild::HichamHANINE
INSERT INTO meveo_script_instance (id, code, created, creator, version, src_type, description, description_i18n, script_instance_cat_id) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.CompareOfferLinesAmountScript', NOW(), 'OPENCELL.ADMIN', 1, 'JAVA_CLASS', 'Amount of each invoice line coming from offers in the list will be compared to the provided value using the selected operator. More details in the translated descriptions...', '{"ENG":"<p>Amount of each invoice line coming from offers in the list will be compared to the provided value using the selected operator.</p><p>Only offer from the list actually present on invoice will be tested</p><p>If offer list is empty, then all invoice lines will be tested regardless of their offer.</p><p>For the test to pass, all tested invoice lines must pass the test.</p>",
				"FRA":"<p>Le montant de chaque ligne de facture provenant d’une offre de la liste sera comparé à la valeur indiquée, en utilisant l’opérateur sélectionné.</p><p>Seule les offres de la liste effectivement présentes sur la facture seront testées.</p><p>Si la liste des offres est vide, alors toutes les lignes de facture seront testées, quelle que soit leur offre.</p><p>Pour que le teste passe, toutes les lignes de facture testées doivent passer le test.</p>"}', (SELECT id FROM meveo_script_instance_cat WHERE code='INVOICE_VALIDATION'));

INSERT INTO meveo_script_parameter (id, version, code, description_i18n, class_name, mandatory, values_separator, collection, script_instance_id) VALUES (nextval('meveo_script_parameter_seq'), 0, 'offers', '{"FRA":"Offres à vérifier","ENG":"Offers to check"}', 'org.meveo.model.catalog.OfferTemplate', 0, '\|', 1, (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.CompareOfferLinesAmountScript'));

INSERT INTO meveo_script_parameter (id, version, code, description_i18n, class_name, default_value, mandatory, allowed_values, values_separator, collection, script_instance_id) VALUES (nextval('meveo_script_parameter_seq'), 0, 'withOrWithoutTax', '{"FRA":"Montant à tester","ENG":"Amount to test"}', 'java.lang.String', 'without tax', 1, 'without tax|with tax', '\|', 0, (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.CompareOfferLinesAmountScript'));

INSERT INTO meveo_script_parameter (id, version, code, description_i18n, class_name, default_value, mandatory, allowed_values, values_separator, collection, script_instance_id) VALUES (nextval('meveo_script_parameter_seq'), 0, 'operator', '{"FRA":"Operateur de comparaison","ENG":"Comparison operator"}', 'java.lang.String', '>', 1, '<|≤|=|≠|>|≥', '\|', 0, (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.CompareOfferLinesAmountScript'));

INSERT INTO meveo_script_parameter (id, version, code, description_i18n, class_name, default_value, mandatory, values_separator, collection, script_instance_id) VALUES (nextval('meveo_script_parameter_seq'), 0, 'value', '{"FRA":"Valeur","ENG":"Value"}', 'java.math.BigDecimal', '0', 1, '\|', 0, (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.CompareOfferLinesAmountScript'));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-12103_20221215_rebuild', 'HichamHANINE', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4055, '9:35e2e17b32a63c65831d0d01f621a864', 'insert tableName=meveo_script_instance; insert tableName=meveo_script_parameter; insert tableName=meveo_script_parameter; insert tableName=meveo_script_parameter; insert tableName=meveo_script_parameter', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#INTRD-14122_20230221::hichamELHALOUI
INSERT INTO cpq_tag_type (id, created, code, description) VALUES ('-1', NOW(), 'tunnel', 'Tunnel');

INSERT INTO cpq_tag (id, created, code, description, tag_type_id) VALUES ('-1', NOW(), 'featured', 'Featured', '-1');

INSERT INTO crm_customer_category (id, version, uuid, created, code, description, accounting_code_id, tax_category_id) VALUES (-3, 0, 'CCC_B2B', NOW(), 'B2B', 'B2B', (select id from billing_accounting_code where code = '410000000'), -3);

INSERT INTO crm_customer_category (id, version, uuid, created, code, description, accounting_code_id, tax_category_id) VALUES (-4, 0, 'CCC_regular_account', NOW(), 'regular account', 'regular account', (select id from billing_accounting_code where code = '410000000'), -3);

INSERT INTO crm_customer_category (id, version, uuid, created, code, description, accounting_code_id, tax_category_id, description_i18n) VALUES (-5, 0, 'CCC_B2G', NOW(), 'B2G', 'Governement', (select id from billing_accounting_code where code = '410000000'), -3, '{"FRA":"Gouvernement","ENG":"Governement"}');

INSERT INTO cat_offer_template_category (id, version, created, code, name, order_level) VALUES (-1, 0, NOW(), 'new', 'New', 0);

INSERT INTO cat_offer_template_category (id, version, created, code, name, order_level) VALUES (-2, 0, NOW(), 'standard', 'Standard', 0);

INSERT INTO cat_channel (id, version, created, code, description) VALUES (-1, 0, NOW(), 'backoffice', 'Backoffice');

INSERT INTO cat_channel (id, version, created, code, description) VALUES (-2, 0, NOW(), 'web', 'Web');

INSERT INTO adm_title (id, version, creator, created, code, description, is_company, description_i18n) VALUES (-8, 0, 'OPENCELL.ADMIN', NOW(), 'SA', 'French joint-stock company', 1, '{"FRA":"Société Anonyme","ENG":"French joint-stock company"}');

INSERT INTO adm_title (id, version, creator, created, code, description, is_company, description_i18n) VALUES (-9, 0, 'OPENCELL.ADMIN', NOW(), 'SARL', 'French limited liability company', 1, '{"FRA":"Société a responsabilité limitée","ENG":"French limited liability company"}');

INSERT INTO adm_title (id, version, creator, created, code, description, is_company, description_i18n) VALUES (-10, 0, 'OPENCELL.ADMIN', NOW(), 'SAS', 'Simplified joint-stock corporation', 1, '{"FRA":"Société par actions simplifiée","ENG":"Simplified joint-stock corporation"}');

INSERT INTO adm_title (id, version, creator, created, code, description, is_company, description_i18n) VALUES (-11, 0, 'OPENCELL.ADMIN', NOW(), 'PLC', 'Public limited company', 1, '{"FRA":"société ouverte à responsabilité limitée","ENG":"Public limited company"}');

INSERT INTO adm_title (id, version, creator, created, code, description, is_company, description_i18n) VALUES (-12, 0, 'OPENCELL.ADMIN', NOW(), 'LTD', 'Private company limited by shares', 1, '{"FRA":"Société privée limité par actions","ENG":"Private company limited by shares"}');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-14122_20230221', 'hichamELHALOUI', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4057, '9:8726327efce9c40bb267df2935488944', 'insert tableName=cpq_tag_type; insert tableName=cpq_tag; insert tableName=crm_customer_category; insert tableName=crm_customer_category; insert tableName=crm_customer_category; insert tableName=cat_offer_template_category; insert tableName=cat_off...', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::rebuild-data-sellerDEMO::AndriusKarpavicius
INSERT INTO crm_seller (id, version, created, code, description, uuid, trading_currency_id, trading_language_id, email, trading_country_id, legal_entity_type_id, vat_no, address_city, address_zipcode, address_1, address_2) VALUES (-1, 0, '2015-03-19 00:04:19.913', 'MAIN_SELLER', 'Demo Distributor', 'MAIN_SELLER', -1, -1, 'billing@opencell.com', '-1', (select id from adm_title where code = 'SAS'), '89810129411', 'New York', '10001', 'High level suite', 'Appt 3327');

INSERT INTO crm_seller (id, version, created, code, description, uuid, parent_seller_id, trading_currency_id, trading_language_id, email) VALUES (-2, 0, '2015-03-19 00:04:19.934', 'SELLER_US', 'US Seller', 'SELLER_US', -1, -1, -1, 'billing@opencell.com');

INSERT INTO crm_seller (id, version, created, code, description, uuid, parent_seller_id, trading_currency_id, trading_language_id, email) VALUES (-3, 0, '2015-03-19 00:04:19.955', 'SELLER_FR', 'France Seller', 'SELLER_FR', -1, -2, -2, 'billing@opencell.com');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-data-sellerDEMO', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4059, '9:5d1b57aa58b552aa8e648c4a46d0ac5a', 'insert tableName=crm_seller; insert tableName=crm_seller; insert tableName=crm_seller', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#INTRD-13074_20230214::zelmeliani
INSERT INTO ar_customer_balance (id, version, created, creator, code, description, default_balance, balance_el) VALUES ('-1', '0', NOW(), 'applicationInitializer', 'default_customer_balance', 'Default Customer Balance', '1', '#{ accountOperation.excludeFromDefaultBalance==false }');

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'INV_ADV'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'REF_CASH'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'PPL_INSTALLMENT'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'PPL_CREATION'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'PAY_WIRE'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'PAY_CASH'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'PAY_BATCH'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'PAY_STP'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'PAY_PAL'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'CRD_TRS'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'DBT_TRS'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'PAY_CRD'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'EXP_WRT'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'REF_TIP'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'INV_CRN'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'INV_DIS'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'INV_REB'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'REJ_RDD'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'REJ_RCR'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'REJ_CRD'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'TAX_VAT_10'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'TAX_VAT_20'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'TAX_VAT_05'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'TAX_VAT_00'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'REF_CRD'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'ADJ_INV'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'ADJ_REF'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'INV_STD'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'INV_FEE'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'PAY_DEP'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'RND_INC'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'RND_EXP'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'REF_DDT'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'REF_CHK'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'PAY_REC'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'PAY_NID'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'REJ_TIP'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'REJ_DDT'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'REJ_CHK'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'PAY_DDT'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'PAY_TIP'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'PAY_CHK'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO ar_customer_balance_templates (template_id, customer_balance_id) VALUES ((SELECT id FROM ar_occ_template WHERE code = 'PAY_SD'), (SELECT id FROM ar_customer_balance WHERE code = 'default_customer_balance'));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-13074_20230214', 'zelmeliani', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4061, '9:4a4eb19443cf155d8761ea92fe33f727', 'insert tableName=ar_customer_balance; insert tableName=ar_customer_balance_templates; insert tableName=ar_customer_balance_templates; insert tableName=ar_customer_balance_templates; insert tableName=ar_customer_balance_templates; insert tableName=...', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#INTRD-14750_20230331_build::TarikFA.
INSERT INTO meveo_job_instance (id, version, disabled, created, job_category, job_template, code, creator, uuid) VALUES (-65, 0, 1, '2023-03-31 15:51:00', 'INVOICING', 'DuplicateRatedTransactionJob', 'DuplicateRatedTransactionJob', 'OPENCELL.ADMIN', 'DuplicateRatedTransactionJob-UUID');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-14750_20230331_build', 'TarikFA.', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4063, '9:500dfc077be55a98fe513fb69cc328e0', 'insert tableName=meveo_job_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#INTRD-16066_20230515::AbdellatifBARI.
INSERT INTO billing_accounting_article (id, version, code, tax_class_id, invoice_sub_category_id, description_i18n, description, created, creator, uuid) VALUES ('-1', 0, 'ADV-STD', '-3', '-3', '{"FRA":"Acompte","ENG":"Advance payment"}', 'Advance payment', NOW(), 'applicationInitializer', 'billing_accounting_article-ADV-STD');

INSERT INTO billing_accounting_article (id, version, code, tax_class_id, invoice_sub_category_id, description_i18n, description, created, creator, uuid, allowance_code) VALUES ('-2', 0, 'DISC-STD', '-5', '-3', '{"FRA":"Remise de pied de facture","ENG":"Invoice discount"}', 'Invoice discount', NOW(), 'applicationInitializer', 'billing_accounting_article-DISC-STD', (SELECT id FROM untdid_5189_allowance_code WHERE code='95'));

INSERT INTO billing_accounting_article (id, version, code, tax_class_id, invoice_sub_category_id, description_i18n, description, created, creator, uuid) VALUES ('-3', 0, 'ART-STD', '-5', '-3', '{"FRA":"Article standard","ENG":"Standard article"}', 'Standard article', NOW(), 'applicationInitializer', 'billing_accounting_article-ART-STD');

INSERT INTO billing_accounting_article (id, version, code, tax_class_id, invoice_sub_category_id, description_i18n, description, created, creator, uuid) VALUES ('-4', 0, 'MIN-STD', '-5', '-3', '{"FRA":"Complément du minimum de facturation","ENG":"Invoice minimum complement"}', 'Invoice minimum complement', NOW(), 'applicationInitializer', 'billing_accounting_article-MIN-STD');

INSERT INTO billing_accounting_article (id, version, code, tax_class_id, invoice_sub_category_id, description_i18n, description, created, creator, uuid, allowance_code) VALUES ('-10', 0, 'PROD-STD', '-5', '-2', '{"FRA":"Remise de pied de facture","ENG":"Invoice discount"}', 'Invoice discount', NOW(), 'applicationInitializer', '63ef9cee-f498-4908-PROD-STD', (SELECT id FROM untdid_5189_allowance_code WHERE code='95'));

INSERT INTO billing_accounting_article (id, version, code, tax_class_id, accounting_code_id, invoice_sub_category_id, invoice_type_id, description, created, creator, uuid, allowance_code) VALUES ('-11', 0, 'ART_SECURITY_DEPOSIT', '-3', '-2', '-4', '-6', 'Article Security Deposit', NOW(), 'opencell.admin', 'billing_accounting_article_art_security_deposit', (SELECT id FROM untdid_5189_allowance_code Where code = '95'));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-16066_20230515', 'AbdellatifBARI.', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4065, '9:a548b0588b857893ee2e32622957d423', 'insert tableName=billing_accounting_article; insert tableName=billing_accounting_article; insert tableName=billing_accounting_article; insert tableName=billing_accounting_article; insert tableName=billing_accounting_article; insert tableName=billi...', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::INTRD-17572_20230721-ADJ-REF::aelmalki
INSERT INTO billing_invoice_type_applies_to (invoice_type_id, applies_to_id) VALUES ((SELECT id FROM billing_invoice_type WHERE code = 'ADJ_REF'), (SELECT id FROM billing_invoice_type WHERE code = 'COM'));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-17572_20230721-ADJ-REF', 'aelmalki', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4067, '9:b4a08b51c58d91484dbc517499c89156', 'insert tableName=billing_invoice_type_applies_to', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::INTRD-12463_20230821::aelmalki
UPDATE billing_invoice_configuration SET default_advanced_payment_article_id = (SELECT id FROM billing_accounting_article WHERE code = 'ADV-STD');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-12463_20230821', 'aelmalki', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4069, '9:daf5ae48ea73dfc05fb138cc576a3078', 'update tableName=billing_invoice_configuration', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#INTRD-16859_20230626::aeljaouhari
INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-16859_20230626', 'aeljaouhari', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4071, '9:d41d8cd98f00b204e9800998ecf8427e', 'empty', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#INTRD-18527_20231002::aeljaouhari
INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-18527_20231002', 'aeljaouhari', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4073, '9:d41d8cd98f00b204e9800998ecf8427e', 'empty', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#INTRD-19367_20231212::aeljaouhari
INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-19367_20231212', 'aeljaouhari', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4075, '9:d41d8cd98f00b204e9800998ecf8427e', 'empty', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::INTRD-19853_20231213::zelmeliani
INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-19853_20231213', 'zelmeliani', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4077, '9:d41d8cd98f00b204e9800998ecf8427e', 'empty', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#INTRD-19862_20231214::zelmeliani
INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-19862_20231214', 'zelmeliani', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4079, '9:d41d8cd98f00b204e9800998ecf8427e', 'empty', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#INTRD-19862_20231220::zelmeliani
INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-19862_20231220', 'zelmeliani', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4081, '9:d41d8cd98f00b204e9800998ecf8427e', 'empty', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#INTRD-20278_20240109::AbdellatifBARI
INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-20278_20240109', 'AbdellatifBARI', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4083, '9:d41d8cd98f00b204e9800998ecf8427e', 'empty', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#INTRD-20752_20240115::zelmeliani
INSERT INTO meveo_script_instance (id, version, disabled, code, src_type, description, created, script_instance_cat_id, description_i18n) VALUES (nextval('meveo_script_instance_seq'), 0, '0', 'org.meveo.service.script.dunning.DunningSuspendSubscriptionScript', 'JAVA_CLASS', 'The invoice''s subscription is suspended when the TriggerCollectionPlanLevelsJob launch a dunning level with a script type action', NOW(), (SELECT id FROM meveo_script_instance_cat WHERE code='DUNNING_ACTION'), '{"ENG": "<p>The invoice''s subscription is suspended when the TriggerCollectionPlanLevelsJob launch a dunning level with a script type action.</p>", "FRA": "<p>La souscription liée à la facture est suspendu lorsque le TriggerCollectionPlanLevelsJob lance un niveau avec une action de type script.</p>"}');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-20752_20240115', 'zelmeliani', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4085, '9:d48f0cf08be7878b6706f644b5831798', 'insert tableName=meveo_script_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#INTRD-21527_20240214::zelmeliani
UPDATE ar_occ_template SET account_code_client_side = '411000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '758100000'), journal_id = (SELECT id FROM journal WHERE code = 'MSC'), occ_category = 'CREDIT' WHERE code = 'RND_INC';

UPDATE ar_occ_template SET account_code_client_side = '658100000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '658100000'), journal_id = (SELECT id FROM journal WHERE code = 'MSC'), occ_category = 'DEBIT' WHERE code = 'RND_EXP';

UPDATE ar_occ_template SET account_code_client_side = '445510000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '445510000'), journal_id = (SELECT id FROM journal WHERE code = 'TAX'), occ_category = 'DEBIT' WHERE code = 'TAX_VAT_00';

UPDATE ar_occ_template SET account_code_client_side = '445510000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '445510000'), journal_id = (SELECT id FROM journal WHERE code = 'TAX'), occ_category = 'DEBIT' WHERE code = 'TAX_VAT_05';

UPDATE ar_occ_template SET account_code_client_side = '445510000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '445510000'), journal_id = (SELECT id FROM journal WHERE code = 'TAX'), occ_category = 'DEBIT' WHERE code = 'TAX_VAT_10';

UPDATE ar_occ_template SET account_code_client_side = '445510000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '445510000'), journal_id = (SELECT id FROM journal WHERE code = 'TAX'), occ_category = 'DEBIT' WHERE code = 'TAX_VAT_20';

UPDATE ar_occ_template SET account_code_client_side = '411000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '419100000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '512000000'), journal_id = (SELECT id FROM journal WHERE code = 'BAN'), occ_category = 'DEBIT' WHERE code = 'REJ_CHK';

UPDATE ar_occ_template SET account_code_client_side = '411000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '419100000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '512000000'), journal_id = (SELECT id FROM journal WHERE code = 'BAN'), occ_category = 'DEBIT' WHERE code = 'REJ_CRD';

UPDATE ar_occ_template SET account_code_client_side = '411000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '419100000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '512000000'), journal_id = (SELECT id FROM journal WHERE code = 'BAN'), occ_category = 'DEBIT' WHERE code = 'REJ_DDT';

UPDATE ar_occ_template SET account_code_client_side = '411000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '419100000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '512000000'), journal_id = (SELECT id FROM journal WHERE code = 'BAN'), occ_category = 'CREDIT' WHERE code = 'REJ_RCR';

UPDATE ar_occ_template SET account_code_client_side = '411000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '419100000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '512000000'), journal_id = (SELECT id FROM journal WHERE code = 'BAN'), occ_category = 'CREDIT' WHERE code = 'REJ_RDD';

UPDATE ar_occ_template SET account_code_client_side = '411000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '419100000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '512000000'), journal_id = (SELECT id FROM journal WHERE code = 'BAN'), occ_category = 'DEBIT' WHERE code = 'REJ_TIP';

UPDATE ar_occ_template SET account_code_client_side = '419120000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '419100000'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '512010000'), journal_id = (SELECT id FROM journal WHERE code = 'BAN'), occ_category = 'CREDIT' WHERE code = 'PAY_REC';

UPDATE ar_occ_template SET account_code_client_side = '419120000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '419100000'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '512010000'), journal_id = (SELECT id FROM journal WHERE code = 'BAN'), occ_category = 'CREDIT' WHERE code = 'PAY_NID';

UPDATE ar_occ_template SET account_code_client_side = '419110000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '419100000'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '512010000'), journal_id = (SELECT id FROM journal WHERE code = 'BAN'), occ_category = 'CREDIT' WHERE code = 'PAY_DEP';

UPDATE ar_occ_template SET account_code_client_side = '411000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '512000000'), journal_id = (SELECT id FROM journal WHERE code = 'BAN'), occ_category = 'CREDIT' WHERE code = 'PAY_DDT';

UPDATE ar_occ_template SET account_code_client_side = '411000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '511011000'), journal_id = (SELECT id FROM journal WHERE code = 'BAN'), occ_category = 'CREDIT' WHERE code = 'PAY_CRD';

UPDATE ar_occ_template SET account_code_client_side = '411000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '511200000'), journal_id = (SELECT id FROM journal WHERE code = 'BAN'), occ_category = 'CREDIT' WHERE code = 'PAY_CHK';

UPDATE ar_occ_template SET account_code_client_side = '411000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '511000610'), journal_id = (SELECT id FROM journal WHERE code = 'BAN'), occ_category = 'CREDIT' WHERE code = 'PAY_TIP';

UPDATE ar_occ_template SET account_code_client_side = NULL, accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '512000000'), journal_id = (SELECT id FROM journal WHERE code = 'BAN'), occ_category = 'CREDIT' WHERE code = 'PAY_BATCH';

UPDATE ar_occ_template SET account_code_client_side = '411000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '512010000'), journal_id = (SELECT id FROM journal WHERE code = 'BAN'), occ_category = 'DEBIT' WHERE code = 'REF_CASH';

UPDATE ar_occ_template SET account_code_client_side = '411000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '511200000'), journal_id = (SELECT id FROM journal WHERE code = 'BAN'), occ_category = 'DEBIT' WHERE code = 'REF_CHK';

UPDATE ar_occ_template SET account_code_client_side = '411000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '511011000'), journal_id = (SELECT id FROM journal WHERE code = 'BAN'), occ_category = 'DEBIT' WHERE code = 'REF_CRD';

UPDATE ar_occ_template SET account_code_client_side = '411000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '512000000'), journal_id = (SELECT id FROM journal WHERE code = 'BAN'), occ_category = 'DEBIT' WHERE code = 'REF_DDT';

UPDATE ar_occ_template SET account_code_client_side = '512010000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '511011000'), journal_id = (SELECT id FROM journal WHERE code = 'BAN'), occ_category = 'DEBIT' WHERE code = 'REF_SD';

UPDATE ar_occ_template SET account_code_client_side = '411000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '511000610'), journal_id = (SELECT id FROM journal WHERE code = 'BAN'), occ_category = 'DEBIT' WHERE code = 'REF_TIP';

UPDATE ar_occ_template SET account_code_client_side = '701000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '701000000'), journal_id = (SELECT id FROM journal WHERE code = 'SAL'), occ_category = 'DEBIT' WHERE code = 'INV_STD';

UPDATE ar_occ_template SET account_code_client_side = '709000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Invoice and Credit Note'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '701000000'), journal_id = (SELECT id FROM journal WHERE code = 'SAL'), occ_category = 'CREDIT' WHERE code = 'INV_REB';

UPDATE ar_occ_template SET account_code_client_side = '763100000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Invoice and Credit Note'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '701000000'), journal_id = (SELECT id FROM journal WHERE code = 'SAL'), occ_category = 'DEBIT' WHERE code = 'INV_FEE';

UPDATE ar_occ_template SET account_code_client_side = '709000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Invoice and Credit Note'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '701000000'), journal_id = (SELECT id FROM journal WHERE code = 'SAL'), occ_category = 'CREDIT' WHERE code = 'INV_DIS';

UPDATE ar_occ_template SET account_code_client_side = NULL, accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '701000000'), journal_id = (SELECT id FROM journal WHERE code = 'SAL'), occ_category = 'CREDIT' WHERE code = 'INV_CRN';

UPDATE ar_occ_template SET account_code_client_side = '701000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '701000000'), journal_id = (SELECT id FROM journal WHERE code = 'SAL'), occ_category = 'DEBIT' WHERE code = 'INV_ADV';

UPDATE ar_occ_template SET account_code_client_side = '41100000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '701010000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), journal_id = (SELECT id FROM journal WHERE code = 'BAN'), occ_category = 'DEBIT' WHERE code = 'DEB_SD';

UPDATE ar_occ_template SET account_code_client_side = '165000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '512010000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), journal_id = (SELECT id FROM journal WHERE code = 'MSC'), occ_category = 'CREDIT' WHERE code = 'CRD_SD';

UPDATE ar_occ_template SET account_code_client_side = '411000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '512010000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), journal_id = (SELECT id FROM journal WHERE code = 'MSC'), occ_category = 'CREDIT' WHERE code = 'CRD_TRS';

UPDATE ar_occ_template SET account_code_client_side = '411000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '512010000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), journal_id = (SELECT id FROM journal WHERE code = 'MSC'), occ_category = 'DEBIT' WHERE code = 'DBT_TRS';

UPDATE ar_occ_template SET account_code_client_side = '411000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '658100000'), journal_id = (SELECT id FROM journal WHERE code = 'MSC'), occ_category = 'DEBIT' WHERE code = 'RND_EXP';

UPDATE ar_occ_template SET account_code_client_side = '411000000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '758100000'), journal_id = (SELECT id FROM journal WHERE code = 'MSC'), occ_category = 'CREDIT' WHERE code = 'RND_INC';

UPDATE ar_occ_template SET account_code_client_side = '416011000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '416000000'), journal_id = (SELECT id FROM journal WHERE code = 'MSC'), occ_category = 'CREDIT' WHERE code = 'PPL_CREATION';

UPDATE ar_occ_template SET account_code_client_side = '416011000', accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '411000000'), accounting_scheme_id = (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), contra_accounting_code_id = (SELECT id FROM billing_accounting_code WHERE code = '416000000'), journal_id = (SELECT id FROM journal WHERE code = 'MSC'), occ_category = 'DEBIT' WHERE code = 'PPL_INSTALLMENT';

INSERT INTO ar_occ_template (id, version, created, creator, accounting_code_id, code, description, accounting_scheme_id, occ_category, journal_id, contra_accounting_code_id) VALUES (nextval('ar_occ_template_seq'), 0, NOW(), 'applicationInitializer', (SELECT id FROM billing_accounting_code WHERE code = '419100000'), 'REJ_PAL', 'Rejected payment - Paypal', (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), 'DEBIT', (SELECT id FROM journal WHERE code = 'BAN'), (SELECT id FROM billing_accounting_code WHERE code = '512000000'));

INSERT INTO ar_occ_template (id, version, created, creator, accounting_code_id, code, description, accounting_scheme_id, occ_category, journal_id, contra_accounting_code_id) VALUES (nextval('ar_occ_template_seq'), 0, NOW(), 'applicationInitializer', (SELECT id FROM billing_accounting_code WHERE code = '419100000'), 'REJ_STP', 'Rejected payment - Stripe', (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), 'DEBIT', (SELECT id FROM journal WHERE code = 'BAN'), (SELECT id FROM billing_accounting_code WHERE code = '512000000'));

INSERT INTO ar_occ_template (id, version, created, creator, accounting_code_id, code, description, accounting_scheme_id, occ_category, journal_id, contra_accounting_code_id) VALUES (nextval('ar_occ_template_seq'), 0, NOW(), 'applicationInitializer', (SELECT id FROM billing_accounting_code WHERE code = '419100000'), 'REJ_CASH', 'Rejected payment - cash', (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), 'DEBIT', (SELECT id FROM journal WHERE code = 'BAN'), (SELECT id FROM billing_accounting_code WHERE code = '512000000'));

INSERT INTO ar_occ_template (id, version, created, creator, accounting_code_id, code, description, accounting_scheme_id, occ_category, journal_id, contra_accounting_code_id) VALUES (nextval('ar_occ_template_seq'), 0, NOW(), 'applicationInitializer', (SELECT id FROM billing_accounting_code WHERE code = '419100000'), 'REJ_WIRE', 'Rejected payment - wire transfer', (SELECT id FROM ar_accounting_scheme WHERE code = 'Dual entry scheme'), 'DEBIT', (SELECT id FROM journal WHERE code = 'BAN'), (SELECT id FROM billing_accounting_code WHERE code = '512000000'));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-21527_20240214', 'zelmeliani', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4087, '9:bb516e334953820ca701ee05382d8643', 'update tableName=ar_occ_template; update tableName=ar_occ_template; update tableName=ar_occ_template; update tableName=ar_occ_template; update tableName=ar_occ_template; update tableName=ar_occ_template; update tableName=ar_occ_template; update ta...', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#INTRD-23293_20240524_build::TarikFA.
INSERT INTO payment_term (id, code, description, description_i18n, created, creator, disabled, version) VALUES (nextval('payment_term_seq'), 'Default', 'Payment conditions No early payment discount. Any amounts owned that are not paid will due shall bear interest, from the time the payment was due until the time paid, at a rate of 10% per annum compounded annually', '{"FRA":"Tout incident de paiement est passible de pénalités de retard ainsi que de l''indemnité forfaitaire pour frais de recouvrement de 40 euros prévue par la loi n°2012-387 du 22 mars 2012 et le décret du 2 octobre 2012. Le montant des pénalités résulte de l''application aux sommes restant dues d''un taux égal au taux d''intérêt appliqué par la Banque centrale européenne à son opération de refinancement la plus récente majoré de 10 points de pourcentage","ENG":"Payment conditions No early payment discount. Any amounts owned that are not paid will due shall bear interest, from the time the payment was due until the time paid, at a rate of 10% per annum compounded annually"}', NOW(), 'applicationInitializer', 0, 0);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-23293_20240524_build', 'TarikFA.', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4089, '9:332b341f1b7f051edfa4535ba398956b', 'insert tableName=payment_term', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#INTRD-24686_20240807_build::TarikFa.
INSERT INTO ar_customer_balance_templates (customer_balance_id, template_id) VALUES ((select id from ar_customer_balance where code = 'default_customer_balance'), (select id from ar_occ_template where code = 'CLOSED_ADV'));

INSERT INTO ar_customer_balance_templates (customer_balance_id, template_id) VALUES ((select id from ar_customer_balance where code = 'default_customer_balance'), (select id from ar_occ_template where code = 'PAY_ADV'));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-24686_20240807_build', 'TarikFa.', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4091, '9:0104f60ad47ddd700bb6211299215035', 'insert tableName=ar_customer_balance_templates; insert tableName=ar_customer_balance_templates', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::INTRD-26180_20241105_rebuild::ZakariaB
INSERT INTO billing_accounting_code (id, version, created, creator, code, description, chart_of_account_type, chart_of_account_view_type) VALUES (nextval('billing_accounting_code_seq'), 0, NOW(), 'applicationInitializer', '44587', 'Output VAT on invoices to be issued (FAE TAX)', 'LIABILITIES', 'REGULAR');

INSERT INTO ar_occ_template (id, version, created, creator, code, description, account_code_client_side, occ_category, journal_id, accounting_code_id, contra_accounting_code_id, contra_accounting_code2_id, accounting_scheme_id) VALUES (nextval('ar_occ_template_seq'), 0, NOW(), 'applicationInitializer', 'INV_FAE', 'Standard invoices to be issued', '701000000', 'DEBIT', (SELECT id FROM journal WHERE code = 'MSC'), (SELECT id FROM billing_accounting_code WHERE code='418100000'), (SELECT id FROM billing_accounting_code WHERE code = '701000000'), (SELECT id FROM billing_accounting_code WHERE code='44587'), (SELECT id FROM ar_accounting_scheme WHERE code = 'FAE_ACCOUNTING_SCHEME'));

INSERT INTO ar_occ_template (id, version, created, creator, code, description, account_code_client_side, occ_category, journal_id, accounting_code_id, contra_accounting_code_id, contra_accounting_code2_id, accounting_scheme_id) VALUES (nextval('ar_occ_template_seq'), 0, NOW(), 'applicationInitializer', 'CRN_FAE', 'Invoice - credit note sub-item to be issued', '701000000', 'CREDIT', (SELECT id FROM journal WHERE code = 'MSC'), (SELECT id FROM billing_accounting_code WHERE code='418100000'), (SELECT id FROM billing_accounting_code WHERE code = '701000000'), (SELECT id FROM billing_accounting_code WHERE code='44587'), (SELECT id FROM ar_accounting_scheme WHERE code = 'FAE_ACCOUNTING_SCHEME'));

INSERT INTO ar_occ_template (id, version, created, creator, code, description, account_code_client_side, occ_category, journal_id, accounting_code_id, contra_accounting_code_id, contra_accounting_code2_id, accounting_scheme_id) VALUES (nextval('ar_occ_template_seq'), 0, NOW(), 'applicationInitializer', 'ADJ_FAE', 'Adjustment on invoice to be issued', '701000000', 'CREDIT', (SELECT id FROM journal WHERE code = 'MSC'), (SELECT id FROM billing_accounting_code WHERE code='418100000'), (SELECT id FROM billing_accounting_code WHERE code = '701000000'), (SELECT id FROM billing_accounting_code WHERE code='44587'), (SELECT id FROM ar_accounting_scheme WHERE code = 'FAE_ACCOUNTING_SCHEME'));

INSERT INTO ar_occ_template (id, version, created, creator, code, description, account_code_client_side, occ_category, journal_id, accounting_code_id, contra_accounting_code_id, contra_accounting_code2_id, accounting_scheme_id) VALUES (nextval('ar_occ_template_seq'), 0, NOW(), 'applicationInitializer', 'REF_FAE', 'Refundable adjustment to be issued', '701000000', 'DEBIT', (SELECT id FROM journal WHERE code = 'MSC'), (SELECT id FROM billing_accounting_code WHERE code='418100000'), (SELECT id FROM billing_accounting_code WHERE code = '701000000'), (SELECT id FROM billing_accounting_code WHERE code='44587'), (SELECT id FROM ar_accounting_scheme WHERE code = 'FAE_ACCOUNTING_SCHEME'));

INSERT INTO ar_occ_template (id, version, created, creator, code, description, account_code_client_side, occ_category, journal_id, accounting_code_id, contra_accounting_code_id, contra_accounting_code2_id, accounting_scheme_id) VALUES (nextval('ar_occ_template_seq'), 0, NOW(), 'applicationInitializer', 'TAX_FAE', 'Tax - VAT', '44587', 'DEBIT', (SELECT id FROM journal WHERE code = 'MSC'), (SELECT id FROM billing_accounting_code WHERE code='418100000'), (SELECT id FROM billing_accounting_code WHERE code = '418100000'), (SELECT id FROM billing_accounting_code WHERE code='44587'), (SELECT id FROM ar_accounting_scheme WHERE code = 'FAE_ACCOUNTING_SCHEME'));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-26180_20241105_rebuild', 'ZakariaB', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4093, '9:f423dfc02ccdfdc474560018d69c8e26', 'insert tableName=billing_accounting_code; insert tableName=ar_occ_template; insert tableName=ar_occ_template; insert tableName=ar_occ_template; insert tableName=ar_occ_template; insert tableName=ar_occ_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#INTRD-30098_20250321::AbdellatifBARI
INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-30098_20250321', 'AbdellatifBARI', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4095, '9:d41d8cd98f00b204e9800998ecf8427e', 'empty', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::INTRD-25869_20250819_rebuild::ZakariaB
INSERT INTO ar_occ_template (id, version, created, creator, code, description, account_code_client_side, accounting_code_id, contra_accounting_code_id, occ_category, journal_id, accounting_scheme_id) VALUES (nextval('ar_occ_template_seq'), 0, NOW(), 'applicationInitializer', 'INV_PCA', 'INV_PCA : Invoice for Deferred revenue', '701000000', (SELECT id FROM billing_accounting_code WHERE code='487000000'), (SELECT id FROM billing_accounting_code WHERE code = '701000000'), 'CREDIT', (SELECT id FROM journal WHERE code = 'MSC'), (SELECT id FROM ar_accounting_scheme WHERE code = 'PCA_ACCOUNTING_SCHEME'));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-25869_20250819_rebuild', 'ZakariaB', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4097, '9:42b58643a0cf6004aa7f28ccddbc6b0a', 'insert tableName=ar_occ_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::INTRD-35414_must_have_charge::a.rouaguebe
INSERT INTO meveo_script_instance (id, code, created, creator, version, src_type, description, description_i18n, script_instance_cat_id) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.invoicing.MustHaveChargeScript', NOW(), 'opencell.admin', 1, 'JAVA_CLASS', 'This rule tests the presence of amounts generated by the listed charges.', '{
                    "ENG": "<p>This rule tests the presence of amounts generated by the listed charges.</p><p>For the test to pass, <b>all</b> charges listed must have contributed to the invoice for the given level.</p><p>Error message will list entities (see “level” below) with missing charges.</p><ins>Levels</ins>:<ul><li><b>Invoice</b>: check is perform for the whole invoice, <b>regardless of</b> user accounts and subscriptions.</li><li><b>User account</b>: rule will check that you have <b>at least one occurrence</b> of each listed charge <b>for each user account</b> on the invoice.<br />If you invoice by subscription, this is equivalent to “Invoice” or “Subscription”.</li><li><b>Subscription</b>: rule will check that you have <b>at least one occurrence</b> of each listed charge <b>for each subscription</b> on the invoice.<br />If you invoice by subscription, this is equivalent to “Invoice” or “User account”.</li></ul><ins>List of offers</ins>:<br /><p>You can provide a list of offers to check. In that case, only subscriptions to these offers will be checked (regardless of level).</p><p>This option is valid only if invoice lines aggregation rules don’t ignore subscriptions (i.e. you have invoice lines are linked to a single subscription).</p><p>If no offer is selected, all subscriptions are checked (if checking subscriptions is relevant).</p><ins>Notes about invoice scopes (invoicing levels)</ins>:<ul><li>Invoicing by <b>subscription</b>: all levels are equivalent, as there will always only be a single subscription per invoice, therefore a single user account</li><li>Invoicing by <b>order</b>: all levels are relevant as order lines will be different subscriptions, possibly for different user accounts.</li><li>Invoicing by <b>billing account</b>: all levels are relevant as a billing account can have several user accounts, that in turn can have several subscriptions.</li></ul>", 
                    "FRA": "<p>Cette règle teste la présence de montants générés par les charges listées.</p><p>Pour que le teste passe, <b>toutes</b> les charges listées doivent avoir contribué à la facture pour le niveau indiqué.</p><p>Le message d’erreur listera les entités (voir “niveau” ci-dessous) avec des charges manquantes.</p><ins>Niveau</ins>:<ul><li><b>Facture (Invoice) :</b> La vérification est effectuée pour l''ensemble de la facture, <b>sans tenir compte</b> des comptes utilisateur et des abonnements.</li><li><b>Compte utilisateur (User account) :</b> La règle vérifiera que vous avez <b>au moins une occurrence</b> de chaque frais listé pour <b>chaque compte utilisateur</b> sur la facture.<br/>Si vous facturez par abonnement, ceci est équivalent à « Facture » ou « Abonnement ».</li><li><b>Abonnement (Subscription) :</b> La règle vérifiera que vous avez <b>au moins une occurrence</b> de chaque frais listé pour <b>chaque abonnement</b> sur la facture.<br/>Si vous facturez par abonnement, ceci est équivalent à « Facture » ou « Compte utilisateur ».</li></ul><ins>Liste des offres</ins>:<br/><p>Vous pouvez fournir une liste d''offres à vérifier. Dans ce cas, seuls les abonnements à ces offres seront vérifiés (quel que soit le niveau).</p><p>Cette option n''est valide que si les règles d''agrégation des lignes de facture n''ignorent pas les abonnements (c''est-à-dire que vos lignes de facture sont liées à un seul abonnement).</p><p>Si aucune offre n''est sélectionnée, tous les abonnements sont vérifiés (si la vérification des abonnements est pertinente).</p><ins>Notes sur les niveaux de facturation</ins>:<ul><li>Facturation par <b>abonnement :</b> Tous les niveaux sont équivalents, car il n''y aura toujours qu''un <b>seul abonnement par facture</b>, et donc un seul compte utilisateur.</li><li>Facturation par <b>commande :</b> Tous les niveaux sont pertinents, car les lignes de commande correspondront à différents abonnements, potentiellement pour différents comptes utilisateur.</li><li>Facturation par <b>compte de facturation :</b> Tous les niveaux sont pertinents, car un compte de facturation peut avoir plusieurs comptes utilisateur, qui à leur tour peuvent avoir plusieurs abonnements.</li></ul>"
                }', (SELECT id FROM meveo_script_instance_cat WHERE code='INVOICE_VALIDATION'));

INSERT INTO meveo_script_parameter (id, version, code, script_instance_id, description_i18n, class_name, mandatory, values_separator, collection) VALUES (nextval('meveo_script_parameter_seq'), 0, 'charges', (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.invoicing.MustHaveChargeScript'), '{"FRA":"Charges à vérifier","ENG":"Charges to check"}', 'org.meveo.model.catalog.ChargeTemplate', 1, '\|', 1);

INSERT INTO meveo_script_parameter (id, version, code, script_instance_id, description_i18n, class_name, default_value, mandatory, allowed_values, values_separator, collection) VALUES (nextval('meveo_script_parameter_seq'), 0, 'level', (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.invoicing.MustHaveChargeScript'), '{"FRA":"Niveau de la vérification","ENG":"Level to check"}', 'java.lang.String', 'Invoice', 1, 'Invoice|User Account|Subscription', '\|', 0);

INSERT INTO meveo_script_parameter (id, version, code, script_instance_id, description_i18n, class_name, mandatory, values_separator, collection) VALUES (nextval('meveo_script_parameter_seq'), 0, 'offers', (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.invoicing.MustHaveChargeScript'), '{"FRA":"Vérifier uniquement les souscriptions à ces offres","ENG":"Check only subscriptions to offers"}', 'org.meveo.model.catalog.OfferTemplate', 0, '\|', 1);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-35414_must_have_charge', 'a.rouaguebe', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4099, '9:3a2f71cdee624adc29275b8befb59c74', 'insert tableName=meveo_script_instance; insert tableName=meveo_script_parameter; insert tableName=meveo_script_parameter; insert tableName=meveo_script_parameter', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-demo.xml::#liquibase_hack_data::AbdelmounaimAkadid
update databasechangelog set filename='src/main/db_resources/changelog/current/data.xml' where filename='src/main/db_resources/changelog/rebuild/data-demo.xml';

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#liquibase_hack_data', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/data-demo.xml', NOW(), 4101, '9:b6267afe39bb1a35252e3759f8ead431', 'sql', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-scripts.xml::rebuild-data-decisionRule::AndriusKarpavicius
INSERT INTO wf_decision_rule (id, version, condition_el, name, type, value, model) VALUES (1, 0, '#{mv:getCFValue(entity,''Territory'')==_VALUE_}', 'Territory', 'STRING', 'Other', 1);

INSERT INTO wf_decision_rule (id, version, condition_el, name, type, value, model) VALUES (2, 0, '#{mv:getCFValue(entity,''Territory'')==_VALUE_}', 'Territory', 'STRING', 'south', 0);

INSERT INTO wf_decision_rule (id, version, condition_el, name, type, value, model) VALUES (3, 0, '#{mv:getCFValue(entity,''Territory'')==_VALUE_}', 'Territory', 'STRING', 'west', 1);

INSERT INTO wf_decision_rule (id, version, condition_el, name, type, value, model) VALUES (4, 0, '#{mv:getCFValue(entity,''Territory'')==_VALUE_}', 'Territory', 'STRING', 'north', 0);

INSERT INTO wf_decision_rule (id, version, condition_el, name, type, value, model) VALUES (5, 0, '#{mv:getCFValue(entity,''SalesAmount'')==_VALUE_}', 'Sales amount', 'STRING', 'Other', 1);

INSERT INTO wf_decision_rule (id, version, condition_el, name, type, value, model) VALUES (6, 0, '#{mv:getCFValue(entity,''AccountType'')==_VALUE_}', 'Account Type', 'STRING', 'Other', 1);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-data-decisionRule', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/data-scripts.xml', NOW(), 4103, '9:bfa2a5a94f2adb8052c6a74c4e834eca', 'insert tableName=wf_decision_rule; insert tableName=wf_decision_rule; insert tableName=wf_decision_rule; insert tableName=wf_decision_rule; insert tableName=wf_decision_rule; insert tableName=wf_decision_rule', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-scripts.xml::rebuild-data-paymentGateway::AndriusKarpavicius
INSERT INTO crm_provider_pay_methods (provider_id, payment_method) VALUES (1, 'CARD');

INSERT INTO crm_provider_pay_methods (provider_id, payment_method) VALUES (1, 'DIRECTDEBIT');

INSERT INTO crm_provider_pay_methods (provider_id, payment_method) VALUES (1, 'PAYPALPAYMENTLINK');

INSERT INTO crm_provider_pay_methods (provider_id, payment_method) VALUES (1, 'STRIPEDIRECTLINK');

INSERT INTO crm_provider_pay_methods (provider_id, payment_method) VALUES (1, 'CHECK');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-data-paymentGateway', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/data-scripts.xml', NOW(), 4105, '9:32672bbd189cc895ef38cec039085388', 'insert tableName=crm_provider_pay_methods; insert tableName=crm_provider_pay_methods; insert tableName=crm_provider_pay_methods; insert tableName=crm_provider_pay_methods; insert tableName=crm_provider_pay_methods', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-scripts.xml::rebuild-data-payment-gateway::AndriusKarpavicius
INSERT INTO meveo_script_instance (id, version, code, src_type, description, created) VALUES (-10, 0, 'org.meveo.service.script.demo.CustomGatewayPaymentScript', 'JAVA_CLASS', 'CustomGatewayPaymentScript demo implementation', NOW());

INSERT INTO public.meveo_script_instance (id, version, disabled, created, code, description, src_type, script) VALUES (-11  , 0, 0,  now(), 'org.meveo.service.script.demo.PaymentCallBackScript', 'PaymentCallBackScript', 'JAVA_CLASS', null);

INSERT INTO public.ar_payment_gateway (id, version, disabled, created, updated, code, description, type, payment_method, card_type,
        implementation_class_name, script_instance_id, trading_currency_id, application_el, uuid, creator) VALUES (-1, 0, 0,  now(), NULL, 'GatewayDemo_CARD', 'GatewayDemo CARD for Demo', 'CUSTOM', 'CARD', NULL, NULL, -10, NULL, NULL,
          '3bb099a3-e72d-49ea-9d96-908e74569e02', 'opencell.admin');

INSERT INTO public.ar_payment_gateway (id, version, disabled, created, updated, code, description, type, payment_method, card_type,
        implementation_class_name, script_instance_id, trading_currency_id, application_el, uuid, creator) VALUES (-2, 0, 0,  now(), NULL, 'GatewayDemo_DD', 'GatewayDemo DirectDebit for Demo', 'CUSTOM', 'DIRECTDEBIT', NULL, NULL, -10, NULL, NULL,
          '45b099a3-e72d-49ee-9d56-908e74569e56', 'opencell.admin');

INSERT INTO public.adm_notification (id, version, disabled, created, updated, code, description, class_name_filter, event_expression_filter, event_type_filter, creator, updater, counter_instance_id, counter_template_id, script_instance_id, priority) VALUES (-10, 0, 0,  now(), NULL, 'PaymentCallBack', NULL, 'org.meveo.model.notification.InboundRequest',
          '#{event.pathInfo.startsWith("/DEMO/custom_payment-callback?")}', 'INBOUND_REQ', 'opencell.admin', NULL, NULL, NULL, -11, 0);

INSERT INTO public.adm_notification_params VALUES (-10, '#{event.getParameters()}', 'params');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-data-payment-gateway', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/data-scripts.xml', NOW(), 4107, '9:9ccd3c2acba6476524723d1bf7ae5c77', 'insert tableName=meveo_script_instance; sql; sql; sql; sql; sql', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-scripts.xml::rebuild-scripting-jobs::AndriusKarpavicius
INSERT INTO meveo_script_instance (id, version, code, src_type, description, created) VALUES (nextval('meveo_script_instance_seq'), 0, 'org.meveo.service.script.product.OneShotOtherTypeMigrationScript', 'JAVA_CLASS', 'Migrate OneShot Charge of Type OTHER to INVOICING_PLAN', NOW());

INSERT INTO meveo_script_instance (id, version, disabled, created, code, description, src_type) VALUES (-30, 0, 0, NOW(), 'org.meveo.service.script.ServiceTemplateToProductScript', 'Migration ServiceTemplate To Product', 'JAVA_CLASS');

INSERT INTO meveo_job_instance (id, version, disabled, created, updated, uuid, code, description, job_category, job_template, parametres, creator, updater, timerentity_id, cf_values) VALUES (-40, 0, 0, NOW(), NULL, 'ServiceTemplateToProductJob', 'ServiceTemplateToProductJob', 'ServiceTemplateToProductJob', 'MEDIATION', 'ScriptingJob', NULL, 'opencell.admin', NULL, NULL, '{"ScriptingJob_script":[{"entity":{"classname":"org.meveo.model.scripts.ScriptInstance","code":"org.meveo.service.script.ServiceTemplateToProductScript","id":-30}}],"ScriptingJob_TransactionType":[{"string":"REQUIRES_NEW"}]}');

INSERT INTO meveo_script_instance (id, code, script, created, creator, version, src_type) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.MassWrittingOffInvoicesScript', 'package org.meveo.service.script;
                    public class MassWrittingOffInvoicesScript extends MassWrittingOffInvoices {}', NOW(), 'OPENCELL.ADMIN', 1, 'JAVA');

INSERT INTO meveo_job_instance (id, version, created, job_category, job_template, code, description, creator, job_speed, cluster_behavior, verbose_report, disabled, cf_values) VALUES (nextval('meveo_job_instance_seq'), 1, NOW(), 'MEDIATION', 'FlatFileProcessingJob', 'massWrittingOffInvoicesJob', 'mass writting off invoices job', 'opencell.admin', 'NORMAL', 'LIMIT_TO_SINGLE_NODE', 1, 0, '{"nbRuns": [{"long": 1}], "oneFilePerJob": [{"boolean": false}], "sortingOption": [{"string": "ALPHA"}], "waitingMillis": [{"long": 0}], "FlatFileProcessingJob_inputDir": [{"string": "/imports/writeOff/inputs"}], "FlatFileProcessingJob_outputDir": [{"string": "/imports/writeOff/outputs"}], "FlatFileProcessingJob_archiveDir": [{"string": "/imports/writeOff/archives"}], "FlatFileProcessingJob_errorAction": [{"string": "CONTINUE"}], "FlatFileProcessingJob_mappingConf": [{"string": "<beanio\r\n\txmlns=\"http://www.beanio.org/2012/03\"\r\n\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n  xsi:schemaLocation=\"http://www.beanio.org/2012/03 http://www.beanio.org/2012/03/mapping.xsd\">\r\n\t<stream name=\"record\" format=\"csv\">\r\n\t\t<parser>\r\n\t\t\t<property name=\"delimiter\" value=\";\" />\r\n\t\t\t<property name=\"comments\" value=\"END\" />\r\n\t\t\t<property name=\"multilineEnabled\" value=\"true\" />\r\n\t\t</parser>\r\n\t\t<record name=\"header\" minOccurs=\"1\" maxOccurs=\"1\" class=\"map\">\r\n\t\t\t<field name=\"INVOICE_NUMBER\" ignore=\"true\"/>\r\n\t\t\t<field name=\"INVOICE_AMOUNT\" ignore=\"true\"/>\r\n\t\t\t<field name=\"UNCOLLECTIBILITY_CERTIFICATE_NUMBER\" ignore=\"true\"/>\r\n\t\t</record>\r\n\t\t<record name=\"details\" minOccurs=\"1\" maxOccurs=\"unbounded\" class=\"map\">\r\n\t\t\t<field name=\"INVOICE_NUMBER\" required=\"true\"/>\r\n\t\t\t<field name=\"INVOICE_AMOUNT\" required=\"true\"/>\r\n\t\t\t<field name=\"UNCOLLECTIBILITY_CERTIFICATE_NUMBER\" required=\"true\"/>\r\n\t\t</record>\r\n\t</stream>\r\n</beanio>"}], "FlatFileProcessingJob_scriptsFlow": [{"string": "org.meveo.service.script.MassWrittingOffInvoicesScript"}], "FlatFileProcessingJob_formatTransfo": [{"string": "None"}], "FlatFileProcessingJob_originFilename": [{"string": "origin_filename"}], "FlatFileProcessingJob_nbLinesToProcess": [{"long": 1}], "FlatFileProcessingJob_fileNameExtension": [{"string": "csv"}], "FlatFileProcessingJob_recordVariableName": [{"string": "record"}]}');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-scripting-jobs', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/data-scripts.xml', NOW(), 4109, '9:5f76df9748507e7b8d13db36befd4968', 'insert tableName=meveo_script_instance; insert tableName=meveo_script_instance; insert tableName=meveo_job_instance; insert tableName=meveo_script_instance; insert tableName=meveo_job_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-scripts.xml::#INTRD-19464_20231225-rebuild::ZBARIKI
INSERT INTO meveo_script_instance (id, version, code, src_type, description, created, script) VALUES (nextval('meveo_script_instance_seq'), 0, 'org.meveo.service.script.DummyPaymentGatewayScript', 'JAVA', 'Dummy payment pateway script', NOW(), 'package org.meveo.service.script;

import org.meveo.admin.exception.BusinessException;

import java.util.Map;


public class DummyPaymentGatewayScript extends org.meveo.service.script.payment.PaymentScript {

    private static final String ERROR_MESSAGE
            = "Dummy gateway for SEPA files generation (For now, its only purpose is to store rejection codes. Please continue to use DD requests for SEPA files)";
    @Override
    public void execute(Map<String, Object> context) throws BusinessException {
        throw new BusinessException(ERROR_MESSAGE);
    }
}');

INSERT INTO ar_payment_gateway (id, version, created, creator, code, description, payment_method, type, script_instance_id) VALUES (nextval('ar_payment_gateway_seq'), 1, NOW(), 'applicationInitializer', 'SEPA_FILE', 'Dummy gateway for SEPA files generation (For now, its only purpose is to store rejection codes. Please continue to use DD requests for SEPA files)', 'DIRECTDEBIT', 'CUSTOM', (SELECT id FROM meveo_script_instance WHERE code = 'org.meveo.service.script.DummyPaymentGatewayScript'));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-19464_20231225-rebuild', 'ZBARIKI', 'src/main/resources/db_resources/changelog/rebuild/data-scripts.xml', NOW(), 4111, '9:ac2b655655827a5623f90ff14c9788e9', 'insert tableName=meveo_script_instance; insert tableName=ar_payment_gateway', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-scripts.xml::INTRD-20888_20240125-rebuild::aeljaouhari
INSERT INTO meveo_script_instance (id, code, script, created, creator, version, src_type, description, description_i18n, script_instance_cat_id) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.payment.TestRejectionAction', 'package org.meveo.service.script.payment;
                    public class TestRejectionAction extends TestRejectionActionScript {}', NOW(), 'OPENCELL.ADMIN', 0, 'JAVA', 'Action will succeed or failed based on the passed parameter, and log the provided text. It’s also possible to add an execution delay.', '{"EN":"<p>Action will succeed or failed based on the passed parameter, and log the provided text.</p><p>It’s also possible to add an execution delay.</p>","FR":"<p>L’action réussira ou échouera selon le paramètre passé, et enregistrera le message fourni.</p><p>Il est également possible d’ajouter un délai d’exécution.</p>"}', (SELECT id FROM meveo_script_instance_cat WHERE code='PAYMENT_REJECTION_ACTIONS'));

INSERT INTO meveo_script_parameter (id, version, code, description_i18n, class_name, mandatory, default_value, allowed_values, values_separator, collection, script_instance_id) VALUES (nextval('meveo_script_parameter_seq'), 0, 'executionResult', '{"FR":"Résultat de l’action","EN":"Action result"}', 'java.lang.String', 1, 'success', 'success|failure', '\|', 0, (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.payment.TestRejectionAction'));

INSERT INTO meveo_script_parameter (id, version, code, description_i18n, class_name, mandatory, values_separator, collection, script_instance_id) VALUES (nextval('meveo_script_parameter_seq'), 0, 'report', '{"FR":"Message du rapport","EN":"Report message"}', 'java.lang.String', 1, '\|', 0, (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.payment.TestRejectionAction'));

INSERT INTO meveo_script_parameter (id, version, code, description_i18n, class_name, default_value, mandatory, values_separator, collection, script_instance_id) VALUES (nextval('meveo_script_parameter_seq'), 0, 'delay', '{"FR":"Délai (secondes)","EN":"Delay (seconds)"}', 'java.lang.Integer', '1', 1, '\|', 0, (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.payment.TestRejectionAction'));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-20888_20240125-rebuild', 'aeljaouhari', 'src/main/resources/db_resources/changelog/rebuild/data-scripts.xml', NOW(), 4113, '9:421c098aba026e3aedf9dea72a9ef7d2', 'insert tableName=meveo_script_instance; insert tableName=meveo_script_parameter; insert tableName=meveo_script_parameter; insert tableName=meveo_script_parameter', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-scripts.xml::INTRD-24480_20241104-rebuild::AbdellatifBARI
INSERT INTO meveo_script_instance (id, version, code, src_type, description, created, script) VALUES (nextval('meveo_script_instance_seq'), 0, 'org.meveo.service.script.MarkWOToReratePreScript', 'JAVA', 'Mark wallet operation to rerate pre script', NOW(), '/*
 * (C) Copyright 2015-2020 Opencell SAS (https://opencellsoft.com/) and contributors.
 *
 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
 * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option)
 * any later version.
 *
 * THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
 * OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS
 * IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO
 * THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE,
 * YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
 *
 * For more information on the GNU Affero General Public License, please consult
 * <https://www.gnu.org/licenses/agpl-3.0.en.html>.
 */

package org.meveo.service.script;

import java.util.Map;

/**
 * An definition script which allow to override a configuration huge entity job before run it.
 *
 * @author Abdellatif BARI
 * @since 17.0.0
 */
public class MarkWOToReratePreScript extends PreUpdateHugeEntityScript {

    private static final long serialVersionUID = 1L;

    @Override
    public String getFilter(Map<String, Object> methodContext) {
        return "{" +
                "  \"filters\": {" +
                "    \"inList status\": [\"OPEN\", \"F_TO_RERATE\", \"REJECTED\", \"TREATED\"]" +
                "  }" +
                "}";
    }
}');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-24480_20241104-rebuild', 'AbdellatifBARI', 'src/main/resources/db_resources/changelog/rebuild/data-scripts.xml', NOW(), 4115, '9:31294ba76516b815b2265bbe0350c57b', 'insert tableName=meveo_script_instance', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-scripts.xml::INTRD-22954_20240521-scripts::ZBariki
INSERT INTO meveo_script_instance (id, code, script, created, creator, version, src_type, description, description_i18n, script_instance_cat_id) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.payment.ApplyChargeScript', 'package org.meveo.service.script.payment;
                public class ApplyChargeScript extends Script {}', NOW(), 'applicationInitializer', 0, 'JAVA', 'Applies a charge to a subscription of the billing account', '{"FRA":"<p> Applique un frais à un abonnement du compte de facturation. </p><p>Vous devrez sélectionner une charge exceptionnelle (type “autre”) à appliquer, avec la possibilité de remplacer le montant (cela générera une erreur si la charge ne permettent pas la surcharge du montant) et le libellé.</p><p>Nous devrons sélectionner un abonnement actif auquel appliquer le frais. Par défaut, nous utiliserons l&apos;abonnement actif le plus récent facturé sur les factures impayées. Vous pouvez fournir un filtre supplémentaire pour affiner la liste des abonnements. Ce filtre est en fait une expression qui doit s&apos;évaluée en une chaîne qui sera comparée au code des abonnements dans la portée de recherche d&apos;abonnement, à l&apos;aide de l&apos;opérateur fourni. L’expression aura accès au rejet de paiement, au paiement, aux entités du périmètre (liste des factures, compte de facturation, compte client) et à la liste des abonnements dans le périmètre. Si aucun abonnement actif n&apos;est trouvé, le script échouera et une erreur sera remontée.</p>", "ENG":"<p>Applies a charge to a subscription of the billing account.</p><p>For the invoice to be valid, tested amount must pass the test.</p><p>You will have to select a one shot charge (type “other”) to apply, with the ability to override the amount (will raise an error if the charge doesn’t allow amount override) and label.</p> <p>We will need to select an active subscription to apply the charge to. By default, we will use the most recent active subscription invoiced on the unpaid invoices. You can provide an additional filter to narrow down the list of subscriptions. This filter is actually an expression that must evaluate to a string that will be compared to the code of subscriptions in the subscription search scope, using the provided operator. Expression will have access to the rejected payment, the payment, and the scope entities (list of invoices, billing account, customer account) and the list of subscriptions in the scope. If no active subscription is found, the script will fail and an error will be raised.</p>"}', (SELECT id FROM meveo_script_instance_cat WHERE code='PAYMENT_REJECTION_ACTIONS'));

INSERT INTO meveo_script_parameter (id, version, code, script_instance_id, description_i18n, class_name, mandatory, filters) VALUES (nextval('meveo_script_parameter_seq'), 0, 'chargeTemplate', (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.payment.ApplyChargeScript'), '{"FRA":"Charge à appliquer","ENG":"Charge to apply"}', 'org.meveo.model.catalog.OneShotChargeTemplate', 1, '{"oneShotChargeTemplateType" : "OTHER", "status" : "ACTIVE"}');

INSERT INTO meveo_script_parameter (id, version, code, script_instance_id, description_i18n, class_name, mandatory) VALUES (nextval('meveo_script_parameter_seq'), 0, 'amountOverride', (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.payment.ApplyChargeScript'), '{"FRA":"Surcharge du montant","ENG":"Amount override"}', 'java.math.BigDecimal', 0);

INSERT INTO meveo_script_parameter (id, version, code, script_instance_id, description_i18n, mandatory, class_name) VALUES (nextval('meveo_script_parameter_seq'), 0, 'descriptionOverride', (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.payment.ApplyChargeScript'), '{"FRA":"Surcharge du libellé de la charge","ENG":"Charge label override"}', 0, 'java.lang.String');

INSERT INTO meveo_script_parameter (id, version, code, script_instance_id, description_i18n, mandatory, class_name, collection, allowed_values, default_value) VALUES (nextval('meveo_script_parameter_seq'), 0, 'subscriptionSearchScope', (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.payment.ApplyChargeScript'), '{"FRA":"Périmètre de la recherche de souscription","ENG":"Subscription search scope"}', 0, 'java.lang.String', 1, 'invoices|billing accounts|customer account', 'invoices');

INSERT INTO meveo_script_parameter (id, version, code, script_instance_id, description_i18n, mandatory, class_name, collection, allowed_values, default_value) VALUES (nextval('meveo_script_parameter_seq'), 0, 'subscriptionSelection', (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.payment.ApplyChargeScript'), '{"FRA":"Selection de la souscription","ENG":"Subscription selection"}', 0, 'java.lang.String', 1, 'oldest|newest', 'newest');

INSERT INTO meveo_script_parameter (id, version, code, script_instance_id, description_i18n, mandatory, class_name) VALUES (nextval('meveo_script_parameter_seq'), 0, 'subscriptionFilter', (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.payment.ApplyChargeScript'), '{"FRA":"Filtre code de souscription","ENG":"Subscription code filter"}', 0, 'java.lang.String');

INSERT INTO meveo_script_parameter (id, version, code, script_instance_id, description_i18n, mandatory, class_name, collection, allowed_values, default_value) VALUES (nextval('meveo_script_parameter_seq'), 0, 'subscriptionOperator', (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.payment.ApplyChargeScript'), '{"FRA":"Opérateur du filtre de souscription (insensible à la casse)","ENG":"Subscription filter operator (case insensitive)"}', 0, 'java.lang.String', 1, 'equals|begins with|contains|ends with', 'equals');

INSERT INTO meveo_script_parameter (id, version, code, script_instance_id, description_i18n, mandatory, class_name, default_value) VALUES (nextval('meveo_script_parameter_seq'), 0, 'generateRTs', (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.payment.ApplyChargeScript'), '{"FRA":"Générer l’élément valorisé (de manière à ce que la charge soit immédiatement facturable) ?","ENG":"Generate rated item (so the charge will be ready for invoicing)?"}', 0, 'java.lang.Boolean', 'true');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-22954_20240521-scripts', 'ZBariki', 'src/main/resources/db_resources/changelog/rebuild/data-scripts.xml', NOW(), 4117, '9:ede9562112575d978391873bc2d1f14e', 'insert tableName=meveo_script_instance; insert tableName=meveo_script_parameter; insert tableName=meveo_script_parameter; insert tableName=meveo_script_parameter; insert tableName=meveo_script_parameter; insert tableName=meveo_script_parameter; in...', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-scripts.xml::#INTRD-21018_20240723-scripts::ZakariaB
INSERT INTO meveo_script_instance (id, code, script, created, creator, version, src_type, description, description_i18n, script_instance_cat_id) VALUES (nextval('meveo_script_instance_seq'), 'org.meveo.service.script.EnterLitigation', 'package org.meveo.service.script;
 public class EnterLitigation extends EnterLitigationScript {}', NOW(), 'applicationInitializer', 0, 'JAVA', 'This action will unconditionally send the invoices linked to the payment rejection to litigation, using the provided reason.', '{"ENG":"This action will unconditionally send the invoices linked to the payment rejection to litigation, using the provided reason.", "FRA":"Cette action passera inconditionnellement les factures liées au rejet de paiement en litige, avec le motif fourni."}', (SELECT id FROM meveo_script_instance_cat WHERE code='PAYMENT_REJECTION_ACTIONS'));

INSERT INTO meveo_script_parameter (id, version, code, description_i18n, mandatory, class_name, default_value, values_separator, collection, script_instance_id) VALUES (nextval('meveo_script_parameter_seq'), 0, 'litigationReason', '{"FRA":"Motif de mise en litige","ENG":"Litigation reason"}', 1, 'java.lang.String', '', '\|', 0, (SELECT id FROM meveo_script_instance WHERE code='org.meveo.service.script.EnterLitigation'));

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-21018_20240723-scripts', 'ZakariaB', 'src/main/resources/db_resources/changelog/rebuild/data-scripts.xml', NOW(), 4119, '9:5dd317991641ef68f34d75b0006330e8', 'insert tableName=meveo_script_instance; insert tableName=meveo_script_parameter', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-scripts.xml::#INTRD-13886_20250106::anasseh
INSERT INTO meveo_script_instance (id, code, script, created, creator, version, src_type, description) VALUES (nextval('meveo_script_instance_seq'), 'org.opencell.payment.stripe.SaveStripePMScript', 'package org.opencell.payment.stripe;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.meveo.admin.exception.BusinessException;
import org.meveo.commons.utils.StringUtils;
import org.meveo.model.billing.BankCoordinates;
import org.meveo.model.notification.InboundRequest;
import org.meveo.model.payments.CardPaymentMethod;
import org.meveo.model.payments.CreditCardTypeEnum;
import org.meveo.model.payments.CustomerAccount;
import org.meveo.model.payments.DDPaymentMethod;
import org.meveo.model.payments.PaymentGateway;
import org.meveo.model.payments.PaymentMethodEnum;
import org.meveo.service.payments.impl.CustomerAccountService;
import org.meveo.service.payments.impl.PaymentGatewayService;
import org.meveo.service.payments.impl.PaymentMethodService;
import org.meveo.service.script.Script;

import com.google.gson.JsonSyntaxException;
import com.stripe.exception.SignatureVerificationException;
import com.stripe.model.Event;
import com.stripe.model.EventDataObjectDeserializer;
import com.stripe.model.PaymentMethod;
import com.stripe.model.StripeObject;
import com.stripe.net.ApiResource;
import com.stripe.net.Webhook;

/**
 * Handle Stripe webhook (async callBack).
 * 
 * @author anasseh
 *
 */
public class SaveStripePMScript extends Script {
	private PaymentMethodService paymentMethodService = (PaymentMethodService) getServiceInterface(
			"PaymentMethodService");
	private CustomerAccountService customerAccountService = (CustomerAccountService) getServiceInterface(
			"CustomerAccountService");
	private PaymentGatewayService paymentGatewayService = (PaymentGatewayService) getServiceInterface(
			"PaymentGatewayService");

	@Override
	public void execute(Map<String, Object> methodContext) throws BusinessException {
		log.info("execute methodContext:{}", methodContext);

		InboundRequest inReq = (InboundRequest) methodContext.get("event");
		log.info("execute inReq.getBody():{}", inReq.getBody());

		if ("POST".equalsIgnoreCase(inReq.getMethod())) {

			final String payload = inReq.getBody();
			Event event = null;

			try {
				event = ApiResource.GSON.fromJson(payload, Event.class);
			} catch (JsonSyntaxException e) {
				throw new BusinessException(e.getMessage());
			}

			// Deserialize the nested object inside the event
			EventDataObjectDeserializer dataObjectDeserializer = event.getDataObjectDeserializer();
			StripeObject stripeObject = null;
			if (dataObjectDeserializer.getObject().isPresent()) {
				stripeObject = dataObjectDeserializer.getObject().get();
			} else {
				throw new BusinessException("EventDataObjectDeserializer deserialization failed ");
			}

			switch (event.getType()) {
			case "payment_method.attached":
				PaymentMethod paymentMethodStripe = (PaymentMethod) stripeObject;
				CustomerAccount ca = customerAccountService.findByExternalRef2(paymentMethodStripe.getCustomer());
				if (ca == null) {
					throw new BusinessException("Cant find customerAccount for Stripe customer:"
							+ paymentMethodStripe.getCustomerObject().getId());
				}

				if (!paymentMethodService.isTokenExist(paymentMethodStripe.getId())) {

					if (paymentMethodStripe.getCard() != null) {
						//PaymentGateway getGateway = getGateway(ca, PaymentMethodEnum.CARD);
						//validateSignature(inReq, getGateway);
						createCardPaymentMethod(paymentMethodStripe, ca);
					}
					if (paymentMethodStripe.getSepaDebit() != null) {
						//PaymentGateway getGateway = getGateway(ca, PaymentMethodEnum.DIRECTDEBIT);
						//validateSignature(inReq, getGateway);
						createDDPaymentMethod(paymentMethodStripe, ca);
					}
				} else {
					log.warn("This PaymentMethod is already exist ");
				}
				break;

			default:
				log.warn("Unhandled event type: " + event.getType());
			}
		}
	}

	private void createDDPaymentMethod(PaymentMethod paymentMethodStripe, CustomerAccount ca) {
		DDPaymentMethod ddPaymentMethod = new DDPaymentMethod();
		ddPaymentMethod.setPaymentType(PaymentMethodEnum.DIRECTDEBIT);
		BankCoordinates bankCoordinates = new BankCoordinates();
		bankCoordinates.setIban(paymentMethodStripe.getSepaDebit().getLast4());
		bankCoordinates.setBankCode(StringUtils.truncate(paymentMethodStripe.getSepaDebit().getBankCode(), 5, false));
		bankCoordinates
				.setBranchCode(StringUtils.truncate(paymentMethodStripe.getSepaDebit().getBranchCode(), 5, false));
		ddPaymentMethod.setBankCoordinates(bankCoordinates);
		ddPaymentMethod.setMandateDate(new Date());
		String mandat = paymentMethodStripe.getSepaDebit().getFingerprint();
		if (StringUtils.isBlank(mandat)) {
			mandat = paymentMethodStripe.getId();
		}
		// mandateId not needed for Stripe, but is mandatory in ihm validation
		ddPaymentMethod.setMandateIdentification(mandat);
		ddPaymentMethod.setCustomerAccount(ca);
		ddPaymentMethod.setPreferred(true);
		ddPaymentMethod.setTokenId(paymentMethodStripe.getId());

		ddPaymentMethod.setAlias("DD " + paymentMethodStripe.getSepaDebit().getLast4());

		paymentMethodService.create(ddPaymentMethod);
		log.info("execute DDPaymentMethod created ");

	}

	private void createCardPaymentMethod(PaymentMethod paymentMethodStripe, CustomerAccount ca) {
		CardPaymentMethod paymentMethod = new CardPaymentMethod();
		paymentMethod.setPaymentType(PaymentMethodEnum.CARD);
		paymentMethod.setCardNumber("xxxxxxxxxxxx" + paymentMethodStripe.getCard().getLast4());
		paymentMethod.setCardType(fromBrand(paymentMethodStripe.getCard().getBrand()));
		paymentMethod.setCustomerAccount(ca);
		paymentMethod.setPreferred(true);
		paymentMethod.setMonthExpiration(paymentMethodStripe.getCard().getExpMonth().intValue());
		paymentMethod.setYearExpiration(paymentMethodStripe.getCard().getExpYear().intValue() - 2000);
		paymentMethod.setOwner(paymentMethodStripe.getBillingDetails().getName());
		paymentMethod.setTokenId(paymentMethodStripe.getId());
		paymentMethod.setHiddenCardNumber(
				CardPaymentMethod.hideCardNumber("xxxxxxxxxxxx" + paymentMethodStripe.getCard().getLast4()));
		paymentMethod.setAlias("Card " + paymentMethodStripe.getCard().getLast4());

		paymentMethodService.create(paymentMethod);
		log.info("execute CardPaymentMethod created ");

	}

	private CreditCardTypeEnum fromBrand(String brand) {
		switch (brand) {
		case "visa":
			return CreditCardTypeEnum.VISA;
		case "amex":
			return CreditCardTypeEnum.AMERICAN_EXPRESS;
		case "mastercard":
			return CreditCardTypeEnum.MASTERCARD;
		default:
			return CreditCardTypeEnum.CB;
		}
	}

	private Event validateSignature(InboundRequest inReq, PaymentGateway paymentGateway) throws BusinessException {
		Map<String, String> headers = inReq.getHeaders();
		String sigHeader = headers.get("Stripe-Signature");
		Event event = null;
		try {
			event = Webhook.constructEvent(inReq.getBody(), sigHeader, paymentGateway.getWebhooksSecretKey());
		} catch (SignatureVerificationException e) {
			throw new BusinessException("InvalidSignature  " + e.getMessage());

		} catch (Exception e) {
			throw new BusinessException(e.getMessage());
		}
		return event;

	}
}', NOW(), 'applicationInitializer', 0, 'JAVA', 'Handle Stripe webhook (async callBack)');

INSERT INTO ar_payment_gateway (id, code, description, payment_method, type, implementation_class_name, marchand_id, secret_key, webhooks_secret_key, created, creator, version, disabled) VALUES (nextval('ar_payment_gateway_seq'), 'Stripe_CARD', 'The stripe account fro CARD', 'CARD', 'NATIF', 'org.meveo.service.payments.impl.StripeGatewayPayment', 'anasseh@yahoo.fr', 'sk_test_TAQVs6Q2W2IR6dZErkhHWBOH', 'whsec_8YjCaTfZOqGiVwqMJjo9rE7xv3PS80Wp', NOW(), 'applicationInitializer', 0, 0);

INSERT INTO ar_payment_gateway (id, code, description, payment_method, type, implementation_class_name, marchand_id, secret_key, webhooks_secret_key, created, creator, version, disabled) VALUES (nextval('ar_payment_gateway_seq'), 'Stripe_DD', 'The stripe account fro DirectDebit', 'DIRECTDEBIT', 'NATIF', 'org.meveo.service.payments.impl.StripeGatewayPayment', 'anasseh@yahoo.fr', 'sk_test_TAQVs6Q2W2IR6dZErkhHWBOH', 'whsec_8YjCaTfZOqGiVwqMJjo9rE7xv3PS80Wp', NOW(), 'applicationInitializer', 0, 0);

INSERT INTO adm_notification (id, code, description, class_name_filter, event_type_filter, event_expression_filter, script_instance_id, created, creator, version, disabled) VALUES (nextval('adm_notification_seq'), 'SaveStripePMInbound', 'Save Stripe PM Inbound', 'org.meveo.model.notification.InboundRequest', 'INBOUND_REQ', '#{event.pathInfo.endsWith(''/stripe/saveCard'')}', (select id from meveo_script_instance where code='org.opencell.payment.stripe.SaveStripePMScript'), NOW(), 'applicationInitializer', 0, 0);

INSERT INTO adm_notification_params (notification_id, params, params_key) VALUES ((select id from adm_notification where code='SaveStripePMInbound'), '#{event}', 'event');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#INTRD-13886_20250106', 'anasseh', 'src/main/resources/db_resources/changelog/rebuild/data-scripts.xml', NOW(), 4121, '9:df756afc28ff547bcc9c2a79426ed003', 'insert tableName=meveo_script_instance; insert tableName=ar_payment_gateway; insert tableName=ar_payment_gateway; insert tableName=adm_notification; insert tableName=adm_notification_params', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-reports.xml::rebuild-data-report-extracts::AndriusKarpavicius
INSERT INTO meveo_script_instance (id, version, disabled, created, code, description, src_type) VALUES (-1, 0, 0, NOW(), 'org.meveo.service.script.export.ExportAccountOperationScript', 'Export account operations', 'JAVA_CLASS');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-1, 0, NOW(), 'SALES_JOURNAL', 'Sales Journal', 'sales', 'SQL', 'sales-[yyyy_MM_dd].html', 'HTML', 'SALES_JOURNAL_UUID', 'SELECT
                    TO_CHAR(ao.invoice_date,''MM'') AS "Mois",
                    TO_CHAR(ao.invoice_date,''DD/MM/YYYY'') AS "Date facture",
                    text(''HG'') AS "Code comptable",
                    ae.code AS "Client facturé",
                    text(''MAI'') AS "Type article",
                    split_part(bac.code, '','', 6) AS "Famille statistique",
                    split_part(bac.code, '','', 2) AS "Article",
                    trim(TO_CHAR(ia.amount_without_tax,''9999990D00'')) AS "Montant HT",
                    trim(TO_CHAR(ia.quantity,''9999990'')) AS "Qté facturée",
                    ao.reference AS "No facture",
                    ao.description AS "Catégorie facture",
                    ao.code AS "Type de pièce",
                    text(''VEN'') AS "Journal"
                FROM
                    ar_customer_account ae
                INNER JOIN ar_account_operation ao ON ao.customer_account_id = ae.id
                INNER JOIN billing_invoice i ON i.invoice_number = ao.reference
                INNER JOIN billing_invoice_agregate ia ON (ia.invoice_id = i.id AND type = ''F'')
                LEFT JOIN billing_accounting_code bac ON bac.id = ia.accounting_code_id
                WHERE :START_DATE<>:END_DATE
                AND ao.invoice_date >= to_date(''01/'' || TO_CHAR(CURRENT_DATE,''MM/YYYY''),''DD/MM/YYYY'') + interval ''-12 month''
                AND ao.invoice_date <= to_date(''01/'' || TO_CHAR(CURRENT_DATE,''MM/YYYY''),''DD/MM/YYYY'') + interval ''0 month''
                ORDER BY
                    ae.code,
                    ao.code,
                    split_part(bac.code, '','', 6),
                    split_part(bac.code, '','', 2)');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-1', 'START_DATE', '31/01/2017');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-1', 'END_DATE', '31/12/2018');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, script_instance_id, uuid, result_type) VALUES (-2, 0, NOW(), 'ACCOUNT_OPS', 'Export account operations', 'sales', 'JAVA', 'accounts-ops-[yyyy_MM_dd].csv', '-1', 'ACOUNT_OPS_UUID', 'CSV');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-2', 'START_DATE', '31/01/2017');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-2', 'END_DATE', '31/12/2018');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-3, 0, NOW(), 'FULL_HIERARCHY', 'Full hierarchy export', 'customer', 'SQL', 'hierarchy-[yyyyMMdd].csv', 'CSV', 'FULL_HIERARCHY_UUID', 'select s.code AS "Seller code"
    , s.description AS "Seller description"
    , coalesce(c.code, '''') AS "Customer code"
    , coalesce(replace(c.description, '','', '' ''), '''') AS "Customer description"
    , coalesce(ca.code, '''') AS "Customer Account code"
    , coalesce(replace(ca.description, '','', '' ''), '''') AS "Customer Account description"
    , coalesce(ba.code, '''') AS "Billing Account code"
    , coalesce(replace(ba.description, '','', '' ''), '''') AS "Billing Account description"
    , coalesce(ua.code, '''') AS "User Account code"
    , coalesce(replace(ua.description, '','', '' ''), '''') AS "User Account description"
    , coalesce(su.code, '''') AS "Subscription code"
    , coalesce(replace(su.description, '','', '' ''), '''') AS "Subscription description"
    , coalesce(ap.acces_user_id, '''') AS "Access Point id"  
from  crm_seller s left
    OUTER JOIN crm_customer c  on c.seller_id = s.id left
    OUTER JOIN ar_customer_account ca  on ca.customer_id = c.id left
    OUTER JOIN billing_billing_account ba  on ba.customer_account_id = ca.id left
    OUTER JOIN billing_user_account ua  on ua.billing_account_id = ba.id left
    OUTER JOIN billing_subscription su  on su.user_account_id = ua.id left
    OUTER JOIN medina_access ap  on ap.subscription_id = su.id 
where s.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or s.description ilike ''%'' 
    || :SEARCH_CRITERION || ''%''  or c.code ilike ''%'' || :SEARCH_CRITERION 
    || ''%''  or c.description ilike ''%'' || :SEARCH_CRITERION || ''%''  or ca.code ilike ''%'' 
    || :SEARCH_CRITERION || ''%''  or ca.description ilike ''%'' || :SEARCH_CRITERION 
    || ''%''  or ba.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or ba.description ilike ''%'' 
    || :SEARCH_CRITERION || ''%''  or ua.code ilike ''%'' || :SEARCH_CRITERION 
    || ''%''  or ua.description ilike ''%'' || :SEARCH_CRITERION || ''%''  or su.code ilike ''%'' 
    || :SEARCH_CRITERION || ''%''  or su.description ilike ''%'' || :SEARCH_CRITERION 
    || ''%''  or ap.acces_user_id ilike ''%'' || :SEARCH_CRITERION || ''%''  
order by s.code
    ,c.code
    ,ca.code
    ,ba.code
    ,ua.code
    ,su.code
    ,ap.acces_user_id');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-3', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-4, 0, NOW(), 'CUSTOMERS_PER_SELLER', 'Customers per seller', 'customer', 'SQL', 'customers_per_seller-[yyyyMMdd].csv', 'CSV', 'CUSTOMERS_PER_SELLER_UUID', 'select s.code AS "Seller code"
                            , s.description AS "Seller description"
                            , coalesce(c.code, '''') AS "Customer code"
                            , coalesce(replace(c.description, '','', '' ''), '''') AS "Customer description"  
                    from  crm_seller s left
                            OUTER JOIN crm_customer c  on c.seller_id = s.id
                    where(  s.code ilike ''%'' || :SEARCH_CRITERION 
                            || ''%''  or s.description ilike ''%'' || :SEARCH_CRITERION || ''%''  or c.code ilike ''%'' 
                            || :SEARCH_CRITERION || ''%''  or c.description ilike ''%'' || :SEARCH_CRITERION || ''%''  )  
                    and (  s.code ilike ''%'' || :SELLER || ''%''  or s.description ilike ''%'' || :SELLER || ''%''  )  
                    order by s.code
                            ,c.code');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-4', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-4', 'SELLER', '%');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-5, 0, NOW(), 'INVOICED_GLOBAL', 'Total invoiced amount per month for interval (ex: last 12 months = -12 month)', 'invoiced', 'SQL', 'invoiced_global-[yyyyMMdd].csv', 'CSV', 'INVOICED_GLOBAL_UUID', 'select trim(to_char(date_trunc(''month'', i.invoice_date), ''Month'')) || to_char(date_trunc(''month'', i.invoice_date), '' YYYY'') AS "Month"
    , it.code AS "Invoice type code"
    , it.description AS "Invoice type description"
    , trim(to_char(sum(i.amount_without_tax), ''9999999990.00'')) AS "Amount without tax"
    , trim(to_char(sum(i.amount_with_tax), ''9999999990.00'')) AS "Amount with tax"  
from billing_invoice i 
    INNER JOIN billing_invoice_type it  on it.id = i.invoice_type_id 
where i.invoice_date > (date_trunc(''month'', CURRENT_DATE) - CAST(:MONTH_INTERVAL || '' month'' AS INTERVAL))  
group by date_trunc(''month'', i.invoice_date)
    , it.code
    , it.description order by date_trunc(''month'', i.invoice_date) DESC
    , it.code DESC');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-5', 'MONTH_INTERVAL', '12');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-6, 0, NOW(), 'INVOICED_BA_HIERARCHY', 'Invoiced per Billing Account with hierarchy per month for interval, global filter', 'invoiced', 'SQL', 'invoiced_per_billing_account_hierarchy-[yyyyMMdd].csv', 'CSV', 'INVOICED_BA_HIERARCHY_UUID', 'select trim(to_char(date_trunc(''month'', i.invoice_date), ''Month'')) || to_char(date_trunc(''month'', i.invoice_date), '' YYYY'') AS "Month"
    , s.code AS "Seller code"
    , s.description AS "Seller description"
    , c.code AS "Customer code"
    , c.description AS "Customer description"
    , ca.code AS "Customer Account code"
    , ca.description AS "Customer Account description"
    , ba.code AS "Billing Account code"
    , ba.description AS "Billing Account description"
    , it.code AS "Invoice type code"
    , it.description AS "Invoice type description"
    , to_char(sum(i.amount_without_tax), ''9999999990.00'') AS "Amount without tax"
    , to_char(sum(i.amount_with_tax), ''9999999990.00'') AS "Amount with tax"  
from crm_seller s 
    INNER JOIN crm_customer c  on c.seller_id = s.id
    INNER JOIN ar_customer_account ca  on ca.customer_id = c.id
    INNER JOIN billing_billing_account ba  on ba.customer_account_id = ca.id
    INNER JOIN billing_invoice i  on i.billing_account_id = ba.id
    INNER JOIN billing_invoice_type it  on it.id = i.invoice_type_id 
where i.invoice_date > (date_trunc(''month'', CURRENT_DATE) - CAST(:MONTH_INTERVAL || '' month'' AS INTERVAL))  
and(  s.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or s.description ilike ''%'' || :SEARCH_CRITERION 
    || ''%''  or c.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or c.description ilike ''%'' || :SEARCH_CRITERION 
    || ''%''  or ca.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or ca.description ilike ''%'' || :SEARCH_CRITERION 
    || ''%''  or ba.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or ba.description ilike ''%'' || :SEARCH_CRITERION 
    || ''%''  )  group by date_trunc(''month'', i.invoice_date)
    , it.code
    , it.description
    , s.code
    , s.description
    , c.code
    , c.description
    , ca.code
    , ca.description
    , ba.code
    , ba.description order by date_trunc(''month'', i.invoice_date) DESC
    , it.code DESC
    , s.code
    , c.code
    , ca.code
    , ba.code');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-6', 'MONTH_INTERVAL', '12');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-6', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-7, 0, NOW(), 'INVOICED_BA', 'Invoiced per Billing Account per month for interval, global filter', 'invoiced', 'SQL', 'invoiced_per_billing_account-[yyyyMMdd].csv', 'CSV', 'INVOICED_BA_UUID', 'select trim(to_char(date_trunc(''month'', i.invoice_date), ''Month'')) || to_char(date_trunc(''month'', i.invoice_date), '' YYYY'') AS "Month"
    , ba.code AS "Billing Account code"
    , ba.description AS "Billing Account description"
    , it.code AS "Invoice type code"
    , it.description AS "Invoice type description"
    , to_char(sum(i.amount_without_tax), ''9999999990.00'') AS "Amount without tax"
    , to_char(sum(i.amount_with_tax), ''9999999990.00'') AS "Amount with tax"  
from crm_seller s
    INNER JOIN crm_customer c  on c.seller_id = s.id
    INNER JOIN ar_customer_account ca  on ca.customer_id = c.id
    INNER JOIN billing_billing_account ba  on ba.customer_account_id = ca.id
    INNER JOIN billing_invoice i  on i.billing_account_id = ba.id
    INNER JOIN billing_invoice_type it  on it.id = i.invoice_type_id 
where i.invoice_date > (date_trunc(''month'', CURRENT_DATE) - CAST(:MONTH_INTERVAL || '' month'' AS INTERVAL))  
and(  ba.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or ba.description ilike ''%'' || :SEARCH_CRITERION || ''%''  )  
group by date_trunc(''month'', i.invoice_date)
    , it.code
    , it.description
    , ba.code
    , ba.description order by date_trunc(''month'', i.invoice_date) DESC
    , it.code DESC
    , ba.code');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-7', 'MONTH_INTERVAL', '12');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-7', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-8, 0, NOW(), 'INVOICED_CA', 'Invoiced per Customer Account per month for interval, global filter', 'invoiced', 'SQL', 'invoiced_per_customer_account-[yyyyMMdd].csv', 'CSV', 'INVOICED_CA_UUID', 'select trim(to_char(date_trunc(''month'', i.invoice_date), ''Month'')) || to_char(date_trunc(''month'', i.invoice_date), '' YYYY'') AS "Month"
    , ca.code AS "Customer Account code"
    , ca.description AS "Customer Account description"
    , it.code AS "Invoice type code"
    , it.description AS "Invoice type description"
    , to_char(sum(i.amount_without_tax), ''9999999990.00'') AS "Amount without tax"
    , to_char(sum(i.amount_with_tax), ''9999999990.00'') AS "Amount with tax"  
from crm_seller s
    INNER JOIN crm_customer c  on c.seller_id = s.id
    INNER JOIN ar_customer_account ca  on ca.customer_id = c.id
    INNER JOIN billing_billing_account ba  on ba.customer_account_id = ca.id
    INNER JOIN billing_invoice i  on i.billing_account_id = ba.id
    INNER JOIN billing_invoice_type it  on it.id = i.invoice_type_id 
where i.invoice_date > (date_trunc(''month'', CURRENT_DATE) - CAST(:MONTH_INTERVAL || '' month'' AS INTERVAL))  
and(  ca.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or ca.description ilike ''%'' || :SEARCH_CRITERION || ''%''  )  
group by date_trunc(''month'', i.invoice_date)
    , it.code
    , it.description
    , ca.code
    , ca.description order by date_trunc(''month'', i.invoice_date) DESC
    , it.code DESC
    , ca.code');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-8', 'MONTH_INTERVAL', '12');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-8', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-9, 0, NOW(), 'INVOICED_C', 'Invoiced per Customer per month for interval, global filter', 'invoiced', 'SQL', 'invoiced_per_customer-[yyyyMMdd].csv', 'CSV', 'INVOICED_C_UUID', 'select trim(to_char(date_trunc(''month'', i.invoice_date), ''Month'')) || to_char(date_trunc(''month'', i.invoice_date), '' YYYY'') AS "Month"
    , c.code AS "Customer code"
    , c.description AS "Customer description"
    , it.code AS "Invoice type code"
    , it.description AS "Invoice type description"
    , to_char(sum(i.amount_without_tax), ''9999999990.00'') AS "Amount without tax"
    , to_char(sum(i.amount_with_tax), ''9999999990.00'') AS "Amount with tax"  
from crm_seller s
    INNER JOIN crm_customer c  on c.seller_id = s.id
    INNER JOIN ar_customer_account ca  on ca.customer_id = c.id
    INNER JOIN billing_billing_account ba  on ba.customer_account_id = ca.id
    INNER JOIN billing_invoice i  on i.billing_account_id = ba.id
    INNER JOIN billing_invoice_type it  on it.id = i.invoice_type_id 
where i.invoice_date > (date_trunc(''month'', CURRENT_DATE) - CAST(:MONTH_INTERVAL || '' month'' AS INTERVAL))  
and(  c.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or c.description ilike ''%'' || :SEARCH_CRITERION || ''%''  )  
group by date_trunc(''month'', i.invoice_date)
    , it.code
    , it.description
    , c.code
    , c.description order by date_trunc(''month'', i.invoice_date) DESC
    , it.code DESC
    , c.code');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-9', 'MONTH_INTERVAL', '12');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-9', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-10, 0, NOW(), 'INVOICED_S', 'Invoiced per Seller per month for interval, global filter', 'invoiced', 'SQL', 'invoiced_per_seller-[yyyyMMdd].csv', 'CSV', 'INVOICED_S_UUID', 'select trim(to_char(date_trunc(''month'', i.invoice_date), ''Month'')) || to_char(date_trunc(''month'', i.invoice_date), '' YYYY'') AS  Month 
    , s.code AS  "Seller code"
    , s.description AS  "Seller description"
    , it.code AS  "Invoice type code"
    , it.description AS  "Invoice type description"
    , to_char(sum(i.amount_without_tax), ''9999999990.00'') AS  "Amount without tax"
    , to_char(sum(i.amount_with_tax), ''9999999990.00'') AS  "Amount with tax"   
from crm_seller s
    INNER JOIN crm_customer c  on c.seller_id = s.id
    INNER JOIN ar_customer_account ca  on ca.customer_id = c.id
    INNER JOIN billing_billing_account ba  on ba.customer_account_id = ca.id
    INNER JOIN billing_invoice i  on i.billing_account_id = ba.id
    INNER JOIN billing_invoice_type it  on it.id = i.invoice_type_id 
where i.invoice_date > (date_trunc(''month'', CURRENT_DATE) - CAST(:MONTH_INTERVAL || ''month'' AS INTERVAL))  
and(  s.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or s.description ilike ''%'' || :SEARCH_CRITERION || ''%''  )  
group by date_trunc(''month'', i.invoice_date)
    , it.code
    , it.description
    , s.code
    , s.description order by date_trunc(''month'', i.invoice_date) DESC
    , it.code DESC
    , s.code');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-10', 'MONTH_INTERVAL', '12');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-10', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-11, 0, NOW(), 'INVOICED_OF', 'Invoiced per Offer per month for interval, global filter', 'invoiced', 'SQL', 'invoiced_per_offer-[yyyyMMdd].csv', 'CSV', 'INVOICED_OF_UUID', 'select trim(to_char(date_trunc(''month'', i.invoice_date), ''Month'')) || to_char(date_trunc(''month'', i.invoice_date), '' YYYY'') AS "Month"
                    , of.code AS "Offer code"
                    , of.description AS "Offer description"
                    , it.code AS "Invoice type code"
                    , it.description AS "Invoice type description"
                    , to_char(sum(rt.amount_without_tax), ''9999999990.00'') AS "Amount without tax"
                    , to_char(sum(rt.amount_with_tax), ''9999999990.00'') AS "Amount with tax"  
                from cat_offer_template of
                    INNER JOIN billing_wallet_operation wo on wo.offer_code = OF.code
                    INNER JOIN billing_rated_transaction rt on wo.rated_transaction_id = rt.id
                    INNER JOIN billing_invoice i  on i.id = rt.invoice_id
                    INNER JOIN billing_invoice_type it  on it.id = i.invoice_type_id 
                where i.invoice_date > (date_trunc(''month'', CURRENT_DATE) - CAST(:MONTH_INTERVAL || '' month'' AS INTERVAL))  
                and(  of.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or OF.description ilike ''%'' || :SEARCH_CRITERION || ''%''  )  
                group by date_trunc(''month'', i.invoice_date)
                    , it.code
                    , it.description
                    , of.code
                    , of.description order by date_trunc(''month'', i.invoice_date) DESC
                    , it.code DESC
                    , of.code');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-11', 'MONTH_INTERVAL', '12');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-11', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-12, 0, NOW(), 'RECORDED_GLOBAL', 'Recorded invoices per month for interval, global filter', 'recorded', 'SQL', 'recorded_global-[yyyyMMdd].csv', 'CSV', 'RECORDED_GLOBAL_UUID', 'SELECT trim(to_char(date_trunc(''month'', ao.invoice_date), ''Month'')) || to_char(date_trunc(''month'', ao.invoice_date), '' YYYY'') AS "Month"
    ,to_char(sum(CASE 
                WHEN ao.transaction_category = ''DEBIT''
                    THEN ao.amount
                ELSE 0
                END), ''99999999990.00'') AS "Amount DEBIT"
    ,to_char(sum(CASE 
                WHEN ao.transaction_category = ''CREDIT''
                    THEN ao.amount
                ELSE 0
                END), ''99999999990.00'') AS "Amount CREDIT"
    ,to_char(sum(CASE 
                WHEN ao.transaction_category = ''DEBIT''
                    THEN ao.amount
                ELSE - ao.amount
                END), ''99999999990.00'') AS "Balance"
FROM ar_account_operation ao
WHERE ao.invoice_date IS NOT NULL
AND ao.invoice_date > (date_trunc(''month'', CURRENT_DATE) - CAST(:MONTH_INTERVAL || '' month'' AS INTERVAL))
GROUP BY date_trunc(''month'', ao.invoice_date)
ORDER BY date_trunc(''month'', ao.invoice_date) DESC');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-12', 'MONTH_INTERVAL', '12');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-13, 0, NOW(), 'RECORDED_BA_HIERARCHY', 'Recorded per Billing Account with Hierarchy per month for interval, global filter', 'recorded', 'SQL', 'recorded_per_billing_account_hierarchy-[yyyyMMdd].csv', 'CSV', 'RECORDED_BA_HIERARCHY_UUID', 'SELECT trim(to_char(date_trunc(''month'', ao.invoice_date), ''Month'')) || to_char(date_trunc(''month'', ao.invoice_date), '' YYYY'') AS "Month"
    ,s.code AS "Seller code"
    ,s.description AS "Seller description"
    ,c.code AS "Customer code"
    ,c.description AS "Customer description"
    ,ca.code AS "Customer Account code"
    ,ca.description AS "Customer Account description"
    ,ba.code AS "Billing Account code"
    ,ba.description AS "Billing Account description"
    ,to_char(sum(CASE 
                WHEN ao.transaction_category = ''DEBIT''
                    THEN ao.amount
                ELSE 0
                END), ''99999999990.00'') AS "Amount DEBIT"
    ,to_char(sum(CASE 
                WHEN ao.transaction_category = ''CREDIT''
                    THEN ao.amount
                ELSE 0
                END), ''99999999990.00'') AS "Amount CREDIT"
    ,to_char(sum(CASE 
                WHEN ao.transaction_category = ''DEBIT''
                    THEN ao.amount
                ELSE - ao.amount
                END), ''99999999990.00'') AS "Balance"
FROM crm_seller s
    INNER JOIN crm_customer c ON c.seller_id = s.id
    INNER JOIN ar_customer_account ca ON ca.customer_id = c.id
    INNER JOIN billing_billing_account ba ON ba.customer_account_id = ca.id
    INNER JOIN billing_invoice i ON i.billing_account_id = ba.id
    INNER JOIN ar_account_operation ao ON ao.customer_account_id = ca.id
        AND ao.reference = i.invoice_number
        AND ao.invoice_date = i.invoice_date
        AND ao.amount = abs(i.amount_with_tax)
WHERE ao.invoice_date IS NOT NULL
    AND ao.invoice_date > (date_trunc(''month'', CURRENT_DATE) - CAST(:MONTH_INTERVAL || '' month'' AS INTERVAL))
    AND (
        s.code ilike ''%'' || :SEARCH_CRITERION || ''%''
        OR s.description ilike ''%'' || :SEARCH_CRITERION || ''%''
        OR c.code ilike ''%'' || :SEARCH_CRITERION || ''%''
        OR c.description ilike ''%'' || :SEARCH_CRITERION || ''%''
        OR ca.code ilike ''%'' || :SEARCH_CRITERION || ''%''
        OR ca.description ilike ''%'' || :SEARCH_CRITERION || ''%''
        OR ba.code ilike ''%'' || :SEARCH_CRITERION || ''%''
        OR ba.description ilike ''%'' || :SEARCH_CRITERION || ''%''
        )
GROUP BY date_trunc(''month'', ao.invoice_date)
    ,s.code
    ,s.description
    ,c.code
    ,c.description
    ,ca.code
    ,ca.description
    ,ba.code
    ,ba.description
ORDER BY date_trunc(''month'', ao.invoice_date) DESC
    ,s.code
    ,c.code
    ,ca.code
    ,ba.code');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-13', 'MONTH_INTERVAL', '12');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-13', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-14, 0, NOW(), 'RECORDED_BA', 'Recorded per Billing Account per month for interval, global filter', 'recorded', 'SQL', 'recorded_per_billing_account-[yyyyMMdd].csv', 'CSV', 'RECORDED_BA_UUID', 'SELECT trim(to_char(date_trunc(''month'', ao.invoice_date), ''Month'')) || to_char(date_trunc(''month'', ao.invoice_date), '' YYYY'') AS "Month"
    ,ba.code AS "Billing Account code"
    ,ba.description AS "Billing Account description"
    ,to_char(sum(CASE 
                WHEN ao.transaction_category = ''DEBIT''
                    THEN ao.amount
                ELSE 0
                END), ''99999999990.00'') AS "Amount DEBIT"
    ,to_char(sum(CASE 
                WHEN ao.transaction_category = ''CREDIT''
                    THEN ao.amount
                ELSE 0
                END), ''99999999990.00'') AS "Amount CREDIT"
    ,to_char(sum(CASE 
                WHEN ao.transaction_category = ''DEBIT''
                    THEN ao.amount
                ELSE - ao.amount
                END), ''99999999990.00'') AS "Balance"
FROM crm_seller s
    INNER JOIN crm_customer c ON c.seller_id = s.id
    INNER JOIN ar_customer_account ca ON ca.customer_id = c.id
    INNER JOIN billing_billing_account ba ON ba.customer_account_id = ca.id
    INNER JOIN billing_invoice i ON i.billing_account_id = ba.id
    INNER JOIN ar_account_operation ao ON ao.customer_account_id = ca.id
        AND ao.reference = i.invoice_number
        AND ao.invoice_date = i.invoice_date
        AND ao.amount = abs(i.amount_with_tax)
WHERE ao.invoice_date IS NOT NULL
    AND ao.invoice_date > (date_trunc(''month'', CURRENT_DATE) - CAST(:MONTH_INTERVAL || '' month'' AS INTERVAL))
    AND (
        ba.code ilike ''%'' || :SEARCH_CRITERION || ''%''
        OR ba.description ilike ''%'' || :SEARCH_CRITERION || ''%''
        )
GROUP BY date_trunc(''month'', ao.invoice_date)
    ,ba.code
    ,ba.description
ORDER BY date_trunc(''month'', ao.invoice_date) DESC
    ,ba.code');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-14', 'MONTH_INTERVAL', '12');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-14', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-15, 0, NOW(), 'RECORDED_CA', 'Recorded per Customer Account per month for interval, global filter', 'recorded', 'SQL', 'recorded_per_customer_account-[yyyyMMdd].csv', 'CSV', 'RECORDED_CA_UUID', 'SELECT trim(to_char(date_trunc(''month'', ao.invoice_date), ''Month'')) || to_char(date_trunc(''month'', ao.invoice_date), '' YYYY'') AS "Month"
    ,ca.code AS "Customer Account code"
    ,ca.description AS "Customer Account description"
    ,to_char(sum(CASE 
                WHEN ao.transaction_category = ''DEBIT''
                    THEN ao.amount
                ELSE 0
                END), ''99999999990.00'') AS "Amount DEBIT"
    ,to_char(sum(CASE 
                WHEN ao.transaction_category = ''CREDIT''
                    THEN ao.amount
                ELSE 0
                END), ''99999999990.00'') AS "Amount CREDIT"
    ,to_char(sum(CASE 
                WHEN ao.transaction_category = ''DEBIT''
                    THEN ao.amount
                ELSE - ao.amount
                END), ''99999999990.00'') AS "Balance"
FROM crm_seller s
    INNER JOIN crm_customer c ON c.seller_id = s.id
    INNER JOIN ar_customer_account ca ON ca.customer_id = c.id
    INNER JOIN ar_account_operation ao ON ao.customer_account_id = ca.id
WHERE ao.invoice_date IS NOT NULL
    AND ao.invoice_date > (date_trunc(''month'', CURRENT_DATE) - CAST(:MONTH_INTERVAL || '' month'' AS INTERVAL))
    AND (
        ca.code ilike ''%'' || :SEARCH_CRITERION || ''%''
        OR ca.description ilike ''%'' || :SEARCH_CRITERION || ''%''
        )
GROUP BY date_trunc(''month'', ao.invoice_date)
    ,ca.code
    ,ca.description
ORDER BY date_trunc(''month'', ao.invoice_date) DESC
    ,ca.code');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-15', 'MONTH_INTERVAL', '12');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-15', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-16, 0, NOW(), 'RECORDED_C', 'Recorded per Customer per month for interval, global filter', 'recorded', 'SQL', 'recorded_per_customer-[yyyyMMdd].csv', 'CSV', 'RECORDED_C_UUID', 'SELECT trim(to_char(date_trunc(''month'', ao.invoice_date), ''Month'')) || to_char(date_trunc(''month'', ao.invoice_date), '' YYYY'') AS "Month"
    ,c.code AS "Customer code"
    ,c.description AS "Customer description"
    ,to_char(sum(CASE 
                WHEN ao.transaction_category = ''DEBIT''
                    THEN ao.amount
                ELSE 0
                END), ''99999999990.00'') AS "Amount DEBIT"
    ,to_char(sum(CASE 
                WHEN ao.transaction_category = ''CREDIT''
                    THEN ao.amount
                ELSE 0
                END), ''99999999990.00'') AS "Amount CREDIT"
    ,to_char(sum(CASE 
                WHEN ao.transaction_category = ''DEBIT''
                    THEN ao.amount
                ELSE - ao.amount
                END), ''99999999990.00'') AS "Balance"
FROM crm_seller s
    INNER JOIN crm_customer c ON c.seller_id = s.id
    INNER JOIN ar_customer_account ca ON ca.customer_id = c.id
    INNER JOIN ar_account_operation ao ON ao.customer_account_id = ca.id
WHERE ao.invoice_date IS NOT NULL
    AND ao.invoice_date > (date_trunc(''month'', CURRENT_DATE) - CAST(:MONTH_INTERVAL || '' month'' AS INTERVAL))
    AND (
        c.code ilike ''%'' || :SEARCH_CRITERION || ''%''
        OR c.description ilike ''%'' || :SEARCH_CRITERION || ''%''
        )
GROUP BY date_trunc(''month'', ao.invoice_date)
    ,c.code
    ,c.description
ORDER BY date_trunc(''month'', ao.invoice_date) DESC
    ,c.code');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-16', 'MONTH_INTERVAL', '12');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-16', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-17, 0, NOW(), 'RECORDED_S', 'Recorded per Seller per month for interval, global filter', 'recorded', 'SQL', 'recorded_per_seller-[yyyyMMdd].csv', 'CSV', 'RECORDED_S_UUID', 'SELECT trim(to_char(date_trunc(''month'', ao.invoice_date), ''Month'')) || to_char(date_trunc(''month'', ao.invoice_date), '' YYYY'') AS "Month"
    ,s.code AS "Seller code"
    ,s.description AS "Seller description"
    ,to_char(sum(CASE 
                WHEN ao.transaction_category = ''DEBIT''
                    THEN ao.amount
                ELSE 0
                END), ''99999999990.00'') AS "Amount DEBIT"
    ,to_char(sum(CASE 
                WHEN ao.transaction_category = ''CREDIT''
                    THEN ao.amount
                ELSE 0
                END), ''99999999990.00'') AS "Amount CREDIT"
    ,to_char(sum(CASE 
                WHEN ao.transaction_category = ''DEBIT''
                    THEN ao.amount
                ELSE - ao.amount
                END), ''99999999990.00'') AS "Balance"
FROM crm_seller s
    INNER JOIN crm_customer c ON c.seller_id = s.id
    INNER JOIN ar_customer_account ca ON ca.customer_id = c.id
    INNER JOIN ar_account_operation ao ON ao.customer_account_id = ca.id
WHERE ao.invoice_date IS NOT NULL
    AND ao.invoice_date > (date_trunc(''month'', CURRENT_DATE) - CAST(:MONTH_INTERVAL || '' month'' AS INTERVAL))
    AND (
        s.code ilike ''%'' || :SEARCH_CRITERION || ''%''
        OR s.description ilike ''%'' || :SEARCH_CRITERION || ''%''
        )
GROUP BY date_trunc(''month'', ao.invoice_date)
    ,s.code
    ,s.description
ORDER BY date_trunc(''month'', ao.invoice_date) DESC
    ,s.code');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-17', 'MONTH_INTERVAL', '12');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-17', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-18, 0, NOW(), 'UNBILLED_UA_HIERARCHY', 'Unbilled per User Account with Hierarchy, global filter', 'unbilled', 'SQL', 'unbilled_per_user_account_hierarchy-[yyyyMMdd].csv', 'CSV', 'UNBILLED_UA_HIERARCHY_UUID', 'select s.code AS "Seller code"
                    , s.description AS "Seller description"
                    , c.code AS "Customer code"
                    , c.description AS "Customer description"
                    , ca.code AS "Customer Account code"
                    , ca.description AS "Customer Account description"
                    , ba.code AS "Billing Account code"
                    , ba.description AS "Billing Account description"
                    , ua.code AS "User Account code"
                    , ua.description AS "User Account description"
                    , count(DISTINCT wo.id) AS "Transaction count"
                    , to_char(sum(wo.amount_without_tax), ''99999999990.00'') AS "Amount without tax"
                    , to_char(sum(wo.amount_with_tax), ''99999999990.00'') AS "Amount with tax"  
                from  billing_wallet_operation wo 
                    INNER JOIN billing_wallet wa  on wa.id = wo.wallet_id 
                    INNER JOIN billing_user_account ua  on ua.id = wa.user_account_id 
                    INNER JOIN billing_billing_account ba  on ba.id = ua.billing_account_id 
                    INNER JOIN ar_customer_account ca  on ca.id = ba.customer_account_id 
                    INNER JOIN crm_customer c  on c.id = ca.customer_id 
                    INNER JOIN crm_seller s  on s.id = c.seller_id 
                where  (  wo.STATUS = ''OPEN''  or (  wo.STATUS = ''TREATED'' 
                    and EXISTS (  select 1 from billing_rated_transaction rt where wo.rated_transaction_id = rt.id and rt.STATUS = ''OPEN'' )  )  )  
                and(  s.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or s.description ilike ''%'' || :SEARCH_CRITERION || ''%''  or c.code ilike ''%'' 
                    || :SEARCH_CRITERION || ''%''  or c.description ilike ''%'' || :SEARCH_CRITERION || ''%''  or ca.code ilike ''%'' 
                    || :SEARCH_CRITERION || ''%''  or ca.description ilike ''%'' || :SEARCH_CRITERION || ''%''  or ba.code ilike ''%'' 
                    || :SEARCH_CRITERION || ''%''  or ba.description ilike ''%'' || :SEARCH_CRITERION || ''%''  or ua.code ilike ''%'' 
                    || :SEARCH_CRITERION || ''%''  or ua.description ilike ''%'' || :SEARCH_CRITERION || ''%''  )  
                group by s.code
                    , s.description
                    , c.code
                    , c.description
                    , ca.code
                    , ca.description
                    , ba.code
                    , ba.description
                    , ua.code
                    , ua.description order by s.code
                    , c.code
                    , ca.code
                    , ba.code
                    , ua.code');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-18', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-19, 0, NOW(), 'UNBILLED_UA', 'Unbilled per User Account, global filter', 'unbilled', 'SQL', 'unbilled_per_user_account-[yyyyMMdd].csv', 'CSV', 'UNBILLED_UA_UUID', 'select ua.code AS "User Account code"
                    , ua.description AS "User Account description"
                    , count(DISTINCT wo.id) AS "Transaction count"
                    , to_char(sum(wo.amount_without_tax), ''99999999990.00'') AS "Amount without tax"
                    , to_char(sum(wo.amount_with_tax), ''99999999990.00'') AS "Amount with tax"  
                from  billing_wallet_operation wo 
                    INNER JOIN billing_wallet wa  on wa.id = wo.wallet_id 
                    INNER JOIN billing_user_account ua  on ua.id = wa.user_account_id 
                    INNER JOIN billing_billing_account ba  on ba.id = ua.billing_account_id 
                    INNER JOIN ar_customer_account ca  on ca.id = ba.customer_account_id 
                    INNER JOIN crm_customer c  on c.id = ca.customer_id 
                    INNER JOIN crm_seller s  on s.id = c.seller_id 
                where  (  wo.STATUS = ''OPEN''  or (   wo.STATUS = ''TREATED''   
                    and EXISTS (   select 1 from billing_rated_transaction rt where wo.rated_transaction_id = rt.id   
                and rt.STATUS = ''OPEN''   )  )  )  and(  ua.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or ua.description ilike ''%'' 
                    || :SEARCH_CRITERION || ''%''  )  
                group by ua.code
                    , ua.description 
                order by ua.code');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-19', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-20, 0, NOW(), 'UNBILLED_BA', 'Unbilled per Billing Account, global filter', 'unbilled', 'SQL', 'unbilled_per_billing_account-[yyyyMMdd].csv', 'CSV', 'UNBILLED_BA_UUID', 'select ba.code AS "Billing Account code"
                    , ba.description AS "Billing Account description"
                    , count(DISTINCT wo.id) AS "Transaction count"
                    , to_char(sum(wo.amount_without_tax), ''99999999990.00'') AS "Amount without tax"
                    , to_char(sum(wo.amount_with_tax), ''99999999990.00'') AS "Amount with tax"  
                from  billing_wallet_operation wo
                    INNER JOIN billing_wallet wa  on wa.id = wo.wallet_id
                    INNER JOIN billing_user_account ua  on ua.id = wa.user_account_id
                    INNER JOIN billing_billing_account ba  on ba.id = ua.billing_account_id
                    INNER JOIN ar_customer_account ca  on ca.id = ba.customer_account_id
                    INNER JOIN crm_customer c  on c.id = ca.customer_id
                    INNER JOIN crm_seller s  on s.id = c.seller_id 
                where  (  wo.STATUS = ''OPEN''  or (  wo.STATUS = ''TREATED'' 
                    and EXISTS (  select 1 from billing_rated_transaction rt where wo.rated_transaction_id = rt.id and rt.STATUS = ''OPEN'' )  )  )  
                    and(  ba.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or ba.description ilike ''%'' || :SEARCH_CRITERION || ''%''  )  
                group by ba.code, ba.description 
                order by ba.code');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-20', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-21, 0, NOW(), 'UNBILLED_CA', 'Unbilled per Customer Account, global filter', 'unbilled', 'SQL', 'unbilled_per_customer_account-[yyyyMMdd].csv', 'CSV', 'UNBILLED_CA_UUID', 'select ca.code AS "Customer Account code"
                    , ca.description AS "Customer Account description"
                    , count(DISTINCT wo.id) AS "Transaction count"
                    , to_char(sum(wo.amount_without_tax), ''99999999990.00'') AS "Amount without tax"
                    , to_char(sum(wo.amount_with_tax), ''99999999990.00'') AS "Amount with tax"  
                from  billing_wallet_operation wo
                    INNER JOIN billing_wallet wa  on wa.id = wo.wallet_id
                    INNER JOIN billing_user_account ua  on ua.id = wa.user_account_id
                    INNER JOIN billing_billing_account ba  on ba.id = ua.billing_account_id
                    INNER JOIN ar_customer_account ca  on ca.id = ba.customer_account_id
                    INNER JOIN crm_customer c  on c.id = ca.customer_id
                    INNER JOIN crm_seller s  on s.id = c.seller_id 
                where  (  wo.STATUS = ''OPEN''  or (  wo.STATUS = ''TREATED'' 
                    and EXISTS (  select 1 from billing_rated_transaction rt where wo.rated_transaction_id = rt.id and rt.STATUS = ''OPEN'' )  )  )  
                and(  ca.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or ca.description ilike ''%'' || :SEARCH_CRITERION || ''%''  )  
                group by ca.code, ca.description 
                order by ca.code');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-21', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-22, 0, NOW(), 'UNBILLED_C', 'Unbilled per Customer, global filter', 'unbilled', 'SQL', 'unbilled_per_customer-[yyyyMMdd].csv', 'CSV', 'UNBILLED_C_UUID', 'select c.code AS "Customer code"
                    , c.description AS "Customer description"
                    , count(DISTINCT wo.id) AS "Transaction count"
                    , to_char(sum(wo.amount_without_tax), ''99999999990.00'') AS "Amount without tax"
                    , to_char(sum(wo.amount_with_tax), ''99999999990.00'') AS "Amount with tax"  
                from  billing_wallet_operation wo
                    INNER JOIN billing_wallet wa  on wa.id = wo.wallet_id
                    INNER JOIN billing_user_account ua  on ua.id = wa.user_account_id
                    INNER JOIN billing_billing_account ba  on ba.id = ua.billing_account_id 
                    INNER JOIN ar_customer_account ca  on ca.id = ba.customer_account_id 
                    INNER JOIN crm_customer c  on c.id = ca.customer_id 
                    INNER JOIN crm_seller s  on s.id = c.seller_id 
                where  (  wo.STATUS = ''OPEN''  or (   wo.STATUS = ''TREATED''   
                    and EXISTS (   select 1 from billing_rated_transaction rt where wo.rated_transaction_id = rt.id and rt.STATUS = ''OPEN''   )  )  )  
                and(  c.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or c.description ilike ''%'' || :SEARCH_CRITERION || ''%''  )  
                group by c.code, c.description 
                order by c.code');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-22', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-23, 0, NOW(), 'UNBILLED_S', 'Unbilled per Seller, global filter', 'unbilled', 'SQL', 'unbilled_per_seller-[yyyyMMdd].csv', 'CSV', 'UNBILLED_S_UUID', 'select s.code AS "Seller code"
                    , s.description AS "Seller description"
                    , count(DISTINCT wo.id) AS "Transaction count"
                    , to_char(sum(wo.amount_without_tax), ''99999999990.00'') AS "Amount without tax"
                    , to_char(sum(wo.amount_with_tax), ''99999999990.00'') AS "Amount with tax"  
                from  billing_wallet_operation wo 
                    INNER JOIN billing_wallet wa  on wa.id = wo.wallet_id 
                    INNER JOIN billing_user_account ua  on ua.id = wa.user_account_id 
                    INNER JOIN billing_billing_account ba  on ba.id = ua.billing_account_id 
                    INNER JOIN ar_customer_account ca  on ca.id = ba.customer_account_id 
                    INNER JOIN crm_customer c  on c.id = ca.customer_id 
                    INNER JOIN crm_seller s  on s.id = c.seller_id 
                where  (  wo.STATUS = ''OPEN''  or (  wo.STATUS = ''TREATED'' 
                    and EXISTS (  select 1 from billing_rated_transaction rt where wo.rated_transaction_id = rt.id and rt.STATUS = ''OPEN'' )  )  )  
                and(  s.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or s.description ilike ''%'' || :SEARCH_CRITERION || ''%''  )  
                group by s.code, s.description 
                order by s.code');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-23', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-24, 0, NOW(), 'UNBILLED_OF', 'Unbilled per Offer, global filter', 'unbilled', 'SQL', 'unbilled_per_offer-[yyyyMMdd].csv', 'CSV', 'UNBILLED_OF_UUID', 'select of.code AS "Offer code"
                    , of.description AS "Offer description"
                    , count(DISTINCT wo.id) AS "Transaction count"
                    , to_char(sum(wo.amount_without_tax), ''99999999990.00'') AS "Amount without tax"
                    , to_char(sum(wo.amount_with_tax), ''99999999990.00'') AS "Amount with tax"  
                from  cat_offer_template of 
                    INNER JOIN billing_wallet_operation wo  on wo.offer_code = OF.code 
                where  (  wo.STATUS = ''OPEN''  or ( wo.STATUS = ''TREATED'' 
                    and EXISTS ( select 1  from billing_rated_transaction rt  where wo.rated_transaction_id = rt.id and rt.STATUS = ''OPEN'' )  )  )  
                and(  of.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or OF.description ilike ''%'' || :SEARCH_CRITERION || ''%''  )  
                group by of.code, of.description 
                order by of.code');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-24', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-25, 0, NOW(), 'INVOICES', 'Invoices per month', 'invoiced', 'SQL', 'invoices-[yyyyMMdd].csv', 'CSV', 'INVOICES_UUID', 'select trim(to_char(date_trunc(''month'', i.invoice_date), ''Month'')) || to_char(date_trunc(''month'', i.invoice_date), '' YYYY'') AS "Month"
    , to_char(i.invoice_date, ''YYYY-MM-DD'') AS "Invoice date"
    , i.invoice_number AS "Invoice number"
    , to_char(i.amount_without_tax, ''9999999990.00'') AS "Amount without tax"
    , to_char(i.amount_with_tax, ''9999999990.00'') AS "Amount with tax"
    , it.code AS "Invoice type code"
    , it.description AS "Invoice type description"
    , s.code AS "Seller code"
    , s.description AS "Seller description"
    , c.code AS "Customer code"
    , c.description AS "Customer description"
    , ca.code AS "Customer Account code"
    , ca.description AS "Customer Account description"
    , ba.code AS "Billing Account code"
    , ba.description AS "Billing Account description"  
from crm_seller s
    INNER JOIN crm_customer c  on c.seller_id = s.id
    INNER JOIN ar_customer_account ca  on ca.customer_id = c.id
    INNER JOIN billing_billing_account ba  on ba.customer_account_id = ca.id
    INNER JOIN billing_invoice i  on i.billing_account_id = ba.id
    INNER JOIN billing_invoice_type it  on it.id = i.invoice_type_id 
where i.invoice_date > (date_trunc(''month'', CURRENT_DATE) - CAST(:MONTH_INTERVAL || '' month'' AS INTERVAL))  
and(  s.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or s.description ilike ''%'' || :SEARCH_CRITERION 
    || ''%''  or c.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or c.description ilike ''%'' || :SEARCH_CRITERION 
    || ''%''  or ca.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or ca.description ilike ''%'' || :SEARCH_CRITERION 
    || ''%''  or ba.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or ba.description ilike ''%'' || :SEARCH_CRITERION 
    || ''%''  )  
order by date_trunc(''month'', i.invoice_date) DESC
    , i.invoice_date DESC
    , it.code
    , i.invoice_number');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-25', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-25', 'MONTH_INTERVAL', '12');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, sql_query) VALUES (-26, 0, NOW(), 'EDR', 'EDR by status, global filter', 'edr', 'SQL', 'edr_by_status-[yyyyMMdd].csv', 'CSV', 'EDR_UUID', 'SELECT  edr.id AS "Id"
    , edr.STATUS AS "Status"
    , edr.reject_reason AS "Rejection reason"
    , edr.access_code AS "Access code"
    , su.code AS "Subscription code"
    , of.code AS "Offer code"
    , edr.event_date AS "Event date"
    , edr.origin_batch AS "Origin batch"
    , edr.origin_record AS "Origin record"
    , edr.quantity AS "Quantity"
    , edr.parameter_1 AS "Param S1"
    , edr.parameter_2 AS "Param S2"
    , edr.parameter_3 AS "Param S3"
    , edr.parameter_4 AS "Param S4"
    , edr.parameter_5 AS "Param S5"
    , edr.parameter_6 AS "Param S6"
    , edr.parameter_7 AS "Param S7"
    , edr.parameter_8 AS "Param S8"
    , edr.parameter_9 AS "Param S9"
    , edr.date_parameter_1 AS "Param D1"
    , edr.date_parameter_2 AS "Param D2"
    , edr.date_parameter_3 AS "Param D3"
    , edr.date_parameter_4 AS "Param D4"
    , edr.date_parameter_5 AS "Param D5"
    , edr.decimal_parameter_1 AS "Param N1"
    , edr.decimal_parameter_2 AS "Param N2"
    , edr.decimal_parameter_3 AS "Param N3"
    , edr.decimal_parameter_4 AS "Param N4"
    , edr.decimal_parameter_5 AS "Param N5"  
from rating_edr edr
    INNER JOIN billing_subscription su  on su.id = edr.subscription_id
    INNER JOIN cat_offer_template of  on OF.id = su.offer_id where edr.event_date > (date_trunc(''month'', CURRENT_DATE) - CAST(:MONTH_INTERVAL || '' month'' AS INTERVAL))  
and edr.STATUS ilike ''%'' || :EDR_STATUS || ''%''  and(  su.code ilike ''%'' || :SEARCH_CRITERION || ''%''  or OF.code ilike ''%'' 
    || :SEARCH_CRITERION || ''%''  or edr.access_code ilike ''%'' || :SEARCH_CRITERION || ''%''  or edr.reject_reason ilike ''%'' 
    || :SEARCH_CRITERION || ''%''  or edr.origin_batch ilike ''%'' || :SEARCH_CRITERION || ''%''  or edr.origin_record ilike ''%'' 
    || :SEARCH_CRITERION || ''%''  or edr.parameter_1 ilike ''%'' || :SEARCH_CRITERION || ''%''  or edr.parameter_2 ilike ''%'' 
    || :SEARCH_CRITERION || ''%''  or edr.parameter_3 ilike ''%'' || :SEARCH_CRITERION || ''%''  or edr.parameter_4 ilike ''%'' 
    || :SEARCH_CRITERION || ''%''  or edr.parameter_5 ilike ''%'' || :SEARCH_CRITERION || ''%''  or edr.parameter_6 ilike ''%'' 
    || :SEARCH_CRITERION || ''%''  or edr.parameter_7 ilike ''%'' || :SEARCH_CRITERION || ''%''  or edr.parameter_8 ilike ''%'' 
    || :SEARCH_CRITERION || ''%''  or edr.parameter_9 ilike ''%'' || :SEARCH_CRITERION || ''%'')  
order by edr.STATUS, edr.id DESC');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-26', 'SEARCH_CRITERION', '%');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-26', 'MONTH_INTERVAL', '12');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-26', 'EDR_STATUS', '%');

INSERT INTO meveo_script_instance (id, version, disabled, created, code, description, src_type) VALUES (-12, 0, 0, NOW(), 'org.meveo.service.script.presale.AgedBalanceReporting', 'Aged Balance Reporting Script', 'JAVA_CLASS');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, script_instance_id) VALUES (-27, 0, NOW(), 'AgedBalanceReport', 'Aged Balance Report', 'AgedBalance', 'JAVA', 'AgedBalanceReporting-[yyyy_MM_dd].csv', 'CSV', 'AgedBalanceReport_UUID', '-12');

INSERT INTO meveo_script_instance (id, version, disabled, created, code, description, src_type) VALUES (-13, 0, 0, NOW(), 'org.meveo.service.script.presale.CustomerRevenuReporting', 'Customer Revenu Reporting Script', 'JAVA_CLASS');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, script_instance_id) VALUES (-28, 0, NOW(), 'CustomerRevenuReport', 'Customers revenu Report', 'revenu', 'JAVA', 'CustomerRevenuReporting-[yyyy_MM_dd].csv', 'CSV', 'CustomerRevenuReport_UUID', '-13');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-28', 'START_DATE', '31/01/2015');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-28', 'END_DATE', '31/01/2019');

INSERT INTO meveo_script_instance (id, version, disabled, created, code, description, src_type) VALUES (-15, 0, 0, NOW(), 'org.meveo.service.script.presale.CustomerPerOfferReporting', 'Customer Per Offer Reporting Script', 'JAVA_CLASS');

INSERT INTO dwh_report_extract (id, version, created, code, description, category, script_type, filename_format, result_type, uuid, script_instance_id) VALUES (-30, 0, NOW(), 'CustomersPerOfferReport', 'List of customer with revenue sorted by decreasing revenue (in a period)', 'accounts', 'JAVA', 'CustomersPerOffer-[yyyy_MM_dd].csv', 'CSV', 'CustomersPerOfferReport_UUID', '-15');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-30', 'START_DATE', '31/01/2015');

INSERT INTO dwh_report_extract_params (reportextract_id, params_key, params) VALUES ('-30', 'OFFER_CODE', '');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-data-report-extracts', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/data-reports.xml', NOW(), 4123, '9:cb82044a65824e5b4885bf0129a5ece5', 'insert tableName=meveo_script_instance; insert tableName=dwh_report_extract; insert tableName=dwh_report_extract_params; insert tableName=dwh_report_extract_params; insert tableName=dwh_report_extract; insert tableName=dwh_report_extract_params; i...', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-reports.xml::rebuild-data-ddRequest::AndriusKarpavicius
INSERT INTO ar_ddrequest_builder (id, version, created, code, description, type, implementation_class_name, nb_ops_file, max_size_file, uuid, creator, payment_level) VALUES (-1, 0, '2018-08-12 14:04:19.955', 'Sepa_STD', 'Sepa  : urn:iso:std:iso:20022:tech:xsd:pain.008.001.02 and Sepa reject file Pain002', 'NATIF', 'org.meveo.admin.sepa.SepaFile', '-1', '-1', '44bb7507-11cc-4a98-aa50-1777ddae3e6c', 'opencell.admin', 'AO');

INSERT INTO ar_ddrequest_builder (id, version, created, code, description, type, implementation_class_name, nb_ops_file, max_size_file, uuid, creator, payment_level) VALUES (-2, 0, '2018-08-12 14:05:32.622', 'Sepa_Paynum', 'Sepa Paynum', 'NATIF', 'org.meveo.admin.sepa.PaynumFile', '-1', '-1', 'a6873856-1d25-4df8-8801-09314528aa17', 'opencell.admin', 'AO');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-data-ddRequest', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/data-reports.xml', NOW(), 4125, '9:7ec64e970dffc23b29009767f29b6c0f', 'insert tableName=ar_ddrequest_builder; insert tableName=ar_ddrequest_builder', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-reports.xml::rebuild-data-adm_custom_generic_entity_code::AndriusKarpavicius
INSERT INTO generic_sequence (id, created, creator, version, code, description, sequence_type) VALUES (-1, '2018-10-02 12:09:00.913', 'OPENCELL.ADMIN', 1, 'order_quote_sequence', 'Order and Quote', 'UUID');

INSERT INTO generic_sequence (id, created, creator, version, code, description, sequence_type, sequence_size, current_number) VALUES (-2, '2018-10-02 12:09:00.913', 'OPENCELL.ADMIN', 1, 'seller_sequence', 'Seller sequence', 'SEQUENCE', 9, 0);

INSERT INTO generic_sequence (id, created, creator, version, code, description, sequence_type, sequence_size, current_number) VALUES (-3, '2018-10-02 12:09:00.913', 'OPENCELL.ADMIN', 1, 'customer_sequence', 'Customer sequence', 'SEQUENCE', 5, 0);

INSERT INTO adm_custom_generic_entity_code (id, created, creator, version, entity_class, sequence_id) VALUES (-1, '2018-10-02 12:09:00.913', 'OPENCELL.ADMIN', 1, 'Customer', -3);

INSERT INTO adm_custom_generic_entity_code (id, created, creator, version, entity_class, sequence_id) VALUES (-2, '2018-10-02 12:12:09.935', 'OPENCELL.ADMIN', 1, 'Quote', -1);

INSERT INTO adm_custom_generic_entity_code (id, created, creator, version, entity_class, sequence_id) VALUES (-3, '2018-10-02 12:12:09.936', 'OPENCELL.ADMIN', 1, 'Order', -1);

INSERT INTO adm_custom_generic_entity_code (id, created, creator, version, entity_class, sequence_id) VALUES (-4, '2018-10-02 12:12:09.937', 'OPENCELL.ADMIN', 1, 'Seller', -2);

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('rebuild-data-adm_custom_generic_entity_code', 'AndriusKarpavicius', 'src/main/resources/db_resources/changelog/rebuild/data-reports.xml', NOW(), 4127, '9:f57bb5e8996cca62a668ee9596466640', 'insert tableName=generic_sequence; insert tableName=generic_sequence; insert tableName=generic_sequence; insert tableName=adm_custom_generic_entity_code; insert tableName=adm_custom_generic_entity_code; insert tableName=adm_custom_generic_entity_c...', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/data-reports.xml::INTRD-263_20210716-rebuild::ZBariki
INSERT INTO com_message_template (media, id, version, created, code, type, tag_start, tag_end, description, subject, htmlcontent) VALUES ('EMAIL', nextval('com_msg_tmpl_seq'), '0', NOW(), 'REPORT_QUERY_RESULT_SUCCESS', 'OTHER', '#{', '}', 'Report query result', '[opencell] Query result #{reportQueryName} #{startDate}', 'Dear #{userName},<br>
<br>
The result for your query is ready.<br>
Check the result on <a href="#{portalResultLink}">Opencell Portal</a><br>
Query : #{reportQueryName}<br>
Started : #{startDate}<br>
Duration : #{duration}<br>
Line count : #{lineCount}<br>
<br>
Best regards,<br>
Opencell team.');

INSERT INTO com_message_template (media, id, version, created, code, type, tag_start, tag_end, description, subject, textcontent) VALUES ('EMAIL', nextval('com_msg_tmpl_seq'), '0', NOW(), 'REPORT_QUERY_RESULT_FAILURE', 'OTHER', '#{', '}', 'Report query failure notification', '[opencell] Query failed #{reportQueryName} #{startDate}', 'Dear #{userName},

Query execution failed with error :
#{error}

Contact your administrator or support.

Query : #{reportQueryName}
Started : #{startDate}
Duration : #{duration}

Best regards,

Opencell team.');

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('INTRD-263_20210716-rebuild', 'ZBariki', 'src/main/resources/db_resources/changelog/rebuild/data-reports.xml', NOW(), 4129, '9:550ef4bf1b2dad4e83278a34bda19101', 'insert tableName=com_message_template; insert tableName=com_message_template', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

-- Changeset src/main/resources/db_resources/changelog/rebuild/finalize_rebuild.xml::#liquibase_hack_structure::AbdelmounaimAkadid
CREATE TABLE db_migration_status (id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, build_nr VARCHAR(50) NOT NULL, app_version VARCHAR(20) NOT NULL, migration_date TIMESTAMP WITHOUT TIME ZONE DEFAULT NOW() NOT NULL, CONSTRAINT db_migration_status_pk PRIMARY KEY (id), CONSTRAINT db_migration_status_build_nr_uk UNIQUE (build_nr));

COMMENT ON TABLE db_migration_status IS 'Tracks if DB was migrated for a given OC build number';

update databasechangelog set filename='src/main/resources/db_resources/changelog/current/structure.xml', md5sum=null where description='empty';

INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('#liquibase_hack_structure', 'AbdelmounaimAkadid', 'src/main/resources/db_resources/changelog/rebuild/finalize_rebuild.xml', NOW(), 4131, '9:c1d128a03609384aaffa6c291ca9b566', 'createTable tableName=db_migration_status; sql', '', 'EXECUTED', NULL, NULL, '4.29.0', '1490728281');

