AAIT#37411 Contract factuurschema bewerken via scaffolding

svn path=/Website/trunk/; revision=31459
This commit is contained in:
Jos Groot Lipman
2016-11-14 13:59:45 +00:00
parent 16f2bf765e
commit 7ce4f83347
4 changed files with 121 additions and 0 deletions

View File

@@ -657,6 +657,15 @@ api2 = {
} }
else else
{ {
if (params.orderby)
{
for (var i = 0; i < params.orderby.length; i++)
{
var field = inc.model.fields[params.orderby[i]];
if (field)
orderbys.push(inc.model.table + "." + field.dbs);
}
}
// In orderbys worden de include primary keys verzameld om te sorteren // In orderbys worden de include primary keys verzameld om te sorteren
// We bieden daar geen garantie op maar tijdens testen is deterministisch // We bieden daar geen garantie op maar tijdens testen is deterministisch
// gedrag wel fijn. // gedrag wel fijn.

View File

@@ -0,0 +1,62 @@
<% /*
$Revision$
$Id$
File: model_cnt_factuurschema.inc
Description: Model voor cnt_factuurschema
Context:
Notes:
*/
%>
<%
function model_cnt_factuurschema()
{
this.table = "cnt_factuurschema";
this.primary = "cnt_factuurschema_key";
this.records_name = "cnt_factuurschemas";
this.record_name = "cnt_factuurschema";
this.autfunction = "WEB_CNTMGT";
this.record_title = L("cnt_factuurschema");
this.records_title = L("cnt_factuurschema_m");
this.fields = {
"id": {
"dbs": "cnt_factuurschema_key",
"label": "Key",
"typ": "key",
"required": true,
"seq": "cnt_s_cnt_factuurschema_key"
},
"cnt_contract_key": {
"dbs": "cnt_contract_key",
"typ": "key",
"foreign": "cnt_contract",
"label": L("lcl_contract")
},
"accountingperiod": {
"dbs": "cnt_factuurschema_boekmaand",
"typ": "varchar",
"track": true,
"label": L("lcl_fin_divide_period")
},
"amount": {
"dbs": "cnt_factuurschema_bedrag",
"typ": "float"
},
"description": {
"dbs": "cnt_factuurschema_opmerking",
"typ": "memo",
"label": L("cnt_factuurschema_opmerking")
}
};
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);
}
%>

View File

@@ -15,6 +15,7 @@
<!-- #include file="../Shared/discx3d.inc" --> <!-- #include file="../Shared/discx3d.inc" -->
<!-- #include file="../cnt/cnt.inc" --> <!-- #include file="../cnt/cnt.inc" -->
<!-- #include file="./model_tracking.inc"--> <!-- #include file="./model_tracking.inc"-->
<!-- #include file="./model_cnt_factuurschema.inc"-->
<% <%
model_contracts = model_contracts =
@@ -47,6 +48,10 @@ model_contracts =
"tracking": { "tracking": {
model: new model_tracking(['contract']), model: new model_tracking(['contract']),
joinfield: "fac_tracking_refkey" joinfield: "fac_tracking_refkey"
},
"schedule": {
model: new model_cnt_factuurschema(),
joinfield: "cnt_contract_key"
} }
}, },

View File

@@ -0,0 +1,45 @@
<%@language = "javascript" %>
<% /*
$Revision$
$Id$
File: cnt_factuurschema
Description: Aanroep voor model_cnt_factuurschema
Context: Zal altijd aangeroepen worden met (include) model=schedule
Notes: cnt_factuurschema is een include van cnt_contract
Daarom doen we hier ook model cnt_contract en zorgen voor
een 'include-aanroep'
*/
%>
<!-- #include file="../scf/scaffolding.inc" -->
<!-- #include file="../mgt/mgt_tools.inc" -->
<!-- #include file="../api2/model_contracts.inc" -->
<%
var this_model = model_contracts;
scaffolding(this_model,
{ "included": {
"schedule" : {
"list": {
"columns": [
"id",
"cnt_contract_key",
"accountingperiod",
"amount",
"description"
],
"orderby": [,
"cnt_contract_key",
"accountingperiod"
]
},
"edit": {
"modal": true
}
}
}
});
%>