Commit 5a53a540 authored by Frank Bergmann's avatar Frank Bergmann

- Added accounts receivable and accounts payable menus

parent 3161b832
......@@ -14,6 +14,7 @@ returns integer as $body$
declare
v_menu integer;
v_invoices_new_menu integer;
v_finance_menu integer;
v_menu_id integer;
v_accounting integer;
v_senman integer;
......@@ -22,7 +23,7 @@ begin
select group_id into v_senman from groups where group_name = 'Senior Managers';
select group_id into v_accounting from groups where group_name = 'Accounting';
select menu_id into v_invoices_new_menu from im_menus where label = 'invoices_customers';
select menu_id into v_finance_menu from im_menus where label = 'finance';
select count(*) into v_count from im_menus where label = 'invoices_customers_new_customer_purchase_order';
IF v_count = 0 THEN
......@@ -61,6 +62,60 @@ begin
END IF;
select count(*) into v_count from im_menus where label = 'invoices_customers_new_invoice_from_customer_purchase_order';
IF v_count = 0 THEN
v_menu_id := im_menu__new (
null, 'im_menu', now(), null, null, null,
'intranet-invoices', -- package_name
'invoices_customers_new_invoice_from_customer_purchase_order', -- label
'New Customer Invoice from Customer Purchase Order', -- name
'/intranet-invoices/new-copy?target_cost_type_id=3700&source_cost_type_id=3740', -- url
350, -- sort_order
v_invoices_new_menu, -- parent_menu_id
null -- visible_tcl
);
PERFORM acs_permission__grant_permission(v_menu_id, v_senman, 'read');
PERFORM acs_permission__grant_permission(v_menu_id, v_accounting, 'read');
END IF;
select count(*) into v_count from im_menus where label = 'invoices_accounts_receivable';
IF v_count = 0 THEN
v_menu_id := im_menu__new (
null, 'im_menu', now(), null, null, null,
'intranet-invoices', -- package_name
'invoices_accounts_receivable', -- label
'Accounts Receivable', -- name
'/intranet-invoices/list?cost_status_id=3802&cost_type_id=3700', -- url
100, -- sort_order
v_finance_menu, -- parent_menu_id
null -- visible_tcl
);
PERFORM acs_permission__grant_permission(v_menu_id, v_senman, 'read');
PERFORM acs_permission__grant_permission(v_menu_id, v_accounting, 'read');
END IF;
select count(*) into v_count from im_menus where label = 'invoices_accounts_payable';
IF v_count = 0 THEN
v_menu_id := im_menu__new (
null, 'im_menu', now(), null, null, null,
'intranet-invoices', -- package_name
'invoices_accounts_payable', -- label
'Accounts Payable', -- name
'/intranet-invoices/list?cost_status_id=3802&cost_type_id=3704', -- url
110, -- sort_order
v_finance_menu, -- parent_menu_id
null -- visible_tcl
);
PERFORM acs_permission__grant_permission(v_menu_id, v_senman, 'read');
PERFORM acs_permission__grant_permission(v_menu_id, v_accounting, 'read');
END IF;
return 0;
end; $body$ language 'plpgsql';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment