-- Name: vw_loan_payments; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_loan_payments AS
 SELECT vw_loans.adjustment_id,
    vw_loans.adjustment_name,
    vw_loans.account_number,
    vw_loans.currency_id,
    vw_loans.currency_name,
    vw_loans.currency_symbol,
    vw_loans.loan_type_id,
    vw_loans.loan_type_name,
    vw_loans.entity_id,
    vw_loans.entity_name,
    vw_loans.employee_id,
    vw_loans.loan_date,
    vw_loans.loan_id,
    vw_loans.principle,
    vw_loans.interest,
    vw_loans.monthly_repayment,
    vw_loans.reducing_balance,
    vw_loans.repayment_period,
    vw_loans.application_date,
    vw_loans.approve_status,
    vw_loans.initial_payment,
    vw_loans.org_id,
    vw_loans.action_date,
    generate_series(1, vw_loans.repayment_period) AS months,
    get_loan_period(vw_loans.principle, vw_loans.interest, generate_series(1, vw_loans.repayment_period), vw_loans.repayment_amount) AS loan_balance,
    (get_loan_period(vw_loans.principle, vw_loans.interest, (generate_series(1, vw_loans.repayment_period) - 1), vw_loans.repayment_amount) * (vw_loans.interest / (1200)::double precision)) AS loan_intrest
   FROM vw_loans;


ALTER TABLE public.vw_loan_payments OWNER TO postgres;

--
-- Name: vw_loan_projection; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_loan_projection AS
 SELECT vw_loans.org_id,
    vw_loans.loan_id,
    vw_loans.loan_type_name,
    vw_loans.entity_name,
    vw_loans.principle,
    vw_loans.monthly_repayment,
    vw_loans.loan_date,
    ((date_part('year'::text, age((('now'::text)::date)::timestamp with time zone, '2010-05-01 00:00:00+03'::timestamp with time zone)) * (12)::double precision) + date_part('month'::text, age((('now'::text)::date)::timestamp with time zone, (vw_loans.loan_date)::timestamp with time zone))) AS loan_months,
    get_total_repayment(vw_loans.loan_id, (((date_part('year'::text, age((('now'::text)::date)::timestamp with time zone, '2010-05-01 00:00:00+03'::timestamp with time zone)) * (12)::double precision) + date_part('month'::text, age((('now'::text)::date)::timestamp with time zone, (vw_loans.loan_date)::timestamp with time zone))))::integer) AS loan_paid
   FROM vw_loans;


ALTER TABLE public.vw_loan_projection OWNER TO postgres;

--
-- Name: vw_objective_details; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_objective_details AS
 SELECT vw_objectives.entity_id,
    vw_objectives.entity_name,
    vw_objectives.employee_objective_id,
    vw_objectives.employee_objective_name,
    vw_objectives.objective_date,
    vw_objectives.approve_status,
    vw_objectives.workflow_table_id,
    vw_objectives.application_date,
    vw_objectives.action_date,
    vw_objectives.supervisor_comments,
    vw_objectives.objective_type_id,
    vw_objectives.objective_type_name,
    vw_objectives.objective_id,
    vw_objectives.date_set,
    vw_objectives.objective_ps,
    vw_objectives.objective_name,
    vw_objectives.objective_completed,
    objective_details.org_id,
    objective_details.objective_detail_id,
    objective_details.ln_objective_detail_id,
    objective_details.objective_detail_name,
    objective_details.success_indicator,
    objective_details.achievements,
    objective_details.resources_required,
    objective_details.target_date,
    objective_details.completed,
    objective_details.completion_date,
    objective_details.ods_ps,
    objective_details.ods_points,
    objective_details.ods_reviewer_points,
    objective_details.details
   FROM (objective_details
     JOIN vw_objectives ON ((objective_details.objective_id = vw_objectives.objective_id)));


ALTER TABLE public.vw_objective_details OWNER TO postgres;

--
-- Name: vw_objective_year; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_objective_year AS
 SELECT vw_employee_objectives.org_id,
    vw_employee_objectives.objective_year
   FROM vw_employee_objectives
  WHERE (vw_employee_objectives.objective_year IS NOT NULL)
  GROUP BY vw_employee_objectives.org_id, vw_employee_objectives.objective_year;


ALTER TABLE public.vw_objective_year OWNER TO postgres;

--
-- Name: vw_org_select; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_org_select AS
 SELECT orgs.org_id,
    orgs.parent_org_id,
    orgs.org_name
   FROM orgs
  WHERE ((orgs.is_active = true) AND (orgs.org_id <> orgs.parent_org_id))
UNION
 SELECT orgs.org_id,
    orgs.org_id AS parent_org_id,
    orgs.org_name
   FROM orgs
  WHERE (orgs.is_active = true);


ALTER TABLE public.vw_org_select OWNER TO postgres;

--
-- Name: vw_pay_scale_steps; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_pay_scale_steps AS
 SELECT currency.currency_id,
    currency.currency_name,
    currency.currency_symbol,
    pay_scales.pay_scale_id,
    pay_scales.pay_scale_name,
    pay_scale_steps.org_id,
    pay_scale_steps.pay_scale_step_id,
    pay_scale_steps.pay_step,
    pay_scale_steps.pay_amount,
    (((((pay_scales.pay_scale_name)::text || '-'::text) || (currency.currency_symbol)::text) || '-'::text) || pay_scale_steps.pay_step) AS pay_step_name
   FROM ((pay_scale_steps
     JOIN pay_scales ON ((pay_scale_steps.pay_scale_id = pay_scales.pay_scale_id)))
     JOIN currency ON ((pay_scales.currency_id = currency.currency_id)));


ALTER TABLE public.vw_pay_scale_steps OWNER TO postgres;

--
-- Name: vw_pay_scales; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_pay_scales AS
 SELECT currency.currency_id,
    currency.currency_name,
    currency.currency_symbol,
    pay_scales.org_id,
    pay_scales.pay_scale_id,
    pay_scales.pay_scale_name,
    pay_scales.min_pay,
    pay_scales.max_pay,
    pay_scales.details
   FROM (pay_scales
     JOIN currency ON ((pay_scales.currency_id = currency.currency_id)));


ALTER TABLE public.vw_pay_scales OWNER TO postgres;

--
-- Name: vw_payroll_ledger; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_payroll_ledger AS
 SELECT b.org_id,
    b.period_id,
    b.end_date,
    b.description,
    b.gl_payroll_account,
    b.dr_amt,
    b.cr_amt
   FROM ( SELECT a.org_id,
            a.period_id,
            a.end_date,
            'BASIC SALARY'::text AS description,
            a.gl_payroll_account,
            sum(a.b_basic_pay) AS dr_amt,
            0::real AS cr_amt
           FROM vw_ems a
          GROUP BY a.org_id, a.period_id, a.end_date, a.gl_payroll_account
        UNION
         SELECT a.org_id,
            a.period_id,
            a.end_date,
            'SALARY PAYMENTS'::text,
            a.gl_payment_account,
            0::real AS float4,
            sum(a.b_banked) AS sum
           FROM vw_ems a
          GROUP BY a.org_id, a.period_id, a.end_date, a.gl_payment_account
        UNION
         SELECT a.org_id,
            a.period_id,
            a.end_date,
            a.tax_type_name,
            a.account_number,
            0::real AS float4,
            sum(((a.b_amount + a.b_additional) + a.b_employer)) AS sum
           FROM vw_employee_tax_types a
          GROUP BY a.org_id, a.period_id, a.end_date, a.tax_type_name, a.account_number
        UNION
         SELECT a.org_id,
            a.period_id,
            a.end_date,
            ('Employer - '::text || (a.tax_type_name)::text),
            a.account_number,
            sum(a.b_employer) AS sum,
            0::real AS float4
           FROM vw_employee_tax_types a
          WHERE (a.employer <> (0)::double precision)
          GROUP BY a.org_id, a.period_id, a.end_date, a.tax_type_name, a.account_number
        UNION
         SELECT a.org_id,
            a.period_id,
            a.end_date,
            a.adjustment_name,
            a.account_number,
            sum(
                CASE
                    WHEN (a.adjustment_type = 1) THEN (a.b_amount - a.b_paid_amount)
                    ELSE (0::real)::double precision
                END) AS sum,
            sum(
                CASE
                    WHEN (a.adjustment_type = 2) THEN (a.b_amount - a.b_paid_amount)
                    ELSE (0::real)::double precision
                END) AS sum
           FROM vw_employee_adjustments a
          WHERE ((a.visible = true) AND (a.adjustment_type < 3))
          GROUP BY a.org_id, a.period_id, a.end_date, a.adjustment_name, a.account_number
        UNION
         SELECT a.org_id,
            a.period_id,
            a.travel_date,
            'Transport'::text AS description,
            a.post_account,
            sum((a.b_full_amount - a.b_cash_paid)) AS sum,
            0::real AS float4
           FROM vw_employee_per_diem a
          WHERE ((a.approve_status)::text = 'Approved'::text)
          GROUP BY a.org_id, a.period_id, a.travel_date, a.post_account
        UNION
         SELECT ea.org_id,
            ea.period_id,
            ea.end_date,
            'SALARY ADVANCE'::text AS description,
            ea.gl_payroll_account,
            sum(ea.b_advance_amount) AS sum,
            0::real AS float4
           FROM vw_employee_advances ea
          WHERE (ea.in_payroll = true)
          GROUP BY ea.org_id, ea.period_id, ea.end_date, ea.gl_payroll_account
        UNION
         SELECT ead.org_id,
            ead.period_id,
            ead.end_date,
            'ADVANCE DEDUCTION'::text AS description,
            ead.gl_payroll_account,
            0::real AS float4,
            sum(ead.b_advance_deduction) AS sum
           FROM vw_advance_deductions ead
          WHERE (ead.in_payroll = true)
          GROUP BY ead.org_id, ead.period_id, ead.end_date, ead.gl_payroll_account) b
  ORDER BY b.gl_payroll_account DESC, b.dr_amt DESC, b.cr_amt DESC;


ALTER TABLE public.vw_payroll_ledger OWNER TO postgres;

--
-- Name: vw_payroll_ledger_trx; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_payroll_ledger_trx AS
 SELECT b.org_id,
    b.period_id,
    b.end_date,
    b.description,
    b.gl_payroll_account,
    b.entity_name,
    b.employee_id,
    b.dr_amt,
    b.cr_amt
   FROM ( SELECT a.org_id,
            a.period_id,
            a.end_date,
            'BASIC SALARY'::text AS description,
            a.gl_payroll_account,
            a.entity_name,
            a.employee_id,
            a.b_basic_pay AS dr_amt,
            0::real AS cr_amt
           FROM vw_ems a
        UNION
         SELECT a.org_id,
            a.period_id,
            a.end_date,
            'SALARY PAYMENTS'::text,
            a.gl_payment_account,
            a.entity_name,
            a.employee_id,
            0::real AS float4,
            a.b_banked
           FROM vw_ems a
        UNION
         SELECT a.org_id,
            a.period_id,
            a.end_date,
            a.tax_type_name,
            a.account_number,
            a.entity_name,
            a.employee_id,
            0::real AS float4,
            ((a.b_amount + a.b_additional) + a.b_employer)
           FROM vw_employee_tax_types a
        UNION
         SELECT a.org_id,
            a.period_id,
            a.end_date,
            ('Employer - '::text || (a.tax_type_name)::text),
            a.account_number,
            a.entity_name,
            a.employee_id,
            a.b_employer,
            0::real AS float4
           FROM vw_employee_tax_types a
          WHERE (a.employer <> (0)::double precision)
        UNION
         SELECT a.org_id,
            a.period_id,
            a.end_date,
            a.adjustment_name,
            a.account_number,
            a.entity_name,
            a.employee_id,
            sum(
                CASE
                    WHEN (a.adjustment_type = 1) THEN (a.b_amount - a.b_paid_amount)
                    ELSE (0::real)::double precision
                END) AS sum,
            sum(
                CASE
                    WHEN (a.adjustment_type = 2) THEN (a.b_amount - a.b_paid_amount)
                    ELSE (0::real)::double precision
                END) AS sum
           FROM vw_employee_adjustments a
          WHERE ((a.visible = true) AND (a.adjustment_type < 3))
          GROUP BY a.org_id, a.period_id, a.end_date, a.adjustment_name, a.account_number, a.entity_name, a.employee_id
        UNION
         SELECT a.org_id,
            a.period_id,
            a.travel_date,
            'Transport'::text AS description,
            a.post_account,
            a.entity_name,
            a.employee_id,
            (a.b_full_amount - a.b_cash_paid),
            0::real AS float4
           FROM vw_employee_per_diem a
          WHERE ((a.approve_status)::text = 'Approved'::text)
        UNION
         SELECT ea.org_id,
            ea.period_id,
            ea.end_date,
            'SALARY ADVANCE'::text AS description,
            ea.gl_payroll_account,
            ea.entity_name,
            ea.employee_id,
            ea.b_advance_amount,
            0::real AS float4
           FROM vw_employee_advances ea
          WHERE (ea.in_payroll = true)
        UNION
         SELECT ead.org_id,
            ead.period_id,
            ead.end_date,
            'ADVANCE DEDUCTION'::text AS description,
            ead.gl_payroll_account,
            ead.entity_name,
            ead.employee_id,
            0::real AS float4,
            ead.b_advance_deduction
           FROM vw_advance_deductions ead
          WHERE (ead.in_payroll = true)) b
  ORDER BY b.gl_payroll_account DESC, b.dr_amt DESC, b.cr_amt DESC;


ALTER TABLE public.vw_payroll_ledger_trx OWNER TO postgres;

--
-- Name: vw_pc_allocations; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_pc_allocations AS
 SELECT vw_periods.fiscal_year_id,
    vw_periods.fiscal_year_start,
    vw_periods.fiscal_year_end,
    vw_periods.year_opened,
    vw_periods.year_closed,
    vw_periods.period_id,
    vw_periods.start_date,
    vw_periods.end_date,
    vw_periods.opened,
    vw_periods.closed,
    vw_periods.month_id,
    vw_periods.period_year,
    vw_periods.period_month,
    vw_periods.quarter,
    vw_periods.semister,
    departments.department_id,
    departments.department_name,
    pc_allocations.org_id,
    pc_allocations.pc_allocation_id,
    pc_allocations.narrative,
    pc_allocations.approve_status,
    pc_allocations.details,
    ( SELECT sum(((pc_budget.budget_units)::double precision * pc_budget.budget_price)) AS sum
           FROM pc_budget
          WHERE (pc_budget.pc_allocation_id = pc_allocations.pc_allocation_id)) AS sum_budget,
    ( SELECT sum(((pc_expenditure.units)::double precision * pc_expenditure.unit_price)) AS sum
           FROM pc_expenditure
          WHERE (pc_expenditure.pc_allocation_id = pc_allocations.pc_allocation_id)) AS sum_expenditure,
    ( SELECT sum(pc_banking.amount) AS sum
           FROM pc_banking
          WHERE (pc_banking.pc_allocation_id = pc_allocations.pc_allocation_id)) AS sum_banking
   FROM ((pc_allocations
     JOIN vw_periods ON ((pc_allocations.period_id = vw_periods.period_id)))
     JOIN departments ON ((pc_allocations.department_id = departments.department_id)));


ALTER TABLE public.vw_pc_allocations OWNER TO postgres;

--
-- Name: vw_pc_items; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_pc_items AS
 SELECT pc_category.pc_category_id,
    pc_category.pc_category_name,
    pc_items.org_id,
    pc_items.pc_item_id,
    pc_items.pc_item_name,
    pc_items.default_price,
    pc_items.default_units,
    pc_items.details,
    (pc_items.default_price * (pc_items.default_units)::double precision) AS default_cost
   FROM (pc_items
     JOIN pc_category ON ((pc_items.pc_category_id = pc_category.pc_category_id)));


ALTER TABLE public.vw_pc_items OWNER TO postgres;

--
-- Name: vw_pc_budget; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_pc_budget AS
 SELECT vw_pc_allocations.fiscal_year_id,
    vw_pc_allocations.fiscal_year_start,
    vw_pc_allocations.fiscal_year_end,
    vw_pc_allocations.year_opened,
    vw_pc_allocations.year_closed,
    vw_pc_allocations.period_id,
    vw_pc_allocations.start_date,
    vw_pc_allocations.end_date,
    vw_pc_allocations.opened,
    vw_pc_allocations.closed,
    vw_pc_allocations.month_id,
    vw_pc_allocations.period_year,
    vw_pc_allocations.period_month,
    vw_pc_allocations.quarter,
    vw_pc_allocations.semister,
    vw_pc_allocations.department_id,
    vw_pc_allocations.department_name,
    vw_pc_allocations.pc_allocation_id,
    vw_pc_allocations.narrative,
    vw_pc_allocations.approve_status,
    vw_pc_items.pc_category_id,
    vw_pc_items.pc_category_name,
    vw_pc_items.pc_item_id,
    vw_pc_items.pc_item_name,
    vw_pc_items.default_price,
    vw_pc_items.default_units,
    vw_pc_items.default_cost,
    pc_budget.org_id,
    pc_budget.pc_budget_id,
    pc_budget.budget_units,
    pc_budget.budget_price,
    ((pc_budget.budget_units)::double precision * pc_budget.budget_price) AS budget_cost,
    pc_budget.details
   FROM ((pc_budget
     JOIN vw_pc_allocations ON ((pc_budget.pc_allocation_id = vw_pc_allocations.pc_allocation_id)))
     JOIN vw_pc_items ON ((pc_budget.pc_item_id = vw_pc_items.pc_item_id)));


ALTER TABLE public.vw_pc_budget OWNER TO postgres;

--
-- Name: vw_pc_expenditure; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_pc_expenditure AS
 SELECT vw_pc_allocations.fiscal_year_id,
    vw_pc_allocations.fiscal_year_start,
    vw_pc_allocations.fiscal_year_end,
    vw_pc_allocations.year_opened,
    vw_pc_allocations.year_closed,
    vw_pc_allocations.period_id,
    vw_pc_allocations.start_date,
    vw_pc_allocations.end_date,
    vw_pc_allocations.opened,
    vw_pc_allocations.closed,
    vw_pc_allocations.month_id,
    vw_pc_allocations.period_year,
    vw_pc_allocations.period_month,
    vw_pc_allocations.quarter,
    vw_pc_allocations.semister,
    vw_pc_allocations.department_id,
    vw_pc_allocations.department_name,
    vw_pc_allocations.pc_allocation_id,
    vw_pc_allocations.narrative,
    vw_pc_items.pc_category_id,
    vw_pc_items.pc_category_name,
    vw_pc_items.pc_item_id,
    vw_pc_items.pc_item_name,
    vw_pc_items.default_price,
    vw_pc_items.default_units,
    vw_pc_items.default_cost,
    pc_types.pc_type_id,
    pc_types.pc_type_name,
    entitys.entity_id,
    entitys.entity_name,
    pc_expenditure.org_id,
    pc_expenditure.pc_expenditure_id,
    pc_expenditure.units,
    pc_expenditure.unit_price,
    pc_expenditure.receipt_number,
    pc_expenditure.exp_date,
    pc_expenditure.is_request,
    pc_expenditure.request_date,
    ((pc_expenditure.units)::double precision * pc_expenditure.unit_price) AS items_cost,
    pc_expenditure.application_date,
    pc_expenditure.approve_status,
    pc_expenditure.workflow_table_id,
    pc_expenditure.action_date,
    pc_expenditure.details
   FROM ((((pc_expenditure
     JOIN vw_pc_allocations ON ((pc_expenditure.pc_allocation_id = vw_pc_allocations.pc_allocation_id)))
     JOIN vw_pc_items ON ((pc_expenditure.pc_item_id = vw_pc_items.pc_item_id)))
     JOIN pc_types ON ((pc_expenditure.pc_type_id = pc_types.pc_type_id)))
     LEFT JOIN entitys ON ((pc_expenditure.entity_id = entitys.entity_id)));


ALTER TABLE public.vw_pc_expenditure OWNER TO postgres;

--
-- Name: vw_period_loans; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_period_loans AS
 SELECT vw_loan_monthly.org_id,
    vw_loan_monthly.period_id,
    sum(vw_loan_monthly.interest_amount) AS sum_interest_amount,
    sum(vw_loan_monthly.repayment) AS sum_repayment,
    sum(vw_loan_monthly.penalty) AS sum_penalty,
    sum(vw_loan_monthly.penalty_paid) AS sum_penalty_paid,
    sum(vw_loan_monthly.interest_paid) AS sum_interest_paid,
    sum(vw_loan_monthly.loan_balance) AS sum_loan_balance
   FROM vw_loan_monthly
  GROUP BY vw_loan_monthly.org_id, vw_loan_monthly.period_id;


ALTER TABLE public.vw_period_loans OWNER TO postgres;

--
-- Name: vw_period_month; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_period_month AS
 SELECT vw_periods.org_id,
    vw_periods.month_id,
    vw_periods.period_year,
    vw_periods.period_month
   FROM vw_periods
  GROUP BY vw_periods.org_id, vw_periods.month_id, vw_periods.period_year, vw_periods.period_month
  ORDER BY vw_periods.month_id, vw_periods.period_year, vw_periods.period_month;


ALTER TABLE public.vw_period_month OWNER TO postgres;

--
-- Name: vw_period_quarter; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_period_quarter AS
 SELECT vw_periods.org_id,
    vw_periods.quarter
   FROM vw_periods
  GROUP BY vw_periods.org_id, vw_periods.quarter
  ORDER BY vw_periods.quarter;


ALTER TABLE public.vw_period_quarter OWNER TO postgres;

--
-- Name: vw_period_semister; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_period_semister AS
 SELECT vw_periods.org_id,
    vw_periods.semister
   FROM vw_periods
  GROUP BY vw_periods.org_id, vw_periods.semister
  ORDER BY vw_periods.semister;


ALTER TABLE public.vw_period_semister OWNER TO postgres;

--
-- Name: vw_period_tax_rates; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_period_tax_rates AS
 SELECT period_tax_types.period_tax_type_id,
    period_tax_types.period_tax_type_name,
    period_tax_types.tax_type_id,
    period_tax_types.period_id,
    period_tax_rates.period_tax_rate_id,
    gettaxmin(period_tax_rates.tax_range, period_tax_types.period_tax_type_id) AS min_range,
    period_tax_rates.org_id,
    period_tax_rates.tax_range AS max_range,
    period_tax_rates.tax_rate,
    period_tax_rates.narrative
   FROM (period_tax_rates
     JOIN period_tax_types ON ((period_tax_rates.period_tax_type_id = period_tax_types.period_tax_type_id)));


ALTER TABLE public.vw_period_tax_rates OWNER TO postgres;

