:: Costs Budget [nobr jump-to-safe jump-from-safe]

<<set $nextButton = "Back to Main", $nextLink = "Main", _arcologyCosts = 0>>

<<if def $lastWeeksCashIncome>>
	<<set $lastWeeksCashIncome.Total = 0>>
	<<set $lastWeeksCashExpenses.Total = 0>>
	<<set $lastWeeksCashProfits.Total = 0>>
<</if>>

<<if ndef $showAllEntries>>
	<<set $showAllEntries = {costsBudget: 0, repBudget: 0}>>
<</if>>

<div class="scene-intro">
	Here you can view many of the financial details of your arcology, <<= properTitle()>>. The detailed list of slaves and their costs (food, hormones) that you may remember can now be found in the "Slave maintenance" link. Other links will allow you to directly control areas of your arcology to adjust spending to suit your tastes.
</div>

<br style="clear:both"><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>>

<<if $difficultySwitch == 1>>
	<div class="scene-intro">
		The Local Economy score effects some prices in your ecology. The lower the score, the higher the prices. The base score is ''100''.
	</div>
	<span id="economy">
		<span class="yellowgreen">
			Global Economy
		</span>
	| <<print $economy>>
	</span>
	<<if ($cheatMode) && ($cheatModeM)>>
		<<set _Teconomy = $economy>>
		<<textbox "_Teconomy" _Teconomy>>
		<<link "Apply">>
		<<set $economy = Math.trunc(Number(_Teconomy)) || $economy, $cheater = 1>>
		<<replace "#economy">>
		<span class="yellowgreen">
			Global Economy
		</span>
		| <<print $economy>>
		<</replace>>
		<</link>>
	<</if>>
	<br>

	<span id="localEcon">
		<span class="yellowgreen">
			Local Economy
		</span>
	| <<print $localEcon>>
	</span>
	<<if ($cheatMode) && ($cheatModeM)>>
		<<set _TlocalEcon = $localEcon>>
		<<textbox "_TlocalEcon" _TlocalEcon>>
		<<link "Apply">>
		<<set $localEcon = Math.trunc(Number(_TlocalEcon)) || $localEcon, $cheater = 1>>
		<<replace "#localEcon">>
		<span class="yellowgreen">
			Local Economy
		</span>
		| <<print $localEcon>>
		<</replace>>
		<</link>>
	<</if>>

	<br> The current score is
	<<if $localEcon > 100>>
		<<set _econPercent = Math.trunc(1000-100000/$localEcon)/10>>
		reducing prices by <span class="cash inc">''<<print _econPercent>>%.''</span>
	<<elseif $localEcon == 100>>
		equal to the base score. There are no price modifications.
	<<else>>
		<<set _econPercent = Math.trunc(100000/$localEcon-1000)/10>>
		increasing prices by <span class="cash dec">''<<print _econPercent>>%.''</span>
	<</if>>
	<br style="clear:both"><<if $lineSeparations == 0>><br><br><<else>><hr style="margin:0"><</if>>
<</if>>

<span class="detail">Your weekly costs are as follows:</span>
<<set _options = new App.UI.OptionsGroup()>>
<<run _options.addOption("", "costsBudget", $showAllEntries)
.addValue("Normal", 0).on().addValue("Show Empty Entries", 1).neutral()>>
<<includeDOM _options.render()>>

<p>
/* Table of Totals */
<<if ndef $lastWeeksCashIncome>>
	Financial data currently unavailable.
<<else>>
	<span id="costTable"></span>
	<script>App.UI.Budget.Cost()</script>
<</if>>
</p>

<<if ndef $lastWeeksCashErrors>>
	<<set $lastWeeksCashErrors = "Errors: ">>
<</if>>

<<if $lastWeeksCashErrors !== "Errors: ">>
	<<link "Reset">>
		<<set $lastWeeksCashErrors = "Errors: ">>
	<</link>><br>
	@@.red;<<print $lastWeeksCashErrors>>@@
<</if>>

src/uncategorized/costsBudget.tw