diff --git a/code/modules/modular_computers/file_system/programs/command/budgetviewer.dm b/code/modules/modular_computers/file_system/programs/command/budgetviewer.dm new file mode 100644 index 000000000000..0fee605764ac --- /dev/null +++ b/code/modules/modular_computers/file_system/programs/command/budgetviewer.dm @@ -0,0 +1,27 @@ +/datum/computer_file/program/budget_monitor + filename = "budgetmonitor" + filedesc = "Budget Monitor" + category = PROGRAM_CATEGORY_CMD + program_icon_state = "id" + extended_desc = "This program will allow you to view the financial status of your department(s)." + transfer_access = ACCESS_HEADS + usage_flags = PROGRAM_ALL + requires_ntnet = 1 + size = 3 + tgui_id = "NtosBudgetMonitor" + program_icon = "id-card" + +/datum/computer_file/program/budget_monitor/ui_data() + var/list/data = get_header_data() + + var/list/budgets = list() + for(var/A in SSeconomy.department_accounts) + var/datum/bank_account/acc = SSeconomy.get_dep_account(A) + var/name = acc.account_holder + var/money = acc.account_balance || "0" + budgets += list(list("name" = name, "money" = money)) + + data["budgets"] = budgets + + return data + diff --git a/tgui/packages/tgui/interfaces/NtosBudgetMonitor.js b/tgui/packages/tgui/interfaces/NtosBudgetMonitor.js new file mode 100644 index 000000000000..afd6ba5461e6 --- /dev/null +++ b/tgui/packages/tgui/interfaces/NtosBudgetMonitor.js @@ -0,0 +1,29 @@ +import { useBackend } from '../backend'; +import { LabeledList, Section } from '../components'; +import { NtosWindow } from '../layouts'; + +export const NtosBudgetMonitor = (props, context) => { + const { act, data } = useBackend(context); + const { + budgets, + } = data; + return ( + + +
+ + {budgets.map((budget, index) => + ( + + {budget["money"] + "cr"} + + ))} + +
+
+
+ ); +}; diff --git a/yogstation.dme b/yogstation.dme index 099447857462..4c5aa6a4ebe6 100644 --- a/yogstation.dme +++ b/yogstation.dme @@ -2673,6 +2673,7 @@ #include "code\modules\modular_computers\file_system\programs\antagonist\contract_uplink.dm" #include "code\modules\modular_computers\file_system\programs\antagonist\dos.dm" #include "code\modules\modular_computers\file_system\programs\antagonist\revelation.dm" +#include "code\modules\modular_computers\file_system\programs\command\budgetviewer.dm" #include "code\modules\modular_computers\file_system\programs\command\card.dm" #include "code\modules\modular_computers\file_system\programs\command\crewmanifest.dm" #include "code\modules\modular_computers\file_system\programs\command\jobmanagement.dm"