<% /*
    $Revision$
    $Id$

    File:           model_fin_kenmerk.inc

    Description:    Vanuit CodeCharge gegenereerd model voor fin_kenmerk

    Context:

    Notes:
*/
%>
<%

function model_fin_kenmerk()
{
    this.table = "fin_kenmerk";
    this.primary = "fin_kenmerk_key";
    this.records_name = "fin_kenmerks";
    this.record_name = "fin_kenmerk";
    this.soft_delete = "fin_kenmerk_verwijder";
    this.autfunction = "WEB_PRSSYS";
    this.record_title = L("fin_kenmerk");
    this.records_title = L("fin_kenmerk_m");

    this.fields = {
        "id": {
            "dbs": "fin_kenmerk_key",
            "label": "Key",
            "typ": "key",
            "required": true,
            "filter": "exact",
            "seq": "fin_s_fin_kenmerk_key"
        },
        "sequence": {
            "dbs": "fin_kenmerk_volgnr",
            "label": L("mgt_kenmerk_volgnummer"),
            "typ": "number",
            "required": true
        },
        "name": {
            "dbs": "fin_kenmerk_omschrijving",
            "label": L("mgt_kenmerk_omschrijving"),
            "typ": "varchar",
            "translate": true,
            "required": true
        },
        "hint": {
            "dbs": "fin_kenmerk_hint",
            "label": L("mgt_kenmerk_hint"),
            "typ": "memo",
            "translate": true
        },
        "unit": {
            "dbs": "fin_kenmerk_dimensie",
            "label": L("mgt_srtkenmerk_dimensie"),
            "typ": "varchar",
            "translate": true
        },
        "property_type": {
            "dbs": "fin_kenmerk_kenmerktype",
            "label": L("mgt_srtkenmerk_kenmerktype"),
            "typ": "varchar",
            "required": true,
            "LOV": buildKenmerktypeLOV()
        },
        "kenmerk_type": {
            "dbs": "fin_kenmerk_type",
            "label": L("fin_kenmerk_type"),
            "typ": "varchar",
            "LOV": fill_fin_type_LOV(),
            "emptyoption": null
        },
        "required": {
            "dbs": "fin_kenmerk_verplicht",
            "label": L("mgt_kenmerk_verplicht"),
            "typ": "key",
            "LOV": buildVerplichtingList(),
            "emptyoption": null
        },
        "property_groep": {
            "dbs": "fin_kenmerk_groep",
            "label": L("mgt_kenmerk_groep"),
            "typ": "key",
            "required": true,
            "LOV": buildGroepsverplichtingList(),
            "emptyoption": null
        },
        "readonly": {
            "dbs": "fin_kenmerk_toonbaar",
            "label": L("mgt_kenmerk_toonbaar"),
            "typ": "check"
        },
        "system": {
            "dbs": "fin_kenmerk_systeem",
            "label": L("mgt_srtkenmerk_systeem"),
            "typ": "check"
        },
        "length": {
            "dbs": "fin_kenmerk_lengte",
            "label": L("mgt_srtkenmerk_lengte"),
            "typ": "number"
        },
        "decimals": {
            "dbs": "fin_kenmerk_dec",
            "label": L("mgt_srtkenmerk_dec"),
            "typ": "number"
        },
        "minimum": {
            "dbs": "fin_kenmerk_nmin",
            "label": L("mgt_srtkenmerk_nmin"),
            "typ": "number"
        },
        "maximum": {
            "dbs": "fin_kenmerk_nmax",
            "label": L("mgt_srtkenmerk_nmax"),
            "typ": "number"
        },
        "domein": {
            "dbs": "fac_kenmerkdomein_key",
            "label": L("fac_kenmerkdomein_key"),
            "typ": "key",
            "foreign": fac_kenmerkdomein_foreign("FIN"),
            "filter": "exact",
            "LOVinit": ""
        },
        "default": {
            "dbs": "fin_kenmerk_default",
            "label": L("mgt_kenmerk_default"),
            "typ": "memo",
            "translate": true
        },
        "regexp": {
            "dbs": "fin_kenmerk_regexp",
            "label": L("mgt_kenmerk_regexp"),
            "typ": "varchar"
        }
    };


    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);

    function fill_fin_type_LOV()
    {
        return  "F;"+L("fin_invoice")
             + ";R;"+L("fin_invoicerows");
    }
}
%>