Commit 596083cc authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Xiaowu Zhang

erp5_travel_expense: Have Left leaves days displayed in the application

parent ec251e8e
......@@ -291,6 +291,7 @@
query: {
query: '(portal_type: "Expense Record" AND simulation_state:("draft","sent","stopped")) ' +
'OR (portal_type: "Travel Request Record" AND simulation_state:("draft","sent","stopped")) ' +
'OR (portal_type: "Leave Report Record" AND simulation_state:"stopped") ' +
'OR (portal_type: "Leave Request Record" AND simulation_state:("draft","sent","stopped")) ' +
'OR (portal_type: "Localisation Record" AND simulation_state:("draft","stopped")) ' +
'OR (portal_type: "Currency" AND validation_state:"validated") ' +
......
......@@ -224,7 +224,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <string>supercedriclen</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -238,7 +238,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.48987.17944.33809</string> </value>
<value> <string>956.55783.61341.2013</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -256,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>1485178892.56</float>
<float>1485339651.94</float>
<string>UTC</string>
</tuple>
</state>
......
/*globals window, RSVP, rJS*/
/*globals window, RSVP, rJS, document*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(function (window, RSVP, rJS) {
(function (window, RSVP, rJS, document) {
"use strict";
rJS(window)
......@@ -96,7 +96,26 @@
sort_on: [["start_date", "descending"]]
}
});
})
.push(function () {
return gadget.jio_allDocs({
query: 'portal_type: "Leave Report Record"',
select_list: ["confirmed_leaves_days_left"],
});
})
.push(function (result) {
var p;
if (result.data.total_rows != 1) {
return;
}
p = document.createElement("p");
p.textContent = "Leaves days left: "
+ result.data.rows[0].value.confirmed_leaves_days_left;
gadget.props.element.insertBefore(
p,
gadget.props.element.querySelector("div")
);
});
});
}(window, RSVP, rJS));
\ No newline at end of file
}(window, RSVP, rJS, document));
\ No newline at end of file
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.4266.40527.32802</string> </value>
<value> <string>956.57347.13686.32631</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1482923348.1</float>
<float>1485341013.1</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -80,6 +80,7 @@
<string>your_simulation_state</string>
<string>your_total_leaves_days_confirmed</string>
<string>your_total_leaves_days_planned</string>
<string>your_confirmed_leaves_days_left</string>
</list>
</value>
</item>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment