From cc182f1bbe1dcf4cb19581351c0de8886608086b Mon Sep 17 00:00:00 2001
From: DCoded <dcoded@live.com>
Date: Sat, 19 Jan 2019 15:04:03 -0500
Subject: [PATCH] Costs budget screen formatting fixes

---
 devNotes/twine JS.txt            |  52 ++
 src/uncategorized/costsBudget.tw | 802 +++++++++++++++++++++----------
 2 files changed, 607 insertions(+), 247 deletions(-)

diff --git a/devNotes/twine JS.txt b/devNotes/twine JS.txt
index 60de2872dd6..c0f7c61ec16 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 f23751d90fd..77a2a76196c 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>$lastWeeksCashIncome.whore</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.rest</td>
-			<td>$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)>>
-				$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: $lastWeeksCashIncome.fucktoy</td>
-			<td>$lastWeeksCashExpenses.fucktoy</td>
+			<td>$lastWeeksCashIncome.fucktoy rep</td>
+			<td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.fucktoy))>>@@</td>
 			<td>
 				<<set $lastWeeksCashProfits.fucktoy = (+ $lastWeeksCashExpenses.fucktoy)>>
-				$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>$lastWeeksCashIncome.subordinateSlave</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.houseServant</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.confined</td>
-			<td>$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)>>
-				$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: $lastWeeksCashIncome.publicServant</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.classes</td>
-			<td>$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)>>
-				$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>>
@@ -148,11 +180,15 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){
 	<<if $lastWeeksCashIncome.milked || $lastWeeksCashExpenses.milked>>
 		<tr>
 			<td>Milked</td> 
-			<td>$lastWeeksCashIncome.milked</td>
-			<td>$lastWeeksCashExpenses.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)>>
-				$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>$lastWeeksCashIncome.gloryhole</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.brothel</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.brothelAds</td>
-			<td>$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)>>
-				$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:$lastWeeksCashIncome.club</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.clubAds</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.arcade</td>
-		<td>$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)>>
-			$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>$lastWeeksCashIncome.dairy</td>
-			<td>$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)>>
-				$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>$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>$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,79 +327,103 @@ 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: $lastWeeksCashIncome.masterSuite</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.school</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.spa</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.clinic</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.cellblock</td>
-			<td>$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)>>
-				$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>$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)>>
 				$lastWeeksCashExpenses.lab
 			</td>
 			<td>
 				<<set $lastWeeksCashProfits.lab = ($lastWeeksCashIncome.lab + $lastWeeksCashExpenses.lab)>>
-				$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>
 					<<set $lastWeeksCashExpenses.lab += (300*$researchLab.hired)>>
@@ -346,7 +434,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>
 					<<set $lastWeeksCashExpenses.lab += (100*$researchLab.menials)>>
@@ -359,60 +447,80 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){
 
 	<<if $lastWeeksCashIncome.cyberMod || $lastWeeksCashExpenses.cyberMod>>
 		<tr>
-			<td>CyberMod</td>
-			<td>$lastWeeksCashIncome.cyberMod</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.incubator</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.nursery</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.farmyard</td>
-			<td>$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)>>
-				$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"]] ($pitSlaves slaves)</td>
-			<td>$lastWeeksCashIncome.pit</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.arcologyImprovement</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.environment</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.weather</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.slaveUpkeep</td>
-		<td>$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>$lastWeeksCashIncome.extraMilk</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.extraMilk</td>
-			<td>$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)>>
-				$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.menialTradesTransfer</td>
-			<td>$lastWeeksCashExpenses.menialTradesTransfer</td>
+			<td>@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.menialTradesTransfer))>>@@</td>
+			<td>@@.red;<<print cashFormat(Math.trunc($lastWeeksCashExpenses.menialTradesTransfer))>>@@</td>
 			<td>
 				<<set $lastWeeksCashProfits.menialTradesTransfer = ($lastWeeksCashIncome.menialTradesTransfer + $lastWeeksCashExpenses.menialTradesTransfer)>>
-				$lastWeeksCashProfits.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>$lastWeeksCashIncome.menialTrades</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.fuckdolls</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.menialBioreactors</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.fuckDollBioFactory</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.porn</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.recruiter</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.slaveTransfer</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.fuckdollsTransfer</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.babyTransfer</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.menialRetirement</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.slaveMod</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.slaveSurgery</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.birth</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.personalBusiness</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.personalLivingExpenses</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.PCtraining</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.PCmedical</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.PCskills</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.rents</td>
-		<td>$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>$lastWeeksCashIncome.stocks</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.stocksTraded</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.fines</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.event</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.war</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.PCtraining</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.capEx</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.cheating</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.policies</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.futureSocieties</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.schoolBacking</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.citizenOrphanage</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.privateOrphanage</td>
-			<td>$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)>>
-				$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 a barracks.@@//<</if>>
 			<<if ($PC.warfare >= 100) || ($PC.career == "arcology owner")>><br>//Cost reduced by your @@.springgreen;mercenary contacts.@@//<</if>>
 			</td>
-			<td>$lastWeeksCashIncome.mercenaries</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.securityExpansion</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.specialForces</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.mercenaries</td>
-			<td>$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)>>
-				$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>$lastWeeksCashIncome.peacekeepers</td>
-				<td>$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>$lastWeeksCashIncome.recruiter</td>
-			<td>$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)>>
-				$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,30 +1309,46 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){
 		<td>Tracked totals</td>	
 		<td>
 			<<set $lastWeeksCashIncome.Total = hashSum($lastWeeksCashIncome)>>
-			$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)>>
-			$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>>
-			$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>Expenses budget for week <<print ($week+1)>></td>
 		<td></td>
-		<td>$costs</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 ($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 (($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:">>
+		<<set $lastWeeksErrors = "Errors: ">>
 	<</link>>
 	@@.red;<<print $lastWeeksErrors>>@@
 <</if>>
\ No newline at end of file
-- 
GitLab