mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
Cargo requests for other departments may now request they come out of the department budget. (#93152)
## About The Pull Request When placing a cargo request as a non-cargo staff, you may now specify which department you are requesting this for, which if approved will bill that department from their budget. Requests placed this way will need to be approved by cargo staff by default. Originally I was going to tie this to my proposed rolling permission system (Think an email chain where if things don't get approved, it goes up a PDA Message chain until someone approves the thing), however I've quite stalled on that and I wanted to at least get the baseline functionality into people's hands. Cargo, as per usual, has a right to refusal to reject the request as well. <img width="797" height="199" alt="image" src="https://github.com/user-attachments/assets/19889b0a-8af5-4347-b91a-91cc39ab2bee" /> _WIP Photos, names/departments only show here as undefined due to being admin spawned and not naturally spawned players_ ## Why It's Good For The Game Heads of staff can already order crates using their departmental ordering apps and utilizing their funds, without needing QM approval. This will allow for crewmembers within a department to request to requisition supplies using their budget's funds as well. As it stands, ordering from budget is already quite clunky, and being able to go to cargo to place a request for your department should at least elicit a conversation between heads of staff to see if it makes sense. Keeping in mind, spending too much of a budget's funds can result in failure to complete paychecks, so there is some conflict that can arise from interacting with this mechanic too aggressively. **I'll be real, there's a pretty good chance this may be too easy to use and too powerful in it's current state.** If it needs something like the additional rolling permissions system in place in the future, we may want to re-assess at a later point. ## Changelog 🆑 qol: When placing cargo requests, you can now request that a crate be obtained using your department's funds as opposed to the cargo budget. /🆑 --------- Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
///Can the supply console send the shuttle back and forth? Used in the UI backend.
|
||||
var/can_send = TRUE
|
||||
///Can this console only send requests?
|
||||
///Can this console only send requests? Typically used at the cargo front desk for pedestrians.
|
||||
var/requestonly = FALSE
|
||||
///Can you approve requests placed for cargo? Works differently between the app and the computer.
|
||||
var/can_approve_requests = TRUE
|
||||
@@ -143,6 +143,7 @@
|
||||
"orderer" = order.orderer,
|
||||
"reason" = order.reason,
|
||||
"id" = order.id,
|
||||
"account" = order.paying_account ? order.paying_account.account_holder : "Cargo Department"
|
||||
))
|
||||
data["amount_by_name"] = amount_by_name
|
||||
|
||||
@@ -238,33 +239,46 @@
|
||||
rank = "Silicon"
|
||||
|
||||
var/datum/bank_account/account
|
||||
if(self_paid && isliving(user))
|
||||
if(isliving(user))
|
||||
var/mob/living/living_user = user
|
||||
var/obj/item/card/id/id_card = living_user.get_idcard(TRUE)
|
||||
if(!istype(id_card))
|
||||
if(!istype(id_card) && self_paid)
|
||||
say("No ID card detected.")
|
||||
return
|
||||
if(IS_DEPARTMENTAL_CARD(id_card))
|
||||
if(IS_DEPARTMENTAL_CARD(id_card) && self_paid)
|
||||
say("The [src] rejects [id_card].")
|
||||
return
|
||||
account = id_card.registered_account
|
||||
if(!istype(account))
|
||||
say("Invalid bank account.")
|
||||
return
|
||||
var/list/access = id_card.GetAccess()
|
||||
if(pack.access_view && !(pack.access_view in access))
|
||||
say("[id_card] lacks the requisite access for this purchase.")
|
||||
return
|
||||
account = id_card?.registered_account // We can still assign an account for request department purposes.
|
||||
if(self_paid)
|
||||
if(!istype(account))
|
||||
say("Invalid bank account.")
|
||||
return
|
||||
var/list/access = id_card.GetAccess()
|
||||
if(pack.access_view && !(pack.access_view in access))
|
||||
say("[id_card] lacks the requisite access for this purchase.")
|
||||
return
|
||||
|
||||
// The list we are operating on right now
|
||||
var/list/working_list = SSshuttle.shopping_list
|
||||
var/reason = ""
|
||||
if(requestonly && !self_paid)
|
||||
if(requestonly && !self_paid && !pack.goody)
|
||||
working_list = SSshuttle.request_list
|
||||
reason = tgui_input_text(user, "Reason", name, max_length = MAX_MESSAGE_LEN)
|
||||
if(isnull(reason))
|
||||
return
|
||||
|
||||
name = account?.account_holder
|
||||
if(account?.account_job)
|
||||
var/datum/bank_account/personal_department = SSeconomy.get_dep_account(account.account_job.paycheck_department)
|
||||
if(!(personal_department.account_holder == "Cargo Budget"))
|
||||
var/dept_choice = tgui_alert(usr, "Which department are you requesting this for?", "Choose department to request from", list("Cargo Budget", "[personal_department.account_holder]"))
|
||||
if(!dept_choice)
|
||||
return
|
||||
if(dept_choice != "Cargo Budget")
|
||||
account = personal_department
|
||||
else
|
||||
account = SSeconomy.get_dep_account(cargo_account)
|
||||
|
||||
if(pack.goody && !self_paid)
|
||||
playsound(src, 'sound/machines/buzz/buzz-sigh.ogg', 50, FALSE)
|
||||
say("ERROR: Small crates may only be purchased by private accounts.")
|
||||
@@ -294,6 +308,7 @@
|
||||
reason = reason,
|
||||
paying_account = account,
|
||||
coupon = applied_coupon,
|
||||
department_destination = reason ? TRUE : FALSE, // Hijacking reason as a way to determine if an order's requested from at least one budget
|
||||
)
|
||||
working_list += order
|
||||
|
||||
|
||||
Reference in New Issue
Block a user