--
-- Name: vw_period_tax_types; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_period_tax_types AS
 SELECT vw_periods.period_id,
    vw_periods.start_date,
    vw_periods.end_date,
    vw_periods.overtime_rate,
    vw_periods.activated,
    vw_periods.closed,
    vw_periods.month_id,
    vw_periods.period_year,
    vw_periods.period_month,
    vw_periods.quarter,
    vw_periods.semister,
    tax_types.tax_type_id,
    tax_types.tax_type_name,
    period_tax_types.period_tax_type_id,
    tax_types.tax_type_number,
    use_keys.use_key_id,
    use_keys.use_key_name,
    use_keys.use_function,
    period_tax_types.period_tax_type_name,
    period_tax_types.org_id,
    period_tax_types.pay_date,
    period_tax_types.tax_relief,
    period_tax_types.linear,
    period_tax_types.percentage,
    period_tax_types.formural,
    period_tax_types.details
   FROM (((period_tax_types
     JOIN vw_periods ON ((period_tax_types.period_id = vw_periods.period_id)))
     JOIN tax_types ON ((period_tax_types.tax_type_id = tax_types.tax_type_id)))
     JOIN use_keys ON ((tax_types.use_key_id = use_keys.use_key_id)));


ALTER TABLE public.vw_period_tax_types OWNER TO postgres;

--
-- Name: vw_period_year; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_period_year AS
 SELECT vw_periods.org_id,
    vw_periods.period_year
   FROM vw_periods
  GROUP BY vw_periods.org_id, vw_periods.period_year
  ORDER BY vw_periods.period_year;


ALTER TABLE public.vw_period_year OWNER TO postgres;

--
-- Name: vw_projects; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_projects AS
 SELECT entitys.entity_id AS client_id,
    entitys.entity_name AS client_name,
    project_types.project_type_id,
    project_types.project_type_name,
    projects.org_id,
    projects.project_id,
    projects.project_name,
    projects.signed,
    projects.contract_ref,
    projects.monthly_amount,
    projects.full_amount,
    projects.project_cost,
    projects.narrative,
    projects.start_date,
    projects.ending_date,
    projects.project_account,
    projects.details
   FROM ((projects
     JOIN entitys ON ((projects.entity_id = entitys.entity_id)))
     JOIN project_types ON ((projects.project_type_id = project_types.project_type_id)));


ALTER TABLE public.vw_projects OWNER TO postgres;

--
-- Name: vw_phases; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_phases AS
 SELECT vw_projects.client_id,
    vw_projects.client_name,
    vw_projects.project_type_id,
    vw_projects.project_type_name,
    vw_projects.project_id,
    vw_projects.project_name,
    vw_projects.signed,
    vw_projects.contract_ref,
    vw_projects.monthly_amount,
    vw_projects.full_amount,
    vw_projects.project_cost,
    vw_projects.narrative,
    vw_projects.start_date,
    vw_projects.ending_date,
    phases.org_id,
    phases.phase_id,
    phases.phase_name,
    phases.start_date AS phase_start_date,
    phases.end_date AS phase_end_date,
    phases.completed AS phase_completed,
    phases.phase_cost,
    phases.details
   FROM (phases
     JOIN vw_projects ON ((phases.project_id = vw_projects.project_id)));


ALTER TABLE public.vw_phases OWNER TO postgres;

--
-- Name: vw_product_receipts; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_product_receipts AS
 SELECT orgs.org_id,
    orgs.org_name,
    receipt_sources.receipt_source_id,
    receipt_sources.receipt_source_name,
    product_receipts.product_receipt_id,
    product_receipts.is_paid,
    product_receipts.receipt_amount,
    product_receipts.receipt_date,
    product_receipts.receipt_time,
    product_receipts.receipt_reference,
    product_receipts.narrative
   FROM ((product_receipts
     JOIN orgs ON ((product_receipts.org_id = orgs.org_id)))
     JOIN receipt_sources ON ((product_receipts.receipt_source_id = receipt_sources.receipt_source_id)));


ALTER TABLE public.vw_product_receipts OWNER TO postgres;

--
-- Name: vw_productions; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_productions AS
 SELECT orgs.org_id,
    orgs.org_name,
    products.product_id,
    products.product_name,
    products.is_montly_bill,
    products.montly_cost,
    products.is_annual_bill,
    products.annual_cost,
    productions.production_id,
    productions.transaction_time,
    productions.montly_billing,
    productions.is_renewed,
    productions.quantity,
    productions.price,
    productions.expiry_date,
    productions.auto_renew,
    productions.details,
    (productions.price * (productions.quantity)::double precision) AS amount
   FROM ((productions
     JOIN orgs ON ((productions.org_id = orgs.org_id)))
     JOIN products ON ((productions.product_id = products.product_id)));


ALTER TABLE public.vw_productions OWNER TO postgres;

--
-- Name: vw_project_cost; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_project_cost AS
 SELECT vw_phases.client_id,
    vw_phases.client_name,
    vw_phases.project_type_id,
    vw_phases.project_type_name,
    vw_phases.project_id,
    vw_phases.project_name,
    vw_phases.signed,
    vw_phases.contract_ref,
    vw_phases.monthly_amount,
    vw_phases.full_amount,
    vw_phases.project_cost,
    vw_phases.narrative,
    vw_phases.start_date,
    vw_phases.ending_date,
    vw_phases.phase_id,
    vw_phases.phase_name,
    vw_phases.phase_start_date,
    vw_phases.phase_end_date,
    vw_phases.phase_cost,
    project_cost.org_id,
    project_cost.project_cost_id,
    project_cost.project_cost_name,
    project_cost.amount,
    project_cost.cost_date,
    project_cost.cost_approved,
    project_cost.details
   FROM (project_cost
     JOIN vw_phases ON ((project_cost.phase_id = vw_phases.phase_id)));


ALTER TABLE public.vw_project_cost OWNER TO postgres;

--
-- Name: vw_project_staff; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_project_staff AS
 SELECT vw_projects.client_id,
    vw_projects.client_name,
    vw_projects.project_type_id,
    vw_projects.project_type_name,
    vw_projects.project_id,
    vw_projects.project_name,
    vw_projects.signed,
    vw_projects.contract_ref,
    vw_projects.monthly_amount,
    vw_projects.full_amount,
    vw_projects.project_cost,
    vw_projects.narrative,
    vw_projects.project_account,
    vw_projects.start_date,
    vw_projects.ending_date,
    entitys.entity_id AS staff_id,
    entitys.entity_name AS staff_name,
    project_staff.org_id,
    project_staff.project_staff_id,
    project_staff.project_role,
    project_staff.is_active,
    project_staff.payroll_ps,
    project_staff.monthly_cost,
    project_staff.staff_cost,
    project_staff.tax_cost,
    project_staff.details
   FROM ((project_staff
     JOIN entitys ON ((project_staff.entity_id = entitys.entity_id)))
     JOIN vw_projects ON ((project_staff.project_id = vw_projects.project_id)));


ALTER TABLE public.vw_project_staff OWNER TO postgres;

--
-- Name: vw_project_staff_adjustments; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_project_staff_adjustments AS
 SELECT vw_employee_month.employee_month_id,
    vw_employee_month.period_id,
    vw_employee_month.start_date,
    vw_employee_month.month_id,
    vw_employee_month.period_year,
    vw_employee_month.period_month,
    vw_employee_month.end_date,
    vw_employee_month.entity_id,
    vw_employee_month.entity_name,
    vw_employee_month.employee_id,
    adjustments.adjustment_id,
    adjustments.adjustment_name,
    adjustments.adjustment_type,
    adjustments.account_number,
    adjustments.earning_code,
    currency.currency_id,
    currency.currency_name,
    currency.currency_symbol,
    employee_adjustments.org_id,
    employee_adjustments.employee_adjustment_id,
    employee_adjustments.pay_date,
    employee_adjustments.amount,
    employee_adjustments.in_payroll,
    employee_adjustments.in_tax,
    employee_adjustments.visible,
    employee_adjustments.exchange_rate,
    employee_adjustments.paid_amount,
    employee_adjustments.balance,
    employee_adjustments.narrative,
    employee_adjustments.tax_relief_amount,
    projects.project_id,
    projects.project_name,
    projects.project_account,
    project_staff_costs.project_staff_cost_id,
    project_staff_costs.project_role,
    project_staff_costs.payroll_ps,
    project_staff_costs.staff_cost,
    project_staff_costs.tax_cost,
    (employee_adjustments.exchange_rate * employee_adjustments.amount) AS base_amount,
    (((employee_adjustments.exchange_rate * employee_adjustments.amount) * project_staff_costs.payroll_ps) / (100)::double precision) AS project_amount
   FROM (((((employee_adjustments
     JOIN adjustments ON ((employee_adjustments.adjustment_id = adjustments.adjustment_id)))
     JOIN vw_employee_month ON ((employee_adjustments.employee_month_id = vw_employee_month.employee_month_id)))
     JOIN currency ON ((adjustments.currency_id = currency.currency_id)))
     JOIN project_staff_costs ON ((vw_employee_month.employee_month_id = project_staff_costs.employee_month_id)))
     JOIN projects ON ((project_staff_costs.project_id = projects.project_id)));


ALTER TABLE public.vw_project_staff_adjustments OWNER TO postgres;

--
-- Name: vw_project_staff_costs; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_project_staff_costs AS
 SELECT vw_employee_month.employee_month_id,
    vw_employee_month.period_id,
    vw_employee_month.start_date,
    vw_employee_month.month_id,
    vw_employee_month.period_year,
    vw_employee_month.period_month,
    vw_employee_month.end_date,
    vw_employee_month.gl_payroll_account,
    vw_employee_month.entity_id,
    vw_employee_month.entity_name,
    vw_employee_month.employee_id,
    projects.project_id,
    projects.project_name,
    projects.project_account,
    project_staff_costs.org_id,
    project_staff_costs.project_staff_cost_id,
    project_staff_costs.project_role,
    project_staff_costs.payroll_ps,
    project_staff_costs.staff_cost,
    project_staff_costs.tax_cost,
    project_staff_costs.details
   FROM ((project_staff_costs
     JOIN vw_employee_month ON ((project_staff_costs.employee_month_id = vw_employee_month.employee_month_id)))
     JOIN projects ON ((project_staff_costs.project_id = projects.project_id)));


ALTER TABLE public.vw_project_staff_costs OWNER TO postgres;

--
-- Name: vw_quotations; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_quotations AS
 SELECT entitys.entity_id,
    entitys.entity_name,
    items.item_id,
    items.item_name,
    quotations.quotation_id,
    quotations.org_id,
    quotations.active,
    quotations.amount,
    quotations.valid_from,
    quotations.valid_to,
    quotations.lead_time,
    quotations.details
   FROM ((quotations
     JOIN entitys ON ((quotations.entity_id = entitys.entity_id)))
     JOIN items ON ((quotations.item_id = items.item_id)));


ALTER TABLE public.vw_quotations OWNER TO postgres;

--
-- Name: vw_referees; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_referees AS
 SELECT sys_countrys.sys_country_id,
    sys_countrys.sys_country_name,
    address.address_id,
    address.org_id,
    address.address_name,
    address.table_name,
    address.table_id,
    address.post_office_box,
    address.postal_code,
    address.premises,
    address.street,
    address.town,
    address.phone_number,
    address.extension,
    address.mobile,
    address.fax,
    address.email,
    address.is_default,
    address.website,
    address.company_name,
    address.position_held,
    address.details
   FROM (address
     JOIN sys_countrys ON ((address.sys_country_id = sys_countrys.sys_country_id)))
  WHERE ((address.table_name)::text = 'referees'::text);


ALTER TABLE public.vw_referees OWNER TO postgres;

--
-- Name: vw_reporting; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_reporting AS
 SELECT entitys.entity_id,
    entitys.entity_name,
    rpt.entity_id AS rpt_id,
    rpt.entity_name AS rpt_name,
    reporting.org_id,
    reporting.reporting_id,
    reporting.date_from,
    reporting.date_to,
    reporting.primary_report,
    reporting.is_active,
    reporting.ps_reporting,
    reporting.reporting_level,
    reporting.details
   FROM ((reporting
     JOIN entitys ON ((reporting.entity_id = entitys.entity_id)))
     JOIN entitys rpt ON ((reporting.report_to_id = rpt.entity_id)));


ALTER TABLE public.vw_reporting OWNER TO postgres;

--
-- Name: vw_review_reporting; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_review_reporting AS
 SELECT entitys.entity_id,
    entitys.entity_name,
    rpt.entity_id AS rpt_id,
    rpt.entity_name AS rpt_name,
    reporting.reporting_id,
    reporting.date_from,
    reporting.date_to,
    reporting.primary_report,
    reporting.is_active,
    reporting.ps_reporting,
    reporting.reporting_level,
    job_reviews.job_review_id,
    job_reviews.total_points,
    job_reviews.org_id,
    job_reviews.review_date,
    job_reviews.review_done,
    job_reviews.approve_status,
    job_reviews.workflow_table_id,
    job_reviews.application_date,
    job_reviews.action_date,
    job_reviews.recomendation,
    job_reviews.reviewer_comments,
    job_reviews.pl_comments,
    date_part('year'::text, job_reviews.review_date) AS review_year
   FROM (((reporting
     JOIN entitys ON ((reporting.entity_id = entitys.entity_id)))
     JOIN entitys rpt ON ((reporting.report_to_id = rpt.entity_id)))
     JOIN job_reviews ON ((reporting.entity_id = job_reviews.entity_id)));


ALTER TABLE public.vw_review_reporting OWNER TO postgres;

--
-- Name: vw_shifts; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_shifts AS
 SELECT projects.project_id,
    projects.project_name,
    shifts.org_id,
    shifts.shift_id,
    shifts.shift_name,
    shifts.shift_hours,
    shifts.include_holiday,
    shifts.include_mon,
    shifts.include_tue,
    shifts.include_wed,
    shifts.include_thu,
    shifts.include_fri,
    shifts.include_sat,
    shifts.include_sun,
    shifts.time_in,
    shifts.time_out,
    shifts.details
   FROM (shifts
     LEFT JOIN projects ON ((shifts.project_id = projects.project_id)));


ALTER TABLE public.vw_shifts OWNER TO postgres;

--
-- Name: vw_shift_schedule; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_shift_schedule AS
 SELECT vw_shifts.project_id,
    vw_shifts.project_name,
    vw_shifts.shift_id,
    vw_shifts.shift_name,
    vw_shifts.shift_hours,
    vw_shifts.include_holiday,
    vw_shifts.include_mon,
    vw_shifts.include_tue,
    vw_shifts.include_wed,
    vw_shifts.include_thu,
    vw_shifts.include_fri,
    vw_shifts.include_sat,
    vw_shifts.include_sun,
    vw_shifts.time_in,
    vw_shifts.time_out,
    entitys.entity_id,
    entitys.entity_name,
    shift_schedule.org_id,
    shift_schedule.shift_schedule_id,
    shift_schedule.is_active,
    shift_schedule.details
   FROM ((shift_schedule
     JOIN vw_shifts ON ((shift_schedule.shift_id = vw_shifts.shift_id)))
     JOIN entitys ON ((shift_schedule.entity_id = entitys.entity_id)));


ALTER TABLE public.vw_shift_schedule OWNER TO postgres;

--
-- Name: vw_skill_types; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_skill_types AS
 SELECT skill_category.skill_category_id,
    skill_category.skill_category_name,
    skill_types.skill_type_id,
    skill_types.org_id,
    skill_types.skill_type_name,
    skill_types.basic,
    skill_types.intermediate,
    skill_types.advanced,
    skill_types.details
   FROM (skill_types
     JOIN skill_category ON ((skill_types.skill_category_id = skill_category.skill_category_id)));


ALTER TABLE public.vw_skill_types OWNER TO postgres;

--
-- Name: vw_skills; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_skills AS
 SELECT vw_skill_types.skill_category_id,
    vw_skill_types.skill_category_name,
    vw_skill_types.skill_type_id,
    vw_skill_types.basic,
    vw_skill_types.intermediate,
    vw_skill_types.advanced,
    entitys.entity_id,
    entitys.entity_name,
    skills.skill_id,
    skills.skill_level,
    skills.aquired,
    skills.training_date,
    skills.org_id,
    skills.trained,
    skills.training_institution,
    skills.training_cost,
    skills.details,
        CASE
            WHEN (vw_skill_types.skill_type_id = 0) THEN skills.state_skill
            ELSE vw_skill_types.skill_type_name
        END AS skill_type_name,
        CASE
            WHEN (skills.skill_level = 1) THEN 'Basic'::text
            WHEN (skills.skill_level = 2) THEN 'Intermediate'::text
            WHEN (skills.skill_level = 3) THEN 'Advanced'::text
            ELSE 'None'::text
        END AS skill_level_name,
        CASE
            WHEN (skills.skill_level = 1) THEN vw_skill_types.basic
            WHEN (skills.skill_level = 2) THEN vw_skill_types.intermediate
            WHEN (skills.skill_level = 3) THEN vw_skill_types.advanced
            ELSE 'None'::character varying
        END AS skill_level_details
   FROM ((skills
     JOIN entitys ON ((skills.entity_id = entitys.entity_id)))
     JOIN vw_skill_types ON ((skills.skill_type_id = vw_skill_types.skill_type_id)));


ALTER TABLE public.vw_skills OWNER TO postgres;

--
-- Name: vw_stocks; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_stocks AS
 SELECT stores.store_id,
    stores.store_name,
    stocks.stock_id,
    stocks.org_id,
    stocks.stock_name,
    stocks.stock_take_date,
    stocks.details
   FROM (stocks
     JOIN stores ON ((stocks.store_id = stores.store_id)));


ALTER TABLE public.vw_stocks OWNER TO postgres;

--
-- Name: vw_stock_lines; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_stock_lines AS
 SELECT vw_stocks.stock_id,
    vw_stocks.stock_name,
    vw_stocks.stock_take_date,
    vw_stocks.store_id,
    vw_stocks.store_name,
    items.item_id,
    items.item_name,
    stock_lines.stock_line_id,
    stock_lines.org_id,
    stock_lines.quantity,
    stock_lines.narrative
   FROM ((stock_lines
     JOIN vw_stocks ON ((stock_lines.stock_id = vw_stocks.stock_id)))
     JOIN items ON ((stock_lines.item_id = items.item_id)));


ALTER TABLE public.vw_stock_lines OWNER TO postgres;

--
-- Name: vw_sub_fields; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_sub_fields AS
 SELECT vw_fields.form_id,
    vw_fields.form_name,
    vw_fields.field_id,
    sub_fields.sub_field_id,
    sub_fields.org_id,
    sub_fields.sub_field_order,
    sub_fields.sub_title_share,
    sub_fields.sub_field_type,
    sub_fields.sub_field_lookup,
    sub_fields.sub_field_size,
    sub_fields.sub_col_spans,
    sub_fields.manditory,
    sub_fields.question
   FROM (sub_fields
     JOIN vw_fields ON ((sub_fields.field_id = vw_fields.field_id)));


ALTER TABLE public.vw_sub_fields OWNER TO postgres;

--
-- Name: vw_subscriptions; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_subscriptions AS
 SELECT industry.industry_id,
    industry.industry_name,
    sys_countrys.sys_country_id,
    sys_countrys.sys_country_name,
    entitys.entity_id,
    entitys.entity_name,
    account_manager.entity_id AS account_manager_id,
    account_manager.entity_name AS account_manager_name,
    orgs.org_id,
    orgs.org_name,
    subscriptions.subscription_id,
    subscriptions.business_name,
    subscriptions.business_address,
    subscriptions.city,
    subscriptions.state,
    subscriptions.country_id,
    subscriptions.number_of_employees,
    subscriptions.telephone,
    subscriptions.website,
    subscriptions.primary_contact,
    subscriptions.job_title,
    subscriptions.primary_email,
    subscriptions.approve_status,
    subscriptions.workflow_table_id,
    subscriptions.application_date,
    subscriptions.action_date,
    subscriptions.system_key,
    subscriptions.subscribed,
    subscriptions.subscribed_date,
    subscriptions.details
   FROM (((((subscriptions
     JOIN industry ON ((subscriptions.industry_id = industry.industry_id)))
     JOIN sys_countrys ON ((subscriptions.country_id = sys_countrys.sys_country_id)))
     LEFT JOIN entitys ON ((subscriptions.entity_id = entitys.entity_id)))
     LEFT JOIN entitys account_manager ON ((subscriptions.account_manager_id = account_manager.entity_id)))
     LEFT JOIN orgs ON ((subscriptions.org_id = orgs.org_id)));


ALTER TABLE public.vw_subscriptions OWNER TO postgres;

--
-- Name: vw_sun_ledger_trx; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_sun_ledger_trx AS
 SELECT b.org_id,
    b.period_id,
    b.end_date,
    b.entity_id,
    b.gl_payroll_account,
    b.description,
    b.department_account,
    b.employee_id,
    b.function_code,
    b.description2,
    round((b.amount)::numeric, 1) AS gl_amount,
    b.debit_credit,
    ((((((b.period_id)::character varying)::text || '.'::text) || ((b.entity_id)::character varying)::text) || '.'::text) || (COALESCE(b.gl_payroll_account, ''::character varying))::text) AS sun_ledger_id
   FROM ( SELECT a.org_id,
            a.period_id,
            a.end_date,
            a.entity_id,
            a.gl_payroll_account,
            'Payroll'::character varying AS description,
            d.department_account,
            a.employee_id,
            d.function_code,
            (to_char((a.start_date)::timestamp with time zone, 'Month YYYY'::text) || ' - Basic Pay'::text) AS description2,
            a.basic_pay AS amount,
            'D'::text AS debit_credit
           FROM (vw_employee_month a
             JOIN departments d ON ((a.department_id = d.department_id)))
        UNION
         SELECT a.org_id,
            a.period_id,
            a.end_date,
            a.entity_id,
            a.employee_id,
            a.entity_name,
            ''::character varying,
            ''::character varying,
            ''::character varying,
            (to_char((a.start_date)::timestamp with time zone, 'Month YYYY'::text) || ' - Netpay'::text) AS description2,
            a.net_pay AS amount,
            'C'::text AS debit_credit
           FROM vw_employee_month a
        UNION
         SELECT a.org_id,
            a.period_id,
            a.end_date,
            a.entity_id,
            a.account_number,
            a.adjustment_name,
            a.department_account,
            a.employee_id,
            a.function_code,
            ((to_char((a.start_date)::timestamp with time zone, 'Month YYYY'::text) || ' - '::text) || (a.adjustment_name)::text) AS description2,
            sum(a.amount) AS sum,
            'D'::text AS debit_credit
           FROM vw_employee_adjustments a
          WHERE ((a.visible = true) AND (a.adjustment_type = 1))
          GROUP BY a.org_id, a.period_id, a.end_date, a.entity_id, a.account_number, a.adjustment_name, a.department_account, a.employee_id, a.function_code, a.start_date
        UNION
         SELECT a.org_id,
            a.period_id,
            a.end_date,
            a.entity_id,
            a.account_number,
            a.adjustment_name,
            a.department_account,
            a.employee_id,
            a.function_code,
            ((to_char((a.start_date)::timestamp with time zone, 'Month YYYY'::text) || ' - '::text) || (a.adjustment_name)::text) AS description2,
            sum(a.amount) AS sum,
            'C'::text AS debit_credit
           FROM vw_employee_adjustments a
          WHERE ((a.visible = true) AND (a.adjustment_type = 2))
          GROUP BY a.org_id, a.period_id, a.end_date, a.entity_id, a.account_number, a.adjustment_name, a.department_account, a.employee_id, a.function_code, a.start_date
        UNION
         SELECT a.org_id,
            a.period_id,
            a.end_date,
            a.entity_id,
            a.account_number,
            a.tax_type_name,
            a.department_account,
            a.employee_id,
            a.function_code,
            (((to_char((a.start_date)::timestamp with time zone, 'Month YYYY'::text) || ' - '::text) || (a.tax_type_name)::text) || ' - Deduction'::text),
            ((a.amount + a.additional) + a.employer),
            'C'::text AS debit_credit
           FROM vw_employee_tax_types a
        UNION
         SELECT a.org_id,
            a.period_id,
            a.end_date,
            a.entity_id,
            a.employer_account,
            a.tax_type_name,
            a.department_account,
            a.employee_id,
            a.function_code,
            (((to_char((a.start_date)::timestamp with time zone, 'Month YYYY'::text) || ' - '::text) || (a.tax_type_name)::text) || ' - Contribution'::text),
            a.employer,
            'D'::text AS debit_credit
           FROM vw_employee_tax_types a
          WHERE (a.employer > (0)::double precision)
        UNION
         SELECT a.org_id,
            a.period_id,
            a.end_date,
            a.entity_id,
            a.employee_id,
            a.entity_name,
            ''::character varying,
            ''::character varying,
            ''::character varying,
            (to_char((a.start_date)::timestamp with time zone, 'Month YYYY'::text) || ' - Payroll Banking'::text) AS description2,
            a.banked AS amount,
            'D'::text AS debit_credit
           FROM vw_employee_month a
        UNION
         SELECT a.org_id,
            a.period_id,
            a.end_date,
            a.entity_id,
            a.gl_payment_account,
            'Bank Account'::character varying,
            ''::character varying,
            ''::character varying,
            ''::character varying,
            (to_char((a.start_date)::timestamp with time zone, 'Month YYYY'::text) || ' - Payroll Banking'::text) AS description2,
            a.banked AS amount,
            'C'::text AS debit_credit
           FROM vw_employee_month a) b
  ORDER BY b.gl_payroll_account DESC, b.amount DESC, b.debit_credit DESC;


