121 lines
3.7 KiB
PHP
121 lines
3.7 KiB
PHP
<% /*
|
|
$Revision$
|
|
$Id$
|
|
|
|
File: model_prs_kostencombinatie.inc
|
|
|
|
Description: Vanuit CodeCharge gegenereerd model voor prs_kostencombinatie
|
|
|
|
Context:
|
|
|
|
Notes:
|
|
*/
|
|
%>
|
|
<%
|
|
var costtype_search = getQParam("_name", "");
|
|
costtype_search = "%" + costtype_search.toUpperCase() + "%";
|
|
|
|
function model_prs_kostencombinatie()
|
|
{
|
|
this.records_name = "costcombinations";
|
|
this.record_name = "costcombination";
|
|
this.table = "prs_kostencombinatie";
|
|
this.primary = "prs_kostencombinatie_key";
|
|
this.autfunction = "WEB_FINMSU";
|
|
this.record_title = L("prs_kostencombinatie");
|
|
this.records_title = L("prs_kostencombinatie_m");
|
|
|
|
|
|
this.fields = {
|
|
"id": {
|
|
"dbs": "prs_kostencombinatie_key",
|
|
"label": L("lcl_key"),
|
|
"typ": "key",
|
|
"required": true,
|
|
"filter": "exact",
|
|
"seq": "prs_s_prs_kostencombinatie_key"
|
|
},
|
|
"_name": { // Wordt gebruikt om op omschrijving van kostensoort te kunnen zoeken, ipv een listbox
|
|
"dbs": "",
|
|
"label": L("prs_kostensoort_key")+"/"+L("prs_kostensoort_oms"),
|
|
"typ": "varchar",
|
|
"hidden_fld": true,
|
|
"filter": "like"
|
|
},
|
|
"refcode": {
|
|
"dbs": "prs_kostencombinatie.prs_kostensoort_key",
|
|
"label": L("prs_kostensoort_refcode"),
|
|
"typ": "key",
|
|
"hidden_fld": true,
|
|
"foreign": {
|
|
"tbl": "prs_kostensoort",
|
|
"key": "prs_kostensoort_key",
|
|
"desc": "prs_kostensoort_refcode"
|
|
}
|
|
},
|
|
"costtype": {
|
|
"dbs": "prs_kostensoort_key",
|
|
"label": L("prs_kostensoort_key"),
|
|
"typ": "key",
|
|
"required": true,
|
|
"foreign": "prs_kostensoort"
|
|
},
|
|
"group": {
|
|
"dbs": "prs_kostenplaatsgrp_key",
|
|
"label": L("prs_kostenplaatsgrp_key"),
|
|
"typ": "key",
|
|
"required": true,
|
|
"foreign": {
|
|
"tbl": "prs_kostenplaatsgrp",
|
|
"key": "prs_kostenplaatsgrp_key",
|
|
"desc": "prs_kostenplaatsgrp_oms"
|
|
}
|
|
}
|
|
};
|
|
|
|
this.list = {
|
|
"columns": [
|
|
"costtype",
|
|
"group"
|
|
]
|
|
};
|
|
this.search = {
|
|
"autosearch": true
|
|
};
|
|
this.edit = {
|
|
"modal": true
|
|
};
|
|
|
|
var xmodel = getQParam("model", "");
|
|
if (mode == "list" && xmodel == this.records_name)
|
|
{
|
|
this.REST_GET = generic_REST_GET(this);
|
|
}
|
|
else
|
|
{
|
|
var ext_sql = "(SELECT prs_kostensoort_key"
|
|
+ " , prs_kostensoort_upper"
|
|
+ " , prs_kostensoort_opmerking"
|
|
+ " , prs_kostensoort_refcode"
|
|
+ " FROM prs_kostensoort"
|
|
+ ") ks";
|
|
|
|
this.REST_GET = generic_REST_GET(this, {
|
|
"GET": {
|
|
"tables": [ext_sql],
|
|
"wheres": ["ks.prs_kostensoort_key = prs_kostencombinatie.prs_kostensoort_key",
|
|
"( ks.prs_kostensoort_upper LIKE " + safe.quoted_sql(costtype_search) +
|
|
"OR UPPER(ks.prs_kostensoort_opmerking) LIKE " + safe.quoted_sql(costtype_search) +
|
|
"OR UPPER(ks.prs_kostensoort_refcode) LIKE " + safe.quoted_sql(costtype_search) +
|
|
")"
|
|
]
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
this.REST_POST = generic_REST_POST(this);
|
|
this.REST_PUT = generic_REST_PUT(this);
|
|
this.REST_DELETE = generic_REST_DELETE(this);
|
|
}
|
|
%> |