CREATE TABLE public.code_list_count_measure_unit (
	code varchar(3) NOT NULL,
	description varchar(50) NULL,
	ord int4 NULL,
	icon varchar(255) NULL,
	misc varchar(255) NULL,
	properties jsonb NULL DEFAULT '{}'::json,
	CONSTRAINT code_list_count_measure_unit_pk PRIMARY KEY (code)
);

INSERT INTO public.code_list_count_measure_unit (code,description,ord,icon,misc,properties) VALUES
	 ('PCS','Pieces',NULL,NULL,NULL,NULL),
	 ('HRS','Hours',NULL,NULL,NULL,NULL);

INSERT INTO public.code_lists ("table",description,editable)
	VALUES ('code_list_count_measure_unit','Count-measure units',true);

INSERT INTO public.core_sm_states (object_name,state_code,description,allowed_from,before_hook,after_hook,feedback,afterhook_once,feedback_once,prevent_feedback_on_afterhook,billable,meta,object_type) VALUES
	 ('count_invoices','CRT','created','[""]',NULL,NULL,'[]',true,false,true,false,'{}',NULL),
	 ('count_invoices','INV','invoices','["CRT"]',NULL,NULL,'[]',true,false,true,false,'{}',NULL);


