INSERT INTO pos_permissions (tenant_no,company_no,permission_cd,permission_nm,invisible,permission_group_cd,permission_desc,order_no)
SELECT tenant_no,company_no,'P_CASH_IN_11','Verlust buchen',0,'P_CASH_IN_GROUP','',11
FROM companies c
WHERE NOT EXISTS(
    SELECT permission_cd
    FROM pos_permissions 
    WHERE permission_cd = 'P_CASH_IN_11'
    AND company_no = c.company_no

);



INSERT INTO employee_group_permissions (tenant_no,company_no,employee_group_cd,permission_cd)
SELECT tenant_no,company_no,'0','P_CASH_IN_11'
FROM companies c
WHERE EXISTS (
    SELECT * from employee_groups
    where employee_group_cd = '0' and employee_group_nm = 'Geschäftsführer'
    and company_no = c.company_no
);


update businessunits set bu_payment_note_form_url = '/payment-receipt.xsl' ;