



insert into businessunit_properties 
SELECT tenant_no,company_no,department_no,businessunit_no,'LOCAL_TSE_TAR_PATH','/tseDateien'
FROM businessunits
WHERE NOT EXISTS (
	SELECT * 
     FROM businessunit_properties 
     WHERE property = 'LOCAL_TSE_TAR_PATH'
	 
);



INSERT INTO EMPLOYEE_GROUPS
SELECT TENANT_NO, COMPANY_NO, '13','Trinkgeld ändern'
FROM companies
WHERE NOT EXISTS (
	SELECT * 
     FROM EMPLOYEE_GROUPS 
     WHERE employee_group_cd = '13'
);

INSERT INTO EMPLOYEE_GROUP_PERMISSIONS
SELECT TENANT_NO, COMPANY_NO, '13','P_CHANGE_TIP','Trinkgeld ändern'
FROM companies
WHERE NOT EXISTS (
	SELECT * 
     FROM EMPLOYEE_GROUP_PERMISSIONS 
     WHERE employee_group_cd = '13'
);



insert into businessunit_properties 
SELECT tenant_no,company_no,department_no,businessunit_no,'HIDE_CASH_PAYMENT','0'
FROM businessunits
WHERE NOT EXISTS (
	SELECT * 
     FROM businessunit_properties 
     WHERE property = 'HIDE_CASH_PAYMENT'
);


insert into businessunit_properties 
SELECT tenant_no,company_no,department_no,businessunit_no,'DISABLE_TIP_FOR_CASH','0'
FROM businessunits
WHERE NOT EXISTS (
	SELECT * 
     FROM businessunit_properties 
     WHERE property = 'DISABLE_TIP_FOR_CASH'
);


insert into businessunit_properties 
SELECT tenant_no,company_no,department_no,businessunit_no,'DISABLE_TIP_FOR_EC_CC','0'
FROM businessunits
WHERE NOT EXISTS (
	SELECT * 
     FROM businessunit_properties 
     WHERE property = 'DISABLE_TIP_FOR_EC_CC'
	 
);

insert into businessunit_properties 
SELECT tenant_no,company_no,department_no,businessunit_no,'DISABLE_TIP_FOR_VOUCHER','0'
FROM businessunits
WHERE NOT EXISTS (
	SELECT * 
     FROM businessunit_properties 
     WHERE property = 'DISABLE_TIP_FOR_VOUCHER'
	 
);


insert into businessunit_properties 
SELECT tenant_no,company_no,department_no,businessunit_no,'ENABLE_TIP_MODULE','0'
FROM businessunits
WHERE NOT EXISTS (
	SELECT * 
     FROM businessunit_properties 
     WHERE property = 'ENABLE_TIP_MODULE'
	 
);

insert into businessunit_properties 
SELECT tenant_no,company_no,department_no,businessunit_no,'BOOKED_ARCHIVE','0'
FROM businessunits
WHERE NOT EXISTS (
	SELECT * 
     FROM businessunit_properties 
     WHERE property = 'BOOKED_ARCHIVE'
	 
);





insert into department_properties 
SELECT tenant_no,company_no,department_no,'PRODUCT_MODE','BOTH'
FROM departments
WHERE NOT EXISTS (
	SELECT * 
     FROM businessunit_properties 
     WHERE property = 'PRODUCT_MODE'
	 
);

insert into department_properties 
SELECT tenant_no,company_no,department_no,'SERVICE_MODE','BOTH'
FROM departments
WHERE NOT EXISTS (
	SELECT * 
     FROM businessunit_properties 
     WHERE property = 'SERVICE_MODE'
	 
);
