diff --git a/APPL/API2/model_reports.inc b/APPL/API2/model_reports.inc index ea8e48527a..50ae3b5893 100644 --- a/APPL/API2/model_reports.inc +++ b/APPL/API2/model_reports.inc @@ -175,7 +175,7 @@ function model_reports(fac_usrrap_key) model.styling = usrrap.styling; model.graph_options = usrrap.graph_options; model.graph_type = usrrap.graph_type; - model.list = { columns : [], groupby : [], canGroup: true, canCSV: true, autoCount: usrrap.count.id, autoPivot: usrrap.pivot.id, autoGraph: usrrap.graph.id, autoRatio: usrrap.ratio.id }; + model.list = { columns : [], groupby : [], canGroup: true, canCSV: true, autoCount: usrrap.count.id, autoPivot: usrrap.pivot.id, autoGraph: usrrap.graph.id, autoRatio: usrrap.ratio.id, autoCond: usrrap.cond.id }; if (model.styling && (model.styling.id & 1)) model.list.fixedColumns = true; model.search.title = L("lcl_usrrap_report") + " " + usrrap.name; @@ -287,6 +287,7 @@ function report_GET(params) // aangeroepen. Pak dan de geconfigureerde defaults def(params.filter, "scf_pivot", (this.list.autoPivot & 2)?2:0); def(params.filter, "scf_graph", (this.list.autoGraph & 2) == 2?"on":""); + def(params.filter, "scf_cond", (this.list.autoCond & 2) == 2?"on":""); if (!params.columns) { @@ -484,12 +485,13 @@ function report_GET(params) if ("addfixedfilters" in this) this.addfixedfilters(params.filter); var wheres = api2.sqlfilter(params, this); - // RWSN#35799 Experimenteel: rapporten waarvan naam begint met OR_ doen een OR op de zichtbare filtervelden - //if (this.records_title.substr(0,3) == "OR_") - //{ - // if (wheres.length) - // wheres = ["(" + wheres.join(" OR ") + ")"]; - //} + + if (params.filter.scf_cond == "on") + { + if (wheres.length) + wheres = ["(" + wheres.join(" OR ") + ")"]; + } + if ("add3d" in this) this.add3d(wheres); @@ -617,6 +619,12 @@ function report_GET(params) ) params.columns.push(datacol); + if (params.filter["scf_cond"] != "on" + && (this.fields[datacol].typ == 'number' || this.fields[datacol].typ == 'float' || this.fields[datacol].typ == 'currency') + && datagroup != 'A' + ) + params.columns.push(datacol); + this.total_count = newdata.length; json = newdata; } diff --git a/APPL/API2/model_reportsx.inc b/APPL/API2/model_reportsx.inc index fed2a87eb5..4bf2894a55 100644 --- a/APPL/API2/model_reportsx.inc +++ b/APPL/API2/model_reportsx.inc @@ -30,10 +30,11 @@ function model_reportsx(usrrap_key, rapparams) "description" : { dbs: "fac_usrrap_info", typ: "varchar", label: L("lcl_usrrap_info"), filter: "like", translate: true }, "viewname" : { dbs: "fac_usrrap_view_name", typ: "varchar", label: L("lcl_usrrap_viewname"), filter: "like", required: true }, "authorization": { dbs: "fac_functie_key", typ: "key", label: L("lcl_usrrap_functie"), foreign: "fac_functie"}, + "cond" : { dbs: "fac_usrrap_cond", typ: "number", label: L("lcl_usrrap_showcondition"), + required: true, defaultvalue: 0, LOV: L("lcl_usrrap_showconditionLOV")}, "group" : { dbs: "fac_usrrap_groep", typ: "varchar", label: L("lcl_usrrap_groep"), filter: "like" }, "styling" : { dbs: "fac_usrrap_functie", typ: "key", label: L("lcl_usrrap_styling"), LOV: L("lcl_usrrap_stylingLOV") }, // 0;on-gestylede;1;gestylede;2;procedure;3;procedure gestyled;8;Via tabelizer;16;mobile;32;UDR Template - "urllink" : { dbs: "fac_usrrap_urllink", typ: "varchar", label: L("lcl_usrrap_urllink")}, "autorefresh" : { dbs: "fac_usrrap_autorefresh", typ: "check", label: L("lcl_usrrap_autorefresh")}, "count" : { dbs: "fac_usrrap_count", typ: "number", label: L("lcl_usrrap_showcount"), @@ -264,6 +265,7 @@ function model_reportsx(usrrap_key, rapparams) this.fields["ratio"].readonly = true; // denk ik dan this.fields["pivot"].readonly = true; this.fields["graph"].readonly = true; + this.fields["cond"].readonly = true; } if (!user.checkAutorisation("WEB_UDRMAN", true)) { // Dit heeft betrekking op de zoekvelden van appl/fac/fac_reportx_show.asp?mode=search diff --git a/APPL/SCF/scaffolding_search.inc b/APPL/SCF/scaffolding_search.inc index 9003e3358b..bfa9bbe67b 100644 --- a/APPL/SCF/scaffolding_search.inc +++ b/APPL/SCF/scaffolding_search.inc @@ -255,6 +255,12 @@ function scaffolding_search(model, scf_params) RWCHECKBOXTR("scf_graph", "fldcheck", L("lcl_scf_graph"), on); } + if ((model.list.autoCond & 1) == 1) + { + var on = (model.list.autoCond & 2) == 2; + RWCHECKBOXTR("scf_cond", "fldcheck", L("lcl_scf_cond"), on); + } + if (includefilters.length) scf_RWHIDDENTR(model, "includefilter", includefilters.join(","));