mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-28 07:20:09 +01:00
VueUI accounting console port (#10867)
This commit is contained in:
+1
-1
@@ -1537,7 +1537,6 @@
|
||||
#include "code\modules\detectivework\tools\storage.dm"
|
||||
#include "code\modules\detectivework\tools\swabs.dm"
|
||||
#include "code\modules\detectivework\tools\uvlight.dm"
|
||||
#include "code\modules\economy\Accounts_DB.dm"
|
||||
#include "code\modules\economy\ATM.dm"
|
||||
#include "code\modules\economy\cash.dm"
|
||||
#include "code\modules\economy\economy_misc.dm"
|
||||
@@ -2203,6 +2202,7 @@
|
||||
#include "code\modules\modular_computers\file_system\programs\civilian\cargo_order.dm"
|
||||
#include "code\modules\modular_computers\file_system\programs\civilian\crusher_control.dm"
|
||||
#include "code\modules\modular_computers\file_system\programs\civilian\janitor.dm"
|
||||
#include "code\modules\modular_computers\file_system\programs\command\account_database.dm"
|
||||
#include "code\modules\modular_computers\file_system\programs\command\card.dm"
|
||||
#include "code\modules\modular_computers\file_system\programs\command\comm.dm"
|
||||
#include "code\modules\modular_computers\file_system\programs\engineering\_engineering.dm"
|
||||
|
||||
@@ -95,7 +95,7 @@ var/datum/controller/subsystem/economy/SSeconomy
|
||||
return TRUE
|
||||
|
||||
//Create a "normal" player account
|
||||
/datum/controller/subsystem/economy/proc/create_account(var/new_owner_name = "Default user", var/starting_funds = 0, var/obj/machinery/account_database/source_db)
|
||||
/datum/controller/subsystem/economy/proc/create_account(var/new_owner_name = "Default user", var/starting_funds = 0, var/datum/computer_file/program/account_db/source_db)
|
||||
//create a new account
|
||||
var/datum/money_account/M = new()
|
||||
M.owner_name = new_owner_name
|
||||
@@ -120,31 +120,28 @@ var/datum/controller/subsystem/economy/SSeconomy
|
||||
T.time = worldtime2text()
|
||||
T.source_terminal = source_db.machine_id
|
||||
|
||||
//create a sealed package containing the account details
|
||||
var/obj/item/smallDelivery/P = new /obj/item/smallDelivery(source_db.loc)
|
||||
if(source_db.computer.nano_printer)
|
||||
var/pname = "Account information: [M.owner_name]"
|
||||
var/info = "<b>Account details (confidential)</b><br><hr><br>"
|
||||
info += "<i>Account holder:</i> [M.owner_name]<br>"
|
||||
info += "<i>Account number:</i> [M.account_number]<br>"
|
||||
info += "<i>Account pin:</i> [M.remote_access_pin]<br>"
|
||||
info += "<i>Starting balance:</i> [M.money]电<br>"
|
||||
info += "<i>Date and time:</i> [worldtime2text()], [worlddate2text()]<br><br>"
|
||||
info += "<i>Creation terminal ID:</i> [source_db.machine_id]<br>"
|
||||
var/obj/item/card/id/held_card = source_db.get_held_card()
|
||||
info += "<i>Authorised NT officer overseeing creation:</i> [held_card.registered_name]<br>"
|
||||
|
||||
var/obj/item/paper/R = new /obj/item/paper(P)
|
||||
P.wrapped = R
|
||||
var/pname = "Account information: [M.owner_name]"
|
||||
var/info = "<b>Account details (confidential)</b><br><hr><br>"
|
||||
info += "<i>Account holder:</i> [M.owner_name]<br>"
|
||||
info += "<i>Account number:</i> [M.account_number]<br>"
|
||||
info += "<i>Account pin:</i> [M.remote_access_pin]<br>"
|
||||
info += "<i>Starting balance:</i> $[M.money]<br>"
|
||||
info += "<i>Date and time:</i> [worldtime2text()], [worlddate2text()]<br><br>"
|
||||
info += "<i>Creation terminal ID:</i> [source_db.machine_id]<br>"
|
||||
info += "<i>Authorised NT officer overseeing creation:</i> [source_db.held_card.registered_name]<br>"
|
||||
|
||||
R.set_content_unsafe(pname, info)
|
||||
|
||||
//stamp the paper
|
||||
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
|
||||
stampoverlay.icon_state = "paper_stamp-cent"
|
||||
if(!R.stamped)
|
||||
R.stamped = new
|
||||
R.stamped += /obj/item/stamp
|
||||
R.add_overlay(stampoverlay)
|
||||
R.stamps += "<HR><i>This paper has been stamped by the Accounts Database.</i>"
|
||||
var/obj/item/paper/R = source_db.computer.nano_printer.print_text("", pname, "#deebff")
|
||||
R.set_content_unsafe(pname, info)
|
||||
//stamp the paper
|
||||
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
|
||||
stampoverlay.icon_state = "paper_stamp-cent"
|
||||
if(!R.stamped)
|
||||
R.stamped = new
|
||||
R.stamped += /obj/item/stamp
|
||||
R.add_overlay(stampoverlay)
|
||||
R.stamps += "<HR><i>This paper has been stamped by the Accounts Database.</i>"
|
||||
|
||||
//add the account
|
||||
add_transaction_log(M,T)
|
||||
|
||||
@@ -1,273 +0,0 @@
|
||||
|
||||
/obj/machinery/account_database
|
||||
name = "Accounts uplink terminal"
|
||||
desc = "Access transaction logs, account data and all kinds of other financial records."
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "account_uplink"
|
||||
density = 1
|
||||
req_one_access = list(access_hop, access_captain, access_cent_captain)
|
||||
anchored = 1
|
||||
var/receipt_num
|
||||
var/machine_id = ""
|
||||
var/obj/item/card/id/held_card
|
||||
var/datum/money_account/detailed_account_view
|
||||
var/creating_new_account = 0
|
||||
var/const/fund_cap = 1000000
|
||||
|
||||
proc/get_access_level()
|
||||
if (!held_card)
|
||||
return 0
|
||||
if(access_cent_captain in held_card.access)
|
||||
return 2
|
||||
else if((access_hop in held_card.access) || (access_captain in held_card.access))
|
||||
return 1
|
||||
|
||||
proc/create_transation(target, reason, amount)
|
||||
var/datum/transaction/T = new()
|
||||
T.target_name = target
|
||||
T.purpose = reason
|
||||
T.amount = amount
|
||||
T.date = worlddate2text()
|
||||
T.time = worldtime2text()
|
||||
T.source_terminal = machine_id
|
||||
return T
|
||||
|
||||
proc/accounting_letterhead(report_name)
|
||||
return {"
|
||||
<center><h1><b>[report_name]</b></h1></center>
|
||||
<center><small><i>[station_name()] Accounting Report</i></small></center>
|
||||
<hr>
|
||||
<u>Generated By:</u> [held_card.registered_name], [held_card.assignment]<br>
|
||||
"}
|
||||
|
||||
/obj/machinery/account_database/Initialize()
|
||||
. = ..()
|
||||
machine_id = "[station_name()] Acc. DB #[SSeconomy.num_financial_terminals++]"
|
||||
|
||||
/obj/machinery/account_database/attackby(obj/O, mob/user)
|
||||
if(!istype(O, /obj/item/card/id))
|
||||
return ..()
|
||||
|
||||
if(!held_card)
|
||||
user.drop_from_inventory(O,src)
|
||||
held_card = O
|
||||
|
||||
SSnanoui.update_uis(src)
|
||||
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/account_database/attack_hand(mob/user as mob)
|
||||
if(stat & (NOPOWER|BROKEN)) return
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/account_database/ui_interact(mob/user, ui_key="main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
user.set_machine(src)
|
||||
|
||||
var/data[0]
|
||||
data["src"] = "\ref[src]"
|
||||
data["id_inserted"] = !!held_card
|
||||
data["id_card"] = held_card ? text("[held_card.registered_name], [held_card.assignment]") : "-----"
|
||||
data["access_level"] = get_access_level()
|
||||
data["machine_id"] = machine_id
|
||||
data["creating_new_account"] = creating_new_account
|
||||
data["detailed_account_view"] = !!detailed_account_view
|
||||
data["station_account_number"] = SSeconomy.station_account.account_number
|
||||
data["transactions"] = null
|
||||
data["accounts"] = null
|
||||
|
||||
if (detailed_account_view)
|
||||
data["account_number"] = detailed_account_view.account_number
|
||||
data["owner_name"] = detailed_account_view.owner_name
|
||||
data["money"] = detailed_account_view.money
|
||||
data["suspended"] = detailed_account_view.suspended
|
||||
|
||||
var/list/trx[0]
|
||||
for (var/datum/transaction/T in detailed_account_view.transactions)
|
||||
trx.Add(list(list(\
|
||||
"date" = T.date, \
|
||||
"time" = T.time, \
|
||||
"target_name" = T.target_name, \
|
||||
"purpose" = T.purpose, \
|
||||
"amount" = T.amount, \
|
||||
"source_terminal" = T.source_terminal)))
|
||||
|
||||
if (trx.len > 0)
|
||||
data["transactions"] = trx
|
||||
|
||||
var/list/accounts[0]
|
||||
for(var/M in SSeconomy.all_money_accounts)
|
||||
var/datum/money_account/D = SSeconomy.get_account(M)
|
||||
accounts.Add(list(list(\
|
||||
"account_number"=D.account_number,\
|
||||
"owner_name"=D.owner_name,\
|
||||
"suspended"=D.suspended ? "SUSPENDED" : "")))
|
||||
|
||||
if (accounts.len > 0)
|
||||
data["accounts"] = accounts
|
||||
|
||||
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "accounts_terminal.tmpl", src.name, 400, 640)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/account_database/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
var/datum/nanoui/ui = SSnanoui.get_open_ui(usr, src, "main")
|
||||
|
||||
if(href_list["choice"])
|
||||
switch(href_list["choice"])
|
||||
if("create_account")
|
||||
creating_new_account = 1
|
||||
|
||||
if("add_funds")
|
||||
var/amount = input("Enter the amount you wish to add", "Silently add funds") as num
|
||||
if(detailed_account_view)
|
||||
detailed_account_view.money = min(detailed_account_view.money + amount, fund_cap)
|
||||
|
||||
if("remove_funds")
|
||||
var/amount = input("Enter the amount you wish to remove", "Silently remove funds") as num
|
||||
if(detailed_account_view)
|
||||
detailed_account_view.money = max(detailed_account_view.money - amount, -fund_cap)
|
||||
|
||||
if("toggle_suspension")
|
||||
if(detailed_account_view)
|
||||
detailed_account_view.suspended = !detailed_account_view.suspended
|
||||
callHook("change_account_status", list(detailed_account_view))
|
||||
|
||||
if("finalise_create_account")
|
||||
var/account_name = href_list["holder_name"]
|
||||
var/starting_funds = max(text2num(href_list["starting_funds"]), 0)
|
||||
|
||||
starting_funds = Clamp(starting_funds, 0, SSeconomy.station_account.money) // Not authorized to put the station in debt.
|
||||
starting_funds = min(starting_funds, fund_cap) // Not authorized to give more than the fund cap.
|
||||
|
||||
SSeconomy.create_account(account_name, starting_funds, src)
|
||||
if(starting_funds > 0)
|
||||
//subtract the money
|
||||
SSeconomy.station_account.money -= starting_funds
|
||||
|
||||
//create a transaction log entry
|
||||
var/datum/transaction/trx = create_transation(account_name, "New account activation", "([starting_funds])")
|
||||
SSeconomy.add_transaction_log(SSeconomy.station_account,trx)
|
||||
|
||||
creating_new_account = 0
|
||||
ui.close()
|
||||
|
||||
creating_new_account = 0
|
||||
if("insert_card")
|
||||
if(held_card)
|
||||
held_card.forceMove(src.loc)
|
||||
|
||||
if(ishuman(usr) && !usr.get_active_hand())
|
||||
usr.put_in_hands(held_card)
|
||||
held_card = null
|
||||
|
||||
else
|
||||
var/obj/item/I = usr.get_active_hand()
|
||||
if (istype(I, /obj/item/card/id))
|
||||
var/obj/item/card/id/C = I
|
||||
usr.drop_from_inventory(C,src)
|
||||
held_card = C
|
||||
|
||||
if("view_account_detail")
|
||||
detailed_account_view = SSeconomy.get_account(href_list["account_number"])
|
||||
|
||||
if("view_accounts_list")
|
||||
detailed_account_view = null
|
||||
creating_new_account = 0
|
||||
|
||||
if("revoke_payroll")
|
||||
var/funds = detailed_account_view.money
|
||||
var/account_trx = create_transation(SSeconomy.station_account.owner_name, "Revoke payroll", "([funds])")
|
||||
var/station_trx = create_transation(detailed_account_view.owner_name, "Revoke payroll", funds)
|
||||
|
||||
SSeconomy.station_account.money += funds
|
||||
detailed_account_view.money = 0
|
||||
|
||||
SSeconomy.add_transaction_log(detailed_account_view,account_trx)
|
||||
SSeconomy.add_transaction_log(SSeconomy.station_account,station_trx)
|
||||
|
||||
callHook("revoke_payroll", list(detailed_account_view))
|
||||
|
||||
if("print")
|
||||
var/text
|
||||
var/obj/item/paper/P = new()
|
||||
var/pname
|
||||
if (detailed_account_view)
|
||||
pname = "account #[detailed_account_view.account_number] details"
|
||||
var/title = "Account #[detailed_account_view.account_number] Details"
|
||||
text = {"
|
||||
[accounting_letterhead(title)]
|
||||
<u>Holder:</u> [detailed_account_view.owner_name]<br>
|
||||
<u>Balance:</u> $[detailed_account_view.money]<br>
|
||||
<u>Status:</u> [detailed_account_view.suspended ? "Suspended" : "Active"]<br>
|
||||
<u>Transactions:</u> ([detailed_account_view.transactions.len])<br>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Timestamp</td>
|
||||
<td>Target</td>
|
||||
<td>Reason</td>
|
||||
<td>Value</td>
|
||||
<td>Terminal</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
"}
|
||||
|
||||
for (var/datum/transaction/T in detailed_account_view.transactions)
|
||||
text += {"
|
||||
<tr>
|
||||
<td>[T.date] [T.time]</td>
|
||||
<td>[T.target_name]</td>
|
||||
<td>[T.purpose]</td>
|
||||
<td>[T.amount]</td>
|
||||
<td>[T.source_terminal]</td>
|
||||
</tr>
|
||||
"}
|
||||
|
||||
text += {"
|
||||
</tbody>
|
||||
</table>
|
||||
"}
|
||||
|
||||
else
|
||||
pname = "financial account list"
|
||||
text = {"
|
||||
[accounting_letterhead("Financial Account List")]
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Account Number</td>
|
||||
<td>Holder</td>
|
||||
<td>Balance</td>
|
||||
<td>Status</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
"}
|
||||
|
||||
for(var/M in SSeconomy.all_money_accounts)
|
||||
var/datum/money_account/D = SSeconomy.get_account(M)
|
||||
text += {"
|
||||
<tr>
|
||||
<td>#[D.account_number]</td>
|
||||
<td>[D.owner_name]</td>
|
||||
<td>$[D.money]</td>
|
||||
<td>[D.suspended ? "Suspended" : "Active"]</td>
|
||||
</tr>
|
||||
"}
|
||||
|
||||
text += {"
|
||||
</tbody>
|
||||
</table>
|
||||
"}
|
||||
|
||||
P.set_content_unsafe(pname, text)
|
||||
print(P)
|
||||
|
||||
return 1
|
||||
@@ -75,6 +75,11 @@
|
||||
_app_preset_type = /datum/modular_computer_app_presets/command/hop
|
||||
enrolled = 1
|
||||
|
||||
/obj/item/modular_computer/console/preset/command/account
|
||||
name = "account console"
|
||||
_app_preset_type = /datum/modular_computer_app_presets/command/account
|
||||
enrolled = 1
|
||||
|
||||
// Security
|
||||
/obj/item/modular_computer/console/preset/security
|
||||
name = "security console"
|
||||
|
||||
@@ -285,6 +285,25 @@
|
||||
)
|
||||
return _prg_list
|
||||
|
||||
/datum/modular_computer_app_presets/command/account
|
||||
name = "command_accounting"
|
||||
display_name = "Command - Accounting"
|
||||
description = "Contains all the programs you would need to become a god-tier accountant."
|
||||
available = FALSE
|
||||
|
||||
/datum/modular_computer_app_presets/command/account/return_install_programs(obj/item/modular_computer/comp)
|
||||
var/list/_prg_list = list(
|
||||
new /datum/computer_file/program/ntnetdownload(comp),
|
||||
new /datum/computer_file/program/filemanager(comp),
|
||||
new /datum/computer_file/program/newsbrowser(comp),
|
||||
new /datum/computer_file/program/manifest(comp),
|
||||
new /datum/computer_file/program/civilian/cargoorder(comp),
|
||||
new /datum/computer_file/program/civilian/cargocontrol(comp),
|
||||
new /datum/computer_file/program/records/employment(comp),
|
||||
new /datum/computer_file/program/account_db(comp)
|
||||
)
|
||||
return _prg_list
|
||||
|
||||
/datum/modular_computer_app_presets/security
|
||||
name = "security"
|
||||
display_name = "Security"
|
||||
|
||||
@@ -0,0 +1,258 @@
|
||||
#define FUND_CAP 1000000
|
||||
|
||||
/datum/computer_file/program/account_db
|
||||
filename = "accdb"
|
||||
filedesc = "Account Database"
|
||||
program_icon_state = "comm"
|
||||
extended_desc = "Access transaction logs, account data and all kinds of other financial records."
|
||||
requires_ntnet = TRUE
|
||||
available_on_ntnet = FALSE
|
||||
size = 4 // primarily cloud computing
|
||||
usage_flags = PROGRAM_CONSOLE
|
||||
color = LIGHT_COLOR_BLUE
|
||||
|
||||
var/machine_id = ""
|
||||
|
||||
/datum/computer_file/program/account_db/New()
|
||||
..()
|
||||
if(current_map)
|
||||
machine_id = "[station_name()] Acc. DB #[SSeconomy.num_financial_terminals++]"
|
||||
else
|
||||
machine_id = "NT-Net Relay Back-up Software DB" // created during map generation inside the ntnet relay, not used by players
|
||||
|
||||
/datum/computer_file/program/account_db/proc/get_held_card()
|
||||
var/obj/item/card/id/held_card
|
||||
if(computer.card_slot?.stored_card)
|
||||
held_card = computer.card_slot.stored_card
|
||||
return held_card
|
||||
|
||||
/datum/computer_file/program/account_db/proc/get_access_level()
|
||||
var/obj/item/card/id/held_card = get_held_card()
|
||||
if (!held_card)
|
||||
return 0
|
||||
if(access_cent_captain in held_card.access)
|
||||
return 2
|
||||
else if((access_hop in held_card.access) || (access_captain in held_card.access))
|
||||
return 1
|
||||
|
||||
/datum/computer_file/program/account_db/proc/create_transation(target, reason, amount)
|
||||
var/datum/transaction/T = new()
|
||||
T.target_name = target
|
||||
T.purpose = reason
|
||||
T.amount = amount
|
||||
T.date = worlddate2text()
|
||||
T.time = worldtime2text()
|
||||
T.source_terminal = machine_id
|
||||
return T
|
||||
|
||||
/datum/computer_file/program/account_db/proc/accounting_letterhead(report_name)
|
||||
var/obj/item/card/id/held_card = get_held_card()
|
||||
return {"
|
||||
<center><h1><b>[report_name]</b></h1></center>
|
||||
<center><small><i>[station_name()] Accounting Report</i></small></center>
|
||||
<hr>
|
||||
<u>Generated By:</u> [held_card.registered_name], [held_card.assignment]<br>
|
||||
"}
|
||||
|
||||
/datum/computer_file/program/account_db/ui_interact(mob/user)
|
||||
var/datum/vueui/ui = SSvueui.get_open_ui(user, src)
|
||||
if(!ui)
|
||||
ui = new /datum/vueui/modularcomputer(user, src, "mcomputer-command-accountdb", 400, 640, filedesc)
|
||||
ui.open()
|
||||
|
||||
/datum/computer_file/program/account_db/vueui_transfer(oldobj)
|
||||
SSvueui.transfer_uis(oldobj, src, "mcomputer-command-accountdb", 400, 640, filedesc)
|
||||
return TRUE
|
||||
|
||||
/datum/computer_file/program/account_db/vueui_data_change(var/list/data, var/mob/user, var/datum/vueui/ui)
|
||||
. = ..()
|
||||
data = . || data || list()
|
||||
|
||||
// Gather data for computer header
|
||||
var/headerdata = get_header_data(data["_PC"])
|
||||
if(headerdata)
|
||||
data["_PC"] = headerdata
|
||||
. = data
|
||||
|
||||
var/obj/item/card/id/held_card = get_held_card()
|
||||
|
||||
data["has_printer"] = !!computer.nano_printer
|
||||
data["id_card"] = held_card ? text("[held_card.registered_name], [held_card.assignment]") : FALSE
|
||||
data["access_level"] = get_access_level()
|
||||
data["machine_id"] = machine_id
|
||||
data["station_account_number"] = SSeconomy.station_account.account_number
|
||||
|
||||
data["accounts"] = list()
|
||||
if(get_access_level())
|
||||
for(var/M in SSeconomy.all_money_accounts)
|
||||
var/datum/money_account/D = SSeconomy.get_account(M)
|
||||
var/account_number = "[M]"
|
||||
data["accounts"][account_number] = list()
|
||||
data["accounts"][account_number]["no"] = D.account_number
|
||||
data["accounts"][account_number]["owner"] = D.owner_name
|
||||
data["accounts"][account_number]["sus"] = D.suspended
|
||||
data["accounts"][account_number]["money"] = D.money
|
||||
var/list/transactions = list()
|
||||
data["accounts"][account_number]["transactions"] = transactions
|
||||
for(var/datum/transaction/T in D.transactions)
|
||||
var/Tref = ref(T)
|
||||
transactions[Tref] = list()
|
||||
transactions[Tref]["d"] = T.date
|
||||
transactions[Tref]["t"] = T.time
|
||||
transactions[Tref]["tar"] = T.target_name
|
||||
transactions[Tref]["purp"] = T.purpose
|
||||
transactions[Tref]["am"] = T.amount
|
||||
transactions[Tref]["src"] = T.source_terminal
|
||||
|
||||
return data
|
||||
|
||||
/datum/computer_file/program/account_db/Topic(href, href_list)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
var/access_level = get_access_level()
|
||||
|
||||
if(!access_level)
|
||||
return
|
||||
|
||||
if(href_list["create_account"])
|
||||
var/account_name = href_list["create_account"]["name"]
|
||||
var/starting_funds = max(href_list["create_account"]["funds"], 0)
|
||||
|
||||
starting_funds = Clamp(starting_funds, 0, SSeconomy.station_account.money) // Not authorized to put the station in debt.
|
||||
starting_funds = min(starting_funds, FUND_CAP) // Not authorized to give more than the fund cap.
|
||||
|
||||
SSeconomy.create_account(account_name, starting_funds, src)
|
||||
|
||||
if(starting_funds > 0)
|
||||
//subtract the money
|
||||
SSeconomy.station_account.money -= starting_funds
|
||||
|
||||
//create a transaction log entry
|
||||
var/datum/transaction/trx = create_transation(account_name, "New account activation", "([starting_funds])")
|
||||
SSeconomy.add_transaction_log(SSeconomy.station_account,trx)
|
||||
|
||||
if(href_list["suspend"])
|
||||
var/account = href_list["suspend"]["account"]
|
||||
|
||||
var/datum/money_account/Acc = SSeconomy.get_account(account)
|
||||
if(Acc)
|
||||
Acc.suspended = !Acc.suspended
|
||||
callHook("change_account_status", list(Acc))
|
||||
|
||||
|
||||
if(href_list["add_funds"] && access_level == 2)
|
||||
var/account = href_list["add_funds"]["account"]
|
||||
var/amount = href_list["add_funds"]["amount"]
|
||||
|
||||
var/datum/money_account/Acc = SSeconomy.get_account(account)
|
||||
if(Acc)
|
||||
Acc.money = min(Acc.money + amount, FUND_CAP)
|
||||
|
||||
if(href_list["remove_funds"] && access_level == 2)
|
||||
var/account = href_list["remove_funds"]["account"]
|
||||
var/amount = href_list["remove_funds"]["amount"]
|
||||
|
||||
var/datum/money_account/Acc = SSeconomy.get_account(account)
|
||||
if(Acc)
|
||||
Acc.money = max(Acc.money - amount, -FUND_CAP)
|
||||
|
||||
if(href_list["revoke_payroll"])
|
||||
var/account = href_list["revoke_payroll"]["account"]
|
||||
|
||||
var/datum/money_account/Acc = SSeconomy.get_account(account)
|
||||
if(Acc)
|
||||
var/funds = Acc.money
|
||||
var/account_trx = create_transation(SSeconomy.station_account.owner_name, "Revoke payroll", "[funds]")
|
||||
var/station_trx = create_transation(Acc.owner_name, "Revoke payroll", funds)
|
||||
|
||||
SSeconomy.station_account.money += funds
|
||||
Acc.money = 0
|
||||
|
||||
SSeconomy.add_transaction_log(Acc,account_trx)
|
||||
SSeconomy.add_transaction_log(SSeconomy.station_account,station_trx)
|
||||
|
||||
callHook("revoke_payroll", list(Acc))
|
||||
|
||||
|
||||
if(href_list["print"])
|
||||
|
||||
var/text
|
||||
var/pname
|
||||
var/datum/money_account/Acc = SSeconomy.get_account(href_list["print"])
|
||||
if(Acc)
|
||||
pname = "account #[Acc.account_number] details"
|
||||
var/title = "Account #[Acc.account_number] Details"
|
||||
text = {"
|
||||
[accounting_letterhead(title)]
|
||||
<u>Holder:</u> [Acc.owner_name]<br>
|
||||
<u>Balance:</u> [Acc.money]电<br>
|
||||
<u>Status:</u> [Acc.suspended ? "Suspended" : "Active"]<br>
|
||||
<u>Transactions:</u> ([Acc.transactions.len])<br>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Timestamp</td>
|
||||
<td>Target</td>
|
||||
<td>Reason</td>
|
||||
<td>Value</td>
|
||||
<td>Terminal</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
"}
|
||||
|
||||
for (var/datum/transaction/T in Acc.transactions)
|
||||
text += {"
|
||||
<tr>
|
||||
<td>[T.date] [T.time]</td>
|
||||
<td>[T.target_name]</td>
|
||||
<td>[T.purpose]</td>
|
||||
<td>[T.amount]</td>
|
||||
<td>[T.source_terminal]</td>
|
||||
</tr>
|
||||
"}
|
||||
|
||||
text += {"
|
||||
</tbody>
|
||||
</table>
|
||||
"}
|
||||
|
||||
else
|
||||
pname = "financial account list"
|
||||
text = {"
|
||||
[accounting_letterhead("Financial Account List")]
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Account Number</td>
|
||||
<td>Holder</td>
|
||||
<td>Balance</td>
|
||||
<td>Status</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
"}
|
||||
|
||||
for(var/M in SSeconomy.all_money_accounts)
|
||||
var/datum/money_account/D = SSeconomy.get_account(M)
|
||||
text += {"
|
||||
<tr>
|
||||
<td>#[D.account_number]</td>
|
||||
<td>[D.owner_name]</td>
|
||||
<td>[D.money]电</td>
|
||||
<td>[D.suspended ? "Suspended" : "Active"]</td>
|
||||
</tr>
|
||||
"}
|
||||
|
||||
text += {"
|
||||
</tbody>
|
||||
</table>
|
||||
"}
|
||||
|
||||
var/obj/item/paper/P = computer.nano_printer.print_text("", pname, "#deebff")
|
||||
P.set_content_unsafe(pname, text)
|
||||
|
||||
SSvueui.check_uis_for_change(src)
|
||||
|
||||
#undef FUND_CAP
|
||||
@@ -0,0 +1,6 @@
|
||||
author: Geeves
|
||||
|
||||
delete-after: True
|
||||
|
||||
changes:
|
||||
- rscadd: "Replaced the accounts terminal with a modular console."
|
||||
@@ -0,0 +1,6 @@
|
||||
author: Karolis2011
|
||||
|
||||
delete-after: True
|
||||
|
||||
changes:
|
||||
- rscadd: "Ported the accounts terminal UI over to VueUI."
|
||||
@@ -31045,7 +31045,7 @@
|
||||
},
|
||||
/area/centcom/holding)
|
||||
"qjS" = (
|
||||
/obj/machinery/account_database{
|
||||
/obj/item/modular_computer/console/preset/command/account{
|
||||
name = "CentComm Accounts database"
|
||||
},
|
||||
/turf/unsimulated/floor{
|
||||
|
||||
@@ -20502,7 +20502,7 @@
|
||||
/turf/simulated/floor/carpet,
|
||||
/area/crew_quarters/captain)
|
||||
"aIQ" = (
|
||||
/obj/machinery/account_database,
|
||||
/obj/item/modular_computer/console/preset/command/account,
|
||||
/turf/simulated/floor/carpet,
|
||||
/area/crew_quarters/captain)
|
||||
"aIR" = (
|
||||
@@ -32692,7 +32692,7 @@
|
||||
name = "Desk Privacy Shutter";
|
||||
pixel_y = -36
|
||||
},
|
||||
/obj/machinery/account_database,
|
||||
/obj/item/modular_computer/console/preset/command/account,
|
||||
/turf/simulated/floor/carpet,
|
||||
/area/crew_quarters/heads/hop)
|
||||
"bec" = (
|
||||
|
||||
@@ -42645,7 +42645,7 @@
|
||||
/obj/machinery/keycard_auth{
|
||||
pixel_x = -24
|
||||
},
|
||||
/obj/machinery/account_database,
|
||||
/obj/item/modular_computer/console/preset/command/account,
|
||||
/obj/effect/floor_decal/corner/blue/full{
|
||||
dir = 8
|
||||
},
|
||||
|
||||
@@ -10974,7 +10974,7 @@
|
||||
/turf/simulated/floor/tiled,
|
||||
/area/merchant_station)
|
||||
"aNJ" = (
|
||||
/obj/machinery/account_database{
|
||||
/obj/item/modular_computer/console/preset/command/account{
|
||||
name = "CentComm Accounts database"
|
||||
},
|
||||
/turf/unsimulated/floor{
|
||||
|
||||
+30
-32
@@ -250,8 +250,8 @@
|
||||
},
|
||||
/obj/machinery/light{
|
||||
brightness_range = 16;
|
||||
must_start_working = 1;
|
||||
dir = 8
|
||||
dir = 8;
|
||||
must_start_working = 1
|
||||
},
|
||||
/obj/effect/floor_decal/industrial/warning{
|
||||
dir = 8
|
||||
@@ -388,8 +388,8 @@
|
||||
"aU" = (
|
||||
/obj/machinery/light{
|
||||
brightness_range = 16;
|
||||
must_start_working = 1;
|
||||
dir = 4
|
||||
dir = 4;
|
||||
must_start_working = 1
|
||||
},
|
||||
/turf/simulated/floor/tiled/dark,
|
||||
/area/engineering/gravity_gen)
|
||||
@@ -579,8 +579,8 @@
|
||||
"bw" = (
|
||||
/obj/machinery/light{
|
||||
brightness_range = 16;
|
||||
must_start_working = 1;
|
||||
dir = 8
|
||||
dir = 8;
|
||||
must_start_working = 1
|
||||
},
|
||||
/turf/simulated/floor/plating,
|
||||
/area/maintenance/maintcentral)
|
||||
@@ -734,8 +734,8 @@
|
||||
"bR" = (
|
||||
/obj/machinery/light{
|
||||
brightness_range = 16;
|
||||
must_start_working = 1;
|
||||
dir = 1
|
||||
dir = 1;
|
||||
must_start_working = 1
|
||||
},
|
||||
/obj/structure/closet/emcloset,
|
||||
/obj/effect/floor_decal/corner/blue{
|
||||
@@ -919,8 +919,8 @@
|
||||
"ck" = (
|
||||
/obj/machinery/light{
|
||||
brightness_range = 16;
|
||||
must_start_working = 1;
|
||||
dir = 4
|
||||
dir = 4;
|
||||
must_start_working = 1
|
||||
},
|
||||
/turf/simulated/floor/tiled,
|
||||
/area/hallway/primary/central_one)
|
||||
@@ -948,7 +948,7 @@
|
||||
/obj/effect/floor_decal/corner/blue/full{
|
||||
dir = 4
|
||||
},
|
||||
/obj/machinery/account_database,
|
||||
/obj/item/modular_computer/console/preset/command/account,
|
||||
/turf/simulated/floor/tiled,
|
||||
/area/bridge)
|
||||
"co" = (
|
||||
@@ -963,8 +963,8 @@
|
||||
/obj/machinery/atmospherics/pipe/simple/hidden/supply,
|
||||
/obj/machinery/light{
|
||||
brightness_range = 16;
|
||||
must_start_working = 1;
|
||||
dir = 8
|
||||
dir = 8;
|
||||
must_start_working = 1
|
||||
},
|
||||
/turf/simulated/floor/tiled,
|
||||
/area/hallway/primary/central_one)
|
||||
@@ -1007,8 +1007,8 @@
|
||||
},
|
||||
/obj/machinery/light{
|
||||
brightness_range = 16;
|
||||
must_start_working = 1;
|
||||
dir = 1
|
||||
dir = 1;
|
||||
must_start_working = 1
|
||||
},
|
||||
/obj/effect/floor_decal/corner/blue{
|
||||
dir = 4
|
||||
@@ -1045,8 +1045,8 @@
|
||||
},
|
||||
/obj/machinery/light{
|
||||
brightness_range = 16;
|
||||
must_start_working = 1;
|
||||
dir = 1
|
||||
dir = 1;
|
||||
must_start_working = 1
|
||||
},
|
||||
/obj/effect/floor_decal/corner/blue{
|
||||
dir = 1
|
||||
@@ -1254,8 +1254,8 @@
|
||||
"dd" = (
|
||||
/obj/machinery/light{
|
||||
brightness_range = 16;
|
||||
must_start_working = 1;
|
||||
dir = 8
|
||||
dir = 8;
|
||||
must_start_working = 1
|
||||
},
|
||||
/obj/effect/floor_decal/industrial/warning{
|
||||
dir = 4
|
||||
@@ -1268,8 +1268,8 @@
|
||||
"df" = (
|
||||
/obj/machinery/light{
|
||||
brightness_range = 16;
|
||||
must_start_working = 1;
|
||||
dir = 4
|
||||
dir = 4;
|
||||
must_start_working = 1
|
||||
},
|
||||
/obj/effect/floor_decal/industrial/warning{
|
||||
dir = 8
|
||||
@@ -1279,16 +1279,16 @@
|
||||
"dg" = (
|
||||
/obj/machinery/light{
|
||||
brightness_range = 16;
|
||||
must_start_working = 1;
|
||||
dir = 8
|
||||
dir = 8;
|
||||
must_start_working = 1
|
||||
},
|
||||
/turf/simulated/floor/plating,
|
||||
/area/storage/primary)
|
||||
"dh" = (
|
||||
/obj/machinery/light{
|
||||
brightness_range = 16;
|
||||
must_start_working = 1;
|
||||
dir = 4
|
||||
dir = 4;
|
||||
must_start_working = 1
|
||||
},
|
||||
/turf/simulated/floor/plating,
|
||||
/area/storage/primary)
|
||||
@@ -1508,8 +1508,8 @@
|
||||
"ob" = (
|
||||
/obj/machinery/light{
|
||||
brightness_range = 16;
|
||||
must_start_working = 1;
|
||||
dir = 8
|
||||
dir = 8;
|
||||
must_start_working = 1
|
||||
},
|
||||
/obj/structure/cable{
|
||||
d1 = 1;
|
||||
@@ -1612,8 +1612,8 @@
|
||||
"HK" = (
|
||||
/obj/machinery/light{
|
||||
brightness_range = 16;
|
||||
must_start_working = 1;
|
||||
dir = 8
|
||||
dir = 8;
|
||||
must_start_working = 1
|
||||
},
|
||||
/obj/effect/floor_decal/industrial/warning{
|
||||
dir = 4
|
||||
@@ -1684,9 +1684,7 @@
|
||||
/turf/simulated/floor/tiled,
|
||||
/area/hallway/primary/central_one)
|
||||
"WS" = (
|
||||
/obj/turbolift_map_holder/runtime{
|
||||
dir = 8
|
||||
},
|
||||
/obj/turbolift_map_holder/runtime,
|
||||
/turf/simulated/floor/plating,
|
||||
/area/turbolift/main_station)
|
||||
"YP" = (
|
||||
|
||||
@@ -1,167 +0,0 @@
|
||||
<div class="item">
|
||||
<div class="itemLabelNarrow">
|
||||
<b>Machine</b>:
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
<span class="average">{{:data.machine_id}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="itemLabelNarrow">
|
||||
<b>ID</b>:
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
{{:helper.link(data.id_card, 'eject', {'choice' : "insert_card"}, null, data.id_inserted ? 'fixedLeftWidest' : 'fixedLeft')}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if data.access_level > 0}}
|
||||
<div class='item'>
|
||||
<h2>Menu</h2>
|
||||
</div>
|
||||
{{:helper.link('Home', 'home', {'choice' : 'view_accounts_list'}, !data.creating_new_account && !data.detailed_account_view ? 'disabled' : null, 'fixedLeft')}}
|
||||
{{:helper.link('New Account', 'gear', {'choice' : 'create_account'}, data.creating_new_account ? 'disabled' : null, 'fixedLeft')}}
|
||||
{{:helper.link('Print', 'print', {'choice' : 'print'}, data.creating_new_account ? 'disabled' : null, 'fixedLeft')}}
|
||||
|
||||
{{if data.creating_new_account}}
|
||||
<div class='item'>
|
||||
<h2>Create Account</h2>
|
||||
</div>
|
||||
|
||||
<form name='create_account' action='?src={{:data.src}}' method='get'>
|
||||
<input type='hidden' name='src' value='{{:data.src}}'>
|
||||
<input type='hidden' name='choice' value='finalise_create_account'>
|
||||
<div class='item'>
|
||||
<div class='itemLabel'>
|
||||
<b>Account Holder</b>:
|
||||
</div>
|
||||
<div class='itemContent'>
|
||||
<input type='text' id='holder_name' name='holder_name'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='item'>
|
||||
<div class='itemLabel'>
|
||||
<b>Initial Deposit</b>:
|
||||
</div>
|
||||
<div class='itemContent'>
|
||||
<input type='text' id='starting_funds' name='starting_funds'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='item'>
|
||||
<input type='submit' value='Create'>
|
||||
</div>
|
||||
</form>
|
||||
{{else}}
|
||||
{{if data.detailed_account_view}}
|
||||
<div class='item'>
|
||||
<h2>Account Details</h2>
|
||||
</div>
|
||||
|
||||
<div class='item'>
|
||||
<div class="itemLabel">
|
||||
<span class='average'><b>Account Number</b>:</span>
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
#{{:data.account_number}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='item'>
|
||||
<div class="itemLabel">
|
||||
<span class='average'><b>Holder</b>:</span>
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
{{:data.owner_name}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='item'>
|
||||
<div class="itemLabel">
|
||||
<span class='average'><b>Balance</b>:</span>
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
${{:helper.formatNumber(data.money)}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='item'>
|
||||
<div class="itemLabel">
|
||||
<span class='average'><b>Status</b>:</span>
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
<span class='{{:data.suspended ? "bad" : "good"}}'>
|
||||
{{:data.suspended ? "Suspended" : "Active"}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class='item'>
|
||||
{{:helper.link(data.suspended ? "Unsuspend" : "Suspend", 'gear', {'choice' : 'toggle_suspension'})}}
|
||||
</div>
|
||||
|
||||
<div class="statusDisplay" style="overflow: auto;">
|
||||
{{if data.transactions}}
|
||||
<table style='width: 100%'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><b>Timestamp</b></th>
|
||||
<th><b>Target</b></th>
|
||||
<th><b>Reason</b></th>
|
||||
<th><b>Value</b></th>
|
||||
<th><b>Terminal</b></th>
|
||||
</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{for data.transactions}}
|
||||
<tr>
|
||||
<td>{{:value.date}} {{:value.time}}</td>
|
||||
<td>{{:value.target_name}}</td>
|
||||
<td>{{:value.purpose}}</td>
|
||||
<td>{{:value.amount}}</td>
|
||||
<td>{{:value.source_terminal}}</td>
|
||||
</tr>
|
||||
{{/for}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{else}}
|
||||
<span class='alert'>This account has no financial transactions on record for today.</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class='item'>
|
||||
<h2>CentCom Administrator</h2>
|
||||
</div>
|
||||
<div class='item'>
|
||||
<div class='fixedLeft'>
|
||||
Payroll:
|
||||
</div>
|
||||
{{:helper.link('Revoke', 'transferthick-e-w', {'choice' : 'revoke_payroll'}, data.account_number == data.station_account_number ? 'disabled' : null, 'linkDanger')}}
|
||||
</div>
|
||||
{{if data.access_level >= 2}}
|
||||
<div class='item'>
|
||||
<div class='fixedLeft'>
|
||||
Silent Fund Adjustment:
|
||||
</div>
|
||||
{{:helper.link('Add', 'plus', {'choice' : 'add_funds'})}}
|
||||
{{:helper.link('Remove', 'minus', {'choice' : 'remove_funds'})}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
|
||||
<div class='item'>
|
||||
<h2>Idris Banking Accounts</h2>
|
||||
</div>
|
||||
{{if data.accounts}}
|
||||
<table style="width: 100%">
|
||||
{{for data.accounts}}
|
||||
<tr class='{{:value.suspended ? "bad" : ""}}'>
|
||||
<td><b>{{:helper.link('#' + value.account_number, '', {'choice' : 'view_account_detail', 'account_number' : value.account_number})}}</b></td>
|
||||
<td>{{:value.owner_name}}</td>
|
||||
<td>{{:value.suspended}}</td>
|
||||
</tr>
|
||||
{{/for}}
|
||||
</table>
|
||||
{{else}}
|
||||
<span class='alert'>There are no accounts available.</span>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
@@ -0,0 +1,122 @@
|
||||
<template>
|
||||
<div>
|
||||
<vui-group>
|
||||
<vui-group-item label="Machine:">{{ s.machine_id }}</vui-group-item>
|
||||
<vui-group-item label="ID card:">{{ s.id_card ? s.id_card : 'None' }}</vui-group-item>
|
||||
<vui-group-item v-if="s.access_level" label="Station funds:">{{ s.accounts[`${s.station_account_number}`].money.toFixed(2) }}电</vui-group-item>
|
||||
<vui-group-row><hr></vui-group-row>
|
||||
<template v-if="new_name != null">
|
||||
<vui-group-row><vui-button @click="new_name = null" icon="arrow-left">Back to list</vui-button></vui-group-row>
|
||||
|
||||
<vui-group-item label="Account Holder:"><input type="text" v-model="new_name"></vui-group-item>
|
||||
<vui-group-item label="Initial Deposit:"><vui-input-numeric v-model="new_funds" :button-count="0" width="7em" :max="1000000"></vui-input-numeric></vui-group-item>
|
||||
<vui-group-item><vui-button @click="create_account()" icon="plus-square">Create</vui-button></vui-group-item>
|
||||
</template>
|
||||
<template v-else-if="s.access_level">
|
||||
<template v-if="active">
|
||||
<vui-group-row>
|
||||
<vui-button @click="active = null" icon="arrow-left">Back to list</vui-button>
|
||||
<vui-button icon="print" :params="{print: active}">Print</vui-button>
|
||||
</vui-group-row>
|
||||
<vui-group-row><h2>Account Details</h2></vui-group-row>
|
||||
<vui-group-item label="Account Number:">#{{ active_acc.no }}</vui-group-item>
|
||||
<vui-group-item label="Holder:">{{ active_acc.owner }}</vui-group-item>
|
||||
<vui-group-item label="Balance:">{{ active_acc.money.toFixed(2) }}电</vui-group-item>
|
||||
<vui-group-item label="Status:">
|
||||
<span v-if="active_acc.sus" class="bad">Suspended </span>
|
||||
<span v-else class="good">Active </span>
|
||||
</vui-group-item>
|
||||
<vui-group-row>
|
||||
<vui-button v-if="active_acc.sus" :params="{ suspend: { account: active }}">Unsuspend</vui-button>
|
||||
<vui-button v-else :params="{ suspend: { account: active }}">Suspend</vui-button>
|
||||
<vui-button v-if="active_acc.no != s.station_account_number" :params="{ revoke_payroll: { account: active }}">Revoke Payroll</vui-button>
|
||||
<template v-if="s.access_level == 2">
|
||||
<h4>Silent fund adjustment</h4>
|
||||
<vui-button v-if="add_funds == null" @click="add_funds = 0">Add</vui-button>
|
||||
<template v-else>
|
||||
<vui-input-numeric v-model="add_funds" :max="1000000"></vui-input-numeric>
|
||||
<vui-button :params="{add_funds: {account: active, amount: add_funds}}">Add</vui-button>
|
||||
</template>
|
||||
<br/>
|
||||
<vui-button v-if="remove_funds == null" @click="remove_funds = 0">Remove</vui-button>
|
||||
<template v-else>
|
||||
<vui-input-numeric v-model="remove_funds" :max="1000000"></vui-input-numeric>
|
||||
<vui-button :params="{remove_funds: {account: active, amount: remove_funds}}">Remove</vui-button>
|
||||
</template>
|
||||
</template>
|
||||
</vui-group-row>
|
||||
<vui-group-row>
|
||||
<h2>Transactions</h2>
|
||||
<table class="table border" style="width: 100%">
|
||||
<tr class="header border">
|
||||
<th><b>Timestamp</b></th>
|
||||
<th><b>Target</b></th>
|
||||
<th><b>Reason</b></th>
|
||||
<th><b>Value</b></th>
|
||||
<th><b>Terminal</b></th>
|
||||
</tr>
|
||||
<tr v-for="(trans, ref) in active_acc.transactions" class="item border" :key="ref">
|
||||
<td>{{trans.d}} {{trans.t}}</td>
|
||||
<td>{{trans.tar}}</td>
|
||||
<td>{{trans.purp}}</td>
|
||||
<td>{{trans.am}}</td>
|
||||
<td>{{trans.src}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</vui-group-row>
|
||||
</template>
|
||||
<template v-else>
|
||||
<vui-group-row>
|
||||
<vui-button v-if="s.has_printer" icon="print" :params="{print: 1}">Print</vui-button>
|
||||
<vui-button icon="file" @click="new_name = ''">New Account</vui-button>
|
||||
</vui-group-row>
|
||||
<vui-group-row><h2>Idris Banking Accounts</h2></vui-group-row>
|
||||
<vui-group-row>
|
||||
<table class="table border" style="width: 100%">
|
||||
<tr class="header border">
|
||||
<th><b>Number</b></th>
|
||||
<th><b>Name</b></th>
|
||||
</tr>
|
||||
<tr v-for="(acc, number) in s.accounts" class="item border" :key="number">
|
||||
<td><vui-button @click="active = number">#{{acc.no}}</vui-button></td>
|
||||
<td><span :class="acc.sus ? 'bad' : ''">{{acc.owner}}</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</vui-group-row>
|
||||
</template>
|
||||
</template>
|
||||
</vui-group>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Utils from '../../../../utils'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
s: this.$root.$data.state,
|
||||
active: null,
|
||||
add_funds: null,
|
||||
remove_funds: null,
|
||||
new_name: null,
|
||||
new_funds: 0,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
active_acc() {
|
||||
if(this.active) {
|
||||
return this.s.accounts[this.active]
|
||||
}
|
||||
return {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
create_account() {
|
||||
Utils.sendToTopic({create_account: {name: this.new_name, funds: this.new_funds}})
|
||||
this.new_name = null
|
||||
this.new_funds = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,10 @@
|
||||
<template>
|
||||
<tr class="item">
|
||||
<td colspan="2"><slot/></td>
|
||||
</tr>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user