INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('PCNTTPL','count_config_templates','PCNTCNF','getObjects','','count/config/templates','count','Permission to count config tamplates page','PAG','fa-solid fa-file-invoice',1,false,false,NULL),
	 ('BCNTTSV','count_config_templates_save_button','SCNTTPL','','','count/config/templates','count','Permission to save template button','BUT','fa-solid fa-floppy-disk',1,false,false,NULL),
	 ('SCNTTPL','count_config_templates_list','PCNTTPL','','','ccount/config/templates','count','Permission to count config templates section','SEC','',1,false,false,NULL);

INSERT INTO public.core_user_role_has_permission (role_id,permission_code) VALUES
    (25,'PCNTTPL'),
    (25,'BCNTTSV'),
    (25,'SCNTTPL');

ALTER TABLE public.count_invoices ALTER COLUMN invoice_total SET DEFAULT 0;
ALTER TABLE public.count_invoices ALTER COLUMN invoice_vat SET DEFAULT 0;

ALTER TABLE public.count_invoices_rows ADD ord int2 NOT NULL DEFAULT 1;

