diff --git a/src/endWeek/reports/penthouseReport.js b/src/endWeek/reports/penthouseReport.js index 23f7b380e3d79f2b34cd1a75fccb00afadd472ff..84d7079dcd7d8944a29475ea7a9db70b3537bea7 100644 --- a/src/endWeek/reports/penthouseReport.js +++ b/src/endWeek/reports/penthouseReport.js @@ -7,17 +7,11 @@ App.EndWeek.penthouseReport = function() { for (const slave of V.slaves) { if (assignmentVisible(slave)) { r = []; - const {He} = getPronouns(slave); const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report"); if (V.seeImages && V.seeReportImages) { App.UI.DOM.appendNewElement("div", slaveEntry, App.Art.SlaveArtElement(slave, 0, 0), ["imageRef", "tinyImg"]); } slaveEntry.append(App.EndWeek.favoriteIcon(slave), " "); - r.push(App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name")); - if (slave.choosesOwnAssignment === 2) { - r.push(App.SlaveAssignment.choosesOwnJob(slave)); - r.push(He); - } r.push(fullReport(slave)); App.Events.addNode(el, r, "p"); @@ -56,13 +50,19 @@ App.EndWeek.penthouseReport = function() { function fullReport(slave) { const el = new DocumentFragment(); const { - His, + He, His, he, him } = getPronouns(slave); let r = []; let _milkResults; let _milkResult; + r.push(App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name")); + if (slave.choosesOwnAssignment === 2) { + r.push(App.SlaveAssignment.choosesOwnJob(slave)); + r.push(He); + } + switch (slave.assignment) { case "rest": r.push(App.SlaveAssignment.rest(slave)); @@ -143,14 +143,14 @@ App.EndWeek.penthouseReport = function() { r.push(`and ${he} gives ${_milkResult.milk} liters of milk over the week, which is sold for <span class="yellowgreen">${cashFormat(_milkResult.milkSale)}.</span>`); } - App.Events.addNode(el, r, "div", "indent"); + App.Events.addNode(el, r, "div"); r = []; if (slave.minorInjury !== 0) { r.push(`${His} ${slave.minorInjury} will heal by the end of the week.`); } - if (V.showEWD === 0) { - App.SlaveAssignment.standardSlaveReport(slave, false); + if (V.showEWD !== 0) { + r.push(App.SlaveAssignment.standardSlaveReport(slave, false)); } else { // discard return values silently App.SlaveAssignment.standardSlaveReport(slave, true); @@ -160,8 +160,11 @@ App.EndWeek.penthouseReport = function() { r.push(personalAttention(slave)); } - for (const girlsGirl of V.HGTrainSlavesIDs) { - r.push(HGApplication(girlsGirl)); + if (V.HGTrainSlavesIDs.length > 0) { + const girlsGirl = V.HGTrainSlavesIDs.find(trainee => slave.ID === trainee.ID); + if (girlsGirl) { + r.push(HGApplication(girlsGirl)); + } } r.push(App.SlaveAssignment.devotion(slave));