ALTER TABLE public.vw_sun_ledger_trx OWNER TO postgres;

--
-- Name: vw_sys_countrys; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_sys_countrys AS
 SELECT sys_continents.sys_continent_id,
    sys_continents.sys_continent_name,
    sys_countrys.sys_country_id,
    sys_countrys.sys_country_code,
    sys_countrys.sys_country_number,
    sys_countrys.sys_phone_code,
    sys_countrys.sys_country_name
   FROM (sys_continents
     JOIN sys_countrys ON ((sys_continents.sys_continent_id = sys_countrys.sys_continent_id)));


ALTER TABLE public.vw_sys_countrys OWNER TO postgres;

--
-- Name: vw_sys_emailed; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_sys_emailed AS
 SELECT sys_emails.sys_email_id,
    sys_emails.org_id,
    sys_emails.sys_email_name,
    sys_emails.title,
    sys_emails.details,
    sys_emailed.sys_emailed_id,
    sys_emailed.table_id,
    sys_emailed.table_name,
    sys_emailed.email_type,
    sys_emailed.emailed,
    sys_emailed.narrative
   FROM (sys_emails
     RIGHT JOIN sys_emailed ON ((sys_emails.sys_email_id = sys_emailed.sys_email_id)));


ALTER TABLE public.vw_sys_emailed OWNER TO postgres;

--
-- Name: vw_tasks; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_tasks AS
 SELECT vw_phases.client_id,
    vw_phases.client_name,
    vw_phases.project_type_id,
    vw_phases.project_type_name,
    vw_phases.project_id,
    vw_phases.project_name,
    vw_phases.signed,
    vw_phases.contract_ref,
    vw_phases.monthly_amount,
    vw_phases.full_amount,
    vw_phases.project_cost,
    vw_phases.narrative,
    vw_phases.start_date,
    vw_phases.ending_date,
    vw_phases.phase_id,
    vw_phases.phase_name,
    vw_phases.phase_start_date,
    vw_phases.phase_end_date,
    vw_phases.phase_completed,
    vw_phases.phase_cost,
    entitys.entity_id,
    entitys.entity_name,
    tasks.task_id,
    tasks.task_name,
    tasks.org_id,
    tasks.start_date AS task_start_date,
    tasks.dead_line AS task_dead_line,
    tasks.end_date AS task_end_date,
    tasks.completed AS task_completed,
    tasks.hours_taken,
    tasks.details AS task_details
   FROM ((tasks
     JOIN entitys ON ((tasks.entity_id = entitys.entity_id)))
     JOIN vw_phases ON ((tasks.phase_id = vw_phases.phase_id)));


ALTER TABLE public.vw_tasks OWNER TO postgres;

--
-- Name: vw_tax_rates; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_tax_rates AS
 SELECT tax_types.tax_type_id,
    tax_types.tax_type_name,
    tax_types.tax_relief,
    tax_types.linear,
    tax_types.percentage,
    tax_rates.org_id,
    tax_rates.tax_rate_id,
    tax_rates.tax_range,
    tax_rates.tax_rate,
    tax_rates.narrative
   FROM (tax_rates
     JOIN tax_types ON ((tax_rates.tax_type_id = tax_types.tax_type_id)));


ALTER TABLE public.vw_tax_rates OWNER TO postgres;

--
-- Name: vw_timesheet; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_timesheet AS
 SELECT vw_tasks.client_id,
    vw_tasks.client_name,
    vw_tasks.project_type_id,
    vw_tasks.project_type_name,
    vw_tasks.project_id,
    vw_tasks.project_name,
    vw_tasks.signed,
    vw_tasks.contract_ref,
    vw_tasks.monthly_amount,
    vw_tasks.full_amount,
    vw_tasks.project_cost,
    vw_tasks.narrative,
    vw_tasks.start_date,
    vw_tasks.ending_date,
    vw_tasks.phase_id,
    vw_tasks.phase_name,
    vw_tasks.phase_start_date,
    vw_tasks.phase_end_date,
    vw_tasks.phase_completed,
    vw_tasks.phase_cost,
    vw_tasks.entity_id,
    vw_tasks.entity_name,
    vw_tasks.task_id,
    vw_tasks.task_name,
    vw_tasks.task_start_date,
    vw_tasks.task_dead_line,
    vw_tasks.task_end_date,
    vw_tasks.task_completed,
    timesheet.org_id,
    timesheet.timesheet_id,
    timesheet.ts_date,
    timesheet.ts_start_time,
    timesheet.ts_end_time,
    timesheet.ts_narrative,
    timesheet.details,
    (date_part('hours'::text, (timesheet.ts_end_time - timesheet.ts_start_time)) + (date_part('minutes'::text, (timesheet.ts_end_time - timesheet.ts_start_time)) / (60)::double precision)) AS ts_hours
   FROM (timesheet
     JOIN vw_tasks ON ((timesheet.task_id = vw_tasks.task_id)));


ALTER TABLE public.vw_timesheet OWNER TO postgres;

--
-- Name: vw_transaction_counters; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_transaction_counters AS
 SELECT transaction_types.transaction_type_id,
    transaction_types.transaction_type_name,
    transaction_types.document_prefix,
    transaction_types.for_posting,
    transaction_types.for_sales,
    transaction_counters.org_id,
    transaction_counters.transaction_counter_id,
    transaction_counters.document_number
   FROM (transaction_counters
     JOIN transaction_types ON ((transaction_counters.transaction_type_id = transaction_types.transaction_type_id)));


ALTER TABLE public.vw_transaction_counters OWNER TO postgres;

--
-- Name: vw_transactions; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_transactions AS
 SELECT transaction_types.transaction_type_id,
    transaction_types.transaction_type_name,
    transaction_types.document_prefix,
    transaction_types.for_posting,
    transaction_types.for_sales,
    entitys.entity_id,
    entitys.entity_name,
    entitys.account_id AS entity_account_id,
    currency.currency_id,
    currency.currency_name,
    vw_bank_accounts.bank_id,
    vw_bank_accounts.bank_name,
    vw_bank_accounts.bank_branch_name,
    vw_bank_accounts.account_id AS gl_bank_account_id,
    vw_bank_accounts.bank_account_id,
    vw_bank_accounts.bank_account_name,
    vw_bank_accounts.bank_account_number,
    departments.department_id,
    departments.department_name,
    ledger_types.ledger_type_id,
    ledger_types.ledger_type_name,
    ledger_types.account_id AS ledger_account_id,
    ledger_types.tax_account_id,
    ledger_types.ledger_posting,
    transaction_status.transaction_status_id,
    transaction_status.transaction_status_name,
    transactions.journal_id,
    transactions.transaction_id,
    transactions.org_id,
    transactions.transaction_date,
    transactions.transaction_amount,
    transactions.transaction_tax_amount,
    transactions.application_date,
    transactions.approve_status,
    transactions.workflow_table_id,
    transactions.action_date,
    transactions.narrative,
    transactions.document_number,
    transactions.payment_number,
    transactions.order_number,
    transactions.exchange_rate,
    transactions.payment_terms,
    transactions.job,
    transactions.details,
        CASE
            WHEN (transactions.journal_id IS NULL) THEN 'Not Posted'::text
            ELSE 'Posted'::text
        END AS posted,
        CASE
            WHEN ((((transactions.transaction_type_id = 2) OR (transactions.transaction_type_id = 8)) OR (transactions.transaction_type_id = 10)) OR (transactions.transaction_type_id = 21)) THEN transactions.transaction_amount
            ELSE (0)::real
        END AS debit_amount,
        CASE
            WHEN ((((transactions.transaction_type_id = 5) OR (transactions.transaction_type_id = 7)) OR (transactions.transaction_type_id = 9)) OR (transactions.transaction_type_id = 22)) THEN transactions.transaction_amount
            ELSE (0)::real
        END AS credit_amount
   FROM (((((((transactions
     JOIN transaction_types ON ((transactions.transaction_type_id = transaction_types.transaction_type_id)))
     JOIN transaction_status ON ((transactions.transaction_status_id = transaction_status.transaction_status_id)))
     JOIN currency ON ((transactions.currency_id = currency.currency_id)))
     LEFT JOIN entitys ON ((transactions.entity_id = entitys.entity_id)))
     LEFT JOIN vw_bank_accounts ON ((vw_bank_accounts.bank_account_id = transactions.bank_account_id)))
     LEFT JOIN departments ON ((transactions.department_id = departments.department_id)))
     LEFT JOIN ledger_types ON ((transactions.ledger_type_id = ledger_types.ledger_type_id)));


ALTER TABLE public.vw_transactions OWNER TO postgres;

--
-- Name: vw_transaction_details; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_transaction_details AS
 SELECT vw_transactions.department_id,
    vw_transactions.department_name,
    vw_transactions.transaction_type_id,
    vw_transactions.transaction_type_name,
    vw_transactions.document_prefix,
    vw_transactions.transaction_id,
    vw_transactions.transaction_date,
    vw_transactions.entity_id,
    vw_transactions.entity_name,
    vw_transactions.approve_status,
    vw_transactions.workflow_table_id,
    vw_transactions.currency_name,
    vw_transactions.exchange_rate,
    accounts.account_id,
    accounts.account_name,
    vw_items.item_id,
    vw_items.item_name,
    vw_items.tax_type_id,
    vw_items.tax_account_id,
    vw_items.tax_type_name,
    vw_items.tax_rate,
    vw_items.tax_inclusive,
    vw_items.sales_account_id,
    vw_items.purchase_account_id,
    stores.store_id,
    stores.store_name,
    transaction_details.transaction_detail_id,
    transaction_details.org_id,
    transaction_details.quantity,
    transaction_details.amount,
    transaction_details.tax_amount,
    transaction_details.narrative,
    transaction_details.details,
    COALESCE(transaction_details.narrative, vw_items.item_name) AS item_description,
    ((transaction_details.quantity)::double precision * transaction_details.amount) AS full_amount,
    ((transaction_details.quantity)::double precision * transaction_details.tax_amount) AS full_tax_amount,
    ((transaction_details.quantity)::double precision * (transaction_details.amount + transaction_details.tax_amount)) AS full_total_amount,
        CASE
            WHEN ((vw_transactions.transaction_type_id = 5) OR (vw_transactions.transaction_type_id = 9)) THEN ((transaction_details.quantity)::double precision * transaction_details.tax_amount)
            ELSE (0)::double precision
        END AS tax_debit_amount,
        CASE
            WHEN ((vw_transactions.transaction_type_id = 2) OR (vw_transactions.transaction_type_id = 10)) THEN ((transaction_details.quantity)::double precision * transaction_details.tax_amount)
            ELSE (0)::double precision
        END AS tax_credit_amount,
        CASE
            WHEN ((vw_transactions.transaction_type_id = 5) OR (vw_transactions.transaction_type_id = 9)) THEN ((transaction_details.quantity)::double precision * transaction_details.amount)
            ELSE (0)::double precision
        END AS full_debit_amount,
        CASE
            WHEN ((vw_transactions.transaction_type_id = 2) OR (vw_transactions.transaction_type_id = 10)) THEN ((transaction_details.quantity)::double precision * transaction_details.amount)
            ELSE (0)::double precision
        END AS full_credit_amount,
        CASE
            WHEN ((vw_transactions.transaction_type_id = 2) OR (vw_transactions.transaction_type_id = 9)) THEN vw_items.sales_account_id
            ELSE vw_items.purchase_account_id
        END AS trans_account_id
   FROM ((((transaction_details
     JOIN vw_transactions ON ((transaction_details.transaction_id = vw_transactions.transaction_id)))
     LEFT JOIN vw_items ON ((transaction_details.item_id = vw_items.item_id)))
     LEFT JOIN accounts ON ((transaction_details.account_id = accounts.account_id)))
     LEFT JOIN stores ON ((transaction_details.store_id = stores.store_id)));


ALTER TABLE public.vw_transaction_details OWNER TO postgres;

--
-- Name: vw_trx; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_trx AS
 SELECT vw_orgs.org_id,
    vw_orgs.org_name,
    vw_orgs.is_default AS org_is_default,
    vw_orgs.is_active AS org_is_active,
    vw_orgs.logo AS org_logo,
    vw_orgs.cert_number AS org_cert_number,
    vw_orgs.pin AS org_pin,
    vw_orgs.vat_number AS org_vat_number,
    vw_orgs.invoice_footer AS org_invoice_footer,
    vw_orgs.org_sys_country_id,
    vw_orgs.org_sys_country_name,
    vw_orgs.org_address_id,
    vw_orgs.org_table_name,
    vw_orgs.org_post_office_box,
    vw_orgs.org_postal_code,
    vw_orgs.org_premises,
    vw_orgs.org_street,
    vw_orgs.org_town,
    vw_orgs.org_phone_number,
    vw_orgs.org_extension,
    vw_orgs.org_mobile,
    vw_orgs.org_fax,
    vw_orgs.org_email,
    vw_orgs.org_website,
    vw_entitys.address_id,
    vw_entitys.address_name,
    vw_entitys.sys_country_id,
    vw_entitys.sys_country_name,
    vw_entitys.table_name,
    vw_entitys.is_default,
    vw_entitys.post_office_box,
    vw_entitys.postal_code,
    vw_entitys.premises,
    vw_entitys.street,
    vw_entitys.town,
    vw_entitys.phone_number,
    vw_entitys.extension,
    vw_entitys.mobile,
    vw_entitys.fax,
    vw_entitys.email,
    vw_entitys.website,
    vw_entitys.entity_id,
    vw_entitys.entity_name,
    vw_entitys.user_name,
    vw_entitys.super_user,
    vw_entitys.attention,
    vw_entitys.date_enroled,
    vw_entitys.is_active,
    vw_entitys.entity_type_id,
    vw_entitys.entity_type_name,
    vw_entitys.entity_role,
    vw_entitys.use_key_id,
    transaction_types.transaction_type_id,
    transaction_types.transaction_type_name,
    transaction_types.document_prefix,
    transaction_types.for_sales,
    transaction_types.for_posting,
    transaction_status.transaction_status_id,
    transaction_status.transaction_status_name,
    currency.currency_id,
    currency.currency_name,
    currency.currency_symbol,
    departments.department_id,
    departments.department_name,
    transactions.journal_id,
    transactions.bank_account_id,
    transactions.transaction_id,
    transactions.transaction_date,
    transactions.transaction_amount,
    transactions.application_date,
    transactions.approve_status,
    transactions.workflow_table_id,
    transactions.action_date,
    transactions.narrative,
    transactions.document_number,
    transactions.payment_number,
    transactions.order_number,
    transactions.exchange_rate,
    transactions.payment_terms,
    transactions.job,
    transactions.details,
        CASE
            WHEN (transactions.journal_id IS NULL) THEN 'Not Posted'::text
            ELSE 'Posted'::text
        END AS posted,
        CASE
            WHEN ((((transactions.transaction_type_id = 2) OR (transactions.transaction_type_id = 8)) OR (transactions.transaction_type_id = 10)) OR (transactions.transaction_type_id = 21)) THEN transactions.transaction_amount
            ELSE (0)::real
        END AS debit_amount,
        CASE
            WHEN ((((transactions.transaction_type_id = 5) OR (transactions.transaction_type_id = 7)) OR (transactions.transaction_type_id = 9)) OR (transactions.transaction_type_id = 22)) THEN transactions.transaction_amount
            ELSE (0)::real
        END AS credit_amount
   FROM ((((((transactions
     JOIN transaction_types ON ((transactions.transaction_type_id = transaction_types.transaction_type_id)))
     JOIN vw_orgs ON ((transactions.org_id = vw_orgs.org_id)))
     JOIN transaction_status ON ((transactions.transaction_status_id = transaction_status.transaction_status_id)))
     JOIN currency ON ((transactions.currency_id = currency.currency_id)))
     LEFT JOIN vw_entitys ON ((transactions.entity_id = vw_entitys.entity_id)))
     LEFT JOIN departments ON ((transactions.department_id = departments.department_id)));


ALTER TABLE public.vw_trx OWNER TO postgres;

--
-- Name: vw_trx_sum; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_trx_sum AS
 SELECT transaction_details.transaction_id,
    sum(((transaction_details.quantity)::double precision * transaction_details.amount)) AS total_amount,
    sum(((transaction_details.quantity)::double precision * transaction_details.tax_amount)) AS total_tax_amount,
    sum(((transaction_details.quantity)::double precision * (transaction_details.amount + transaction_details.tax_amount))) AS total_sale_amount
   FROM transaction_details
  GROUP BY transaction_details.transaction_id;


ALTER TABLE public.vw_trx_sum OWNER TO postgres;

--
-- Name: vw_tx_ledger; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_tx_ledger AS
 SELECT ledger_types.ledger_type_id,
    ledger_types.ledger_type_name,
    ledger_types.account_id,
    ledger_types.ledger_posting,
    currency.currency_id,
    currency.currency_name,
    currency.currency_symbol,
    entitys.entity_id,
    entitys.entity_name,
    bank_accounts.bank_account_id,
    bank_accounts.bank_account_name,
    transactions.org_id,
    transactions.transaction_id,
    transactions.journal_id,
    transactions.exchange_rate,
    transactions.tx_type,
    transactions.transaction_date,
    transactions.payment_date,
    transactions.transaction_amount,
    transactions.transaction_tax_amount,
    transactions.reference_number,
    transactions.payment_number,
    transactions.for_processing,
    transactions.completed,
    transactions.is_cleared,
    transactions.application_date,
    transactions.approve_status,
    transactions.workflow_table_id,
    transactions.action_date,
    transactions.narrative,
    transactions.details,
        CASE
            WHEN (transactions.journal_id IS NULL) THEN 'Not Posted'::text
            ELSE 'Posted'::text
        END AS posted,
    to_char((transactions.payment_date)::timestamp with time zone, 'YYYY.MM'::text) AS ledger_period,
    to_char((transactions.payment_date)::timestamp with time zone, 'YYYY'::text) AS ledger_year,
    to_char((transactions.payment_date)::timestamp with time zone, 'Month'::text) AS ledger_month,
    ((transactions.exchange_rate * (transactions.tx_type)::double precision) * transactions.transaction_amount) AS base_amount,
    ((transactions.exchange_rate * (transactions.tx_type)::double precision) * transactions.transaction_tax_amount) AS base_tax_amount,
        CASE
            WHEN (transactions.completed = true) THEN ((transactions.exchange_rate * (transactions.tx_type)::double precision) * transactions.transaction_amount)
            ELSE ((0)::real)::double precision
        END AS base_balance,
        CASE
            WHEN (transactions.is_cleared = true) THEN ((transactions.exchange_rate * (transactions.tx_type)::double precision) * transactions.transaction_amount)
            ELSE ((0)::real)::double precision
        END AS cleared_balance,
        CASE
            WHEN (transactions.tx_type = 1) THEN (transactions.exchange_rate * transactions.transaction_amount)
            ELSE (0)::real
        END AS dr_amount,
        CASE
            WHEN (transactions.tx_type = (-1)) THEN (transactions.exchange_rate * transactions.transaction_amount)
            ELSE (0)::real
        END AS cr_amount
   FROM ((((transactions
     JOIN currency ON ((transactions.currency_id = currency.currency_id)))
     JOIN entitys ON ((transactions.entity_id = entitys.entity_id)))
     LEFT JOIN bank_accounts ON ((transactions.bank_account_id = bank_accounts.bank_account_id)))
     LEFT JOIN ledger_types ON ((transactions.ledger_type_id = ledger_types.ledger_type_id)))
  WHERE (transactions.tx_type IS NOT NULL);


ALTER TABLE public.vw_tx_ledger OWNER TO postgres;

