diff --git a/devNotes/twine JS.txt b/devNotes/twine JS.txt index 1311b023116760332f14d3a835bb0d9c1cbcd86d..f05294145975afadded526be5f3453c60c7c24e3 100644 --- a/devNotes/twine JS.txt +++ b/devNotes/twine JS.txt @@ -2232,6 +2232,58 @@ window.Job = Object.freeze({ }); window.PersonalAttention = Object.freeze({TRADE: 'trading', WAR: 'warfare', SLAVING: 'slaving', ENGINEERING: 'engineering', MEDICINE: 'medicine', MAID: 'upkeep', HACKING: 'hacking'}); +window.predictCost = function(array) { + var array2 = array; + var totalCosts = ( + getBrothelCosts() + + getBrothelAdsCosts() + + getArcadeCosts() + + getClubCosts() + + getClubAdsCosts() + + getDairyCosts() + + getIncubatorCosts() + + getServantsQuartersCosts() + + getMasterSuiteCosts() + + getNurseryCosts() + + getFarmyardCosts() + + getSecurityExpansionCost() + + getLifestyleCosts() + + getFSCosts() + + getCitizenOrphanageCosts() + + getPrivateOrphanageCosts() + + getPeacekeeperCosts() + + getMercenariesCosts() + + getMenialRetirementCosts() + + getRecruiterCosts() + + getSchoolCosts() + + getPolicyCosts() + + getCyberModCosts() + + getPCTrainingCosts() + + getPCCosts() + + predictTotalSlaveCosts(array2) + ); + + //these two apply a multiplicative effect to all costs so far. + totalCosts = getEnvironmentCosts(totalCosts); + totalCosts = getPCMultiplierCosts(totalCosts); + + //in the old order these were applied after multiplication. Not sure if deliberate, but I'm leaving it for now. + totalCosts += ( + getSFCosts() + + getWeatherCosts() + ); + totalCosts = Math.trunc(totalCosts); +/* + // clean up + if(totalCosts > 0) { + totalCosts = 0; + } else { + totalCosts = Math.ceil(totalCosts); + } +*/ + return totalCosts; +}; + window.getCost = function(array) { var array2 = array; var oldCash = State.variables.cash; diff --git a/src/uncategorized/costsBudget.tw b/src/uncategorized/costsBudget.tw index f563b5a5b9a160252a5b6b27086706e9e1a24543..13126c8a9effb2cef8fb8c5036623ac42888622b 100644 --- a/src/uncategorized/costsBudget.tw +++ b/src/uncategorized/costsBudget.tw @@ -51,11 +51,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.whore || $lastWeeksCashExpenses.whore>> /* If it's not 0, it will return true. */ <tr> <td>Whores</td> - <td><<= cashNumFormat($lastWeeksCashIncome.whore)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.whore)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.whore))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.whore))>>@@</td> <td> <<set $lastWeeksCashProfits.whore = ($lastWeeksCashIncome.whore + $lastWeeksCashExpenses.whore)>> - <<= cashNumFormat($lastWeeksCashProfits.whore)>> + <<if $lastWeeksCashProfits.whore > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.whore))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.whore))>>@@ + <</if>> </td> </tr> <</if>> @@ -63,11 +67,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.rest || $lastWeeksCashExpenses.rest>> <tr> <td>Resting</td> - <td><<= cashNumFormat($lastWeeksCashIncome.rest)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.rest)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.rest))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.rest))>>@@</td> <td> <<set $lastWeeksCashProfits.rest = ($lastWeeksCashIncome.rest + $lastWeeksCashExpenses.rest)>> - <<= cashNumFormat($lastWeeksCashProfits.rest)>> + <<if $lastWeeksCashProfits.rest > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.rest))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.rest))>>@@ + <</if>> </td> </tr> <</if>> @@ -75,11 +83,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.fucktoy || $lastWeeksCashExpenses.fucktoy>> <tr> <td>Fucktoys <<if $Concubine != 0>>including your concubine <</if>>($fuckSlaves slaves)</td> - <td>Rep: <<= cashNumFormat($lastWeeksCashIncome.fucktoy)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.fucktoy)>></td> + <td>$lastWeeksCashIncome.fucktoy rep</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.fucktoy))>>@@</td> <td> <<set $lastWeeksCashProfits.fucktoy = (+ $lastWeeksCashExpenses.fucktoy)>> - <<= cashNumFormat($lastWeeksCashProfits.fucktoy)>> + <<if $lastWeeksCashProfits.fucktoy > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.fucktoy))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.fucktoy))>>@@ + <</if>> </td> </tr> <</if>> @@ -87,11 +99,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.subordinateSlave || $lastWeeksCashExpenses.subordinateSlave>> <tr> <td>subordinateSlaves</td> - <td><<= cashNumFormat($lastWeeksCashIncome.subordinateSlave)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.subordinateSlave)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.subordinateSlave))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.subordinateSlave))>>@@</td> <td> <<set $lastWeeksCashProfits.subordinateSlave = ($lastWeeksCashIncome.subordinateSlave + $lastWeeksCashExpenses.subordinateSlave)>> - <<= cashNumFormat($lastWeeksCashProfits.subordinateSlave)>> + <<if $lastWeeksCashProfits.subordinateSlave > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.subordinateSlave))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.subordinateSlave))>>@@ + <</if>> </td> </tr> <</if>> @@ -99,11 +115,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.houseServant || $lastWeeksCashExpenses.houseServant>> <tr> <td>HouseServants</td> - <td><<= cashNumFormat($lastWeeksCashIncome.houseServant)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.houseServant)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.houseServant))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.houseServant))>>@@</td> <td> <<set $lastWeeksCashProfits.houseServant = ($lastWeeksCashIncome.houseServant + $lastWeeksCashExpenses.houseServant)>> - <<= cashNumFormat($lastWeeksCashProfits.houseServant)>> + <<if $lastWeeksCashProfits.houseServant > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.houseServant))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.houseServant))>>@@ + <</if>> </td> </tr> <</if>> @@ -111,11 +131,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.confined || $lastWeeksCashExpenses.confined>> <tr> <td>Confined</td> - <td><<= cashNumFormat($lastWeeksCashIncome.confined)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.confined)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.confined))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.confined))>>@@</td> <td> <<set $lastWeeksCashProfits.confined = ($lastWeeksCashIncome.confined + $lastWeeksCashExpenses.confined)>> - <<= cashNumFormat($lastWeeksCashProfits.confined)>> + <<if $lastWeeksCashProfits.confined > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.confined))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.confined))>>@@ + <</if>> </td> </tr> <</if>> @@ -123,11 +147,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.publicServant || $lastWeeksCashExpenses.publicServant>> <tr> <td>Public servants</td> - <td>Rep: <<= cashNumFormat($lastWeeksCashIncome.publicServant)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.publicServant)>></td> + <td>$lastWeeksCashIncome.publicServant rep</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.publicServant))>>@@</td> <td> <<set $lastWeeksCashProfits.publicServant = ($lastWeeksCashIncome.publicServant + $lastWeeksCashExpenses.publicServant)>> - <<= cashNumFormat($lastWeeksCashProfits.publicServant)>> + <<if $lastWeeksCashProfits.publicServant > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.publicServant))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.publicServant))>>@@ + <</if>> </td> </tr> <</if>> @@ -135,11 +163,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.classes || $lastWeeksCashExpenses.classes>> <tr> <td>Classes</td> - <td><<= cashNumFormat($lastWeeksCashIncome.classes)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.classes)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.classes))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.classes))>>@@</td> <td> <<set $lastWeeksCashProfits.classes = ($lastWeeksCashIncome.classes + $lastWeeksCashExpenses.classes)>> - <<= cashNumFormat($lastWeeksCashProfits.classes)>> + <<if $lastWeeksCashProfits.classes > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.classes))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.classes))>>@@ + <</if>> </td> </tr> <</if>> @@ -147,12 +179,16 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.milked || $lastWeeksCashExpenses.milked>> <tr> - <td>Milked</td> - <td><<= cashNumFormat($lastWeeksCashIncome.milked)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.milked)>></td> + <td>Milked</td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.milked))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.milked))>>@@</td> <td> <<set $lastWeeksCashProfits.milked = ($lastWeeksCashIncome.milked + $lastWeeksCashExpenses.milked)>> - <<= cashNumFormat($lastWeeksCashProfits.milked)>> + <<if $lastWeeksCashProfits.milked > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.milked))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.milked))>>@@ + <</if>> </td> </tr> <</if>> @@ -160,17 +196,21 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.gloryhole || $lastWeeksCashExpenses.gloryhole>> <tr> <td>Gloryhole</td> - <td><<= cashNumFormat($lastWeeksCashIncome.gloryhole)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.gloryhole)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.gloryhole))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.gloryhole))>>@@</td> <td> <<set $lastWeeksCashProfits.gloryhole = ($lastWeeksCashIncome.gloryhole + $lastWeeksCashExpenses.gloryhole)>> - <<= cashNumFormat($lastWeeksCashProfits.gloryhole)>> + <<if $lastWeeksCashProfits.gloryhole > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.gloryhole))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.gloryhole))>>@@ + <</if>> </td> </tr> <</if>> <tr> - <h2>Structures</h2> + <h2>Structures</h2> /* TODO: using h2s doesn't fit in with the rest of the game */ </tr> <tr> //Slaves working in these buildings have their profits reported in "jobs".// @@ -178,36 +218,48 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $brothel > 0>> <tr> - <td>[[$brothelName|Brothel][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($brothelSlaves slaves)</td> - <td><<= cashNumFormat($lastWeeksCashIncome.brothel)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.brothel)>></td> + <td>[[$brothelNameCaps|Brothel][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($brothelSlaves slaves)</td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.brothel))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.brothel))>>@@</td> <td> <<set $lastWeeksCashProfits.brothel = ($lastWeeksCashIncome.brothel + $lastWeeksCashExpenses.brothel)>> - <<= cashNumFormat($lastWeeksCashProfits.brothel)>> + <<if $lastWeeksCashProfits.brothel > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.brothel))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.brothel))>>@@ + <</if>> </td> </tr> <</if>> <<if $lastWeeksCashIncome.brothelAds || $lastWeeksCashExpenses.brothelAds>> <tr> - <td>[[Brothel Ads|Brothel Advertisement][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] also increase the income of whoring slaves in "jobs."</td> - <td><<= cashNumFormat($lastWeeksCashIncome.brothelAds)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.brothelAds)>></td> + <td>[[Brothel Ads|Brothel Advertisement][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] also increase the income of whoring slaves in "jobs."</td> /* TODO: this is also weird */ + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.brothelAds))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.brothelAds))>>@@</td> <td> <<set $lastWeeksCashProfits.brothelAds = ($lastWeeksCashIncome.brothelAds + $lastWeeksCashExpenses.brothelAds)>> - <<= cashNumFormat($lastWeeksCashProfits.brothelAds)>> + <<if $lastWeeksCashProfits.brothelAds > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.brothelAds))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.brothelAds))>>@@ + <</if>> </td> </tr> <</if>> <<if $club > 0>> <tr> - <td>[[$clubName|Club][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($clubSlaves slaves)</td> - <td>Rep:<<= cashNumFormat($lastWeeksCashIncome.club)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.club)>></td> + <td>[[$clubNameCaps|Club][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($clubSlaves slaves)</td> + <td>$lastWeeksCashIncome.club rep</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.club))>>@@</td> <td> <<set $lastWeeksCashProfits.club = ($lastWeeksCashIncome.club + $lastWeeksCashExpenses.club)>> - <<= cashNumFormat($lastWeeksCashProfits.club)>> + <<if $lastWeeksCashProfits.club > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.club))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.club))>>@@ + <</if>> </td> </tr> <</if>> @@ -215,35 +267,47 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.clubAds || $lastWeeksCashExpenses.clubAds>> <tr> <td>[[Club Ads|Club Advertisement][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]]</td> - <td><<= cashNumFormat($lastWeeksCashIncome.clubAds)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.clubAds)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.clubAds))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.clubAds))>>@@</td> <td> <<set $lastWeeksCashProfits.clubAds = ($lastWeeksCashIncome.clubAds + $lastWeeksCashExpenses.clubAds)>> - <<= cashNumFormat($lastWeeksCashProfits.clubAds)>> + <<if $lastWeeksCashProfits.clubAds > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.clubAds))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.clubAds))>>@@ + <</if>> </td> </tr> <</if>> <<if $arcade > 0>> <tr> - <td>[[$arcadeName|Arcade][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($arcadeSlaves slaves)</td> - <td><<= cashNumFormat($lastWeeksCashIncome.arcade)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.arcade)>></td> + <td>[[$arcadeNameCaps|Arcade][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($arcadeSlaves slaves)</td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.arcade))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.arcade))>>@@</td> <td> <<set $lastWeeksCashProfits.arcade = ($lastWeeksCashIncome.arcade + $lastWeeksCashExpenses.arcade)>> - <<= cashNumFormat($lastWeeksCashProfits.arcade)>> + <<if $lastWeeksCashProfits.arcade > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.arcade))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.arcade))>>@@ + <</if>> </td> </tr> <</if>> <<if $dairy > 0>> <tr> - <td>[[$dairyName|Dairy][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($dairySlaves slaves)</td> - <td><<= cashNumFormat($lastWeeksCashIncome.dairy)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.dairy)>></td> + <td>[[$dairyNameCaps|Dairy][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($dairySlaves slaves)</td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.dairy))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.dairy))>>@@</td> <td> <<set $lastWeeksCashProfits.dairy = ($lastWeeksCashIncome.dairy + $lastWeeksCashExpenses.dairy)>> - <<= cashNumFormat($lastWeeksCashProfits.dairy)>> + <<if $lastWeeksCashProfits.dairy > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.dairy))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.dairy))>>@@ + <</if>> </td> </tr> <</if>> @@ -251,8 +315,8 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if ($servantsQuarters > 0) && ($servantsQuartersUpgradeMonitoring > 0)>> <tr> <td>[[Servants' Quarters][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($servantsQuartersSlaves slaves)</td> - <td><<= cashNumFormat($lastWeeksCashIncome.servantsQuarters)>></td> /*Does not count servants who are serving, only what Stewardess makes. If I can find savings, perhaps show as negative expense? */ - <td><<= cashNumFormat($lastWeeksCashExpenses.servantsQuarters)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.servantsQuarters))>>@@</td> /*Does not count servants who are serving, only what Stewardess makes. If I can find savings, perhaps show as negative expense? */ + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.servantsQuarters))>>@@</td> <td> <<set $lastWeeksCashProfits.servantsQuarters = ($lastWeeksCashIncome.servantsQuarters + $lastWeeksCashExpenses.servantsQuarters)>> //$lastWeeksCashProfits.servantsQuarters// @@ -263,81 +327,105 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if ($masterSuiteUpgradePregnancy == 1)>> <tr> <td>[[Master Suite][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($masterSuiteSlaves slaves)</td> - <td>Rep: <<= cashNumFormat($lastWeeksCashIncome.masterSuite)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.masterSuite)>></td> + <td>$lastWeeksCashIncome.masterSuite rep</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.masterSuite))>>@@</td> <td> <<set $lastWeeksCashProfits.masterSuite = ($lastWeeksCashIncome.masterSuite + $lastWeeksCashExpenses.masterSuite)>> - <<= cashNumFormat($lastWeeksCashProfits.masterSuite)>> + <<if $lastWeeksCashProfits.masterSuite > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.masterSuite))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.masterSuite))>>@@ + <</if>> </td> </tr> <</if>> <<if $schoolroom>> <tr> - <td>[[$schoolroomName|Schoolroom][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($schoolroomSlaves slaves)</td> - <td><<= cashNumFormat($lastWeeksCashIncome.school)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.school)>></td> + <td>[[$schoolroomNameCaps|Schoolroom][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($schoolroomSlaves slaves)</td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.school))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.school))>>@@</td> <td> <<set $lastWeeksCashProfits.school = ($lastWeeksCashIncome.school + $lastWeeksCashExpenses.school)>> - <<= cashNumFormat($lastWeeksCashProfits.school)>> + <<if $lastWeeksCashProfits.school > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.school))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.school))>>@@ + <</if>> </td> </tr> <</if>> <<if $spa>> <tr> - <td>[[$spaName|Spa][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($spaSlaves slaves)</td> - <td><<= cashNumFormat($lastWeeksCashIncome.spa)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.spa)>></td> + <td>[[$spaNameCaps|Spa][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($spaSlaves slaves)</td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.spa))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.spa))>>@@</td> <td> <<set $lastWeeksCashProfits.spa = ($lastWeeksCashIncome.spa + $lastWeeksCashExpenses.spa)>> - <<= cashNumFormat($lastWeeksCashProfits.spa)>> + <<if $lastWeeksCashProfits.spa > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.spa))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.spa))>>@@ + <</if>> </td> </tr> <</if>> <<if $clinic>> <tr> - <td>[[$clinicName|Clinic][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($clinicSlaves slaves)</td> - <td><<= cashNumFormat($lastWeeksCashIncome.clinic)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.clinic)>></td> + <td>[[$clinicNameCaps|Clinic][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($clinicSlaves slaves)</td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.clinic))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.clinic))>>@@</td> <td> <<set $lastWeeksCashProfits.clinic = ($lastWeeksCashIncome.clinic + $lastWeeksCashExpenses.clinic)>> - <<= cashNumFormat($lastWeeksCashProfits.clinic)>> + <<if $lastWeeksCashProfits.clinic > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.clinic))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.clinic))>>@@ + <</if>> </td> </tr> <</if>> <<if $cellblock>> <tr> - <td>[[$cellblockName|Cellblock][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($cellblockSlaves slaves)</td> - <td><<= cashNumFormat($lastWeeksCashIncome.cellblock)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.cellblock)>></td> + <td>[[$cellblockNameCaps|Cellblock][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($cellblockSlaves slaves)</td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.cellblock))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.cellblock))>>@@</td> <td> <<set $lastWeeksCashProfits.cellblock = ($lastWeeksCashIncome.cellblock + $lastWeeksCashExpenses.cellblock)>> - <<= cashNumFormat($lastWeeksCashProfits.cellblock)>> + <<if $lastWeeksCashProfits.cellblock > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.cellblock))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.cellblock))>>@@ + <</if>> </td> </tr> <</if>> <<if $researchLab.built == "true">> <tr> - <td>[[Research Lab][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]]: Maintenance</td> - <td><<= cashNumFormat($lastWeeksCashIncome.lab)>></td> + <td>[[Research Lab][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] maintenance</td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.lab))>>@@</td> <td> <<set $lastWeeksCashExpenses.lab = (100*$researchLab.maxSpace)>> <<= cashNumFormat($lastWeeksCashExpenses.lab)>> </td> <td> <<set $lastWeeksCashProfits.lab = ($lastWeeksCashIncome.lab + $lastWeeksCashExpenses.lab)>> - <<= cashNumFormat($lastWeeksCashProfits.lab)>> + <<if $lastWeeksCashProfits.lab > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.lab))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.lab))>>@@ + <</if>> </td> </tr> // <<if $researchLab.hired != 0>> <tr> - <td>[[Research Lab][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]]: ($researchLab.hired scientists)</td> + <td>[[Research Lab][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($researchLab.hired scientists)</td> <td></td> <td><<print cashNumFormat(300*$researchLab.hired)>></td> <td><<print cashNumFormat(300*$researchLab.hired)>></td> @@ -345,7 +433,7 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <</if>> <<if $researchLab.menials != 0>> <tr> - <td>[[Research Lab][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]]: ($researchLab.menials menial Slaves)</td> + <td>[[Research Lab][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($researchLab.menials menial Slaves)</td> <td></td> <td><<print cashNumFormat(100*$researchLab.menials)>></td> <td><<print cashNumFormat(100*$researchLab.menials)>></td> @@ -359,60 +447,80 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.cyberMod || $lastWeeksCashExpenses.cyberMod>> <tr> - <td>CyberMod</td> - <td><<= cashNumFormat($lastWeeksCashIncome.cyberMod)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.cyberMod)>></td> + <td>CyberMod</td> /* TODO: this doesn't fit in*/ + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.cyberMod))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.cyberMod))>>@@</td> <td> <<set $lastWeeksCashProfits.cyberMod = ($lastWeeksCashIncome.cyberMod + $lastWeeksCashExpenses.cyberMod)>> - <<= cashNumFormat($lastWeeksCashProfits.cyberMod)>> + <<if $lastWeeksCashProfits.cyberMod > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.cyberMod))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.cyberMod))>>@@ + <</if>> </td> </tr> <</if>> <<if $incubator>> <tr> - <td>[[$incubatorName|Incubator][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($incubatorSlaves slaves)</td> - <td><<= cashNumFormat($lastWeeksCashIncome.incubator)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.incubator)>></td> + <td>[[$incubatorNameCaps|Incubator][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($incubatorSlaves slaves)</td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.incubator))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.incubator))>>@@</td> <td> <<set $lastWeeksCashProfits.incubator = ($lastWeeksCashIncome.incubator + $lastWeeksCashExpenses.incubator)>> - <<= cashNumFormat($lastWeeksCashProfits.incubator)>> + <<if $lastWeeksCashProfits.incubator > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.incubator))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.incubator))>>@@ + <</if>> </td> </tr> <</if>> <<if $nursery>> <tr> - <td>[[$nurseryName|Nursery][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($nurserySlaves slaves)</td> - <td><<= cashNumFormat($lastWeeksCashIncome.nursery)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.nursery)>></td> + <td>[[$nurseryNameCaps|Nursery][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($nurserySlaves slaves)</td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.nursery))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.nursery))>>@@</td> <td> <<set $lastWeeksCashProfits.nursery = ($lastWeeksCashIncome.nursery + $lastWeeksCashExpenses.nursery)>> - <<= cashNumFormat($lastWeeksCashProfits.nursery)>> + <<if $lastWeeksCashProfits.nursery > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.nursery))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.nursery))>>@@ + <</if>> </td> </tr> <</if>> <<if $farmyard>> <tr> - <td>[[$farmyardName|Farmyard][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($farmyardSlaves slaves)</td> - <td><<= cashNumFormat($lastWeeksCashIncome.farmyard)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.farmyard)>></td> + <td>[[$farmyardNameCaps|Farmyard][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($farmyardSlaves slaves)</td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.farmyard))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.farmyard))>>@@</td> <td> <<set $lastWeeksCashProfits.farmyard = ($lastWeeksCashIncome.farmyard + $lastWeeksCashExpenses.farmyard)>> - <<= cashNumFormat($lastWeeksCashProfits.farmyard)>> + <<if $lastWeeksCashProfits.farmyard > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.farmyard))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.farmyard))>>@@ + <</if>> </td> </tr> <</if>> <<if $pit>> <tr> - <td>[[$pitName|Pit][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($fighterIDs.length fighters)</td> - <td><<= cashNumFormat($lastWeeksCashIncome.pit)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.pit)>></td> + <td>[[$pitNameCaps|Pit][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($fighterIDs.length slaves)</td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.pit))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.pit))>>@@</td> <td> <<set $lastWeeksCashProfits.pit = ($lastWeeksCashIncome.pit + $lastWeeksCashExpenses.pit)>> - <<= cashNumFormat($lastWeeksCashProfits.pit)>> + <<if $lastWeeksCashProfits.pit > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.pit))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.pit))>>@@ + <</if>> </td> </tr> <</if>> @@ -420,11 +528,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.arcologyImprovement || $lastWeeksCashExpenses.arcologyImprovement>> <tr> <td>Arcology construction and repair</td> - <td><<= cashNumFormat($lastWeeksCashIncome.arcologyImprovement)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.arcologyImprovement)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.arcologyImprovement))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.arcologyImprovement))>>@@</td> <td> <<set $lastWeeksCashProfits.arcologyImprovement = ($lastWeeksCashIncome.arcologyImprovement + $lastWeeksCashExpenses.arcologyImprovement)>> - <<= cashNumFormat($lastWeeksCashProfits.arcologyImprovement)>> + <<if $lastWeeksCashProfits.arcologyImprovement > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.arcologyImprovement))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.arcologyImprovement))>>@@ + <</if>> </td> </tr> <</if>> @@ -432,16 +544,20 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.environment || $lastWeeksCashExpenses.environment>> <tr> <td>Environment</td> - <td><<= cashNumFormat($lastWeeksCashIncome.environment)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.environment)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.environment))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.environment))>>@@</td> <td> <<set $lastWeeksCashProfits.environment = ($lastWeeksCashIncome.environment + $lastWeeksCashExpenses.environment)>> - <<= cashNumFormat($lastWeeksCashProfits.environment)>> + <<if $lastWeeksCashProfits.environment > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.environment))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.environment))>>@@ + <</if>> </td> </tr> <</if>> - <<if $lastWeeksCashIncome.weather || $lastWeeksCashExpenses.weather>> + <<if $lastWeeksCashIncome.weather || $lastWeeksCashExpenses.weather>> /* TODO: this doesn't fit in */ <tr> <td> <<if $lastWeeksCashExpenses.weather > 0>> @@ -450,11 +566,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ Weather <</if>> </td> - <td><<= cashNumFormat($lastWeeksCashIncome.weather)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.weather)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.weather))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.weather))>>@@</td> <td> <<set $lastWeeksCashProfits.weather = ($lastWeeksCashIncome.weather + $lastWeeksCashExpenses.weather)>> - <<= cashNumFormat($lastWeeksCashProfits.weather)>> + <<if $lastWeeksCashProfits.weather > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.weather))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.weather))>>@@ + <</if>> </td> </tr> <</if>> @@ -465,23 +585,31 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ </tr> <tr> - <td>[[Slave maintenance|Costs Report][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] (food, hormones) ($slaves.length slaves)</td> - <td><<= cashNumFormat($lastWeeksCashIncome.slaveUpkeep)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.slaveUpkeep)>></td> + <td>[[Slave maintenance|Costs Report][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($slaves.length slaves)</td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.slaveUpkeep))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.slaveUpkeep))>>@@</td> <td> <<set $lastWeeksCashProfits.slaveUpkeep = ($lastWeeksCashIncome.slaveUpkeep + $lastWeeksCashExpenses.slaveUpkeep)>> - $lastWeeksCashProfits.slaveUpkeep + <<if $lastWeeksCashProfits.slaveUpkeep > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.slaveUpkeep))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.slaveUpkeep))>>@@ + <</if>> </td> </tr> <<if $lastWeeksCashIncome.extraMilk || $lastWeeksCashExpenses.extraMilk>> <tr> <td>Extra Milk</td> - <td><<= cashNumFormat($lastWeeksCashIncome.extraMilk)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.extraMilk)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.extraMilk))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.extraMilk))>>@@</td> <td> <<set $lastWeeksCashProfits.extraMilk = ($lastWeeksCashIncome.extraMilk + $lastWeeksCashExpenses.extraMilk)>> - <<= cashNumFormat($lastWeeksCashProfits.extraMilk)>> + <<if $lastWeeksCashProfits.extraMilk > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.extraMilk))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.extraMilk))>>@@ + <</if>> </td> </tr> <</if>> @@ -489,22 +617,30 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.extraMilk || $lastWeeksCashExpenses.extraMilk>> <tr> <td>Extra Milk</td> - <td><<= cashNumFormat($lastWeeksCashIncome.extraMilk)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.extraMilk)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.extraMilk))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.extraMilk))>>@@</td> <td> <<set $lastWeeksCashProfits.extraMilk = ($lastWeeksCashIncome.extraMilk + $lastWeeksCashExpenses.extraMilk)>> - <<= cashNumFormat($lastWeeksCashProfits.extraMilk)>> + <<if $lastWeeksCashProfits.extraMilk > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.extraMilk))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.extraMilk))>>@@ + <</if>> </td> </tr> <</if>> <<if $marketAssistantLimit>> <tr> <td>Menials: [[Assistant's|Personal assistant options][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] flipping</td> - <td>$lastWeeksCashIncome.menialTransfer</td> - <td>$lastWeeksCashExpenses.menialTransfer</td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.menialTradesTransfer))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.menialTradesTransfer))>>@@</td> <td> - <<set $lastWeeksCashProfits.menialTransfer = ($lastWeeksCashIncome.menialTransfer + $lastWeeksCashExpenses.menialTransfer)>> - $lastWeeksCashProfits.menialTransfer + <<set $lastWeeksCashProfits.menialTradesTransfer = ($lastWeeksCashIncome.menialTradesTransfer + $lastWeeksCashExpenses.menialTradesTransfer)>> + <<if $lastWeeksCashProfits.menialTradesTransfer > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.menialTradesTransfer))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.menialTradesTransfer))>>@@ + <</if>> </td> </tr> <</if>> @@ -512,11 +648,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if ($lastWeeksCashIncome.menialTrades) || ($lastWeeksCashExpenses.menialTrades)>> <tr> <td>Menials: labor</td> - <td><<= cashNumFormat($lastWeeksCashIncome.menialTrades)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.menialTrades)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.menialTrades))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.menialTrades))>>@@</td> <td> <<set $lastWeeksCashProfits.menialTrades = ($lastWeeksCashIncome.menialTrades + $lastWeeksCashExpenses.menialTrades)>> - <<= cashNumFormat($lastWeeksCashProfits.menialTrades)>> + <<if $lastWeeksCashProfits.menialTrades > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.menialTrades))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.menialTrades))>>@@ + <</if>> </td> </tr> <</if>> @@ -524,11 +664,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.fuckdolls || $lastWeeksCashExpenses.fuckdolls>> <tr> <td>Fuckdolls</td> - <td><<= cashNumFormat($lastWeeksCashIncome.fuckdolls)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.fuckdolls)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.fuckdolls))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.fuckdolls))>>@@</td> <td> <<set $lastWeeksCashProfits.fuckdolls = ($lastWeeksCashIncome.fuckdolls + $lastWeeksCashExpenses.fuckdolls)>> - <<= cashNumFormat($lastWeeksCashProfits.fuckdolls)>> + <<if $lastWeeksCashProfits.fuckdolls > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.fuckdolls))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.fuckdolls))>>@@ + <</if>> </td> </tr> <</if>> @@ -536,11 +680,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if ($lastWeeksCashIncome.menialBioreactors) || ($lastWeeksCashExpenses.menialBioreactors)>> <tr> <td>Menials: bioreactors</td> - <td><<= cashNumFormat($lastWeeksCashIncome.menialBioreactors)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.menialBioreactors)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.menialBioreactors))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.menialBioreactors))>>@@</td> <td> <<set $lastWeeksCashProfits.menialBioreactors = ($lastWeeksCashIncome.menialBioreactors + $lastWeeksCashExpenses.menialBioreactors)>> - <<= cashNumFormat($lastWeeksCashProfits.menialBioreactors)>> + <<if $lastWeeksCashProfits.menialBioreactors > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.menialBioreactors))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.menialBioreactors))>>@@ + <</if>> </td> </tr> <</if>> @@ -548,11 +696,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if ($lastWeeksCashIncome.fuckDollBioFactory) || ($lastWeeksCashExpenses.fuckDollBioFactory)>> <tr> <td>Menials: labor</td> - <td><<= cashNumFormat($lastWeeksCashIncome.fuckDollBioFactory)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.fuckDollBioFactory)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.fuckDollBioFactory))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.fuckDollBioFactory))>>@@</td> <td> <<set $lastWeeksCashProfits.fuckDollBioFactory = ($lastWeeksCashIncome.fuckDollBioFactory + $lastWeeksCashExpenses.fuckDollBioFactory)>> - <<= cashNumFormat($lastWeeksCashProfits.fuckDollBioFactory)>> + <<if $lastWeeksCashProfits.fuckDollBioFactory > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.fuckDollBioFactory))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.fuckDollBioFactory))>>@@ + <</if>> </td> </tr> <</if>> @@ -562,11 +714,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.porn || $lastWeeksCashExpenses.porn>> <tr> <td>Porn</td> - <td><<= cashNumFormat($lastWeeksCashIncome.porn)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.porn)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.porn))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.porn))>>@@</td> <td> <<set $lastWeeksCashProfits.porn = ($lastWeeksCashIncome.porn + $lastWeeksCashExpenses.porn)>> - <<= cashNumFormat($lastWeeksCashProfits.porn)>> + <<if $lastWeeksCashProfits.porn > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.porn))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.porn))>>@@ + <</if>> </td> </tr> <</if>> @@ -574,11 +730,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.recruiter || $lastWeeksCashExpenses.recruiter>> <tr> <td>Recruiter</td> - <td><<= cashNumFormat($lastWeeksCashIncome.recruiter)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.recruiter)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.recruiter))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.recruiter))>>@@</td> <td> <<set $lastWeeksCashProfits.recruiter = ($lastWeeksCashIncome.recruiter + $lastWeeksCashExpenses.recruiter)>> - <<= cashNumFormat($lastWeeksCashProfits.recruiter)>> + <<if $lastWeeksCashProfits.recruiter > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.recruiter))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.recruiter))>>@@ + <</if>> </td> </tr> <</if>> @@ -588,11 +748,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.slaveTransfer || $lastWeeksCashExpenses.slaveTransfer>> <tr> <td>Buying/Selling Major Slaves</td> - <td><<= cashNumFormat($lastWeeksCashIncome.slaveTransfer)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.slaveTransfer)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.slaveTransfer))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.slaveTransfer))>>@@</td> <td> <<set $lastWeeksCashProfits.slaveTransfer = ($lastWeeksCashIncome.slaveTransfer + $lastWeeksCashExpenses.slaveTransfer)>> - <<= cashNumFormat($lastWeeksCashProfits.slaveTransfer)>> + <<if $lastWeeksCashProfits.slaveTransfer > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.slaveTransfer))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.slaveTransfer))>>@@ + <</if>> </td> </tr> <</if>> @@ -600,11 +764,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.fuckdollsTransfer || $lastWeeksCashExpenses.fuckdollsTransfer>> <tr> <td>Buying/Selling Fuckdolls</td> - <td><<= cashNumFormat($lastWeeksCashIncome.fuckdollsTransfer)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.fuckdollsTransfer)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.fuckdollsTransfer))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.fuckdollsTransfer))>>@@</td> <td> <<set $lastWeeksCashProfits.fuckdollsTransfer = ($lastWeeksCashIncome.fuckdollsTransfer + $lastWeeksCashExpenses.fuckdollsTransfer)>> - <<= cashNumFormat($lastWeeksCashProfits.fuckdollsTransfer)>> + <<if $lastWeeksCashProfits.fuckdollsTransfer > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.fuckdollsTransfer))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.fuckdollsTransfer))>>@@ + <</if>> </td> </tr> <</if>> @@ -612,11 +780,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.babyTransfer || $lastWeeksCashExpenses.babyTransfer>> <tr> <td>Buying/Selling Babies</td> - <td><<= cashNumFormat($lastWeeksCashIncome.babyTransfer)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.babyTransfer)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.babyTransfer))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.babyTransfer))>>@@</td> <td> <<set $lastWeeksCashProfits.babyTransfer = ($lastWeeksCashIncome.babyTransfer + $lastWeeksCashExpenses.babyTransfer)>> - <<= cashNumFormat($lastWeeksCashProfits.babyTransfer)>> + <<if $lastWeeksCashProfits.babyTransfer > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.babyTransfer))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.babyTransfer))>>@@ + <</if>> </td> </tr> <</if>> @@ -624,11 +796,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.menialRetirement || $lastWeeksCashExpenses.menialRetirement>> <tr> <td>Menials retiring</td> - <td><<= cashNumFormat($lastWeeksCashIncome.menialRetirement)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.menialRetirement)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.menialRetirement))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.menialRetirement))>>@@</td> <td> <<set $lastWeeksCashProfits.menialRetirement = ($lastWeeksCashIncome.menialRetirement + $lastWeeksCashExpenses.menialRetirement)>> - <<= cashNumFormat($lastWeeksCashProfits.menialRetirement)>> + <<if $lastWeeksCashProfits.menialRetirement > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.menialRetirement))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.menialRetirement))>>@@ + <</if>> </td> </tr> <</if>> @@ -636,11 +812,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.slaveMod || $lastWeeksCashExpenses.slaveMod>> <tr> <td>Slave Modification</td> - <td><<= cashNumFormat($lastWeeksCashIncome.slaveMod)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.slaveMod)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.slaveMod))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.slaveMod))>>@@</td> <td> <<set $lastWeeksCashProfits.slaveMod = ($lastWeeksCashIncome.slaveMod + $lastWeeksCashExpenses.slaveMod)>> - <<= cashNumFormat($lastWeeksCashProfits.slaveMod)>> + <<if $lastWeeksCashProfits.slaveMod > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.slaveMod))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.slaveMod))>>@@ + <</if>> </td> </tr> <</if>> @@ -648,11 +828,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.slaveSurgery || $lastWeeksCashExpenses.slaveSurgery>> <tr> <td>Slave Surgery</td> - <td><<= cashNumFormat($lastWeeksCashIncome.slaveSurgery)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.slaveSurgery)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.slaveSurgery))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.slaveSurgery))>>@@</td> <td> <<set $lastWeeksCashProfits.slaveSurgery = ($lastWeeksCashIncome.slaveSurgery + $lastWeeksCashExpenses.slaveSurgery)>> - <<= cashNumFormat($lastWeeksCashProfits.slaveSurgery)>> + <<if $lastWeeksCashProfits.slaveSurgery > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.slaveSurgery))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.slaveSurgery))>>@@ + <</if>> </td> </tr> <</if>> @@ -660,11 +844,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.birth || $lastWeeksCashExpenses.birth>> <tr> <td>Slave Surgery</td> - <td><<= cashNumFormat($lastWeeksCashIncome.birth)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.birth)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.birth))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.birth))>>@@</td> <td> <<set $lastWeeksCashProfits.birth = ($lastWeeksCashIncome.birth + $lastWeeksCashExpenses.birth)>> - <<= cashNumFormat($lastWeeksCashProfits.birth)>> + <<if $lastWeeksCashProfits.birth > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.birth))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.birth))>>@@ + <</if>> </td> </tr> <</if>> @@ -677,11 +865,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.personalBusiness || $lastWeeksCashExpenses.personalBusiness>> <tr> <td>Personal Business</td> - <td><<= cashNumFormat($lastWeeksCashIncome.personalBusiness)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.personalBusiness)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.personalBusiness))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.personalBusiness))>>@@</td> <td> <<set $lastWeeksCashProfits.personalBusiness = ($lastWeeksCashIncome.personalBusiness + $lastWeeksCashExpenses.personalBusiness)>> - <<= cashNumFormat($lastWeeksCashProfits.personalBusiness)>> + <<if $lastWeeksCashProfits.personalBusiness > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.personalBusiness))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.personalBusiness))>>@@ + <</if>> </td> </tr> <</if>> @@ -694,22 +886,30 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<else>> <td>Since you are used to a fairly normal life, your personal living expenses are:</td> <</if>> - <td><<= cashNumFormat($lastWeeksCashIncome.personalLivingExpenses)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.personalLivingExpenses)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.personalLivingExpenses))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.personalLivingExpenses))>>@@</td> <td> <<set $lastWeeksCashProfits.personalLivingExpenses = ($lastWeeksCashIncome.personalLivingExpenses + $lastWeeksCashExpenses.personalLivingExpenses)>> - <<= cashNumFormat($lastWeeksCashProfits.personalLivingExpenses)>> + <<if $lastWeeksCashProfits.personalLivingExpenses > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.personalLivingExpenses))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.personalLivingExpenses))>>@@ + <</if>> </td> </tr> <<if $lastWeeksCashIncome.PCtraining || $lastWeeksCashExpenses.PCtraining>> <tr> <td>Your training</td> - <td><<= cashNumFormat($lastWeeksCashIncome.PCtraining)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.PCtraining)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.PCtraining))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.PCtraining))>>@@</td> <td> <<set $lastWeeksCashProfits.PCtraining = ($lastWeeksCashIncome.PCtraining + $lastWeeksCashExpenses.PCtraining)>> - <<= cashNumFormat($lastWeeksCashProfits.PCtraining)>> + <<if $lastWeeksCashProfits.PCtraining > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.PCtraining))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.PCtraining))>>@@ + <</if>> </td> </tr> <</if>> @@ -717,11 +917,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.PCmedical || $lastWeeksCashExpenses.PCmedical>> <tr> <td>Your medical expenses</td> - <td><<= cashNumFormat($lastWeeksCashIncome.PCmedical)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.PCmedical)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.PCmedical))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.PCmedical))>>@@</td> <td> <<set $lastWeeksCashProfits.PCmedical = ($lastWeeksCashIncome.PCmedical + $lastWeeksCashExpenses.PCmedical)>> - <<= cashNumFormat($lastWeeksCashProfits.PCmedical)>> + <<if $lastWeeksCashProfits.PCmedical > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.PCmedical))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.PCmedical))>>@@ + <</if>> </td> </tr> <</if>> @@ -729,11 +933,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.PCskills || $lastWeeksCashExpenses.PCskills>> <tr> <td>Your skills</td> - <td><<= cashNumFormat($lastWeeksCashIncome.PCskills)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.PCskills)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.PCskills))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.PCskills))>>@@</td> <td> <<set $lastWeeksCashProfits.PCskills = ($lastWeeksCashIncome.PCskills + $lastWeeksCashExpenses.PCskills)>> - <<= cashNumFormat($lastWeeksCashProfits.PCskills)>> + <<if $lastWeeksCashProfits.PCskills > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.PCskills))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.PCskills))>>@@ + <</if>> </td> </tr> <</if>> @@ -745,8 +953,8 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ (and bribes) <</if>> </td> - <td><<= cashNumFormat($lastWeeksCashIncome.rents)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.rents)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.rents))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.rents))>>@@</td> <td> <<set $lastWeeksCashProfits.rents = ($lastWeeksCashIncome.rents + $lastWeeksCashExpenses.rents)>> $lastWeeksCashIncome.rents @@ -756,11 +964,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.stocks || $personalShares > 0>> <tr> <td>Stock dividends on ($personalShares/<<print ($publicShares + $personalShares)>> shares), paying <<print ($lastWeeksCashIncome.stocks/$personalShares*100)>>% per share.</td> - <td><<= cashNumFormat($lastWeeksCashIncome.stocks)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.stocks)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.stocks))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.stocks))>>@@</td> <td> <<set $lastWeeksCashProfits.stocks = ($lastWeeksCashIncome.stocks + $lastWeeksCashExpenses.stocks)>> - <<= cashNumFormat($lastWeeksCashProfits.stocks)>> + <<if $lastWeeksCashProfits.stocks > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.stocks))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.stocks))>>@@ + <</if>> </td> </tr> <</if>> @@ -768,11 +980,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.stocksTraded|| $lastWeeksCashExpenses.stocksTraded>> <tr> <td>Stock trading</td> - <td><<= cashNumFormat($lastWeeksCashIncome.stocksTraded)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.stocksTraded)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.stocksTraded))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.stocksTraded))>>@@</td> <td> <<set $lastWeeksCashProfits.stocksTraded = ($lastWeeksCashIncome.stocksTraded + $lastWeeksCashExpenses.stocksTraded)>> - <<= cashNumFormat($lastWeeksCashProfits.stocksTraded)>> + <<if $lastWeeksCashProfits.stocksTraded > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.stocksTraded))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.stocksTraded))>>@@ + <</if>> </td> </tr> <</if>> @@ -780,11 +996,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.fines || $lastWeeksCashExpenses.fines>> <tr> <td>Fines</td> - <td><<= cashNumFormat($lastWeeksCashIncome.fines)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.fines)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.fines))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.fines))>>@@</td> <td> <<set $lastWeeksCashProfits.fines = ($lastWeeksCashIncome.fines + $lastWeeksCashExpenses.fines)>> - <<= cashNumFormat($lastWeeksCashProfits.fines)>> + <<if $lastWeeksCashProfits.fines > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.fines))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.fines))>>@@ + <</if>> </td> </tr> <</if>> @@ -792,11 +1012,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.event || $lastWeeksCashExpenses.event>> <tr> <td>Events</td> - <td><<= cashNumFormat($lastWeeksCashIncome.event)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.event)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.event))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.event))>>@@</td> <td> <<set $lastWeeksCashProfits.event = ($lastWeeksCashIncome.event + $lastWeeksCashExpenses.event)>> - <<= cashNumFormat($lastWeeksCashProfits.event)>> + <<if $lastWeeksCashProfits.event > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.event))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.event))>>@@ + <</if>> </td> </tr> <</if>> @@ -804,11 +1028,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.war || $lastWeeksCashExpenses.war>> <tr> <td>Archology conflict</td> - <td><<= cashNumFormat($lastWeeksCashIncome.war)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.war)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.war))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.war))>>@@</td> <td> <<set $lastWeeksCashProfits.war = ($lastWeeksCashIncome.war + $lastWeeksCashExpenses.war)>> - <<= cashNumFormat($lastWeeksCashProfits.war)>> + <<if $lastWeeksCashProfits.war > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.war))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.war))>>@@ + <</if>> </td> </tr> <</if>> @@ -828,11 +1056,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ [[Medicine trainer|Personal Attention Select][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] fees <</if>> </td> - <td><<= cashNumFormat($lastWeeksCashIncome.PCtraining)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.PCtraining)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.PCtraining))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.PCtraining))>>@@</td> <td> <<set $lastWeeksCashProfits.PCtraining = ($lastWeeksCashIncome.PCtraining + $lastWeeksCashExpenses.PCtraining)>> - <<= cashNumFormat($lastWeeksCashProfits.PCtraining)>> + <<if $lastWeeksCashProfits.PCtraining > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.PCtraining))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.PCtraining))>>@@ + <</if>> </td> </tr> <</if>> @@ -840,11 +1072,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.capEx || $lastWeeksCashExpenses.capEx>> <tr> <td>Capital Expenses</td> - <td><<= cashNumFormat($lastWeeksCashIncome.capEx)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.capEx)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.capEx))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.capEx))>>@@</td> <td> <<set $lastWeeksCashProfits.capEx = ($lastWeeksCashIncome.capEx + $lastWeeksCashExpenses.capEx)>> - <<= cashNumFormat($lastWeeksCashProfits.capEx)>> + <<if $lastWeeksCashProfits.capEx > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.capEx))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.capEx))>>@@ + <</if>> </td> </tr> <</if>> @@ -852,11 +1088,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.cheating || $lastWeeksCashExpenses.cheating>> <tr> <td>CHEATING</td> - <td><<= cashNumFormat($lastWeeksCashIncome.cheating)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.cheating)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.cheating))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.cheating))>>@@</td> <td> <<set $lastWeeksCashProfits.cheating = ($lastWeeksCashIncome.cheating + $lastWeeksCashExpenses.cheating)>> - <<= cashNumFormat($lastWeeksCashProfits.cheating)>> + <<if $lastWeeksCashProfits.cheating > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.cheating))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.cheating))>>@@ + <</if>> </td> </tr> <</if>> @@ -868,11 +1108,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.policies || $lastWeeksCashExpenses.policies>> <tr> <td>[[Policies|Policies][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]]</td> - <td><<= cashNumFormat($lastWeeksCashIncome.policies)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.policies)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.policies))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.policies))>>@@</td> <td> <<set $lastWeeksCashProfits.policies = ($lastWeeksCashIncome.policies + $lastWeeksCashExpenses.policies)>> - <<= cashNumFormat($lastWeeksCashProfits.policies)>> + <<if $lastWeeksCashProfits.policies > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.policies))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.policies))>>@@ + <</if>> </td> </tr> <</if>> @@ -880,11 +1124,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $FSSpending != 0>> <tr> <td>[[Society Shaping|Future Society][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]]</td> - <td><<= cashNumFormat($lastWeeksCashIncome.futureSocieties)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.futureSocieties)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.futureSocieties))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.futureSocieties))>>@@</td> <td> <<set $lastWeeksCashProfits.futureSocieties = ($lastWeeksCashIncome.futureSocieties + $lastWeeksCashExpenses.futureSocieties)>> - <<= cashNumFormat($lastWeeksCashProfits.futureSocieties)>> + <<if $lastWeeksCashProfits.futureSocieties > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.futureSocieties))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.futureSocieties))>>@@ + <</if>> </td> </tr> <</if>> @@ -910,11 +1158,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<else>> Unknown school expense <</if>> </td> - <td><<= cashNumFormat($lastWeeksCashIncome.schoolBacking)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.schoolBacking)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.schoolBacking))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.schoolBacking))>>@@</td> <td> <<set $lastWeeksCashProfits.schoolBacking = ($lastWeeksCashIncome.schoolBacking + $lastWeeksCashExpenses.schoolBacking)>> - <<= cashNumFormat($lastWeeksCashProfits.schoolBacking)>> + <<if $lastWeeksCashProfits.schoolBacking > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.schoolBacking))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.schoolBacking))>>@@ + <</if>> </td> </tr> <</if>> @@ -922,11 +1174,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $citizenOrphanageTotal > 0>> <tr> <td>Education of $citizenOrphanageTotal of your slaves' children in citizen schools</td> - <td><<= cashNumFormat($lastWeeksCashIncome.citizenOrphanage)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.citizenOrphanage)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.citizenOrphanage))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.citizenOrphanage))>>@@</td> <td> <<set $lastWeeksCashProfits.citizenOrphanage = ($lastWeeksCashIncome.citizenOrphanage + $lastWeeksCashExpenses.citizenOrphanage)>> - <<= cashNumFormat($lastWeeksCashProfits.citizenOrphanage)>> + <<if $lastWeeksCashProfits.citizenOrphanage > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.citizenOrphanage))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.citizenOrphanage))>>@@ + <</if>> </td> </tr> <</if>> @@ -934,11 +1190,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $privateOrphanageTotal > 0>> <tr> <td>Private tutelage of $privateOrphanageTotal of your slaves' children</td> - <td><<= cashNumFormat($lastWeeksCashIncome.privateOrphanage)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.privateOrphanage)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.privateOrphanage))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.privateOrphanage))>>@@</td> <td> <<set $lastWeeksCashProfits.privateOrphanage = ($lastWeeksCashIncome.privateOrphanage + $lastWeeksCashExpenses.privateOrphanage)>> - <<= cashNumFormat($lastWeeksCashProfits.privateOrphanage)>> + <<if $lastWeeksCashProfits.privateOrphanage > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.privateOrphanage))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.privateOrphanage))>>@@ + <</if>> </td> </tr> <</if>> @@ -949,11 +1209,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $barracks>><<else>><br>//@@.red;Cost increased by the lack of an armory to house them.@@//<</if>> <<if ($PC.warfare >= 100) || ($PC.career == "arcology owner")>><br>//Cost reduced by your @@.springgreen;mercenary contacts.@@//<</if>> </td> - <td><<= cashNumFormat($lastWeeksCashIncome.mercenaries)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.mercenaries)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.mercenaries))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.mercenaries))>>@@</td> <td> <<set $lastWeeksCashProfits.mercenaries = ($lastWeeksCashIncome.mercenaries + $lastWeeksCashExpenses.mercenaries)>> - <<= cashNumFormat($lastWeeksCashProfits.mercenaries)>> + <<if $lastWeeksCashProfits.mercenaries > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.mercenaries))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.mercenaries))>>@@ + <</if>> </td> </tr> <</if>> @@ -961,11 +1225,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.securityExpansion || $lastWeeksCashExpenses.securityExpansion>> <tr> <td>Security Expansion</td> - <td><<= cashNumFormat($lastWeeksCashIncome.securityExpansion)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.securityExpansion)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.securityExpansion))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.securityExpansion))>>@@</td> <td> <<set $lastWeeksCashProfits.securityExpansion = ($lastWeeksCashIncome.securityExpansion + $lastWeeksCashExpenses.securityExpansion)>> - <<= cashNumFormat($lastWeeksCashProfits.securityExpansion)>> + <<if $lastWeeksCashProfits.securityExpansion > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.securityExpansion))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.securityExpansion))>>@@ + <</if>> </td> </tr> <</if>> @@ -973,23 +1241,31 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.specialForces || $lastWeeksCashExpenses.specialForces>> <tr> <td>Special Forces</td> - <td><<= cashNumFormat($lastWeeksCashIncome.specialForces)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.specialForces)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.specialForces))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.specialForces))>>@@</td> <td> <<set $lastWeeksCashProfits.specialForces = ($lastWeeksCashIncome.specialForces + $lastWeeksCashExpenses.specialForces)>> - <<= cashNumFormat($lastWeeksCashProfits.specialForces)>> + <<if $lastWeeksCashProfits.specialForces > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.specialForces))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.specialForces))>>@@ + <</if>> </td> </tr> <</if>> <<if $securityForceActive > 0>> <tr> - <td>Acquisitions: [[$securityForceName|SFM Barracks][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]]</td> - <td><<= cashNumFormat($lastWeeksCashIncome.mercenaries)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.mercenaries)>></td> + <td>Acquisitions: [[$securityForceNameCaps|SFM Barracks][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]]</td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.mercenaries))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.mercenaries))>>@@</td> <td> <<set $lastWeeksCashProfits.mercenaries = ($lastWeeksCashIncome.mercenaries + $lastWeeksCashExpenses.mercenaries)>> - <<= cashNumFormat($lastWeeksCashProfits.mercenaries)>> + <<if $lastWeeksCashProfits.mercenaries > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.mercenaries))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.mercenaries))>>@@ + <</if>> </td> </tr> <</if>> @@ -998,11 +1274,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $peacekeepers.undermining != 0>> <tr> <td>Undermine political support for the nearby old world peacekeeping mission.</td> - <td><<= cashNumFormat($lastWeeksCashIncome.peacekeepers)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.peacekeepers)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.peacekeepers))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.peacekeepers))>>@@</td> <td> <<set $lastWeeksCashProfits.peacekeepers = ($lastWeeksCashIncome.peacekeepers + $lastWeeksCashExpenses.peacekeepers)>> - $lastWeeksCashProfits.peacekeepers + <<if $lastWeeksCashProfits.peacekeepers > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.peacekeepers))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.peacekeepers))>>@@ + <</if>> </td> </tr> <</if>> @@ -1011,11 +1291,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <<if $lastWeeksCashIncome.recruiter || $lastWeeksCashExpenses.recruiter>> <tr> <td>__Recruiting__</td> - <td><<= cashNumFormat($lastWeeksCashIncome.recruiter)>></td> - <td><<= cashNumFormat($lastWeeksCashExpenses.recruiter)>></td> + <td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.recruiter))>>@@</td> + <td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.recruiter))>>@@</td> <td> <<set $lastWeeksCashProfits.recruiter = ($lastWeeksCashIncome.recruiter + $lastWeeksCashExpenses.recruiter)>> - <<= cashNumFormat($lastWeeksCashProfits.recruiter)>> + <<if $lastWeeksCashProfits.recruiter > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.recruiter))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.recruiter))>>@@ + <</if>> </td> </tr> <</if>> @@ -1025,31 +1309,47 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <td>Tracked totals</td> <td> <<set $lastWeeksCashIncome.Total = hashSum($lastWeeksCashIncome)>> - <<= cashNumFormat($lastWeeksCashIncome.Total)>> + <<if $lastWeeksCashIncome.Total > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.Total))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashIncome.Total))>>@@ + <</if>> </td> <td> <<set $lastWeeksCashExpenses.Total = hashSum($lastWeeksCashExpenses)>> - <<= cashNumFormat($lastWeeksCashExpenses.Total)>> + <<if $lastWeeksCashExpenses.Total > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.Total))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.Total))>>@@ + <</if>> </td> <td> <<set $lastWeeksCashProfits.Total = ($lastWeeksCashIncome.Total + $lastWeeksCashExpenses.Total)>> /* each "profit" item is calculated on this sheet, and there's two ways to generate a profit total: the difference of the income and expense totals, and adding all the profit items. If they aren't the same, I probably forgot to properly add an item's profit calculation to this sheet.*/ <<if $lastWeeksCashProfits.Total != hashSum($lastWeeksCashProfits) - $lastWeeksCashProfits.Total>>/* Profits includes the total number of profits, so we have to subtract it back out */ - <<print (hashSum($lastWeeksCashProfits)-$lastWeeksCashProfits.Total)>><br> + <<print (cashFormat(Math.trunc(hashSum($lastWeeksCashProfits)-$lastWeeksCashProfits.Total)))>><br> @@.red;Fix profit calc<br>@@ <</if>> - <<= cashNumFormat($lastWeeksCashProfits.Total)>> + <<if $lastWeeksCashProfits.Total > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.Total))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc($lastWeeksCashProfits.Total))>>@@ + <</if>> </td> </tr> <tr><td></td></tr> <tr> - <td>Expenses budget for week <<print ($week +1)>></td> - <td></td> - <td><<= cashNumFormat($costs)>></td> + <td>Expenses budget for week <<print ($week+1)>></td> <td></td> + <td><<if $costs > 0>> + @@.yellowgreen;<<print cashFormat($costs)>>@@ + <<else>> + @@.red;<<print cashFormat($costs)>>@@ + <</if>></td> + <td></td> </tr> @@ -1059,7 +1359,11 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <td>Last week actuals</td> <td></td> <td></td> - <td><<print cashNumFormat($cash-$cashLastWeek)>></td> + <td><<if ($cash-$cashLastWeek) > 0>> + @@.yellowgreen;<<print cashFormat($cash-$cashLastWeek)>>@@ + <<else>> + @@.red;<<print cashFormat($cash-$cashLastWeek)>>@@ + <</if>></td> </tr> <<if ($cash-$cashLastWeek) == $lastWeeksCashProfits.Total>> @@ -1071,7 +1375,11 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <td>Transaction tracking off by:</td> <td></td> <td>/*<<print ($lastWeeksCashExpenses.Total + $costs)>>*/</td> - <td><<print cashNumFormat(($cash-$cashLastWeek) - $lastWeeksCashProfits.Total)>></td> + <td><<if (($cash-$cashLastWeek) - $lastWeeksCashProfits.Total) > 0>> + @@.yellowgreen;<<print cashFormat(Math.trunc(($cash-$cashLastWeek) - $lastWeeksCashProfits.Total))>>@@ + <<else>> + @@.red;<<print cashFormat(Math.trunc((($cash-$cashLastWeek) - $lastWeeksCashProfits.Total)))>>@@ + <</if>></td> </tr> <</if>> </table> @@ -1085,12 +1393,12 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){ <</if>> <<if ndef $lastWeeksErrors>> - <<set $lastWeeksErrors = "Errors:">> + <<set $lastWeeksErrors = "Errors: ">> <</if>> <<if $lastWeeksErrors !== "Errors:">> - <<link "Reset">> - <<set $lastWeeksErrors = "Errors:">> + <<link "Reset">> + <<set $lastWeeksErrors = "Errors: ">> <</link>> @@.red;<<print $lastWeeksErrors>>@@ <</if>>