<% /*
    $Revision$
    $Id$

    File:           model_res_deel.inc

    Description:    Vanuit CodeCharge gegenereerd model voor res_deel

    Context:

    Notes:
*/
%>
<%

function model_res_deel()
{
    this.table = "res_deel";
    this.primary = "res_deel_key";
    this.records_name = "res_deels";
    this.record_name = "res_deel";
    this.soft_delete = "res_deel_verwijder";
    this.soft_expire = "res_deel_vervaldatum";
    this.autfunction = "WEB_RESMSU";
    this.record_title = L("res_deel");
    this.records_title = L("res_deel_m");


    this.fields = {
        "id": {
            "dbs": "res_deel_key",
            "label": "Key",
            "typ": "key",
            "required": true,
            "filter": "exact",
            "seq": "res_s_res_deel_key"
        },
        "res_ins_deel_key": {
            "dbs": "res_ins_deel_key",
            "label": L("res_ins_deel_key"),
            "typ": "key",
            "insertonly": true,
            "foreign": {
                "tbl": "ins_deel",
                "key": "ins_deel_key",
                "desc": "ins_deel_omschrijving"
            },
            "filter": "exact"
        },
        "name": {
            "dbs": "res_deel_omschrijving",
            "label": L("res_deel_omschrijving"),
            "typ": "varchar",
            "translate": true,
            "required": true,
            "filter": "like"
        },
        "res_discipline_key": {
            "dbs": "res_discipline_key",
            "label": L("res_discipline_key"),
            "typ": "key",
            "required": true,
            "foreign": {
                "tbl": "(select ins_discipline_key, ins_discipline_omschrijving"
                     + "   from ins_tab_discipline"
                     + "  where ins_discipline_module = 'RES'"
                     + "    and ins_discipline_min_level = 1"
                     + "    and ins_discipline_verwijder is null"
                     + "  order by ins_discipline_omschrijving asc)",
                "key": "ins_discipline_key",
                "desc": "ins_discipline_omschrijving"
            },
            "filter": "exact",
            "LOVinit": ""
        },
        "res_deel_eenheid": {
            "dbs": "res_deel_eenheid",
            "label": L("res_deel_eenheid"),
            "typ": "varchar",
            "translate": true
        },
        "res_deel_prijs": {
            "dbs": "res_deel_prijs",
            "label": L("res_deel_prijs"),
            "iscurrency": true,
            "typ": "float"
        },
        "res_deel_prijs_vast": {
            "dbs": "res_deel_prijs_vast",
            "label": L("res_deel_prijs_vast"),
            "typ": "check"
        },
        "res_deel_alg_level": {
            "dbs": "res_deel_alg_level",
            "label": L("res_deel_alg_level"),
            "typ": "number",
            "LOV": L("res_deel_alg_levelLOV"),
            "emptyoption": null
        },
        "res_deel_beschikbaar_bits": {
            "dbs": "res_deel_beschikbaar_bits",
            "label": L("res_deel_beschikbaar_bits"),
            "typ": "number",
            "hidden_fld": true,
            "required": true
        },
        "_beschikbaar": {
            "dbs": "",
            "label": L("res_deel_beschikbaarheid"),
            "typ": "button",
            "defaultvalue": L("lcl_select")
        },
        "res_deel_opmerking": {
            "dbs": "res_deel_opmerking",
            "label": L("res_deel_opmerking"),
            "typ": "memo",
            "translate": true
        },
        "res_deel_image": {
            "dbs": "res_deel_image",
            "label": L("res_deel_image"),
            "typ": "varchar",
            "flexmodule": "RESPHD"
        },
        "res_deel_vervaldatum": {
            "dbs": "res_deel_vervaldatum",
            "label": L("res_deel_vervaldatum"),
            "typ": "date"
        }
    };


    this.REST_GET    = generic_REST_GET(this);
    this.REST_POST   = generic_REST_POST(this);
    this.REST_PUT    = generic_REST_PUT(this);
    this.REST_DELETE = generic_REST_DELETE(this);
}
%>