AAIT#37411 Contract factuurschema bewerken via scaffolding
svn path=/Website/trunk/; revision=31459
This commit is contained in:
@@ -657,6 +657,15 @@ api2 = {
|
||||
}
|
||||
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
|
||||
// We bieden daar geen garantie op maar tijdens testen is deterministisch
|
||||
// gedrag wel fijn.
|
||||
|
||||
62
APPL/API2/model_cnt_factuurschema.inc
Normal file
62
APPL/API2/model_cnt_factuurschema.inc
Normal 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);
|
||||
}
|
||||
%>
|
||||
@@ -15,6 +15,7 @@
|
||||
<!-- #include file="../Shared/discx3d.inc" -->
|
||||
<!-- #include file="../cnt/cnt.inc" -->
|
||||
<!-- #include file="./model_tracking.inc"-->
|
||||
<!-- #include file="./model_cnt_factuurschema.inc"-->
|
||||
<%
|
||||
|
||||
model_contracts =
|
||||
@@ -47,6 +48,10 @@ model_contracts =
|
||||
"tracking": {
|
||||
model: new model_tracking(['contract']),
|
||||
joinfield: "fac_tracking_refkey"
|
||||
},
|
||||
"schedule": {
|
||||
model: new model_cnt_factuurschema(),
|
||||
joinfield: "cnt_contract_key"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
45
APPL/CNT/cnt_factuurschema.asp
Normal file
45
APPL/CNT/cnt_factuurschema.asp
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
%>
|
||||
Reference in New Issue
Block a user