<% /*
    $Revision$
    $Id$

    File:           model_cnt_disc_params.inc

    Description:    Vanuit CodeCharge gegenereerd model voor cnt_discipline

    Context:

    Notes:          *uitsluitend* gebruikt als include van model_cnt_discipline
*/
%>
<%
model_cnt_disc_params =
{
    "records_name": "cnt_disc_params",
    "record_name": "cnt_disc_params",
    "table": "cnt_disc_params",
    "primary": "cnt_disc_params_key",
    "autfunction": "WEB_CNTMGT",


    "fields": {
        "id": {
            "dbs": "cnt_disc_params_key",
            "label": L("lcl_key"),
            "typ": "key",
            "seq": "cnt_s_cnt_disc_params_key"
        },
        "contractdiscipline": {
            "dbs": "cnt_ins_discipline_key",
            "label": "Foreign key",
            "typ": "key",
            "hidden_fld": true
        },
        "contracttype": {
            "dbs": "cnt_srtcontract_type",
            "label": L("cnt_discipline_cnt_disckey"),
            "typ": "key",
            "insertonly": true,
            "required": true,
            "foreign": {
                "tbl": "cnt_typecontract",
                "key": "cnt_typecontract_key",
                "desc": "lcl.l(cnt_typecontract_omschrijving, 1)"
            }
        },
        "salescontract": {
            "dbs": "cnt_disc_params_verkoopcontr",
            "label": L("cnt_discipline_verkoopcontr"),
            "typ": "check0"
        },
        "schedule": {
            "dbs": "cnt_disc_params_factuurschema",
            "label": L("cnt_discipline_factuurschema"),
            "typ": "check0"
        },
        "percentage": {
            "dbs": "cnt_disc_params_factuurpct",
            "label": L("cnt_discipline_factuurpct"),
            "typ": "number"
        },
        "margin": {
            "dbs": "cnt_disc_params_factuurmarge",
            "label": L("cnt_discipline_factuurmarge"),
            "iscurrency": true,
            "typ": "float"
        },
        "approve": {
            "dbs": "cnt_disc_params_factuurappr",
            "label": L("cnt_discipline_factuurappr"),
            "typ": "check0"
        },
        "invoicelimit": { // "limit" is een reserved naam in API2
            "dbs": "cnt_disc_params_factuurgrens",
            "label": L("cnt_discipline_factuurgrens"),
            "typ": "number"
        },
        //"period": {
        //    "dbs": "cnt_disc_params_termijndefault",
        //    "label": L("cnt_discipline_termijn"),
        //    "typ": "number"
        //},
        "remark": {
            "dbs": "cnt_disc_params_opmerking",
            "label": L("cnt_discipline_opmerking"),
            "typ": "memo",
            "translate": true
        },
        "financialdata": {
            "dbs": "cnt_disc_params_fin",
            "label": L("cnt_discipline_fin"),
            "typ": "check0",
            "defaultvalue": 1
        },
        "binding": {
            "dbs": "cnt_disc_params_binding",
            "label": L("cnt_discipline_binding"),
            "typ": "number",
            "bits": [
                {
                    "name": "",
                    "label": "",
                    "typ": "check",
                    "mask": 3,
                    "radios":  [
                        {
                            "name": "company",
                            "label": L("cnt_discipline_bind_company"),
                            "mask": 1,
                            "defaultvalue": 1
                        },
                        {
                            "name": "person",
                            "label": L("cnt_discipline_bind_person"),
                            "mask": 2,
                            "defaultvalue": 1
                        }
                    ]
                }
            ]
        },
        "forsupplier": {
            "dbs": "cnt_disc_params_leverancier",
            "label": L("cnt_discipline_leverancier"),
            "typ": "check0",
            "defaultvalue": 1
        },
        "forexecutor": {
            "dbs": "cnt_disc_params_uitvoerende",
            "label": L("cnt_discipline_uitvoerende"),
            "typ": "check0",
            "defaultvalue": 1
        },
        "forrenter": {
            "dbs": "cnt_disc_params_huurder",
            "label": L("cnt_discipline_huurder"),
            "typ": "check0",
            "defaultvalue": 1
        },
        "options": {
            "dbs": "cnt_disc_params_opties",
            "label": L("cnt_discipline_verlengbaar"),
            "typ": "check0",
            "defaultvalue": 0
        },
        "costtypemandatory": {
            "dbs": "cnt_disc_params_ksverplicht",
            "label": L("cnt_discipline_ksverplicht"),
            "typ": "check0",
            "defaultvalue": 0
        },
        "approvenew": {
            "dbs": "cnt_disc_params_approve_new",
            "label": L("cnt_discipline_approve_new"),
            "typ": "check0",
            "defaultvalue": 0
        }
/*      // Voor als in cnt_disc_params_opties meerdere bits worden gebruikt om verschillende opties aan te geven:
        "options": {
            "dbs": "cnt_disc_params_opties",
            "label": L("cnt_discipline_optie"),
            "typ": "number",
            "bits": [
                {
                    "name": "",
                    "label": "",
                    "typ": "check",
                    "mask": 1,
                    "radios":  [
                        {
                            "name": "renewable",
                            "label": L("cnt_discipline_verlengbaar"),
                            "mask": 1,
                            "defaultvalue": 0
                        }
                    ]
                }
            ],
            "defaultvalue": 0
        }
*/
    }
}

api2.generic_REST(model_cnt_disc_params);
%>