From: kilian (dks-laptop) Date: Sun, 16 Feb 2020 08:23:16 +0000 (+0100) Subject: v20200215 X-Git-Tag: 1.0.15~67 X-Git-Url: http://cloud.dks.lu/git/?a=commitdiff_plain;h=2efa76319d540837b51a51a05fb07487ee63c25a;p=pot_lu.git v20200215 --- diff --git a/backoffice/data/output/pot/periode_20191230-20200223_pot_period.pdf b/backoffice/data/output/pot/periode_20191230-20200223_pot_period.pdf index 548398e0..dde68551 100644 Binary files a/backoffice/data/output/pot/periode_20191230-20200223_pot_period.pdf and b/backoffice/data/output/pot/periode_20191230-20200223_pot_period.pdf differ diff --git a/backoffice/data/tmp/pot_period1348.footer.html b/backoffice/data/tmp/pot_period1348.footer.html new file mode 100644 index 00000000..8a5797b9 --- /dev/null +++ b/backoffice/data/tmp/pot_period1348.footer.html @@ -0,0 +1,36 @@ + + + + + + + + + + + + +
 
+ Page / +
+ \ No newline at end of file diff --git a/backoffice/data/tmp/pot_period1348.header.html b/backoffice/data/tmp/pot_period1348.header.html new file mode 100644 index 00000000..dcac0a43 --- /dev/null +++ b/backoffice/data/tmp/pot_period1348.header.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + +
+

Plan d'Organisation du Travail

+

du 30.12.2019 au 23.02.2020

+
+
+ Portanova s.à r.l.
+ rue de la faïencerie
+ Luxembourg

