----------------------------------------------------------------------------------------------------------------------------------------------------------------

INSERT INTO public.core_settings (setting_type,setting_name,value,properties,ord) VALUES
	 ('email_settings','main_settings','{"MAIL_ADDBCC": ["admin@jivalabs.com"], "MAIL_TIMEOUT": "10", "MAIL_SMTPAUTH": "true", "MAIL_SMTPHOST": "smtp.gmail.com", "MAIL_SMTPPASS": "nxiiebpregxmgufi", "MAIL_SMTPPORT": "587", "MAIL_SMTPSECU": "tls", "MAIL_SMTPUSER": "stanese@gmail.com", "MAIL_CHARSET": "UTF-8", "MAIL_ENCODING": "base64"}','{"section_desc": "Manage email settings", "section_icon": "fas fa-mail-bulk", "setting_desc": "General email settings", "setting_icon": "fas fa-cogs", "section_button": "Change settings", "setting_button": "View"}',10);

INSERT INTO core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('PMESS','herald_message','MHERALD','getObjects','','herald/message','herald','Permission to get messages','PAG','fas fa-paper-plane',1,false,false,NULL),
	 ('SHMLST','herald_message_list_view','PMESS','','','herald/message','herald','Permission to view message list section','SEC','',1,false,false,NULL),
	 ('XHMSGET','herald_message_list_get','SHMLST','getMessages','','herald/message','herald','Permission to get messages','EXE','',1,false,false,NULL),
	 ('SMBKEND','herald_message_backend_only','MHERALD','','','','herald','','SEC','',1,false,false,NULL),
	 ('XHMCRT','herald_message_create','SMBKEND','crtMessage','','herald/message','herald','Permission to create new message','EXE','',1,false,false,NULL),
	 ('XHMSCR','herald_message_create_send','SMBKEND','sendMessage','','herald/message','herald','Permission to create and send new message','EXE','',1,false,false,NULL),
	 ('JHERALD','mobile_herald_jason','MHERALD','heraldPage.json','','herald/mobile','herald','Permission to view herald page mobile','MOB','',1,false,false,NULL),
	 ('MHERALD','herald',NULL,NULL,NULL,'herald','herald','Access to herald module','MOD','fas fa-envelope-open-text',900,false,false,NULL);

INSERT INTO public.core_permissions
(code, permission_name, parent, permission_function, default_child, permission_namespace, "module", permission_description, permission_type, icon, ord, guest, meta, hidden)
VALUES('BHMSRC', 'herald_message_list_button_search', 'SHMLST', '', '', 'herald/message', 'herald', 'Permission to search with selected filters', 'BUT', 'fas fa-filter', 1, false, NULL, false);
INSERT INTO public.core_permissions
(code, permission_name, parent, permission_function, default_child, permission_namespace, "module", permission_description, permission_type, icon, ord, guest, meta, hidden)
VALUES('BHMFIL', 'herald_message_list_button_filters', 'SHMLST', '', '', 'herald/message', 'herald', 'Permission to open filters', 'BUT', 'fas fa-filter', 1, false, NULL, false);
INSERT INTO public.core_permissions
(code, permission_name, parent, permission_function, default_child, permission_namespace, "module", permission_description, permission_type, icon, ord, guest, meta, hidden)
VALUES('BHMFRM', 'herald_message_list_button_filters_remove', 'SHMLST', '', '', 'herald/message', 'herald', 'Permission to remove selected filters', 'BUT', 'fas fa-times', 1, false, NULL, false);
INSERT INTO public.core_permissions
(code, permission_name, parent, permission_function, default_child, permission_namespace, "module", permission_description, permission_type, icon, ord, guest, meta, hidden)
VALUES('BHMADD', 'herald_message_list_view_add', 'SHMLST', '', '', 'herald/message', 'herald', 'Permission to add new message', 'BUT', 'fas fa-plus', 1, false, NULL, false);
INSERT INTO public.core_permissions
(code, permission_name, parent, permission_function, default_child, permission_namespace, "module", permission_description, permission_type, icon, ord, guest, meta, hidden)
VALUES('BHMDEL', 'herald_message_list_view_del', 'SHMLST', '', '', 'herald/message', 'herald', 'Permission to delete selected message', 'BUT', 'fas fa-trash', 1, false, NULL, false);
INSERT INTO public.core_permissions
(code, permission_name, parent, permission_function, default_child, permission_namespace, "module", permission_description, permission_type, icon, ord, guest, meta, hidden)
VALUES('BMHEDT', 'herald_message_list_view_edit', 'SHMLST', '', '', 'herald/message', 'herald', 'Permission to edit selected message', 'BUT', 'fas fa-edit', 1, false, NULL, false);


-- Auto-generated SQL script #202211291030
INSERT INTO public.core_settings (setting_type,setting_name,value,properties,ord)
	VALUES ('count_settings','invoice_template','{
  "body": "<p>test</p>\n<p><strong>test</strong></p>\n<p><em>dfdfgdfs</em></p>\n<p><strong>gggg kjh kjh</strong></p>\n<p></p>",
  "queries": [
  	"SELECT * FROM count_invoices WHERE id=:id",
  	"SELECT * FROM count_invoices_rows WHERE invoice_id=:id"
  ]
}'::jsonb,'{
  "section_desc": "Count Module Settings",
  "section_icon": "fa-solid fa-calculator",
  "setting_desc": "Invoice template",
  "setting_icon": "fa-solid fa-file-invoice",
  "section_button": "Change template",
  "setting_button": "Edit"
}'::jsonb,110);

INSERT INTO core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('XHDCCR','herald_document_create','SMBKEND','createDocument','','herald/message','herald','Permission to create new document','EXE','',1,false,false,NULL);
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
	 ('XHRLPDF','herald_document_pdf','SMBKEND','crtDocumentPDF','','herald/message','herald','Permission to create document pdf','EXE','',1,false,false,NULL);