--
-- Name: vw_week_attendance; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_week_attendance AS
 SELECT a.period_id,
    a.start_date,
    a.period_year,
    a.period_month,
    a.period_code,
    a.week_start,
    a.p_week,
    a.org_id,
    a.entity_id,
    a.employee_id,
    a.employee_name,
    a.active,
    pp1.time_in AS mon_time_in,
    pp1.time_out AS mon_time_out,
    (pp1.time_out - pp1.time_in) AS mon_time_diff,
    pp2.time_in AS tue_time_in,
    pp2.time_out AS tue_time_out,
    (pp2.time_out - pp2.time_in) AS tue_time_diff,
    pp3.time_in AS wed_time_in,
    pp3.time_out AS wed_time_out,
    (pp3.time_out - pp3.time_in) AS wed_time_diff,
    pp4.time_in AS thu_time_in,
    pp4.time_out AS thu_time_out,
    (pp4.time_out - pp4.time_in) AS thu_time_diff,
    pp5.time_in AS fri_time_in,
    pp5.time_out AS fri_time_out,
    (pp5.time_out - pp5.time_in) AS fri_time_diff,
        CASE
            WHEN ((pp1.time_in IS NULL) OR (pp1.time_out IS NULL)) THEN 0
            ELSE 1
        END AS mon_count,
        CASE
            WHEN ((pp2.time_in IS NULL) OR (pp2.time_out IS NULL)) THEN 0
            ELSE 1
        END AS tue_count,
        CASE
            WHEN ((pp3.time_in IS NULL) OR (pp3.time_out IS NULL)) THEN 0
            ELSE 1
        END AS wed_count,
        CASE
            WHEN ((pp4.time_in IS NULL) OR (pp4.time_out IS NULL)) THEN 0
            ELSE 1
        END AS thu_count,
        CASE
            WHEN ((pp5.time_in IS NULL) OR (pp5.time_out IS NULL)) THEN 0
            ELSE 1
        END AS fri_count
   FROM (((((vw_employee_periods a
     LEFT JOIN ( SELECT p1.time_in,
            p1.time_out,
            p1.entity_id,
            p1.a_month,
            p1.a_week
           FROM vw_attendance p1
          WHERE (p1.a_dow = (1)::double precision)) pp1 ON ((((a.entity_id = pp1.entity_id) AND (a.period_code = pp1.a_month)) AND (a.p_week = pp1.a_week))))
     LEFT JOIN ( SELECT p2.time_in,
            p2.time_out,
            p2.entity_id,
            p2.a_month,
            p2.a_week
           FROM vw_attendance p2
          WHERE (p2.a_dow = (2)::double precision)) pp2 ON ((((a.entity_id = pp2.entity_id) AND (a.period_code = pp2.a_month)) AND (a.p_week = pp2.a_week))))
     LEFT JOIN ( SELECT p3.time_in,
            p3.time_out,
            p3.entity_id,
            p3.a_month,
            p3.a_week
           FROM vw_attendance p3
          WHERE (p3.a_dow = (1)::double precision)) pp3 ON ((((a.entity_id = pp3.entity_id) AND (a.period_code = pp3.a_month)) AND (a.p_week = pp3.a_week))))
     LEFT JOIN ( SELECT p4.time_in,
            p4.time_out,
            p4.entity_id,
            p4.a_month,
            p4.a_week
           FROM vw_attendance p4
          WHERE (p4.a_dow = (4)::double precision)) pp4 ON ((((a.entity_id = pp4.entity_id) AND (a.period_code = pp4.a_month)) AND (a.p_week = pp4.a_week))))
     LEFT JOIN ( SELECT p5.time_in,
            p5.time_out,
            p5.entity_id,
            p5.a_month,
            p5.a_week
           FROM vw_attendance p5
          WHERE (p5.a_dow = (1)::double precision)) pp5 ON ((((a.entity_id = pp5.entity_id) AND (a.period_code = pp5.a_month)) AND (a.p_week = pp5.a_week))));


ALTER TABLE public.vw_week_attendance OWNER TO postgres;

--
-- Name: vw_workflow_approvals; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_workflow_approvals AS
 SELECT vw_approvals.workflow_id,
    vw_approvals.org_id,
    vw_approvals.workflow_name,
    vw_approvals.approve_email,
    vw_approvals.reject_email,
    vw_approvals.source_entity_id,
    vw_approvals.source_entity_name,
    vw_approvals.table_name,
    vw_approvals.table_id,
    vw_approvals.org_entity_id,
    vw_approvals.org_entity_name,
    vw_approvals.org_user_name,
    vw_approvals.org_primary_email,
    rt.rejected_count,
        CASE
            WHEN (rt.rejected_count IS NULL) THEN ((vw_approvals.workflow_name)::text || ' Approved'::text)
            ELSE ((vw_approvals.workflow_name)::text || ' declined'::text)
        END AS workflow_narrative
   FROM (vw_approvals
     LEFT JOIN ( SELECT approvals.table_id,
            count(approvals.approval_id) AS rejected_count
           FROM approvals
          WHERE (((approvals.approve_status)::text = 'Rejected'::text) AND (approvals.forward_id IS NULL))
          GROUP BY approvals.table_id) rt ON ((vw_approvals.table_id = rt.table_id)))
  GROUP BY vw_approvals.workflow_id, vw_approvals.org_id, vw_approvals.workflow_name, vw_approvals.approve_email, vw_approvals.reject_email, vw_approvals.source_entity_id, vw_approvals.source_entity_name, vw_approvals.table_name, vw_approvals.table_id, vw_approvals.org_entity_id, vw_approvals.org_entity_name, vw_approvals.org_user_name, vw_approvals.org_primary_email, rt.rejected_count;


ALTER TABLE public.vw_workflow_approvals OWNER TO postgres;

--
-- Name: vw_workflow_entitys; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_workflow_entitys AS
 SELECT vw_workflow_phases.workflow_id,
    vw_workflow_phases.org_id,
    vw_workflow_phases.workflow_name,
    vw_workflow_phases.table_name,
    vw_workflow_phases.table_link_id,
    vw_workflow_phases.source_entity_id,
    vw_workflow_phases.source_entity_name,
    vw_workflow_phases.approval_entity_id,
    vw_workflow_phases.approval_entity_name,
    vw_workflow_phases.workflow_phase_id,
    vw_workflow_phases.approval_level,
    vw_workflow_phases.return_level,
    vw_workflow_phases.escalation_days,
    vw_workflow_phases.escalation_hours,
    vw_workflow_phases.notice,
    vw_workflow_phases.notice_email,
    vw_workflow_phases.notice_file,
    vw_workflow_phases.advice,
    vw_workflow_phases.advice_email,
    vw_workflow_phases.advice_file,
    vw_workflow_phases.required_approvals,
    vw_workflow_phases.use_reporting,
    vw_workflow_phases.phase_narrative,
    entity_subscriptions.entity_subscription_id,
    entity_subscriptions.entity_id,
    entity_subscriptions.subscription_level_id
   FROM (vw_workflow_phases
     JOIN entity_subscriptions ON ((vw_workflow_phases.source_entity_id = entity_subscriptions.entity_type_id)));


ALTER TABLE public.vw_workflow_entitys OWNER TO postgres;

--
-- Name: work_rates; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE work_rates (
    work_rate_id integer NOT NULL,
    org_id integer,
    work_rate_name character varying(50),
    work_rate_code character varying(50),
    work_rate real DEFAULT 0 NOT NULL,
    weight_rate real DEFAULT 0 NOT NULL,
    overtime_rate real DEFAULT 0 NOT NULL,
    special_rate real DEFAULT 0 NOT NULL,
    details text
);


ALTER TABLE public.work_rates OWNER TO postgres;

--
-- Name: works; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE works (
    work_id integer NOT NULL,
    day_work_id integer NOT NULL,
    entity_id integer NOT NULL,
    work_rate_id integer NOT NULL,
    org_id integer,
    work_weight real DEFAULT 0 NOT NULL,
    work_pay integer DEFAULT 0 NOT NULL,
    overtime real DEFAULT 0 NOT NULL,
    special_time real DEFAULT 0 NOT NULL,
    work_amount real DEFAULT 0 NOT NULL,
    narrative character varying(320)
);


ALTER TABLE public.works OWNER TO postgres;

--
-- Name: vw_works; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vw_works AS
 SELECT vw_day_works.supervisor_id,
    vw_day_works.supervisor_name,
    vw_day_works.farm_field_id,
    vw_day_works.farm_field_name,
    vw_day_works.period_id,
    vw_day_works.start_date,
    vw_day_works.end_date,
    vw_day_works.activated,
    vw_day_works.closed,
    vw_day_works.month_id,
    vw_day_works.period_year,
    vw_day_works.period_month,
    vw_day_works.quarter,
    vw_day_works.semister,
    vw_day_works.day_work_id,
    vw_day_works.batch_ref,
    vw_day_works.work_date,
    vw_day_works.work_start,
    vw_day_works.work_end,
    vw_day_works.farm_weight,
    vw_day_works.factory_weight,
    entitys.entity_id AS worker_id,
    entitys.entity_name AS worker_name,
    work_rates.work_rate_id,
    work_rates.work_rate_name,
    work_rates.work_rate_code,
    works.org_id,
    works.work_id,
    works.work_weight,
    works.work_pay,
    works.overtime,
    works.special_time,
    works.work_amount,
    works.narrative
   FROM (((works
     JOIN vw_day_works ON ((works.day_work_id = vw_day_works.day_work_id)))
     JOIN entitys ON ((works.entity_id = entitys.entity_id)))
     JOIN work_rates ON ((works.work_rate_id = work_rates.work_rate_id)));


ALTER TABLE public.vw_works OWNER TO postgres;

--
-- Name: vws_pc_expenditure; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vws_pc_expenditure AS
 SELECT a.period_id,
    a.period_year,
    a.period_month,
    a.department_id,
    a.department_name,
    a.pc_allocation_id,
    a.pc_category_id,
    a.pc_category_name,
    a.pc_item_id,
    a.pc_item_name,
    a.sum_units,
    a.avg_unit_price,
    a.sum_items_cost,
    pc_budget.budget_units,
    pc_budget.budget_price,
    ((pc_budget.budget_units)::double precision * pc_budget.budget_price) AS budget_cost,
    (COALESCE(pc_budget.budget_units, 0) - a.sum_units) AS unit_diff,
    (COALESCE(((pc_budget.budget_units)::double precision * pc_budget.budget_price), (0)::double precision) - a.sum_items_cost) AS budget_diff
   FROM (( SELECT vw_pc_expenditure.period_id,
            vw_pc_expenditure.period_year,
            vw_pc_expenditure.period_month,
            vw_pc_expenditure.department_id,
            vw_pc_expenditure.department_name,
            vw_pc_expenditure.pc_allocation_id,
            vw_pc_expenditure.pc_category_id,
            vw_pc_expenditure.pc_category_name,
            vw_pc_expenditure.pc_item_id,
            vw_pc_expenditure.pc_item_name,
            sum(vw_pc_expenditure.units) AS sum_units,
            avg(vw_pc_expenditure.unit_price) AS avg_unit_price,
            sum(((vw_pc_expenditure.units)::double precision * vw_pc_expenditure.unit_price)) AS sum_items_cost
           FROM vw_pc_expenditure
          GROUP BY vw_pc_expenditure.period_id, vw_pc_expenditure.period_year, vw_pc_expenditure.period_month, vw_pc_expenditure.department_id, vw_pc_expenditure.department_name, vw_pc_expenditure.pc_allocation_id, vw_pc_expenditure.pc_category_id, vw_pc_expenditure.pc_category_name, vw_pc_expenditure.pc_item_id, vw_pc_expenditure.pc_item_name) a
     LEFT JOIN pc_budget ON (((a.pc_allocation_id = pc_budget.pc_allocation_id) AND (a.pc_item_id = pc_budget.pc_item_id))));


ALTER TABLE public.vws_pc_expenditure OWNER TO postgres;

--
-- Name: vws_pc_budget_diff; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vws_pc_budget_diff AS
 SELECT a.period_id,
    a.period_year,
    a.period_month,
    a.department_id,
    a.department_name,
    a.pc_allocation_id,
    a.pc_category_id,
    a.pc_category_name,
    a.pc_item_id,
    a.pc_item_name,
    a.sum_units,
    a.avg_unit_price,
    a.sum_items_cost,
    a.budget_units,
    a.budget_price,
    a.budget_cost,
    a.unit_diff,
    a.budget_diff
   FROM vws_pc_expenditure a
UNION
 SELECT a.period_id,
    a.period_year,
    a.period_month,
    a.department_id,
    a.department_name,
    a.pc_allocation_id,
    a.pc_category_id,
    a.pc_category_name,
    a.pc_item_id,
    a.pc_item_name,
    0 AS sum_units,
    0 AS avg_unit_price,
    0 AS sum_items_cost,
    a.budget_units,
    a.budget_price,
    a.budget_cost,
    a.budget_units AS unit_diff,
    a.budget_cost AS budget_diff
   FROM (vw_pc_budget a
     LEFT JOIN pc_expenditure ON (((a.pc_allocation_id = pc_expenditure.pc_allocation_id) AND (a.pc_item_id = pc_expenditure.pc_item_id))))
  WHERE (pc_expenditure.pc_item_id IS NULL);


ALTER TABLE public.vws_pc_budget_diff OWNER TO postgres;

--
-- Name: vws_productions; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vws_productions AS
 SELECT orgs.org_id,
    orgs.org_name,
    products.product_id,
    products.product_name,
    products.is_montly_bill,
    products.montly_cost,
    products.is_annual_bill,
    products.annual_cost,
    products.details,
    productions.is_renewed,
    productions.expiry_date,
    count(productions.production_id) AS count_production,
    sum(productions.quantity) AS sum_quantity,
    sum((productions.price * (productions.quantity)::double precision)) AS amount
   FROM ((productions
     JOIN orgs ON ((productions.org_id = orgs.org_id)))
     JOIN products ON ((productions.product_id = products.product_id)))
  GROUP BY orgs.org_id, orgs.org_name, products.product_id, products.product_name, products.is_montly_bill, products.montly_cost, products.is_annual_bill, products.annual_cost, products.details, productions.is_renewed, productions.expiry_date;


ALTER TABLE public.vws_productions OWNER TO postgres;

--
-- Name: vws_tx_ledger; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW vws_tx_ledger AS
 SELECT vw_tx_ledger.org_id,
    vw_tx_ledger.ledger_period,
    vw_tx_ledger.ledger_year,
    vw_tx_ledger.ledger_month,
    sum(vw_tx_ledger.base_amount) AS sum_base_amount,
    sum(vw_tx_ledger.base_tax_amount) AS sum_base_tax_amount,
    sum(vw_tx_ledger.base_balance) AS sum_base_balance,
    sum(vw_tx_ledger.cleared_balance) AS sum_cleared_balance,
    sum(vw_tx_ledger.dr_amount) AS sum_dr_amount,
    sum(vw_tx_ledger.cr_amount) AS sum_cr_amount,
    to_date((vw_tx_ledger.ledger_period || '.01'::text), 'YYYY.MM.DD'::text) AS start_date,
    (sum(vw_tx_ledger.base_amount) + prev_balance(to_date((vw_tx_ledger.ledger_period || '.01'::text), 'YYYY.MM.DD'::text))) AS prev_balance_amount,
    (sum(vw_tx_ledger.cleared_balance) + prev_clear_balance(to_date((vw_tx_ledger.ledger_period || '.01'::text), 'YYYY.MM.DD'::text))) AS prev_clear_balance_amount
   FROM vw_tx_ledger
  GROUP BY vw_tx_ledger.org_id, vw_tx_ledger.ledger_period, vw_tx_ledger.ledger_year, vw_tx_ledger.ledger_month;


ALTER TABLE public.vws_tx_ledger OWNER TO postgres;