+
+ TVA:
+
+
+ diff --git a/backoffice/data/tmp/pot_period1348.html b/backoffice/data/tmp/pot_period1348.html new file mode 100644 index 00000000..b8d46dd7 --- /dev/null +++ b/backoffice/data/tmp/pot_period1348.html @@ -0,0 +1,71 @@ + + + + + + Invoice + + + + + + + + + + +
+ + \ No newline at end of file diff --git a/backoffice/img/icons/coin.svg b/backoffice/img/icons/coin.svg new file mode 100644 index 00000000..bd41fa89 --- /dev/null +++ b/backoffice/img/icons/coin.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/backoffice/img/icons/edit.svg b/backoffice/img/icons/edit.svg index c0bb9ac9..ab200c39 100644 --- a/backoffice/img/icons/edit.svg +++ b/backoffice/img/icons/edit.svg @@ -1,3 +1 @@ - - - + \ No newline at end of file diff --git a/backoffice/img/icons/pay.svg b/backoffice/img/icons/pay.svg new file mode 100644 index 00000000..559f80da --- /dev/null +++ b/backoffice/img/icons/pay.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/backoffice/img/icons/plus.svg b/backoffice/img/icons/plus.svg index 08e85b5e..c46887f6 100644 --- a/backoffice/img/icons/plus.svg +++ b/backoffice/img/icons/plus.svg @@ -1,3 +1 @@ - - - + \ No newline at end of file diff --git a/backoffice/img/icons/plus2.svg b/backoffice/img/icons/plus2.svg new file mode 100644 index 00000000..08e85b5e --- /dev/null +++ b/backoffice/img/icons/plus2.svg @@ -0,0 +1,3 @@ + + + diff --git a/backoffice/img/icons/remove.svg b/backoffice/img/icons/remove.svg index e459477f..026b9ee0 100644 --- a/backoffice/img/icons/remove.svg +++ b/backoffice/img/icons/remove.svg @@ -1,3 +1,5 @@ - - - + + + + \ No newline at end of file diff --git a/backoffice/img/icons/remove_2.svg b/backoffice/img/icons/remove_2.svg new file mode 100644 index 00000000..e459477f --- /dev/null +++ b/backoffice/img/icons/remove_2.svg @@ -0,0 +1,3 @@ + + + diff --git a/backoffice/img/icons/rename.svg b/backoffice/img/icons/rename.svg new file mode 100644 index 00000000..d1d7f311 --- /dev/null +++ b/backoffice/img/icons/rename.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/backoffice/img/icons/table.svg b/backoffice/img/icons/table.svg new file mode 100644 index 00000000..d398197a --- /dev/null +++ b/backoffice/img/icons/table.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/backoffice/js/formsave.js b/backoffice/js/formsave.js index 9e2e2149..4bd5f2ec 100644 --- a/backoffice/js/formsave.js +++ b/backoffice/js/formsave.js @@ -261,7 +261,7 @@ function fillformbydataclass2(dataclass,choices,data){ for (var f in frm){ //console.log(frm[f]); if (data[frm[f].id]){ - //console.log(frm[f].id + " => " + data[frm[f].id]); + if (frm[f].tagName == 'INPUT'){ if (frm[f].type == "checkbox"){ @@ -271,7 +271,9 @@ function fillformbydataclass2(dataclass,choices,data){ frm[f].checked = false; } } else if (frm[f].classList.contains("datefield")){ + console.log("DateField:" + frm[f].id + " => " + data[frm[f].id]); frm[f]._flatpickr.setDate(data[frm[f].id]); + } else if (frm[f].classList.contains("timefield")){ frm[f]._flatpickr.setDate(data[frm[f].id]); }else if (frm[f].classList.contains("choices__input")){ diff --git a/backoffice/js/module_global.js b/backoffice/js/module_global.js index 000f66b5..da31dc81 100644 --- a/backoffice/js/module_global.js +++ b/backoffice/js/module_global.js @@ -81,22 +81,22 @@ var timecalc = { StringToTime: function(strin){ strin = strin.substring(0,5); strin = strin.replace(/\D/g,''); - console.log(strin); + //console.log(strin); if (strin.length == 0){ return "";} if (strin.length <= 2){ - console.log(strin + "<=2"); + //console.log(strin + "<=2"); if (strin > "23") {return ""} else { return timecalc.lpad(strin,2,'0')+":00"; } } else if (strin.length == 3){ - console.log(strin + "==3"); + //console.log(strin + "==3"); var hours = strin.substring(0,1); var minutes = strin.substring(1,3); - console.log(hours + ":" + minutes) + //console.log(hours + ":" + minutes) if (minutes > "59"){ return "";} return timecalc.lpad(hours,2,'0')+ ":"+ timecalc.lpad(minutes,2,'0'); } else if (strin.length == 4){ - console.log(strin + "==4"); + //console.log(strin + "==4"); var hours = strin.substring(0,2); var minutes = strin.substring(2,4); if ((hours > "23") || (minutes > "59")){return "";} @@ -123,6 +123,31 @@ var timecalc = { return strin + ":00"; }, + MinutesToInterval: function(minutes){ + if ((minutes == null) || (minutes == "")){ return "0:00";} + var prep =""; + if (minutes < 0){ + prep = "-"; + minutes = minutes * -1; + } + var hours = parseInt(minutes/60); + var restminutes = minutes-(hours*60); + return prep+hours+ ":"+ timecalc.lpad(restminutes,2,'0'); + }, + IntervalToMinutes: function(strin){ + if (strin == "" || strin == null){ + return 0; + } + var mult = 1; + if (strin.startsWith("-")){ + mult = -1; + strin = strin.replace(/-/g,''); + } + var spl = strin.split(":"); + var hours = parseInt(spl[0]) * 60; + var minutes = parseInt(spl[1]); + return (hours+minutes) * mult; + }, validateTime(obj){ obj.value = timecalc.StringToTime(obj.value); return false; diff --git a/backoffice/tmpl/module/companies/index.tt b/backoffice/tmpl/module/companies/index.tt index eb09b479..d16b8a03 100644 --- a/backoffice/tmpl/module/companies/index.tt +++ b/backoffice/tmpl/module/companies/index.tt @@ -3,12 +3,12 @@
- + @@ -55,7 +55,7 @@
- +
@@ -67,9 +67,9 @@

Départements

- - - + + +
@@ -95,7 +95,7 @@ diff --git a/backoffice/tmpl/module/companies/staffgroups.js b/backoffice/tmpl/module/companies/staffgroups.js index 6fc25a0c..8e6e9594 100644 --- a/backoffice/tmpl/module/companies/staffgroups.js +++ b/backoffice/tmpl/module/companies/staffgroups.js @@ -11,23 +11,18 @@ var staffgroups = { height: "400px", layout: "fitDataFill", selectable: 1, - rowContext:function(e, row){ - //e - the click event object - //row - row component - e.preventDefault(); // prevent the browsers default context menu form appearing. - }, - columns: [{ - title: "Département", - field: "groupname" - },{ - title: "Groupe standard", - field: "isdefault",formatter:"tickCross", formatterParams:{ - allowEmpty:true, - allowTruthy:true, - tickElement:'', - crossElement:'×', -} -}] + rowContext:function(e, row){ e.preventDefault(); }, + columns: [{ title: "Département", field: "groupname" } +// ,{ +// title: "Groupe standard", +// field: "isdefault",formatter:"tickCross", formatterParams:{ +// allowEmpty:true, +// allowTruthy:true, +// tickElement:'', +// crossElement:'×', +// } +// } +] }); staffgroups.gettbldata(); }, diff --git a/backoffice/tmpl/module/periods/index.tt b/backoffice/tmpl/module/periods/index.tt index d531dc1d..8e2899cc 100644 --- a/backoffice/tmpl/module/periods/index.tt +++ b/backoffice/tmpl/module/periods/index.tt @@ -3,8 +3,7 @@
- + @@ -33,7 +34,34 @@
- + +
+
+
+ × +

Heures Payés

+
+
+
+
+
+

Periode du .. au ..

+
+ [% fieldhidden("id_staffreportperiod",'staffreportperiod','ident') %] + [% fieldintervalbox("payedhours",'staffreportperiod','Heures Payés','','','') %] +
+ +
+
+
+
+ + +
+
+
+ +
@@ -90,6 +118,7 @@
+
[% INCLUDE block/dlgdeleterow.tt %] [% INCLUDE block/dlgmessage.tt %] diff --git a/backoffice/tmpl/module/periods/reportperiod.js b/backoffice/tmpl/module/periods/reportperiod.js index 70060063..6a415212 100644 --- a/backoffice/tmpl/module/periods/reportperiod.js +++ b/backoffice/tmpl/module/periods/reportperiod.js @@ -23,7 +23,7 @@ var reportperiod ={ groupStartOpen:[true], groupClosedShowCalcs:true, groupHeader:[ - function(value, count, data){ //generate header contents for gender groups + function(value, count, data){ //generate header return value; }, ], @@ -41,7 +41,8 @@ var reportperiod ={ {title: "Récup", field:"recuperationhours",sorter: false}, {title: "congé", field:"vacancyhours",sorter: false}, {title: "Total", field:"totalhours",sorter: false}, - {title: "Rest", field:"hoursdiff",sorter: false,bottomCalc:reportperiod.periodrestsum} // ,bottomCalcFormatter:"html" + {title: "à récup.", field:"hoursdiff",sorter: false,bottomCalc:reportperiod.periodrestsum}, + {title: "payés", field:"payedhours",sorter: false} ] } ] @@ -88,11 +89,36 @@ var reportperiod ={ return false; }, periodrestsum: function(values, data, calcParams){ - return '00:00'; + var mts = 0; + //console.log(values); + for (var m in values){ + mts += timecalc.IntervalToMinutes(values[m]); + } + return timecalc.MinutesToInterval(mts); }, - togglegroups: function(){ + showdlgpayedhours: function(){ + cleanform2("rppayedhours",{}); + var prd = reportperiod.tbl.getSelectedData(); + if (prd[0]){ + document.getElementById("title_rppayedhours").innerHTML = "Période du " +moment(prd[0].startdate).format("DD.MM.YYYY") + " au " + moment(prd[0].enddate).format("DD.MM.YYYY"); + document.getElementById("id_staffreportperiod").value=prd[0].id; + document.getElementById("payedhours").value=prd[0].payedhours; + //fillformbydataclass2("staffreportperioddays",{},prd[0]); + module.viewdialog('rppayedhours'); + } + }, + savepayedhours: function(){ + document.getElementById('dlg_rppayedhours').style.display='none'; + var rpdata = getformcontent("rppayedhours"); + rpdata["ident_staffreportperiod_id"] = rpdata["ident_staffreportperiod_id_staffreportperiod"]; + delete rpdata["ident_staffreportperiod_id_staffreportperiod"]; + rpdata["fn"] ="saveform"; + rpdata["schemata"] = schemata; + console.log(rpdata); + formsaved({}); + req.reqdata("POST","index.cgi",rpdata,reportperiod.gettbldata); + + return false; } - - } \ No newline at end of file diff --git a/backoffice/tmpl/module/staff/index.tt b/backoffice/tmpl/module/staff/index.tt index 8c67d6b9..0f390116 100644 --- a/backoffice/tmpl/module/staff/index.tt +++ b/backoffice/tmpl/module/staff/index.tt @@ -2,11 +2,11 @@
- + @@ -43,7 +43,7 @@
- +
@@ -54,9 +54,9 @@
- - - + + +
@@ -84,14 +84,17 @@
[% fieldintervalbox("weekhours","staffcontract","heures par semaine","w3-third","","","") %] - [% fieldselectbox("weekdays","staffcontract","jours par semaine","w3-third","","","") %] + [% fieldselectbox("weekdays","staffcontract","jours de travail par semaine","w3-third","","","") %] +
+ [% fieldmultiselectbox("defaultfreedays","staffcontract","Jours de semaines libre ","","","","") %] +
[% fieldselectbox('id_workplan','staffcontract','POT (Modèle)','w3-third','','','') %]
- +
diff --git a/backoffice/tmpl/module/staff/staffcontract.js b/backoffice/tmpl/module/staff/staffcontract.js index dc798242..b458f332 100644 --- a/backoffice/tmpl/module/staff/staffcontract.js +++ b/backoffice/tmpl/module/staff/staffcontract.js @@ -1,7 +1,8 @@ var staffcontract = { name: "staffcontract", tbl: null, - choices:{"weekdays":null,"id_workplan":null}, + choices:{"weekdays":null,"id_workplan":null,"defaultfreedays":null}, + maxfreedays: 1, initform: function(){ staffcontract.choices["id_workplan"] = new Choices('#id_workplan',{ searchEnabled: false, @@ -15,30 +16,44 @@ var staffcontract = { removeItemButton: false, choices : [{value:"1",label:"1"},{value:"2",label:"2"},{value:"3",label:"3"},{value:"4",label:"4"},{value:"5",label:"5"},{value:"6",label:"6"},{value:"7",label:"7"}] }); + staffcontract.choices["defaultfreedays"] = new Choices('#defaultfreedays',{ + searchEnabled: false, + itemSelectText: '', + itemSort: false, + removeItemButton: true, + shouldSort: false, + shouldSortItems: false, + maxItemCount: staffcontract.maxfreedays, + maxItemText: (maxItemCount) => { + return `max. de jours de semaine ajoutées`; + }, + choices : [{label:"lundi",value:"1"},{label:"mardi",value:"2"},{label:"mercredi",value:"3"},{label:"jeudi",value:"4"},{label:"vendredi",value:"5"},{label:"samedi",value:"6"},{label:"dimanche",value:"7"}] + }); flatpickr("#startdate",{altInput: true, altFormat: "d.m.Y", dateFormat: "Y-m-d", "locale": "fr", weekNumbers: true, - "disable": [ - function(date) { - // return true to disable - return (date.getDay() !== 1); - } - ], + // "disable": [ + // function(date) { + // // return true to disable + // return (date.getDay() !== 1); + // } + // ], }); flatpickr("#enddate",{altInput: true, altFormat: "d.m.Y", dateFormat: "Y-m-d", "locale": "fr", weekNumbers: true, - "disable": [ - function(date) { - // return true to disable - return (date.getDay() !== 0); - } - ], + // "disable": [ + // function(date) { + // // return true to disable + // return (date.getDay() !== 0); + // } + // ], }); + document.getElementById("weekdays").addEventListener('change', function(event){staffcontract.setmaxfreedays(event,this.id);}); }, inittable: function(){ staffcontract.initform(); @@ -58,6 +73,7 @@ var staffcontract = { {title: "fin", field: "enddate",headerSort: false,formatter:"datetime",formatterParams:{inputFormat:"YYYY-MM-DD",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""}}, {title: "h/semaine",field: "weekhours",align: "right",headerSort: false}, {title: "j/semaine",field: "weekdays",align: "right", headerSort: false,formatter:"money",formatterParams:{decimal:",",thousand:".",symbol:" ",symbolAfter:"",precision:0}}, + {title: "j/semaine libre",field: "defaultfreedays",headerSort: false}, {title: "POT(modèle)",field: "workplan",headerSort: false} ] }); @@ -100,7 +116,7 @@ var staffcontract = { fillform: function(data){ //console.log("Fill Form 1"); if (data && data.sqldata){ - //console.log("Fill Form 2"); + console.log(data.sqldata[0]); fillformbydataclass2(staffcontract.name,staffcontract.choices,data.sqldata[0]); } }, @@ -130,6 +146,13 @@ var staffcontract = { } //console.log(f + " => " + flds[f]); } + if (parseInt(flds["staffcontract_weekdays"]) + flds["staffcontract_defaultfreedays"].length != 7){ + document.getElementById("contractmsg").innerHTML= '
jours de semaine libre incomplet!
'; + return false; + } + console.log(); + + //if ( + ) if (bok == false){ document.getElementById("contractmsg").innerHTML= '
Tous les champs sauf "date fin" sans requis!
'; return false; @@ -164,4 +187,16 @@ var staffcontract = { fillwptemplates: function(data){ fillselectlist(staffcontract.choices["id_workplan"],data.sqldata,'id','workplan'); }, + setmaxfreedays: function(ev,id){ + + console.log(ev); + + var wmax = document.getElementById("weekdays").value; + staffcontract.maxfreedays = 7-wmax; + console.log("Maxfree " + staffcontract.maxfreedays); + staffcontract.choices["defaultfreedays"].config.maxItemCount = staffcontract.maxfreedays; + console.log(staffcontract.choices["defaultfreedays"]) + staffcontract.choices["defaultfreedays"].removeActiveItems(); + return false; + } } \ No newline at end of file diff --git a/backoffice/tmpl/module/users/index.tt b/backoffice/tmpl/module/users/index.tt index 8031e5c1..4f33bdbe 100644 --- a/backoffice/tmpl/module/users/index.tt +++ b/backoffice/tmpl/module/users/index.tt @@ -3,11 +3,11 @@
- +
@@ -52,7 +52,7 @@
- +
diff --git a/backoffice/tmpl/module/workplans/index.tt b/backoffice/tmpl/module/workplans/index.tt index e5913f7d..de9e7fcf 100644 --- a/backoffice/tmpl/module/workplans/index.tt +++ b/backoffice/tmpl/module/workplans/index.tt @@ -6,11 +6,12 @@
- +
- - - + + + +