<% /*
    $Revision$
    $Id$

    File:           model_mld_discipline.inc

    Description:    Vanuit CodeCharge gegenereerd model voor mld_discipline

    Context:

    Notes:
*/
%>
<!-- #include file="model_mld_disc_params.inc" -->
<%
function model_mld_discipline(disc_key, params)
{
    // Eén model voor de buitenwereld
    api2.merge_disc_params_model(this, _model_mld_discipline);

    this.REST_GET    = generic_REST_GET(_model_mld_discipline,  // Let op: de originele _model_res_discipline
                                           { "GET": {
                                                     wheres: [ "ins_tab_discipline.ins_discipline_module = 'MLD'"
                                                             ]
                                                    }
                                            }
                                      )

    this.REST_POST   = generic_REST_POST(_model_mld_discipline);
    this.REST_PUT    = generic_REST_PUT(_model_mld_discipline);
    this.REST_DELETE = generic_REST_DELETE(this);
}

_model_mld_discipline = // Internal only
{
    "table": "ins_tab_discipline",
    "primary": "ins_discipline_key",
    "records_name": "issuedisciplines",
    "record_name": "issuediscipline",
    "autfunction": "WEB_MLDMGT",
    "record_title": L("mld_discipline"),
    "records_title": L("mld_discipline_m"),
    "soft_delete": "ins_discipline_verwijder",


    "fields": {
        "id": {
            "dbs": "ins_discipline_key",
            "label": "Key",
            "typ": "key",
            "filter": "exact",
            "seq": "ins_s_ins_discipline_key"
        },
        "disciplinetype": {
            "dbs": "ins_srtdiscipline_key",
            "label": L("ins_srtdiscipline"),
            "typ": "key",
            "foreign" : {
                "tbl": "ins_v_aanwezigsrtdiscipline",
                "key": "ins_srtdiscipline_key",
                "desc": "ins_srtdiscipline_omschrijving"
            },
            "emptyoption": null,
            "filter": "exact",
            "required": true
        },
        "name": {
            "dbs": "ins_discipline_omschrijving",
            "label": L("ins_discipline_omschrijving"),
            "typ": "varchar",
            "required": true,
            "translate": true
        },
        "costtype": {
            "dbs": "prs_kostensoort_key",
            "label": L("prs_kostensoort"),
            "typ": "key",
            "foreign": {
                "tbl": "PRS_KOSTENSOORT",
                "key": "PRS_KOSTENSOORT_KEY",
                "desc": "PRS_KOSTENSOORT_OMS"
            }
        },
        "ins_discipline_kpnverplicht": {
            "dbs": "ins_discipline_kpnverplicht",
            "label": L("ins_discipline_kpnverplicht"),
            "typ": "check"
        },
        "ins_discipline_module": {
            "dbs": "ins_discipline_module",
            "label": L("ins_discipline_module"),
            "typ": "varchar",
            "required": true,
            "defaultvalue": "MLD",
            "hidden_fld": true
        },
        "ins_discipline_email": {
            "dbs": "ins_discipline_email",
            "label": L("ins_discipline_email"),
            "typ": "varchar"
        },
        "ins_discipline_ktopercentage": {
            "dbs": "ins_discipline_ktopercentage",
            "label": L("ins_discipline_ktopercentage"),
            "typ": "number"
        },
        "ins_discipline_ktodrempel": {
            "dbs": "ins_discipline_ktodrempel",
            "label": L("ins_discipline_ktodrempel"),
            "typ": "number"
        }
    },
    "disc_params": {
        "model": model_mld_disc_params,
        "joinfield": "mld_ins_discipline_key"
    }
}
%>