--
-- Name: work_rate_changes; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE work_rate_changes (
    work_rate_change integer NOT NULL,
    work_rate_id integer,
    org_id integer,
    work_rate_name character varying(50),
    work_rate_code character varying(50),
    work_rate real DEFAULT 0 NOT NULL,
    weight_rate real DEFAULT 0 NOT NULL,
    overtime_rate real DEFAULT 0 NOT NULL,
    special_rate real DEFAULT 0 NOT NULL,
    change_date timestamp without time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.work_rate_changes OWNER TO postgres;

--
-- Name: work_rate_changes_work_rate_change_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE work_rate_changes_work_rate_change_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.work_rate_changes_work_rate_change_seq OWNER TO postgres;

--
-- Name: work_rate_changes_work_rate_change_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE work_rate_changes_work_rate_change_seq OWNED BY work_rate_changes.work_rate_change;


--
-- Name: work_rates_work_rate_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE work_rates_work_rate_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.work_rates_work_rate_id_seq OWNER TO postgres;

--
-- Name: work_rates_work_rate_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE work_rates_work_rate_id_seq OWNED BY work_rates.work_rate_id;


--
-- Name: workflow_logs; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE workflow_logs (
    workflow_log_id integer NOT NULL,
    org_id integer,
    table_name character varying(64),
    table_id integer,
    table_old_id integer
);


ALTER TABLE public.workflow_logs OWNER TO postgres;

--
-- Name: workflow_logs_workflow_log_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE workflow_logs_workflow_log_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.workflow_logs_workflow_log_id_seq OWNER TO postgres;

--
-- Name: workflow_logs_workflow_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE workflow_logs_workflow_log_id_seq OWNED BY workflow_logs.workflow_log_id;


--
-- Name: workflow_phases_workflow_phase_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE workflow_phases_workflow_phase_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.workflow_phases_workflow_phase_id_seq OWNER TO postgres;

--
-- Name: workflow_phases_workflow_phase_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE workflow_phases_workflow_phase_id_seq OWNED BY workflow_phases.workflow_phase_id;


--
-- Name: workflow_sql; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE workflow_sql (
    workflow_sql_id integer NOT NULL,
    workflow_phase_id integer NOT NULL,
    org_id integer,
    workflow_sql_name character varying(50),
    is_condition boolean DEFAULT false,
    is_action boolean DEFAULT false,
    message_number character varying(32),
    ca_sql text
);


ALTER TABLE public.workflow_sql OWNER TO postgres;

--
-- Name: workflow_table_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE workflow_table_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.workflow_table_id_seq OWNER TO postgres;

--
-- Name: workflows_workflow_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE workflows_workflow_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.workflows_workflow_id_seq OWNER TO postgres;

--
-- Name: workflows_workflow_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE workflows_workflow_id_seq OWNED BY workflows.workflow_id;


--
-- Name: works_work_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE works_work_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.works_work_id_seq OWNER TO postgres;

--
-- Name: works_work_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE works_work_id_seq OWNED BY works.work_id;


--
-- Name: account_class_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY account_class ALTER COLUMN account_class_id SET DEFAULT nextval('account_class_account_class_id_seq'::regclass);


--
-- Name: account_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY account_types ALTER COLUMN account_type_id SET DEFAULT nextval('account_types_account_type_id_seq'::regclass);


--
-- Name: account_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY accounts ALTER COLUMN account_id SET DEFAULT nextval('accounts_account_id_seq'::regclass);


--
-- Name: address_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY address ALTER COLUMN address_id SET DEFAULT nextval('address_address_id_seq'::regclass);


--
-- Name: address_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY address_types ALTER COLUMN address_type_id SET DEFAULT nextval('address_types_address_type_id_seq'::regclass);


--
-- Name: adjustment_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY adjustments ALTER COLUMN adjustment_id SET DEFAULT nextval('adjustments_adjustment_id_seq'::regclass);


--
-- Name: advance_deduction_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY advance_deductions ALTER COLUMN advance_deduction_id SET DEFAULT nextval('advance_deductions_advance_deduction_id_seq'::regclass);


--
-- Name: amortisation_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY amortisation ALTER COLUMN amortisation_id SET DEFAULT nextval('amortisation_amortisation_id_seq'::regclass);


--
-- Name: application_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY applications ALTER COLUMN application_id SET DEFAULT nextval('applications_application_id_seq'::regclass);


--
-- Name: approval_checklist_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY approval_checklists ALTER COLUMN approval_checklist_id SET DEFAULT nextval('approval_checklists_approval_checklist_id_seq'::regclass);


--
-- Name: approval_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY approvals ALTER COLUMN approval_id SET DEFAULT nextval('approvals_approval_id_seq'::regclass);


--
-- Name: aptitude_grade_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY aptitude_grades ALTER COLUMN aptitude_grade_id SET DEFAULT nextval('aptitude_grades_aptitude_grade_id_seq'::regclass);


--
-- Name: aptitude_ongoing_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY aptitude_ongoing ALTER COLUMN aptitude_ongoing_id SET DEFAULT nextval('aptitude_ongoing_aptitude_ongoing_id_seq'::regclass);


--
-- Name: aptitude_test_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY aptitude_tests ALTER COLUMN aptitude_test_id SET DEFAULT nextval('aptitude_tests_aptitude_test_id_seq'::regclass);


--
-- Name: asset_movement_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY asset_movement ALTER COLUMN asset_movement_id SET DEFAULT nextval('asset_movement_asset_movement_id_seq'::regclass);


--
-- Name: asset_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY asset_types ALTER COLUMN asset_type_id SET DEFAULT nextval('asset_types_asset_type_id_seq'::regclass);


--
-- Name: asset_valuation_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY asset_valuations ALTER COLUMN asset_valuation_id SET DEFAULT nextval('asset_valuations_asset_valuation_id_seq'::regclass);


--
-- Name: asset_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY assets ALTER COLUMN asset_id SET DEFAULT nextval('assets_asset_id_seq'::regclass);


--
-- Name: attendance_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY attendance ALTER COLUMN attendance_id SET DEFAULT nextval('attendance_attendance_id_seq'::regclass);


--
-- Name: bank_account_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY bank_accounts ALTER COLUMN bank_account_id SET DEFAULT nextval('bank_accounts_bank_account_id_seq'::regclass);


--
-- Name: bank_branch_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY bank_branch ALTER COLUMN bank_branch_id SET DEFAULT nextval('bank_branch_bank_branch_id_seq'::regclass);


--
-- Name: bank_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY banks ALTER COLUMN bank_id SET DEFAULT nextval('banks_bank_id_seq'::regclass);


--
-- Name: bidder_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY bidders ALTER COLUMN bidder_id SET DEFAULT nextval('bidders_bidder_id_seq'::regclass);


--
-- Name: bio_imports1_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY bio_imports1 ALTER COLUMN bio_imports1_id SET DEFAULT nextval('bio_imports1_bio_imports1_id_seq'::regclass);


--
-- Name: budget_line_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY budget_lines ALTER COLUMN budget_line_id SET DEFAULT nextval('budget_lines_budget_line_id_seq'::regclass);


--
-- Name: budget_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY budgets ALTER COLUMN budget_id SET DEFAULT nextval('budgets_budget_id_seq'::regclass);


--
-- Name: career_development_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY career_development ALTER COLUMN career_development_id SET DEFAULT nextval('career_development_career_development_id_seq'::regclass);


--
-- Name: case_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY case_types ALTER COLUMN case_type_id SET DEFAULT nextval('case_types_case_type_id_seq'::regclass);


--
-- Name: casual_application_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY casual_application ALTER COLUMN casual_application_id SET DEFAULT nextval('casual_application_casual_application_id_seq'::regclass);


--
-- Name: casual_category_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY casual_category ALTER COLUMN casual_category_id SET DEFAULT nextval('casual_category_casual_category_id_seq'::regclass);


--
-- Name: casual_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY casuals ALTER COLUMN casual_id SET DEFAULT nextval('casuals_casual_id_seq'::regclass);


--
-- Name: checklist_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY checklists ALTER COLUMN checklist_id SET DEFAULT nextval('checklists_checklist_id_seq'::regclass);


--
-- Name: claim_detail_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY claim_details ALTER COLUMN claim_detail_id SET DEFAULT nextval('claim_details_claim_detail_id_seq'::regclass);


--
-- Name: claim_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY claim_types ALTER COLUMN claim_type_id SET DEFAULT nextval('claim_types_claim_type_id_seq'::regclass);


--
-- Name: claim_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY claims ALTER COLUMN claim_id SET DEFAULT nextval('claims_claim_id_seq'::regclass);


--
-- Name: contract_status_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY contract_status ALTER COLUMN contract_status_id SET DEFAULT nextval('contract_status_contract_status_id_seq'::regclass);


--
-- Name: contract_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY contract_types ALTER COLUMN contract_type_id SET DEFAULT nextval('contract_types_contract_type_id_seq'::regclass);


--
-- Name: contract_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY contracts ALTER COLUMN contract_id SET DEFAULT nextval('contracts_contract_id_seq'::regclass);


--
-- Name: currency_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY currency ALTER COLUMN currency_id SET DEFAULT nextval('currency_currency_id_seq'::regclass);


--
-- Name: currency_rate_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY currency_rates ALTER COLUMN currency_rate_id SET DEFAULT nextval('currency_rates_currency_rate_id_seq'::regclass);


--
-- Name: cv_projectid; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY cv_projects ALTER COLUMN cv_projectid SET DEFAULT nextval('cv_projects_cv_projectid_seq'::regclass);


--
-- Name: cv_seminar_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY cv_seminars ALTER COLUMN cv_seminar_id SET DEFAULT nextval('cv_seminars_cv_seminar_id_seq'::regclass);


--
-- Name: day_work_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY day_works ALTER COLUMN day_work_id SET DEFAULT nextval('day_works_day_work_id_seq'::regclass);


--
-- Name: default_account_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY default_accounts ALTER COLUMN default_account_id SET DEFAULT nextval('default_accounts_default_account_id_seq'::regclass);


--
-- Name: default_adjustment_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY default_adjustments ALTER COLUMN default_adjustment_id SET DEFAULT nextval('default_adjustments_default_adjustment_id_seq'::regclass);


--
-- Name: default_banking_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY default_banking ALTER COLUMN default_banking_id SET DEFAULT nextval('default_banking_default_banking_id_seq'::regclass);


--
-- Name: default_tax_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY default_tax_types ALTER COLUMN default_tax_type_id SET DEFAULT nextval('default_tax_types_default_tax_type_id_seq'::regclass);


--
-- Name: define_phase_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY define_phases ALTER COLUMN define_phase_id SET DEFAULT nextval('define_phases_define_phase_id_seq'::regclass);


--
-- Name: define_task_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY define_tasks ALTER COLUMN define_task_id SET DEFAULT nextval('define_tasks_define_task_id_seq'::regclass);


--
-- Name: department_role_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY department_roles ALTER COLUMN department_role_id SET DEFAULT nextval('department_roles_department_role_id_seq'::regclass);


--
-- Name: department_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY departments ALTER COLUMN department_id SET DEFAULT nextval('departments_department_id_seq'::regclass);


--
-- Name: disability_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY disability ALTER COLUMN disability_id SET DEFAULT nextval('disability_disability_id_seq'::regclass);


--
-- Name: education_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY education ALTER COLUMN education_id SET DEFAULT nextval('education_education_id_seq'::regclass);


--
-- Name: education_class_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY education_class ALTER COLUMN education_class_id SET DEFAULT nextval('education_class_education_class_id_seq'::regclass);


--
-- Name: employee_adjustment_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY employee_adjustments ALTER COLUMN employee_adjustment_id SET DEFAULT nextval('employee_adjustments_employee_adjustment_id_seq'::regclass);


--
-- Name: employee_advance_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY employee_advances ALTER COLUMN employee_advance_id SET DEFAULT nextval('employee_advances_employee_advance_id_seq'::regclass);


--
-- Name: employee_banking_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY employee_banking ALTER COLUMN employee_banking_id SET DEFAULT nextval('employee_banking_employee_banking_id_seq'::regclass);


--
-- Name: employee_case_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY employee_cases ALTER COLUMN employee_case_id SET DEFAULT nextval('employee_cases_employee_case_id_seq'::regclass);


--
-- Name: employee_leave_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY employee_leave ALTER COLUMN employee_leave_id SET DEFAULT nextval('employee_leave_employee_leave_id_seq'::regclass);


--
-- Name: employee_leave_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY employee_leave_types ALTER COLUMN employee_leave_type_id SET DEFAULT nextval('employee_leave_types_employee_leave_type_id_seq'::regclass);


--
-- Name: employee_month_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY employee_month ALTER COLUMN employee_month_id SET DEFAULT nextval('employee_month_employee_month_id_seq'::regclass);


--
-- Name: employee_objective_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY employee_objectives ALTER COLUMN employee_objective_id SET DEFAULT nextval('employee_objectives_employee_objective_id_seq'::regclass);


--
-- Name: employee_overtime_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY employee_overtime ALTER COLUMN employee_overtime_id SET DEFAULT nextval('employee_overtime_employee_overtime_id_seq'::regclass);


--
-- Name: employee_per_diem_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY employee_per_diem ALTER COLUMN employee_per_diem_id SET DEFAULT nextval('employee_per_diem_employee_per_diem_id_seq'::regclass);


--
-- Name: employee_tax_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY employee_tax_types ALTER COLUMN employee_tax_type_id SET DEFAULT nextval('employee_tax_types_employee_tax_type_id_seq'::regclass);


--
-- Name: employee_training_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY employee_trainings ALTER COLUMN employee_training_id SET DEFAULT nextval('employee_trainings_employee_training_id_seq'::regclass);


--
-- Name: employment_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY employment ALTER COLUMN employment_id SET DEFAULT nextval('employment_employment_id_seq'::regclass);


--
-- Name: entity_subscription_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY entity_subscriptions ALTER COLUMN entity_subscription_id SET DEFAULT nextval('entity_subscriptions_entity_subscription_id_seq'::regclass);


--
-- Name: entity_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY entity_types ALTER COLUMN entity_type_id SET DEFAULT nextval('entity_types_entity_type_id_seq'::regclass);


--
-- Name: entity_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY entitys ALTER COLUMN entity_id SET DEFAULT nextval('entitys_entity_id_seq'::regclass);


--
-- Name: entry_form_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY entry_forms ALTER COLUMN entry_form_id SET DEFAULT nextval('entry_forms_entry_form_id_seq'::regclass);


--
-- Name: evaluation_point_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY evaluation_points ALTER COLUMN evaluation_point_id SET DEFAULT nextval('evaluation_points_evaluation_point_id_seq'::regclass);


--
-- Name: farm_field_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY farm_fields ALTER COLUMN farm_field_id SET DEFAULT nextval('farm_fields_farm_field_id_seq'::regclass);


--
-- Name: field_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY fields ALTER COLUMN field_id SET DEFAULT nextval('fields_field_id_seq'::regclass);


--
-- Name: fiscal_year_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY fiscal_years ALTER COLUMN fiscal_year_id SET DEFAULT nextval('fiscal_years_fiscal_year_id_seq'::regclass);


--
-- Name: follow_up_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY follow_up ALTER COLUMN follow_up_id SET DEFAULT nextval('follow_up_follow_up_id_seq'::regclass);


--
-- Name: form_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY forms ALTER COLUMN form_id SET DEFAULT nextval('forms_form_id_seq'::regclass);


--
-- Name: gl_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY gls ALTER COLUMN gl_id SET DEFAULT nextval('gls_gl_id_seq'::regclass);


--
-- Name: helpdesk_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY helpdesk ALTER COLUMN helpdesk_id SET DEFAULT nextval('helpdesk_helpdesk_id_seq'::regclass);


--
-- Name: holiday_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY holidays ALTER COLUMN holiday_id SET DEFAULT nextval('holidays_holiday_id_seq'::regclass);


--
-- Name: identification_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY identification_types ALTER COLUMN identification_type_id SET DEFAULT nextval('identification_types_identification_type_id_seq'::regclass);


--
-- Name: identification_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY identifications ALTER COLUMN identification_id SET DEFAULT nextval('identifications_identification_id_seq'::regclass);


--
-- Name: industry_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY industry ALTER COLUMN industry_id SET DEFAULT nextval('industry_industry_id_seq'::regclass);


--
-- Name: intake_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY intake ALTER COLUMN intake_id SET DEFAULT nextval('intake_intake_id_seq'::regclass);


--
-- Name: intern_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY interns ALTER COLUMN intern_id SET DEFAULT nextval('interns_intern_id_seq'::regclass);


--
-- Name: internship_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY internships ALTER COLUMN internship_id SET DEFAULT nextval('internships_internship_id_seq'::regclass);


--
-- Name: item_category_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY item_category ALTER COLUMN item_category_id SET DEFAULT nextval('item_category_item_category_id_seq'::regclass);


--
-- Name: item_unit_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY item_units ALTER COLUMN item_unit_id SET DEFAULT nextval('item_units_item_unit_id_seq'::regclass);


--
-- Name: item_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY items ALTER COLUMN item_id SET DEFAULT nextval('items_item_id_seq'::regclass);


--
-- Name: job_review_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY job_reviews ALTER COLUMN job_review_id SET DEFAULT nextval('job_reviews_job_review_id_seq'::regclass);


--
-- Name: jobs_category_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY jobs_category ALTER COLUMN jobs_category_id SET DEFAULT nextval('jobs_category_jobs_category_id_seq'::regclass);


--
-- Name: journal_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY journals ALTER COLUMN journal_id SET DEFAULT nextval('journals_journal_id_seq'::regclass);


--
-- Name: kin_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY kin_types ALTER COLUMN kin_type_id SET DEFAULT nextval('kin_types_kin_type_id_seq'::regclass);


--
-- Name: kin_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY kins ALTER COLUMN kin_id SET DEFAULT nextval('kins_kin_id_seq'::regclass);


--
-- Name: lead_item_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY lead_items ALTER COLUMN lead_item_id SET DEFAULT nextval('lead_items_lead_item_id_seq'::regclass);


--
-- Name: lead_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY leads ALTER COLUMN lead_id SET DEFAULT nextval('leads_lead_id_seq'::regclass);


--
-- Name: leave_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY leave_types ALTER COLUMN leave_type_id SET DEFAULT nextval('leave_types_leave_type_id_seq'::regclass);


--
-- Name: leave_work_day_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY leave_work_days ALTER COLUMN leave_work_day_id SET DEFAULT nextval('leave_work_days_leave_work_day_id_seq'::regclass);


--
-- Name: ledger_link_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY ledger_links ALTER COLUMN ledger_link_id SET DEFAULT nextval('ledger_links_ledger_link_id_seq'::regclass);


--
-- Name: ledger_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY ledger_types ALTER COLUMN ledger_type_id SET DEFAULT nextval('ledger_types_ledger_type_id_seq'::regclass);


--
-- Name: loan_month_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY loan_monthly ALTER COLUMN loan_month_id SET DEFAULT nextval('loan_monthly_loan_month_id_seq'::regclass);


--
-- Name: loan_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY loan_types ALTER COLUMN loan_type_id SET DEFAULT nextval('loan_types_loan_type_id_seq'::regclass);


--
-- Name: loan_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY loans ALTER COLUMN loan_id SET DEFAULT nextval('loans_loan_id_seq'::regclass);


--
-- Name: location_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY locations ALTER COLUMN location_id SET DEFAULT nextval('locations_location_id_seq'::regclass);


--
-- Name: objective_detail_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY objective_details ALTER COLUMN objective_detail_id SET DEFAULT nextval('objective_details_objective_detail_id_seq'::regclass);


--
-- Name: objective_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY objective_types ALTER COLUMN objective_type_id SET DEFAULT nextval('objective_types_objective_type_id_seq'::regclass);


--
-- Name: objective_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY objectives ALTER COLUMN objective_id SET DEFAULT nextval('objectives_objective_id_seq'::regclass);


--
-- Name: org_event_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY org_events ALTER COLUMN org_event_id SET DEFAULT nextval('org_events_org_event_id_seq'::regclass);


--
-- Name: org_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY orgs ALTER COLUMN org_id SET DEFAULT nextval('orgs_org_id_seq'::regclass);


--
-- Name: pay_group_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY pay_groups ALTER COLUMN pay_group_id SET DEFAULT nextval('pay_groups_pay_group_id_seq'::regclass);


--
-- Name: pay_scale_step_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY pay_scale_steps ALTER COLUMN pay_scale_step_id SET DEFAULT nextval('pay_scale_steps_pay_scale_step_id_seq'::regclass);


--
-- Name: pay_scale_year_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY pay_scale_years ALTER COLUMN pay_scale_year_id SET DEFAULT nextval('pay_scale_years_pay_scale_year_id_seq'::regclass);


--
-- Name: pay_scale_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY pay_scales ALTER COLUMN pay_scale_id SET DEFAULT nextval('pay_scales_pay_scale_id_seq'::regclass);


--
-- Name: pc_allocation_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY pc_allocations ALTER COLUMN pc_allocation_id SET DEFAULT nextval('pc_allocations_pc_allocation_id_seq'::regclass);


--
-- Name: pc_banking_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY pc_banking ALTER COLUMN pc_banking_id SET DEFAULT nextval('pc_banking_pc_banking_id_seq'::regclass);


--
-- Name: pc_budget_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY pc_budget ALTER COLUMN pc_budget_id SET DEFAULT nextval('pc_budget_pc_budget_id_seq'::regclass);


--
-- Name: pc_category_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY pc_category ALTER COLUMN pc_category_id SET DEFAULT nextval('pc_category_pc_category_id_seq'::regclass);


--
-- Name: pc_expenditure_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY pc_expenditure ALTER COLUMN pc_expenditure_id SET DEFAULT nextval('pc_expenditure_pc_expenditure_id_seq'::regclass);


--
-- Name: pc_item_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY pc_items ALTER COLUMN pc_item_id SET DEFAULT nextval('pc_items_pc_item_id_seq'::regclass);


--
-- Name: pc_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY pc_types ALTER COLUMN pc_type_id SET DEFAULT nextval('pc_types_pc_type_id_seq'::regclass);


--
-- Name: pdefinition_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY pdefinitions ALTER COLUMN pdefinition_id SET DEFAULT nextval('pdefinitions_pdefinition_id_seq'::regclass);


--
-- Name: pension_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY pensions ALTER COLUMN pension_id SET DEFAULT nextval('pensions_pension_id_seq'::regclass);


--
-- Name: period_tax_rate_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY period_tax_rates ALTER COLUMN period_tax_rate_id SET DEFAULT nextval('period_tax_rates_period_tax_rate_id_seq'::regclass);


--
-- Name: period_tax_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY period_tax_types ALTER COLUMN period_tax_type_id SET DEFAULT nextval('period_tax_types_period_tax_type_id_seq'::regclass);


--
-- Name: period_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY periods ALTER COLUMN period_id SET DEFAULT nextval('periods_period_id_seq'::regclass);


--
-- Name: phase_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY phases ALTER COLUMN phase_id SET DEFAULT nextval('phases_phase_id_seq'::regclass);


--
-- Name: plevel_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY plevels ALTER COLUMN plevel_id SET DEFAULT nextval('plevels_plevel_id_seq'::regclass);


--
-- Name: product_receipt_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY product_receipts ALTER COLUMN product_receipt_id SET DEFAULT nextval('product_receipts_product_receipt_id_seq'::regclass);


--
-- Name: production_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY productions ALTER COLUMN production_id SET DEFAULT nextval('productions_production_id_seq'::regclass);


--
-- Name: product_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY products ALTER COLUMN product_id SET DEFAULT nextval('products_product_id_seq'::regclass);


--
-- Name: project_cost_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY project_cost ALTER COLUMN project_cost_id SET DEFAULT nextval('project_cost_project_cost_id_seq'::regclass);


--
-- Name: project_staff_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY project_staff ALTER COLUMN project_staff_id SET DEFAULT nextval('project_staff_project_staff_id_seq'::regclass);


--
-- Name: project_staff_cost_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY project_staff_costs ALTER COLUMN project_staff_cost_id SET DEFAULT nextval('project_staff_costs_project_staff_cost_id_seq'::regclass);


--
-- Name: project_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY project_types ALTER COLUMN project_type_id SET DEFAULT nextval('project_types_project_type_id_seq'::regclass);


--
-- Name: project_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY projects ALTER COLUMN project_id SET DEFAULT nextval('projects_project_id_seq'::regclass);


--
-- Name: ptype_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY ptypes ALTER COLUMN ptype_id SET DEFAULT nextval('ptypes_ptype_id_seq'::regclass);


--
-- Name: quotation_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY quotations ALTER COLUMN quotation_id SET DEFAULT nextval('quotations_quotation_id_seq'::regclass);


--
-- Name: receipt_source_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY receipt_sources ALTER COLUMN receipt_source_id SET DEFAULT nextval('receipt_sources_receipt_source_id_seq'::regclass);


--
-- Name: reporting_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reporting ALTER COLUMN reporting_id SET DEFAULT nextval('reporting_reporting_id_seq'::regclass);


--
-- Name: review_category_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY review_category ALTER COLUMN review_category_id SET DEFAULT nextval('review_category_review_category_id_seq'::regclass);


--
-- Name: review_point_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY review_points ALTER COLUMN review_point_id SET DEFAULT nextval('review_points_review_point_id_seq'::regclass);


--
-- Name: shift_schedule_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY shift_schedule ALTER COLUMN shift_schedule_id SET DEFAULT nextval('shift_schedule_shift_schedule_id_seq'::regclass);


--
-- Name: shift_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY shifts ALTER COLUMN shift_id SET DEFAULT nextval('shifts_shift_id_seq'::regclass);


--
-- Name: skill_category_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY skill_category ALTER COLUMN skill_category_id SET DEFAULT nextval('skill_category_skill_category_id_seq'::regclass);


--
-- Name: skill_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY skill_types ALTER COLUMN skill_type_id SET DEFAULT nextval('skill_types_skill_type_id_seq'::regclass);


--
-- Name: skill_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY skills ALTER COLUMN skill_id SET DEFAULT nextval('skills_skill_id_seq'::regclass);


--
-- Name: stock_line_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY stock_lines ALTER COLUMN stock_line_id SET DEFAULT nextval('stock_lines_stock_line_id_seq'::regclass);


--
-- Name: stock_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY stocks ALTER COLUMN stock_id SET DEFAULT nextval('stocks_stock_id_seq'::regclass);


--
-- Name: store_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY stores ALTER COLUMN store_id SET DEFAULT nextval('stores_store_id_seq'::regclass);


--
-- Name: sub_field_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY sub_fields ALTER COLUMN sub_field_id SET DEFAULT nextval('sub_fields_sub_field_id_seq'::regclass);


--
-- Name: subscription_level_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY subscription_levels ALTER COLUMN subscription_level_id SET DEFAULT nextval('subscription_levels_subscription_level_id_seq'::regclass);


--
-- Name: subscription_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY subscriptions ALTER COLUMN subscription_id SET DEFAULT nextval('subscriptions_subscription_id_seq'::regclass);


--
-- Name: sys_audit_trail_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY sys_audit_trail ALTER COLUMN sys_audit_trail_id SET DEFAULT nextval('sys_audit_trail_sys_audit_trail_id_seq'::regclass);


--
-- Name: sys_dashboard_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY sys_dashboard ALTER COLUMN sys_dashboard_id SET DEFAULT nextval('sys_dashboard_sys_dashboard_id_seq'::regclass);


--
-- Name: sys_emailed_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY sys_emailed ALTER COLUMN sys_emailed_id SET DEFAULT nextval('sys_emailed_sys_emailed_id_seq'::regclass);


--
-- Name: sys_email_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY sys_emails ALTER COLUMN sys_email_id SET DEFAULT nextval('sys_emails_sys_email_id_seq'::regclass);


--
-- Name: sys_error_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY sys_errors ALTER COLUMN sys_error_id SET DEFAULT nextval('sys_errors_sys_error_id_seq'::regclass);


--
-- Name: sys_file_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY sys_files ALTER COLUMN sys_file_id SET DEFAULT nextval('sys_files_sys_file_id_seq'::regclass);


--
-- Name: sys_login_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY sys_logins ALTER COLUMN sys_login_id SET DEFAULT nextval('sys_logins_sys_login_id_seq'::regclass);


--
-- Name: sys_menu_msg_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY sys_menu_msg ALTER COLUMN sys_menu_msg_id SET DEFAULT nextval('sys_menu_msg_sys_menu_msg_id_seq'::regclass);


--
-- Name: sys_news_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY sys_news ALTER COLUMN sys_news_id SET DEFAULT nextval('sys_news_sys_news_id_seq'::regclass);


--
-- Name: sys_queries_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY sys_queries ALTER COLUMN sys_queries_id SET DEFAULT nextval('sys_queries_sys_queries_id_seq'::regclass);


--
-- Name: sys_reset_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY sys_reset ALTER COLUMN sys_reset_id SET DEFAULT nextval('sys_reset_sys_reset_id_seq'::regclass);


--
-- Name: task_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tasks ALTER COLUMN task_id SET DEFAULT nextval('tasks_task_id_seq'::regclass);


--
-- Name: tax_rate_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tax_rates ALTER COLUMN tax_rate_id SET DEFAULT nextval('tax_rates_tax_rate_id_seq'::regclass);


--
-- Name: tax_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tax_types ALTER COLUMN tax_type_id SET DEFAULT nextval('tax_types_tax_type_id_seq'::regclass);


--
-- Name: tender_item_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tender_items ALTER COLUMN tender_item_id SET DEFAULT nextval('tender_items_tender_item_id_seq'::regclass);


--
-- Name: tender_type_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tender_types ALTER COLUMN tender_type_id SET DEFAULT nextval('tender_types_tender_type_id_seq'::regclass);


--
-- Name: tender_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tenders ALTER COLUMN tender_id SET DEFAULT nextval('tenders_tender_id_seq'::regclass);


--
-- Name: timesheet_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY timesheet ALTER COLUMN timesheet_id SET DEFAULT nextval('timesheet_timesheet_id_seq'::regclass);


--
-- Name: training_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY trainings ALTER COLUMN training_id SET DEFAULT nextval('trainings_training_id_seq'::regclass);


--
-- Name: transaction_counter_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY transaction_counters ALTER COLUMN transaction_counter_id SET DEFAULT nextval('transaction_counters_transaction_counter_id_seq'::regclass);


--
-- Name: transaction_detail_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY transaction_details ALTER COLUMN transaction_detail_id SET DEFAULT nextval('transaction_details_transaction_detail_id_seq'::regclass);


--
-- Name: transaction_link_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY transaction_links ALTER COLUMN transaction_link_id SET DEFAULT nextval('transaction_links_transaction_link_id_seq'::regclass);


--
-- Name: transaction_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY transactions ALTER COLUMN transaction_id SET DEFAULT nextval('transactions_transaction_id_seq'::regclass);


--
-- Name: work_rate_change; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY work_rate_changes ALTER COLUMN work_rate_change SET DEFAULT nextval('work_rate_changes_work_rate_change_seq'::regclass);


--
-- Name: work_rate_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY work_rates ALTER COLUMN work_rate_id SET DEFAULT nextval('work_rates_work_rate_id_seq'::regclass);


--
-- Name: workflow_log_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY workflow_logs ALTER COLUMN workflow_log_id SET DEFAULT nextval('workflow_logs_workflow_log_id_seq'::regclass);


--
-- Name: workflow_phase_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY workflow_phases ALTER COLUMN workflow_phase_id SET DEFAULT nextval('workflow_phases_workflow_phase_id_seq'::regclass);


--
-- Name: workflow_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY workflows ALTER COLUMN workflow_id SET DEFAULT nextval('workflows_workflow_id_seq'::regclass);


--
-- Name: work_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY works ALTER COLUMN work_id SET DEFAULT nextval('works_work_id_seq'::regclass);


--
-- Data for Name: access_logs; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Data for Name: account_class; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO account_class (account_class_id, account_class_no, org_id, chat_type_id, chat_type_name, account_class_name, details) VALUES (10, 10, 0, 1, 'ASSETS', 'FIXED ASSETS', NULL);
INSERT INTO account_class (account_class_id, account_class_no, org_id, chat_type_id, chat_type_name, account_class_name, details) VALUES (20, 20, 0, 1, 'ASSETS', 'INTANGIBLE ASSETS', NULL);
INSERT INTO account_class (account_class_id, account_class_no, org_id, chat_type_id, chat_type_name, account_class_name, details) VALUES (30, 30, 0, 1, 'ASSETS', 'CURRENT ASSETS', NULL);
INSERT INTO account_class (account_class_id, account_class_no, org_id, chat_type_id, chat_type_name, account_class_name, details) VALUES (40, 40, 0, 2, 'LIABILITIES', 'CURRENT LIABILITIES', NULL);
INSERT INTO account_class (account_class_id, account_class_no, org_id, chat_type_id, chat_type_name, account_class_name, details) VALUES (50, 50, 0, 2, 'LIABILITIES', 'LONG TERM LIABILITIES', NULL);
INSERT INTO account_class (account_class_id, account_class_no, org_id, chat_type_id, chat_type_name, account_class_name, details) VALUES (60, 60, 0, 3, 'EQUITY', 'EQUITY AND RESERVES', NULL);
INSERT INTO account_class (account_class_id, account_class_no, org_id, chat_type_id, chat_type_name, account_class_name, details) VALUES (70, 70, 0, 4, 'REVENUE', 'REVENUE AND OTHER INCOME', NULL);
INSERT INTO account_class (account_class_id, account_class_no, org_id, chat_type_id, chat_type_name, account_class_name, details) VALUES (80, 80, 0, 5, 'COST OF REVENUE', 'COST OF REVENUE', NULL);
INSERT INTO account_class (account_class_id, account_class_no, org_id, chat_type_id, chat_type_name, account_class_name, details) VALUES (90, 90, 0, 6, 'EXPENSES', 'EXPENSES', NULL);
INSERT INTO account_class (account_class_id, account_class_no, org_id, chat_type_id, chat_type_name, account_class_name, details) VALUES (100, 90, 1, 6, 'EXPENSES', 'EXPENSES', NULL);
INSERT INTO account_class (account_class_id, account_class_no, org_id, chat_type_id, chat_type_name, account_class_name, details) VALUES (101, 80, 1, 5, 'COST OF REVENUE', 'COST OF REVENUE', NULL);
INSERT INTO account_class (account_class_id, account_class_no, org_id, chat_type_id, chat_type_name, account_class_name, details) VALUES (102, 70, 1, 4, 'REVENUE', 'REVENUE AND OTHER INCOME', NULL);
INSERT INTO account_class (account_class_id, account_class_no, org_id, chat_type_id, chat_type_name, account_class_name, details) VALUES (103, 60, 1, 3, 'EQUITY', 'EQUITY AND RESERVES', NULL);
INSERT INTO account_class (account_class_id, account_class_no, org_id, chat_type_id, chat_type_name, account_class_name, details) VALUES (104, 50, 1, 2, 'LIABILITIES', 'LONG TERM LIABILITIES', NULL);
INSERT INTO account_class (account_class_id, account_class_no, org_id, chat_type_id, chat_type_name, account_class_name, details) VALUES (105, 40, 1, 2, 'LIABILITIES', 'CURRENT LIABILITIES', NULL);
INSERT INTO account_class (account_class_id, account_class_no, org_id, chat_type_id, chat_type_name, account_class_name, details) VALUES (106, 30, 1, 1, 'ASSETS', 'CURRENT ASSETS', NULL);
INSERT INTO account_class (account_class_id, account_class_no, org_id, chat_type_id, chat_type_name, account_class_name, details) VALUES (107, 20, 1, 1, 'ASSETS', 'INTANGIBLE ASSETS', NULL);
INSERT INTO account_class (account_class_id, account_class_no, org_id, chat_type_id, chat_type_name, account_class_name, details) VALUES (108, 10, 1, 1, 'ASSETS', 'FIXED ASSETS', NULL);


--
-- Name: account_class_account_class_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('account_class_account_class_id_seq', 108, true);


--
-- Data for Name: account_types; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (100, 100, 10, 0, 'COST', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (110, 110, 10, 0, 'ACCUMULATED DEPRECIATION', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (200, 200, 20, 0, 'COST', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (210, 210, 20, 0, 'ACCUMULATED AMORTISATION', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (300, 300, 30, 0, 'DEBTORS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (310, 310, 30, 0, 'INVESTMENTS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (320, 320, 30, 0, 'CURRENT BANK ACCOUNTS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (330, 330, 30, 0, 'CASH ON HAND', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (340, 340, 30, 0, 'PRE-PAYMMENTS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (400, 400, 40, 0, 'CREDITORS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (410, 410, 40, 0, 'ADVANCED BILLING', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (420, 420, 40, 0, 'TAX', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (430, 430, 40, 0, 'WITHHOLDING TAX', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (500, 500, 50, 0, 'LOANS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (600, 600, 60, 0, 'CAPITAL GRANTS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (610, 610, 60, 0, 'ACCUMULATED SURPLUS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (700, 700, 70, 0, 'SALES REVENUE', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (710, 710, 70, 0, 'OTHER INCOME', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (800, 800, 80, 0, 'COST OF REVENUE', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (900, 900, 90, 0, 'STAFF COSTS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (905, 905, 90, 0, 'COMMUNICATIONS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (910, 910, 90, 0, 'DIRECTORS ALLOWANCES', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (915, 915, 90, 0, 'TRANSPORT', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (920, 920, 90, 0, 'TRAVEL', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (925, 925, 90, 0, 'POSTAL and COURIER', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (930, 930, 90, 0, 'ICT PROJECT', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (935, 935, 90, 0, 'STATIONERY', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (940, 940, 90, 0, 'SUBSCRIPTION FEES', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (945, 945, 90, 0, 'REPAIRS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (950, 950, 90, 0, 'PROFESSIONAL FEES', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (955, 955, 90, 0, 'OFFICE EXPENSES', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (960, 960, 90, 0, 'MARKETING EXPENSES', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (965, 965, 90, 0, 'STRATEGIC PLANNING', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (970, 970, 90, 0, 'DEPRECIATION', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (975, 975, 90, 0, 'CORPORATE SOCIAL INVESTMENT', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (980, 980, 90, 0, 'FINANCE COSTS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (985, 985, 90, 0, 'TAXES', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (990, 990, 90, 0, 'INSURANCE', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (995, 995, 90, 0, 'OTHER EXPENSES', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1000, 110, 108, 1, 'ACCUMULATED DEPRECIATION', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1001, 100, 108, 1, 'COST', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1002, 210, 107, 1, 'ACCUMULATED AMORTISATION', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1003, 200, 107, 1, 'COST', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1004, 340, 106, 1, 'PRE-PAYMMENTS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1005, 330, 106, 1, 'CASH ON HAND', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1006, 320, 106, 1, 'CURRENT BANK ACCOUNTS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1007, 310, 106, 1, 'INVESTMENTS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1008, 300, 106, 1, 'DEBTORS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1009, 430, 105, 1, 'WITHHOLDING TAX', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1010, 420, 105, 1, 'TAX', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1011, 410, 105, 1, 'ADVANCED BILLING', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1012, 400, 105, 1, 'CREDITORS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1013, 500, 104, 1, 'LOANS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1014, 610, 103, 1, 'ACCUMULATED SURPLUS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1015, 600, 103, 1, 'CAPITAL GRANTS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1016, 710, 102, 1, 'OTHER INCOME', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1017, 700, 102, 1, 'SALES REVENUE', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1018, 800, 101, 1, 'COST OF REVENUE', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1019, 995, 100, 1, 'OTHER EXPENSES', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1020, 990, 100, 1, 'INSURANCE', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1021, 985, 100, 1, 'TAXES', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1022, 980, 100, 1, 'FINANCE COSTS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1023, 975, 100, 1, 'CORPORATE SOCIAL INVESTMENT', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1024, 970, 100, 1, 'DEPRECIATION', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1025, 965, 100, 1, 'STRATEGIC PLANNING', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1026, 960, 100, 1, 'MARKETING EXPENSES', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1027, 955, 100, 1, 'OFFICE EXPENSES', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1028, 950, 100, 1, 'PROFESSIONAL FEES', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1029, 945, 100, 1, 'REPAIRS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1030, 940, 100, 1, 'SUBSCRIPTION FEES', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1031, 935, 100, 1, 'STATIONERY', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1032, 930, 100, 1, 'ICT PROJECT', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1033, 925, 100, 1, 'POSTAL and COURIER', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1034, 920, 100, 1, 'TRAVEL', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1035, 915, 100, 1, 'TRANSPORT', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1036, 910, 100, 1, 'DIRECTORS ALLOWANCES', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1037, 905, 100, 1, 'COMMUNICATIONS', NULL);
INSERT INTO account_types (account_type_id, account_type_no, account_class_id, org_id, account_type_name, details) VALUES (1038, 900, 100, 1, 'STAFF COSTS', NULL);


--
-- Name: account_types_account_type_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('account_types_account_type_id_seq', 1038, true);


--
-- Data for Name: accounts; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (10000, 10000, 100, 0, 'COMPUTERS and EQUIPMENT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (10005, 10005, 100, 0, 'FURNITURE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (11000, 11000, 110, 0, 'COMPUTERS and EQUIPMENT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (11005, 11005, 110, 0, 'FURNITURE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (20000, 20000, 200, 0, 'INTANGIBLE ASSETS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (20005, 20005, 200, 0, 'NON CURRENT ASSETS: DEFFERED TAX', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (20010, 20010, 200, 0, 'INTANGIBLE ASSETS: ACCOUNTING PACKAGE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (21000, 21000, 210, 0, 'ACCUMULATED AMORTISATION', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (30000, 30000, 300, 0, 'TRADE DEBTORS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (30005, 30005, 300, 0, 'STAFF DEBTORS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (30010, 30010, 300, 0, 'OTHER DEBTORS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (30015, 30015, 300, 0, 'DEBTORS PROMPT PAYMENT DISCOUNT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (30020, 30020, 300, 0, 'INVENTORY', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (30025, 30025, 300, 0, 'INVENTORY WORK IN PROGRESS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (30030, 30030, 300, 0, 'GOODS RECEIVED CLEARING ACCOUNT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (31005, 31005, 310, 0, 'UNIT TRUST INVESTMENTS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (32000, 32000, 320, 0, 'COMMERCIAL BANK', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (32005, 32005, 320, 0, 'MPESA', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (33000, 33000, 330, 0, 'CASH ACCOUNT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (33005, 33005, 330, 0, 'PETTY CASH', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (34000, 34000, 340, 0, 'PREPAYMENTS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (34005, 34005, 340, 0, 'DEPOSITS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (34010, 34010, 340, 0, 'TAX RECOVERABLE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (34015, 34015, 340, 0, 'TOTAL REGISTRAR DEPOSITS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (40000, 40000, 400, 0, 'TRADE CREDITORS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (40005, 40005, 400, 0, 'ADVANCE BILLING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (40010, 40010, 400, 0, 'LEAVE - ACCRUALS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (40015, 40015, 400, 0, 'ACCRUED LIABILITIES: CORPORATE TAX', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (40020, 40020, 400, 0, 'OTHER ACCRUALS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (40025, 40025, 400, 0, 'PROVISION FOR CREDIT NOTES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (40030, 40030, 400, 0, 'NSSF', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (40035, 40035, 400, 0, 'NHIF', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (40040, 40040, 400, 0, 'HELB', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (40045, 40045, 400, 0, 'PAYE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (40050, 40050, 400, 0, 'PENSION', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (40055, 40055, 400, 0, 'PAYROLL LIABILITIES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (41000, 41000, 410, 0, 'ADVANCED BILLING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (42000, 42000, 420, 0, 'Value Added Tax (VAT)', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (42010, 42010, 420, 0, 'REMITTANCE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (43000, 43000, 430, 0, 'WITHHOLDING TAX', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (50000, 50000, 500, 0, 'BANK LOANS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (60000, 60000, 600, 0, 'CAPITAL GRANTS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (60005, 60005, 600, 0, 'ACCUMULATED AMORTISATION OF CAPITAL GRANTS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (60010, 60010, 600, 0, 'DIVIDEND', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (61000, 61000, 610, 0, 'RETAINED EARNINGS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (61005, 61005, 610, 0, 'ACCUMULATED SURPLUS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (61010, 61010, 610, 0, 'ASSET REVALUATION GAIN / LOSS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (70005, 70005, 700, 0, 'GOODS SALES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (70010, 70010, 700, 0, 'SERVICE SALES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (70015, 70015, 700, 0, 'SALES DISCOUNT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (71000, 71000, 710, 0, 'FAIR VALUE GAIN/LOSS IN INVESTMENTS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (71005, 71005, 710, 0, 'DONATION', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (71010, 71010, 710, 0, 'EXCHANGE GAIN(LOSS)', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (71015, 71015, 710, 0, 'REGISTRAR TRAINING FEES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (71020, 71020, 710, 0, 'DISPOSAL OF ASSETS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (71025, 71025, 710, 0, 'DIVIDEND INCOME', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (71030, 71030, 710, 0, 'INTEREST INCOME', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (71035, 71035, 710, 0, 'TRAINING, FORUM, MEETINGS and WORKSHOPS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (80000, 80000, 800, 0, 'COST OF GOODS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90000, 90000, 900, 0, 'BASIC SALARY', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90005, 90005, 900, 0, 'STAFF ALLOWANCES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90010, 90010, 900, 0, 'AIRTIME', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90012, 90012, 900, 0, 'TRANSPORT ALLOWANCE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90015, 90015, 900, 0, 'REMOTE ACCESS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90020, 90020, 900, 0, 'EMPLOYER PENSION CONTRIBUTION', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90025, 90025, 900, 0, 'NSSF EMPLOYER CONTRIBUTION', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90035, 90035, 900, 0, 'CAPACITY BUILDING - TRAINING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90040, 90040, 900, 0, 'INTERNSHIP ALLOWANCES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90045, 90045, 900, 0, 'BONUSES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90050, 90050, 900, 0, 'LEAVE ACCRUAL', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90055, 90055, 900, 0, 'WELFARE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90056, 90056, 900, 0, 'STAFF WELLFARE: CONSUMABLES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90060, 90060, 900, 0, 'MEDICAL INSURANCE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90065, 90065, 900, 0, 'GROUP PERSONAL ACCIDENT AND WIBA', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90070, 90070, 900, 0, 'STAFF EXPENDITURE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90075, 90075, 900, 0, 'GROUP LIFE INSURANCE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90500, 90500, 905, 0, 'FIXED LINES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90505, 90505, 905, 0, 'CALLING CARDS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90510, 90510, 905, 0, 'LEASE LINES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90515, 90515, 905, 0, 'REMOTE ACCESS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (90520, 90520, 905, 0, 'LEASE LINE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (91000, 91000, 910, 0, 'SITTING ALLOWANCES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (91005, 91005, 910, 0, 'HONORARIUM', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (91010, 91010, 910, 0, 'WORKSHOPS and SEMINARS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (91500, 91500, 915, 0, 'CAB FARE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (91505, 91505, 915, 0, 'FUEL', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (91510, 91510, 915, 0, 'BUS FARE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (91515, 91515, 915, 0, 'POSTAGE and BOX RENTAL', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (92000, 92000, 920, 0, 'TRAINING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (92005, 92005, 920, 0, 'BUSINESS PROSPECTING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (92505, 92505, 925, 0, 'DIRECTORY LISTING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (92510, 92510, 925, 0, 'COURIER', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (93000, 93000, 930, 0, 'IP TRAINING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (93010, 93010, 930, 0, 'COMPUTER SUPPORT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (93500, 93500, 935, 0, 'PRINTED MATTER', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (93505, 93505, 935, 0, 'PAPER', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (93510, 93510, 935, 0, 'OTHER CONSUMABLES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (93515, 93515, 935, 0, 'TONER and CATRIDGE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (93520, 93520, 935, 0, 'COMPUTER ACCESSORIES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (94010, 94010, 940, 0, 'LICENSE FEE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (94015, 94015, 940, 0, 'SYSTEM SUPPORT FEES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (94500, 94500, 945, 0, 'FURNITURE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (94505, 94505, 945, 0, 'COMPUTERS and EQUIPMENT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (94510, 94510, 945, 0, 'JANITORIAL', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (95000, 95000, 950, 0, 'AUDIT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (95005, 95005, 950, 0, 'MARKETING AGENCY', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (95010, 95010, 950, 0, 'ADVERTISING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (95015, 95015, 950, 0, 'CONSULTANCY', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (95020, 95020, 950, 0, 'TAX CONSULTANCY', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (95025, 95025, 950, 0, 'MARKETING CAMPAIGN', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (95030, 95030, 950, 0, 'PROMOTIONAL MATERIALS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (95035, 95035, 950, 0, 'RECRUITMENT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (95040, 95040, 950, 0, 'ANNUAL GENERAL MEETING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (95045, 95045, 950, 0, 'SEMINARS, WORKSHOPS and MEETINGS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (95500, 95500, 955, 0, 'OFFICE RENT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (95502, 95502, 955, 0, 'OFFICE COSTS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (95505, 95505, 955, 0, 'CLEANING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (95510, 95510, 955, 0, 'NEWSPAPERS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (95515, 95515, 955, 0, 'OTHER CONSUMABLES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (95520, 95520, 955, 0, 'ADMINISTRATIVE EXPENSES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (96005, 96005, 960, 0, 'WEBSITE REVAMPING COSTS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (96505, 96505, 965, 0, 'STRATEGIC PLANNING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (96510, 96510, 965, 0, 'MONITORING and EVALUATION', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (97000, 97000, 970, 0, 'COMPUTERS and EQUIPMENT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (97005, 97005, 970, 0, 'FURNITURE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (97010, 97010, 970, 0, 'AMMORTISATION OF INTANGIBLE ASSETS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (97500, 97500, 975, 0, 'CORPORATE SOCIAL INVESTMENT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (97505, 97505, 975, 0, 'DONATION', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (98000, 98000, 980, 0, 'LEDGER FEES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (98005, 98005, 980, 0, 'BOUNCED CHEQUE CHARGES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (98010, 98010, 980, 0, 'OTHER FEES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (98015, 98015, 980, 0, 'SALARY TRANSFERS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (98020, 98020, 980, 0, 'UPCOUNTRY CHEQUES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (98025, 98025, 980, 0, 'SAFETY DEPOSIT BOX', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (98030, 98030, 980, 0, 'MPESA TRANSFERS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (98035, 98035, 980, 0, 'CUSTODY FEES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (98040, 98040, 980, 0, 'PROFESSIONAL FEES: MANAGEMENT FEES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (98500, 98500, 985, 0, 'EXCISE DUTY', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (98505, 98505, 985, 0, 'FINES and PENALTIES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (98510, 98510, 985, 0, 'CORPORATE TAX', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (98515, 98515, 985, 0, 'FRINGE BENEFIT TAX', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (99000, 99000, 990, 0, 'ALL RISKS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (99005, 99005, 990, 0, 'FIRE and PERILS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (99010, 99010, 990, 0, 'BURGLARY', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (99015, 99015, 990, 0, 'COMPUTER POLICY', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (99500, 99500, 995, 0, 'BAD DEBTS WRITTEN OFF', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (99505, 99505, 995, 0, 'PURCHASE DISCOUNT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (99510, 99510, 995, 0, 'COST OF GOODS SOLD (COGS)', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (99515, 99515, 995, 0, 'PURCHASE PRICE VARIANCE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (99999, 99999, 995, 0, 'SURPLUS/DEFICIT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100000, 90075, 1038, 1, 'GROUP LIFE INSURANCE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100001, 90070, 1038, 1, 'STAFF EXPENDITURE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100002, 90065, 1038, 1, 'GROUP PERSONAL ACCIDENT AND WIBA', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100003, 90060, 1038, 1, 'MEDICAL INSURANCE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100004, 90056, 1038, 1, 'STAFF WELLFARE: CONSUMABLES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100005, 90055, 1038, 1, 'WELFARE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100006, 90050, 1038, 1, 'LEAVE ACCRUAL', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100007, 90045, 1038, 1, 'BONUSES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100008, 90040, 1038, 1, 'INTERNSHIP ALLOWANCES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100009, 90035, 1038, 1, 'CAPACITY BUILDING - TRAINING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100010, 90025, 1038, 1, 'NSSF EMPLOYER CONTRIBUTION', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100011, 90020, 1038, 1, 'EMPLOYER PENSION CONTRIBUTION', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100012, 90015, 1038, 1, 'REMOTE ACCESS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100013, 90012, 1038, 1, 'TRANSPORT ALLOWANCE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100014, 90010, 1038, 1, 'AIRTIME', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100015, 90005, 1038, 1, 'STAFF ALLOWANCES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100016, 90000, 1038, 1, 'BASIC SALARY', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100017, 90520, 1037, 1, 'LEASE LINE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100018, 90515, 1037, 1, 'REMOTE ACCESS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100019, 90510, 1037, 1, 'LEASE LINES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100020, 90505, 1037, 1, 'CALLING CARDS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100021, 90500, 1037, 1, 'FIXED LINES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100022, 91010, 1036, 1, 'WORKSHOPS and SEMINARS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100023, 91005, 1036, 1, 'HONORARIUM', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100024, 91000, 1036, 1, 'SITTING ALLOWANCES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100025, 91515, 1035, 1, 'POSTAGE and BOX RENTAL', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100026, 91510, 1035, 1, 'BUS FARE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100027, 91505, 1035, 1, 'FUEL', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100028, 91500, 1035, 1, 'CAB FARE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100029, 92005, 1034, 1, 'BUSINESS PROSPECTING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100030, 92000, 1034, 1, 'TRAINING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100031, 92510, 1033, 1, 'COURIER', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100032, 92505, 1033, 1, 'DIRECTORY LISTING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100033, 93010, 1032, 1, 'COMPUTER SUPPORT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100034, 93000, 1032, 1, 'IP TRAINING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100035, 93520, 1031, 1, 'COMPUTER ACCESSORIES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100036, 93515, 1031, 1, 'TONER and CATRIDGE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100037, 93510, 1031, 1, 'OTHER CONSUMABLES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100038, 93505, 1031, 1, 'PAPER', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100039, 93500, 1031, 1, 'PRINTED MATTER', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100040, 94015, 1030, 1, 'SYSTEM SUPPORT FEES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100041, 94010, 1030, 1, 'LICENSE FEE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100042, 94510, 1029, 1, 'JANITORIAL', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100043, 94505, 1029, 1, 'COMPUTERS and EQUIPMENT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100044, 94500, 1029, 1, 'FURNITURE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100045, 95045, 1028, 1, 'SEMINARS, WORKSHOPS and MEETINGS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100046, 95040, 1028, 1, 'ANNUAL GENERAL MEETING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100047, 95035, 1028, 1, 'RECRUITMENT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100048, 95030, 1028, 1, 'PROMOTIONAL MATERIALS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100049, 95025, 1028, 1, 'MARKETING CAMPAIGN', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100050, 95020, 1028, 1, 'TAX CONSULTANCY', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100051, 95015, 1028, 1, 'CONSULTANCY', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100052, 95010, 1028, 1, 'ADVERTISING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100053, 95005, 1028, 1, 'MARKETING AGENCY', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100054, 95000, 1028, 1, 'AUDIT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100055, 95520, 1027, 1, 'ADMINISTRATIVE EXPENSES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100056, 95515, 1027, 1, 'OTHER CONSUMABLES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100057, 95510, 1027, 1, 'NEWSPAPERS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100058, 95505, 1027, 1, 'CLEANING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100059, 95502, 1027, 1, 'OFFICE COSTS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100060, 95500, 1027, 1, 'OFFICE RENT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100061, 96005, 1026, 1, 'WEBSITE REVAMPING COSTS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100062, 96510, 1025, 1, 'MONITORING and EVALUATION', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100063, 96505, 1025, 1, 'STRATEGIC PLANNING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100064, 97010, 1024, 1, 'AMMORTISATION OF INTANGIBLE ASSETS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100065, 97005, 1024, 1, 'FURNITURE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100066, 97000, 1024, 1, 'COMPUTERS and EQUIPMENT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100067, 97505, 1023, 1, 'DONATION', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100068, 97500, 1023, 1, 'CORPORATE SOCIAL INVESTMENT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100069, 98040, 1022, 1, 'PROFESSIONAL FEES: MANAGEMENT FEES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100070, 98035, 1022, 1, 'CUSTODY FEES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100071, 98030, 1022, 1, 'MPESA TRANSFERS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100072, 98025, 1022, 1, 'SAFETY DEPOSIT BOX', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100073, 98020, 1022, 1, 'UPCOUNTRY CHEQUES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100074, 98015, 1022, 1, 'SALARY TRANSFERS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100075, 98010, 1022, 1, 'OTHER FEES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100076, 98005, 1022, 1, 'BOUNCED CHEQUE CHARGES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100077, 98000, 1022, 1, 'LEDGER FEES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100078, 98515, 1021, 1, 'FRINGE BENEFIT TAX', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100079, 98510, 1021, 1, 'CORPORATE TAX', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100080, 98505, 1021, 1, 'FINES and PENALTIES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100081, 98500, 1021, 1, 'EXCISE DUTY', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100082, 99015, 1020, 1, 'COMPUTER POLICY', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100083, 99010, 1020, 1, 'BURGLARY', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100084, 99005, 1020, 1, 'FIRE and PERILS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100085, 99000, 1020, 1, 'ALL RISKS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100086, 99999, 1019, 1, 'SURPLUS/DEFICIT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100087, 99515, 1019, 1, 'PURCHASE PRICE VARIANCE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100088, 99510, 1019, 1, 'COST OF GOODS SOLD (COGS)', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100089, 99505, 1019, 1, 'PURCHASE DISCOUNT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100090, 99500, 1019, 1, 'BAD DEBTS WRITTEN OFF', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100091, 80000, 1018, 1, 'COST OF GOODS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100092, 70015, 1017, 1, 'SALES DISCOUNT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100093, 70010, 1017, 1, 'SERVICE SALES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100094, 70005, 1017, 1, 'GOODS SALES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100095, 71035, 1016, 1, 'TRAINING, FORUM, MEETINGS and WORKSHOPS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100096, 71030, 1016, 1, 'INTEREST INCOME', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100097, 71025, 1016, 1, 'DIVIDEND INCOME', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100098, 71020, 1016, 1, 'DISPOSAL OF ASSETS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100099, 71015, 1016, 1, 'REGISTRAR TRAINING FEES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100100, 71010, 1016, 1, 'EXCHANGE GAIN(LOSS)', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100101, 71005, 1016, 1, 'DONATION', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100102, 71000, 1016, 1, 'FAIR VALUE GAIN/LOSS IN INVESTMENTS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100103, 60010, 1015, 1, 'DIVIDEND', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100104, 60005, 1015, 1, 'ACCUMULATED AMORTISATION OF CAPITAL GRANTS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100105, 60000, 1015, 1, 'CAPITAL GRANTS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100106, 61010, 1014, 1, 'ASSET REVALUATION GAIN / LOSS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100107, 61005, 1014, 1, 'ACCUMULATED SURPLUS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100108, 61000, 1014, 1, 'RETAINED EARNINGS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100109, 50000, 1013, 1, 'BANK LOANS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100110, 40055, 1012, 1, 'PAYROLL LIABILITIES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100111, 40050, 1012, 1, 'PENSION', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100112, 40045, 1012, 1, 'PAYE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100113, 40040, 1012, 1, 'HELB', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100114, 40035, 1012, 1, 'NHIF', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100115, 40030, 1012, 1, 'NSSF', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100116, 40025, 1012, 1, 'PROVISION FOR CREDIT NOTES', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100117, 40020, 1012, 1, 'OTHER ACCRUALS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100118, 40015, 1012, 1, 'ACCRUED LIABILITIES: CORPORATE TAX', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100119, 40010, 1012, 1, 'LEAVE - ACCRUALS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100120, 40005, 1012, 1, 'ADVANCE BILLING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100121, 40000, 1012, 1, 'TRADE CREDITORS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100122, 41000, 1011, 1, 'ADVANCED BILLING', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100123, 42010, 1010, 1, 'REMITTANCE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100124, 42000, 1010, 1, 'Value Added Tax (VAT)', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100125, 43000, 1009, 1, 'WITHHOLDING TAX', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100126, 30030, 1008, 1, 'GOODS RECEIVED CLEARING ACCOUNT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100127, 30025, 1008, 1, 'INVENTORY WORK IN PROGRESS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100128, 30020, 1008, 1, 'INVENTORY', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100129, 30015, 1008, 1, 'DEBTORS PROMPT PAYMENT DISCOUNT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100130, 30010, 1008, 1, 'OTHER DEBTORS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100131, 30005, 1008, 1, 'STAFF DEBTORS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100132, 30000, 1008, 1, 'TRADE DEBTORS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100133, 31005, 1007, 1, 'UNIT TRUST INVESTMENTS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100134, 32005, 1006, 1, 'MPESA', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100135, 32000, 1006, 1, 'COMMERCIAL BANK', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100136, 33005, 1005, 1, 'PETTY CASH', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100137, 33000, 1005, 1, 'CASH ACCOUNT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100138, 34015, 1004, 1, 'TOTAL REGISTRAR DEPOSITS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100139, 34010, 1004, 1, 'TAX RECOVERABLE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100140, 34005, 1004, 1, 'DEPOSITS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100141, 34000, 1004, 1, 'PREPAYMENTS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100142, 20010, 1003, 1, 'INTANGIBLE ASSETS: ACCOUNTING PACKAGE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100143, 20005, 1003, 1, 'NON CURRENT ASSETS: DEFFERED TAX', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100144, 20000, 1003, 1, 'INTANGIBLE ASSETS', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100145, 21000, 1002, 1, 'ACCUMULATED AMORTISATION', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100146, 10005, 1001, 1, 'FURNITURE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100147, 10000, 1001, 1, 'COMPUTERS and EQUIPMENT', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100148, 11005, 1000, 1, 'FURNITURE', false, true, NULL);
INSERT INTO accounts (account_id, account_no, account_type_id, org_id, account_name, is_header, is_active, details) VALUES (100149, 11000, 1000, 1, 'COMPUTERS and EQUIPMENT', false, true, NULL);


--
-- Name: accounts_account_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('accounts_account_id_seq', 100149, true);


--
-- Data for Name: address; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: address_address_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('address_address_id_seq', 1, false);


--
-- Data for Name: address_types; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: address_types_address_type_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('address_types_address_type_id_seq', 1, false);


--
-- Data for Name: adjustment_effects; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO adjustment_effects (adjustment_effect_id, adjustment_effect_name) VALUES (0, 'General');
INSERT INTO adjustment_effects (adjustment_effect_id, adjustment_effect_name) VALUES (1, 'Housing');
INSERT INTO adjustment_effects (adjustment_effect_id, adjustment_effect_name) VALUES (2, 'Insurance');


--
-- Data for Name: adjustments; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (1, 1, NULL, 0, 'Sacco Allowance', 1, 0, NULL, NULL, 0, true, true, true, true, false, false, 0, 0, 0, '90005', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (2, 1, NULL, 0, 'Bonus', 1, 0, NULL, NULL, 0, true, true, true, true, false, false, 0, 0, 0, '90005', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (3, 1, NULL, 0, 'Employer - Pension', 1, 0, NULL, NULL, 0, true, false, false, true, false, false, 0, 0, 0, '90005', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (11, 1, NULL, 0, 'SACCO', 2, 0, NULL, NULL, 0, true, true, false, true, false, false, 0, 0, 0, '40055', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (12, 1, NULL, 0, 'HELB', 2, 0, NULL, NULL, 0, true, true, false, true, false, false, 0, 0, 0, '40055', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (13, 1, NULL, 0, 'Rent Payment', 2, 0, NULL, NULL, 0, true, true, false, true, false, false, 0, 0, 0, '40055', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (14, 1, NULL, 0, 'Pension deduction', 2, 0, NULL, NULL, 0, true, true, false, true, false, false, 0, 0, 0, '40055', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (15, 1, NULL, 0, 'Internal loans', 2, 0, NULL, NULL, 0, true, true, false, true, false, false, 0, 0, 0, '40055', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (21, 1, NULL, 0, 'Travel', 3, 0, NULL, NULL, 0, true, true, false, true, false, false, 0, 0, 0, '90070', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (22, 1, NULL, 0, 'Communcation', 3, 0, NULL, NULL, 0, true, true, false, true, false, false, 0, 0, 0, '90070', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (23, 1, NULL, 0, 'Tools', 3, 0, NULL, NULL, 0, true, true, false, true, false, false, 0, 0, 0, '90070', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (24, 1, NULL, 0, 'Payroll Cost', 3, 0, NULL, NULL, 0, true, true, false, true, false, false, 0, 0, 0, '90070', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (25, 1, NULL, 0, 'Health Insurance', 3, 0, NULL, NULL, 0, true, true, false, false, false, false, 0, 0, 0, '90070', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (26, 1, NULL, 0, 'GPA Insurance', 3, 0, NULL, NULL, 0, true, true, false, false, false, false, 0, 0, 0, '90070', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (27, 1, NULL, 0, 'Accomodation', 3, 0, NULL, NULL, 0, true, true, false, true, false, false, 0, 0, 0, '90070', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (28, 1, NULL, 0, 'Avenue Health Care', 3, 0, NULL, NULL, 0, true, true, false, false, false, false, 0, 0, 0, '90070', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (29, 1, NULL, 0, 'Maternety Cost', 3, 0, NULL, NULL, 0, true, true, false, true, false, false, 0, 0, 0, '90070', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (30, 1, NULL, 0, 'Health care claims', 3, 0, NULL, NULL, 0, true, true, false, true, false, false, 0, 0, 0, '90070', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (31, 1, NULL, 0, 'Trainining', 3, 0, NULL, NULL, 0, true, true, false, true, false, false, 0, 0, 0, '90070', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (32, 1, NULL, 0, 'per diem', 3, 0, NULL, NULL, 0, true, true, false, true, false, false, 0, 0, 0, '90070', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (47, 5, NULL, 1, 'Communcation', 3, 0, NULL, NULL, 0, true, true, false, true, false, false, 0, 0, 0, '90070', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (46, 5, NULL, 1, 'Travel', 3, 0, NULL, NULL, 0, true, true, false, true, false, false, 0, 0, 0, '90070', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (45, 5, NULL, 1, 'Staff contribution', 2, 0, NULL, NULL, 0, true, true, false, true, false, false, 0, 0, 0, '40055', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (44, 5, NULL, 1, 'Home Ownership saving plan', 2, 0, NULL, NULL, 0, true, true, false, true, false, false, 0, 0, 0, '40055', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (43, 5, NULL, 1, 'External Loan', 2, 0, NULL, NULL, 0, true, true, false, true, false, false, 0, 0, 0, '40055', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (42, 5, NULL, 1, 'Bonus', 1, 0, NULL, NULL, 0, true, true, true, true, false, false, 0, 0, 0, '90005', NULL);
INSERT INTO adjustments (adjustment_id, currency_id, adjustment_effect_id, org_id, adjustment_name, adjustment_type, adjustment_order, earning_code, formural, default_amount, monthly_update, in_payroll, in_tax, visible, running_balance, reduce_balance, tax_reduction_ps, tax_relief_ps, tax_max_allowed, account_number, details) VALUES (41, 5, NULL, 1, 'Sitting Allowance', 1, 0, NULL, NULL, 0, true, true, true, true, false, false, 0, 0, 0, '90005', NULL);


--
-- Name: adjustments_adjustment_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('adjustments_adjustment_id_seq', 50, true);


--
-- Data for Name: advance_deductions; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: advance_deductions_advance_deduction_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('advance_deductions_advance_deduction_id_seq', 1, false);


--
-- Data for Name: amortisation; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: amortisation_amortisation_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('amortisation_amortisation_id_seq', 1, false);


--
-- Data for Name: applicants; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Data for Name: applications; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: applications_application_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('applications_application_id_seq', 1, false);


--
-- Data for Name: approval_checklists; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: approval_checklists_approval_checklist_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('approval_checklists_approval_checklist_id_seq', 1, false);


--
-- Data for Name: approvals; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: approvals_approval_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('approvals_approval_id_seq', 1, false);


--
-- Data for Name: aptitude_grades; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: aptitude_grades_aptitude_grade_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('aptitude_grades_aptitude_grade_id_seq', 1, false);


--
-- Data for Name: aptitude_ongoing; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: aptitude_ongoing_aptitude_ongoing_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('aptitude_ongoing_aptitude_ongoing_id_seq', 1, false);


--
-- Data for Name: aptitude_tests; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: aptitude_tests_aptitude_test_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('aptitude_tests_aptitude_test_id_seq', 1, false);


--
-- Data for Name: asset_movement; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: asset_movement_asset_movement_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('asset_movement_asset_movement_id_seq', 1, false);


--
-- Data for Name: asset_types; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: asset_types_asset_type_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('asset_types_asset_type_id_seq', 1, false);


--
-- Data for Name: asset_valuations; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: asset_valuations_asset_valuation_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('asset_valuations_asset_valuation_id_seq', 1, false);


--
-- Data for Name: assets; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: assets_asset_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('assets_asset_id_seq', 1, false);


--
-- Data for Name: attendance; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: attendance_attendance_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('attendance_attendance_id_seq', 1, false);


--
-- Data for Name: bank_accounts; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO bank_accounts (bank_account_id, org_id, bank_branch_id, account_id, currency_id, bank_account_name, bank_account_number, narrative, is_default, is_active, details) VALUES (0, 0, 0, 33000, 1, 'Cash Account', NULL, NULL, true, true, NULL);


--
-- Name: bank_accounts_bank_account_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('bank_accounts_bank_account_id_seq', 1, false);


--
-- Data for Name: bank_branch; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO bank_branch (bank_branch_id, bank_id, org_id, bank_branch_name, bank_branch_code, narrative) VALUES (0, 0, 0, 'Cash', NULL, NULL);


--
-- Name: bank_branch_bank_branch_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('bank_branch_bank_branch_id_seq', 1, false);


--
-- Data for Name: banks; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO banks (bank_id, sys_country_id, org_id, bank_name, bank_code, swift_code, sort_code, narrative) VALUES (0, NULL, 0, 'Cash', NULL, NULL, NULL, NULL);


--
-- Name: banks_bank_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('banks_bank_id_seq', 1, false);


--
-- Data for Name: bidders; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: bidders_bidder_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('bidders_bidder_id_seq', 1, false);


--
-- Data for Name: bio_imports1; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: bio_imports1_bio_imports1_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('bio_imports1_bio_imports1_id_seq', 1, false);


--
-- Data for Name: budget_lines; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: budget_lines_budget_line_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('budget_lines_budget_line_id_seq', 1, false);


--
-- Data for Name: budgets; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: budgets_budget_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('budgets_budget_id_seq', 1, false);


--
-- Data for Name: career_development; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: career_development_career_development_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('career_development_career_development_id_seq', 1, false);


--
-- Data for Name: case_types; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: case_types_case_type_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('case_types_case_type_id_seq', 1, false);


--
-- Data for Name: casual_application; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: casual_application_casual_application_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('casual_application_casual_application_id_seq', 1, false);


--
-- Data for Name: casual_category; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: casual_category_casual_category_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('casual_category_casual_category_id_seq', 1, false);


--
-- Data for Name: casuals; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: casuals_casual_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('casuals_casual_id_seq', 1, false);


--
-- Data for Name: checklists; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: checklists_checklist_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('checklists_checklist_id_seq', 1, false);


--
-- Data for Name: claim_details; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: claim_details_claim_detail_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('claim_details_claim_detail_id_seq', 1, false);


--
-- Data for Name: claim_types; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: claim_types_claim_type_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('claim_types_claim_type_id_seq', 1, false);


--
-- Data for Name: claims; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: claims_claim_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('claims_claim_id_seq', 1, false);


--
-- Data for Name: contract_status; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO contract_status (contract_status_id, org_id, contract_status_name, details) VALUES (1, 0, 'Active', NULL);
INSERT INTO contract_status (contract_status_id, org_id, contract_status_name, details) VALUES (2, 0, 'Resigned', NULL);
INSERT INTO contract_status (contract_status_id, org_id, contract_status_name, details) VALUES (3, 0, 'Deceased', NULL);
INSERT INTO contract_status (contract_status_id, org_id, contract_status_name, details) VALUES (4, 0, 'Terminated', NULL);
INSERT INTO contract_status (contract_status_id, org_id, contract_status_name, details) VALUES (5, 0, 'Transferred', NULL);
INSERT INTO contract_status (contract_status_id, org_id, contract_status_name, details) VALUES (6, 1, 'Active', NULL);
INSERT INTO contract_status (contract_status_id, org_id, contract_status_name, details) VALUES (7, 1, 'Resigned', NULL);
INSERT INTO contract_status (contract_status_id, org_id, contract_status_name, details) VALUES (8, 1, 'Deceased', NULL);
INSERT INTO contract_status (contract_status_id, org_id, contract_status_name, details) VALUES (9, 1, 'Terminated', NULL);
INSERT INTO contract_status (contract_status_id, org_id, contract_status_name, details) VALUES (10, 1, 'Transferred', NULL);


--
-- Name: contract_status_contract_status_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('contract_status_contract_status_id_seq', 10, true);


--
-- Data for Name: contract_types; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: contract_types_contract_type_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('contract_types_contract_type_id_seq', 1, false);


--
-- Data for Name: contracts; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: contracts_contract_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('contracts_contract_id_seq', 1, false);


--
-- Data for Name: currency; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO currency (currency_id, currency_name, currency_symbol, org_id) VALUES (1, 'Kenya Shillings', 'KES', 0);
INSERT INTO currency (currency_id, currency_name, currency_symbol, org_id) VALUES (2, 'US Dollar', 'USD', 0);
INSERT INTO currency (currency_id, currency_name, currency_symbol, org_id) VALUES (3, 'British Pound', 'BPD', 0);
INSERT INTO currency (currency_id, currency_name, currency_symbol, org_id) VALUES (4, 'Euro', 'ERO', 0);
INSERT INTO currency (currency_id, currency_name, currency_symbol, org_id) VALUES (5, 'US Dollar', 'USD', 1);


--
-- Name: currency_currency_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('currency_currency_id_seq', 5, true);


--
-- Data for Name: currency_rates; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO currency_rates (currency_rate_id, currency_id, org_id, exchange_date, exchange_rate) VALUES (0, 1, 0, '2017-01-03', 1);
INSERT INTO currency_rates (currency_rate_id, currency_id, org_id, exchange_date, exchange_rate) VALUES (1, 5, 1, '2017-01-04', 1);


--
-- Name: currency_rates_currency_rate_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('currency_rates_currency_rate_id_seq', 1, true);


--
-- Data for Name: cv_projects; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: cv_projects_cv_projectid_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('cv_projects_cv_projectid_seq', 1, false);


--
-- Data for Name: cv_seminars; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: cv_seminars_cv_seminar_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('cv_seminars_cv_seminar_id_seq', 1, false);


--
-- Data for Name: day_works; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: day_works_day_work_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('day_works_day_work_id_seq', 1, false);


--
-- Data for Name: default_accounts; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (1, 90012, 23, 0, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (2, 30005, 24, 0, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (3, 40045, 25, 0, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (4, 40055, 26, 0, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (5, 90000, 27, 0, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (6, 40055, 28, 0, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (7, 90005, 29, 0, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (8, 40055, 30, 0, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (9, 90070, 31, 0, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (10, 30000, 51, 0, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (11, 40000, 52, 0, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (12, 70005, 53, 0, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (13, 80000, 54, 0, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (14, 42000, 55, 0, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (15, 99999, 56, 0, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (16, 61000, 57, 0, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (17, 100108, 57, 1, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (18, 100086, 56, 1, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (19, 100124, 55, 1, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (20, 100091, 54, 1, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (21, 100094, 53, 1, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (22, 100121, 52, 1, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (23, 100132, 51, 1, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (24, 100001, 31, 1, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (25, 100110, 30, 1, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (26, 100015, 29, 1, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (27, 100110, 28, 1, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (28, 100016, 27, 1, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (29, 100110, 26, 1, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (30, 100112, 25, 1, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (31, 100131, 24, 1, NULL);
INSERT INTO default_accounts (default_account_id, account_id, use_key_id, org_id, narrative) VALUES (32, 100013, 23, 1, NULL);


--
-- Name: default_accounts_default_account_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('default_accounts_default_account_id_seq', 32, true);


--
-- Data for Name: default_adjustments; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: default_adjustments_default_adjustment_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('default_adjustments_default_adjustment_id_seq', 1, false);


--
-- Data for Name: default_banking; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: default_banking_default_banking_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('default_banking_default_banking_id_seq', 1, false);


--
-- Data for Name: default_tax_types; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: default_tax_types_default_tax_type_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('default_tax_types_default_tax_type_id_seq', 1, false);


--
-- Data for Name: define_phases; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: define_phases_define_phase_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('define_phases_define_phase_id_seq', 1, false);


--
-- Data for Name: define_tasks; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: define_tasks_define_task_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('define_tasks_define_task_id_seq', 1, false);


--
-- Data for Name: department_roles; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO department_roles (department_role_id, department_id, ln_department_role_id, jobs_category_id, org_id, department_role_name, active, job_description, job_requirements, duties, performance_measures, details) VALUES (0, 0, 0, NULL, 0, 'Chair Person', true, NULL, NULL, NULL, NULL, NULL);
INSERT INTO department_roles (department_role_id, department_id, ln_department_role_id, jobs_category_id, org_id, department_role_name, active, job_description, job_requirements, duties, performance_measures, details) VALUES (1, 0, 0, NULL, 0, 'Chief Executive Officer', true, '- Defining short term and long term corporate strategies and objectives
- Direct overall company operations ', NULL, '- Develop and control strategic relationships with third-party companies
- Guide the development of client specific systems
- Provide leadership and monitor team performance and individual staff performance ', NULL, NULL);
INSERT INTO department_roles (department_role_id, department_id, ln_department_role_id, jobs_category_id, org_id, department_role_name, active, job_description, job_requirements, duties, performance_measures, details) VALUES (2, 1, 0, NULL, 0, 'Director, Human Resources', true, '- To direct and guide projects support services
- Train end client users 
- Provide leadership and monitor team performance and individual staff performance ', NULL, NULL, NULL, NULL);
INSERT INTO department_roles (department_role_id, department_id, ln_department_role_id, jobs_category_id, org_id, department_role_name, active, job_description, job_requirements, duties, performance_measures, details) VALUES (3, 2, 0, NULL, 0, 'Director, Sales and Marketing', true, '- To direct and guide in systems and products development.
- Provide leadership and monitor team performance and individual staff performance ', NULL, NULL, NULL, NULL);
INSERT INTO department_roles (department_role_id, department_id, ln_department_role_id, jobs_category_id, org_id, department_role_name, active, job_description, job_requirements, duties, performance_measures, details) VALUES (4, 3, 0, NULL, 0, 'Director, Finance', true, '- To direct and guide projects implementation
- Train end client users 
- Provide leadership and monitor team performance and individual staff performance ', NULL, NULL, NULL, NULL);


--
-- Name: department_roles_department_role_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('department_roles_department_role_id_seq', 9, true);


--
-- Data for Name: departments; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO departments (department_id, ln_department_id, org_id, department_name, department_account, function_code, active, petty_cash, cost_center, revenue_center, description, duties, reports, details) VALUES (0, 0, 0, 'Board of Directors', NULL, NULL, true, false, true, true, NULL, NULL, NULL, NULL);
INSERT INTO departments (department_id, ln_department_id, org_id, department_name, department_account, function_code, active, petty_cash, cost_center, revenue_center, description, duties, reports, details) VALUES (1, 0, 0, 'Human Resources and Administration', NULL, NULL, true, false, true, true, NULL, NULL, NULL, NULL);
INSERT INTO departments (department_id, ln_department_id, org_id, department_name, department_account, function_code, active, petty_cash, cost_center, revenue_center, description, duties, reports, details) VALUES (2, 0, 0, 'Sales and Marketing', NULL, NULL, true, false, true, true, NULL, NULL, NULL, NULL);
INSERT INTO departments (department_id, ln_department_id, org_id, department_name, department_account, function_code, active, petty_cash, cost_center, revenue_center, description, duties, reports, details) VALUES (3, 0, 0, 'Finance', NULL, NULL, true, false, true, true, NULL, NULL, NULL, NULL);
INSERT INTO departments (department_id, ln_department_id, org_id, department_name, department_account, function_code, active, petty_cash, cost_center, revenue_center, description, duties, reports, details) VALUES (4, 4, 0, 'Procurement', NULL, NULL, true, false, true, true, NULL, NULL, NULL, NULL);


--
-- Name: departments_department_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('departments_department_id_seq', 5, true);


--
-- Data for Name: disability; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: disability_disability_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('disability_disability_id_seq', 1, false);


--
-- Data for Name: education; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Data for Name: education_class; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO education_class (education_class_id, org_id, education_class_name, details) VALUES (1, 0, 'Primary School', NULL);
INSERT INTO education_class (education_class_id, org_id, education_class_name, details) VALUES (2, 0, 'Secondary School', NULL);
INSERT INTO education_class (education_class_id, org_id, education_class_name, details) VALUES (3, 0, 'High School', NULL);
INSERT INTO education_class (education_class_id, org_id, education_class_name, details) VALUES (4, 0, 'Certificate', NULL);
INSERT INTO education_class (education_class_id, org_id, education_class_name, details) VALUES (5, 0, 'Diploma', NULL);
INSERT INTO education_class (education_class_id, org_id, education_class_name, details) VALUES (6, 0, 'Profesional Qualifications', NULL);
INSERT INTO education_class (education_class_id, org_id, education_class_name, details) VALUES (7, 0, 'Higher Diploma', NULL);
INSERT INTO education_class (education_class_id, org_id, education_class_name, details) VALUES (8, 0, 'Under Graduate', NULL);
INSERT INTO education_class (education_class_id, org_id, education_class_name, details) VALUES (9, 0, 'Post Graduate', NULL);
INSERT INTO education_class (education_class_id, org_id, education_class_name, details) VALUES (10, 1, 'Primary School', NULL);
INSERT INTO education_class (education_class_id, org_id, education_class_name, details) VALUES (11, 1, 'Secondary School', NULL);
INSERT INTO education_class (education_class_id, org_id, education_class_name, details) VALUES (12, 1, 'High School', NULL);
INSERT INTO education_class (education_class_id, org_id, education_class_name, details) VALUES (13, 1, 'Certificate', NULL);
INSERT INTO education_class (education_class_id, org_id, education_class_name, details) VALUES (14, 1, 'Diploma', NULL);
INSERT INTO education_class (education_class_id, org_id, education_class_name, details) VALUES (15, 1, 'Profesional Qualifications', NULL);
INSERT INTO education_class (education_class_id, org_id, education_class_name, details) VALUES (16, 1, 'Higher Diploma', NULL);
INSERT INTO education_class (education_class_id, org_id, education_class_name, details) VALUES (17, 1, 'Under Graduate', NULL);
INSERT INTO education_class (education_class_id, org_id, education_class_name, details) VALUES (18, 1, 'Post Graduate', NULL);


--
-- Name: education_class_education_class_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('education_class_education_class_id_seq', 18, true);


--
-- Name: education_education_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('education_education_id_seq', 1, false);


--
-- Data for Name: employee_adjustments; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: employee_adjustments_employee_adjustment_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('employee_adjustments_employee_adjustment_id_seq', 1, false);


--
-- Data for Name: employee_advances; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: employee_advances_employee_advance_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('employee_advances_employee_advance_id_seq', 1, false);


--
-- Data for Name: employee_banking; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: employee_banking_employee_banking_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('employee_banking_employee_banking_id_seq', 1, false);


--
-- Data for Name: employee_cases; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: employee_cases_employee_case_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('employee_cases_employee_case_id_seq', 1, false);


--
-- Data for Name: employee_leave; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: employee_leave_employee_leave_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('employee_leave_employee_leave_id_seq', 1, false);


--
-- Data for Name: employee_leave_types; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: employee_leave_types_employee_leave_type_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('employee_leave_types_employee_leave_type_id_seq', 1, false);


--
-- Data for Name: employee_month; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: employee_month_employee_month_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('employee_month_employee_month_id_seq', 1, false);


--
-- Data for Name: employee_objectives; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: employee_objectives_employee_objective_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('employee_objectives_employee_objective_id_seq', 1, false);


--
-- Data for Name: employee_overtime; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: employee_overtime_employee_overtime_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('employee_overtime_employee_overtime_id_seq', 1, false);


--
-- Data for Name: employee_per_diem; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: employee_per_diem_employee_per_diem_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('employee_per_diem_employee_per_diem_id_seq', 1, false);


--
-- Data for Name: employee_tax_types; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: employee_tax_types_employee_tax_type_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('employee_tax_types_employee_tax_type_id_seq', 1, false);


--
-- Data for Name: employee_trainings; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: employee_trainings_employee_training_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('employee_trainings_employee_training_id_seq', 1, false);


--
-- Data for Name: employees; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Data for Name: employment; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: employment_employment_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('employment_employment_id_seq', 1, false);


--
-- Data for Name: entity_subscriptions; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO entity_subscriptions (entity_subscription_id, entity_type_id, entity_id, subscription_level_id, org_id, details) VALUES (1, 0, 0, 0, 0, NULL);
INSERT INTO entity_subscriptions (entity_subscription_id, entity_type_id, entity_id, subscription_level_id, org_id, details) VALUES (2, 0, 1, 0, 0, NULL);


--
-- Name: entity_subscriptions_entity_subscription_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('entity_subscriptions_entity_subscription_id_seq', 2, true);


--
-- Data for Name: entity_types; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO entity_types (entity_type_id, use_key_id, org_id, entity_type_name, entity_role, start_view, group_email, description, details) VALUES (0, 0, 0, 'Users', 'user', NULL, NULL, NULL, NULL);
INSERT INTO entity_types (entity_type_id, use_key_id, org_id, entity_type_name, entity_role, start_view, group_email, description, details) VALUES (1, 1, 0, 'Staff', 'staff', NULL, NULL, NULL, NULL);
INSERT INTO entity_types (entity_type_id, use_key_id, org_id, entity_type_name, entity_role, start_view, group_email, description, details) VALUES (2, 2, 0, 'Client', 'client', NULL, NULL, NULL, NULL);
INSERT INTO entity_types (entity_type_id, use_key_id, org_id, entity_type_name, entity_role, start_view, group_email, description, details) VALUES (3, 3, 0, 'Supplier', 'supplier', NULL, NULL, NULL, NULL);
INSERT INTO entity_types (entity_type_id, use_key_id, org_id, entity_type_name, entity_role, start_view, group_email, description, details) VALUES (4, 4, 0, 'Applicant', 'applicant', '10:0', NULL, NULL, NULL);
INSERT INTO entity_types (entity_type_id, use_key_id, org_id, entity_type_name, entity_role, start_view, group_email, description, details) VALUES (5, 5, 0, 'Subscription', 'subscription', NULL, NULL, NULL, NULL);
INSERT INTO entity_types (entity_type_id, use_key_id, org_id, entity_type_name, entity_role, start_view, group_email, description, details) VALUES (6, 0, 1, 'Users', 'user', NULL, NULL, NULL, NULL);
INSERT INTO entity_types (entity_type_id, use_key_id, org_id, entity_type_name, entity_role, start_view, group_email, description, details) VALUES (7, 1, 1, 'Staff', 'staff', NULL, NULL, NULL, NULL);
INSERT INTO entity_types (entity_type_id, use_key_id, org_id, entity_type_name, entity_role, start_view, group_email, description, details) VALUES (8, 2, 1, 'Client', 'client', NULL, NULL, NULL, NULL);
INSERT INTO entity_types (entity_type_id, use_key_id, org_id, entity_type_name, entity_role, start_view, group_email, description, details) VALUES (9, 3, 1, 'Supplier', 'supplier', NULL, NULL, NULL, NULL);
INSERT INTO entity_types (entity_type_id, use_key_id, org_id, entity_type_name, entity_role, start_view, group_email, description, details) VALUES (10, 4, 1, 'Applicant', 'applicant', '10:0', NULL, NULL, NULL);


--
-- Name: entity_types_entity_type_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('entity_types_entity_type_id_seq', 10, true);


--
-- Data for Name: entitys; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO entitys (entity_id, entity_type_id, use_key_id, org_id, entity_name, user_name, primary_email, primary_telephone, super_user, entity_leader, no_org, function_role, date_enroled, is_active, entity_password, first_password, new_password, start_url, is_picked, details, attention, credit_limit, account_id, bio_code) VALUES (0, 0, 0, 0, 'root', 'root', 'root@localhost', NULL, true, true, false, NULL, '2017-01-03 15:38:52.355353', true, 'b6f0038dfd42f8aa6ca25354cd2e3660', 'baraza', NULL, NULL, false, NULL, NULL, 0, NULL, NULL);
INSERT INTO entitys (entity_id, entity_type_id, use_key_id, org_id, entity_name, user_name, primary_email, primary_telephone, super_user, entity_leader, no_org, function_role, date_enroled, is_active, entity_password, first_password, new_password, start_url, is_picked, details, attention, credit_limit, account_id, bio_code) VALUES (1, 0, 0, 0, 'repository', 'repository', 'repository@localhost', NULL, false, true, false, NULL, '2017-01-03 15:38:52.355353', true, 'b6f0038dfd42f8aa6ca25354cd2e3660', 'baraza', NULL, NULL, false, NULL, NULL, 0, NULL, NULL);


--
-- Name: entitys_entity_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('entitys_entity_id_seq', 1, true);


--
-- Data for Name: entry_forms; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: entry_forms_entry_form_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('entry_forms_entry_form_id_seq', 1, false);


--
-- Data for Name: evaluation_points; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: evaluation_points_evaluation_point_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('evaluation_points_evaluation_point_id_seq', 1, false);


--
-- Data for Name: farm_fields; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: farm_fields_farm_field_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('farm_fields_farm_field_id_seq', 1, false);


--
-- Data for Name: fields; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: fields_field_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('fields_field_id_seq', 1, false);


--
-- Data for Name: fiscal_years; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: fiscal_years_fiscal_year_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('fiscal_years_fiscal_year_id_seq', 1, false);


--
-- Data for Name: follow_up; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: follow_up_follow_up_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('follow_up_follow_up_id_seq', 1, false);


--
-- Data for Name: forms; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: forms_form_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('forms_form_id_seq', 1, false);


--
-- Data for Name: gls; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: gls_gl_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('gls_gl_id_seq', 1, false);


--
-- Data for Name: helpdesk; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: helpdesk_helpdesk_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('helpdesk_helpdesk_id_seq', 1, false);


--
-- Data for Name: holidays; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: holidays_holiday_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('holidays_holiday_id_seq', 1, false);


--
-- Data for Name: identification_types; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: identification_types_identification_type_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('identification_types_identification_type_id_seq', 1, false);


--
-- Data for Name: identifications; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: identifications_identification_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('identifications_identification_id_seq', 1, false);


--
-- Data for Name: industry; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (1, 0, 'Aerospace', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (2, 0, 'Agriculture', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (3, 0, 'Automotive', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (4, 0, 'Business and Consultancy Services', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (5, 0, 'ICT - Reseller', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (6, 0, 'ICT - Services and Consultancy', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (7, 0, 'ICT - Manufacturer', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (8, 0, 'ICT - Software Development', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (9, 0, 'Investments', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (10, 0, 'Education', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (11, 0, 'Electronics', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (12, 0, 'Finance, Banking, Insurance', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (13, 0, 'Government - National or Federal', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (14, 0, 'Government - State, Country or Local', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (15, 0, 'Healthcare', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (16, 0, 'Hotel and Leisure', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (17, 0, 'Legal', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (18, 0, 'Manufacturing', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (19, 0, 'Media, Marketing, Entertainment, Publishing, PR', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (20, 0, 'Real Estate', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (21, 0, 'Retail, Wholesale', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (22, 0, 'Telecoms', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (23, 0, 'Transportation and Distribution', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (24, 0, 'Travel and Tours', NULL);
INSERT INTO industry (industry_id, org_id, industry_name, details) VALUES (25, 0, 'Other', NULL);


--
-- Name: industry_industry_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('industry_industry_id_seq', 25, true);


--
-- Data for Name: intake; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: intake_intake_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('intake_intake_id_seq', 1, false);


--
-- Data for Name: interns; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: interns_intern_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('interns_intern_id_seq', 1, false);


--
-- Data for Name: internships; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: internships_internship_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('internships_internship_id_seq', 1, false);


--
-- Data for Name: item_category; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO item_category (item_category_id, org_id, item_category_name, details) VALUES (1, 0, 'Services', NULL);
INSERT INTO item_category (item_category_id, org_id, item_category_name, details) VALUES (2, 0, 'Goods', NULL);
INSERT INTO item_category (item_category_id, org_id, item_category_name, details) VALUES (3, 0, 'Utilities', NULL);


--
-- Name: item_category_item_category_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('item_category_item_category_id_seq', 3, true);


--
-- Data for Name: item_units; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO item_units (item_unit_id, org_id, item_unit_name, details) VALUES (1, 0, 'Each', NULL);
INSERT INTO item_units (item_unit_id, org_id, item_unit_name, details) VALUES (2, 0, 'Man Hours', NULL);
INSERT INTO item_units (item_unit_id, org_id, item_unit_name, details) VALUES (3, 0, '100KG', NULL);


--
-- Name: item_units_item_unit_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('item_units_item_unit_id_seq', 3, true);


--
-- Data for Name: items; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: items_item_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('items_item_id_seq', 1, false);


--
-- Data for Name: job_reviews; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: job_reviews_job_review_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('job_reviews_job_review_id_seq', 1, false);


--
-- Data for Name: jobs_category; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (1, 0, 'Accounting', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (2, 0, 'Banking and Financial Services', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (3, 0, 'CEO', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (4, 0, 'General Management', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (5, 0, 'Creative and Design', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (6, 0, 'Customer Service and Call Centre', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (7, 0, 'Education and Training', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (8, 0, 'Engineering and Construction', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (9, 0, 'Farming and Agribusiness', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (10, 0, 'Government', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (11, 0, 'Healthcare and Pharmaceutical', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (12, 0, 'Human Resources', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (13, 0, 'Insurance', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (14, 0, 'ICT', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (15, 0, 'Telecoms', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (16, 0, 'Legal', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (17, 0, 'Manufacturing', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (18, 0, 'Marketing, Media and Brand', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (19, 0, 'NGO, Community and Social Development', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (20, 0, 'Office and Administration', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (21, 0, 'Project and Programme Management', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (22, 0, 'Research, Science and Biotech', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (23, 0, 'Retail', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (24, 0, 'Sales', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (25, 0, 'Security', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (26, 0, 'Strategy and Consulting', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (27, 0, 'Tourism and Travel', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (28, 0, 'Trades and Services', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (29, 0, 'Transport and Logistics', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (30, 0, 'Internships and Volunteering', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (31, 0, 'Real Estate', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (32, 0, 'Hospitality', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (33, 0, 'Other', NULL);
INSERT INTO jobs_category (jobs_category_id, org_id, jobs_category, details) VALUES (34, 1, 'General Management', NULL);


--
-- Name: jobs_category_jobs_category_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('jobs_category_jobs_category_id_seq', 34, true);


--
-- Data for Name: journals; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: journals_journal_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('journals_journal_id_seq', 1, false);


--
-- Data for Name: kin_types; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO kin_types (kin_type_id, org_id, kin_type_name, details) VALUES (1, 0, 'Wife', NULL);
INSERT INTO kin_types (kin_type_id, org_id, kin_type_name, details) VALUES (2, 0, 'Husband', NULL);
INSERT INTO kin_types (kin_type_id, org_id, kin_type_name, details) VALUES (3, 0, 'Daughter', NULL);
INSERT INTO kin_types (kin_type_id, org_id, kin_type_name, details) VALUES (4, 0, 'Son', NULL);
INSERT INTO kin_types (kin_type_id, org_id, kin_type_name, details) VALUES (5, 0, 'Mother', NULL);
INSERT INTO kin_types (kin_type_id, org_id, kin_type_name, details) VALUES (6, 0, 'Father', NULL);
INSERT INTO kin_types (kin_type_id, org_id, kin_type_name, details) VALUES (7, 0, 'Brother', NULL);
INSERT INTO kin_types (kin_type_id, org_id, kin_type_name, details) VALUES (8, 0, 'Sister', NULL);
INSERT INTO kin_types (kin_type_id, org_id, kin_type_name, details) VALUES (9, 0, 'Others', NULL);
INSERT INTO kin_types (kin_type_id, org_id, kin_type_name, details) VALUES (10, 1, 'Wife', NULL);
INSERT INTO kin_types (kin_type_id, org_id, kin_type_name, details) VALUES (11, 1, 'Husband', NULL);
INSERT INTO kin_types (kin_type_id, org_id, kin_type_name, details) VALUES (12, 1, 'Daughter', NULL);
INSERT INTO kin_types (kin_type_id, org_id, kin_type_name, details) VALUES (13, 1, 'Son', NULL);
INSERT INTO kin_types (kin_type_id, org_id, kin_type_name, details) VALUES (14, 1, 'Mother', NULL);
INSERT INTO kin_types (kin_type_id, org_id, kin_type_name, details) VALUES (15, 1, 'Father', NULL);
INSERT INTO kin_types (kin_type_id, org_id, kin_type_name, details) VALUES (16, 1, 'Brother', NULL);
INSERT INTO kin_types (kin_type_id, org_id, kin_type_name, details) VALUES (17, 1, 'Sister', NULL);
INSERT INTO kin_types (kin_type_id, org_id, kin_type_name, details) VALUES (18, 1, 'Others', NULL);


--
-- Name: kin_types_kin_type_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('kin_types_kin_type_id_seq', 18, true);


--
-- Data for Name: kins; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: kins_kin_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('kins_kin_id_seq', 1, false);


--
-- Data for Name: lead_items; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: lead_items_lead_item_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('lead_items_lead_item_id_seq', 1, false);


--
-- Data for Name: leads; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: leads_lead_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('leads_lead_id_seq', 1, false);


--
-- Data for Name: leave_types; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO leave_types (leave_type_id, org_id, leave_type_name, allowed_leave_days, leave_days_span, use_type, month_quota, initial_days, maximum_carry, include_holiday, include_mon, include_tue, include_wed, include_thu, include_fri, include_sat, include_sun, details) VALUES (0, 0, 'Annual Leave', 21, 7, 1, 0, 0, 0, false, true, true, true, true, true, false, false, NULL);


--
-- Name: leave_types_leave_type_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('leave_types_leave_type_id_seq', 1, false);


--
-- Data for Name: leave_work_days; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: leave_work_days_leave_work_day_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('leave_work_days_leave_work_day_id_seq', 1, false);


--
-- Data for Name: ledger_links; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: ledger_links_ledger_link_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('ledger_links_ledger_link_id_seq', 1, false);


--
-- Data for Name: ledger_types; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: ledger_types_ledger_type_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('ledger_types_ledger_type_id_seq', 1, false);


--
-- Data for Name: loan_monthly; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: loan_monthly_loan_month_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('loan_monthly_loan_month_id_seq', 1, false);


--
-- Data for Name: loan_types; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO loan_types (loan_type_id, adjustment_id, org_id, loan_type_name, default_interest, reducing_balance, details) VALUES (0, 15, 0, 'Emergency', 6, true, NULL);


--
-- Name: loan_types_loan_type_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('loan_types_loan_type_id_seq', 1, false);


--
-- Data for Name: loans; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: loans_loan_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('loans_loan_id_seq', 1, false);


--
-- Data for Name: locations; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO locations (location_id, org_id, location_name, details) VALUES (0, 0, 'Main office', NULL);
INSERT INTO locations (location_id, org_id, location_name, details) VALUES (1, 1, 'Main office', NULL);


--
-- Name: locations_location_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('locations_location_id_seq', 1, true);


--
-- Data for Name: objective_details; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: objective_details_objective_detail_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('objective_details_objective_detail_id_seq', 1, false);


--
-- Data for Name: objective_types; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO objective_types (objective_type_id, org_id, objective_type_name, details) VALUES (1, 0, 'General', NULL);


--
-- Name: objective_types_objective_type_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('objective_types_objective_type_id_seq', 1, true);


--
-- Data for Name: objectives; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- Name: objectives_objective_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('objectives_objective_id_seq', 1, false);


--
