diff --git a/code/game/machinery/computer/orders/order_computer/mining_order.dm b/code/game/machinery/computer/orders/order_computer/mining_order.dm index 5245f297639..ca423d41ac2 100644 --- a/code/game/machinery/computer/orders/order_computer/mining_order.dm +++ b/code/game/machinery/computer/orders/order_computer/mining_order.dm @@ -1,5 +1,5 @@ /obj/machinery/computer/order_console/mining - name = "mining equipment vendor" + name = "mining equipment order console" desc = "An equipment shop for miners, points collected at an ore redemption machine can be spent here." icon = 'icons/obj/machines/mining_machines.dmi' icon_state = "mining" @@ -40,16 +40,18 @@ contains = things_to_order, ) var/datum/supply_order/new_order = new( - pack = mining_pack, \ - orderer = purchaser, \ - orderer_rank = "Mining Vendor", \ - orderer_ckey = purchaser.ckey, \ - reason = "", \ - paying_account = card.registered_account, \ - department_destination = null, \ - coupon = null, \ + pack = mining_pack, + orderer = purchaser, + orderer_rank = "Mining Vendor", + orderer_ckey = purchaser.ckey, + reason = "", + paying_account = card.registered_account, + department_destination = null, + coupon = null, charge_on_purchase = FALSE, manifest_can_fail = FALSE, + cost_type = "mp", + can_be_cancelled = FALSE, ) if(ltsrbt_delivered) var/obj/machinery/mining_ltsrbt/ltsrbt diff --git a/code/game/machinery/computer/orders/order_computer/order_computer.dm b/code/game/machinery/computer/orders/order_computer/order_computer.dm index 461a27fa162..f0933f0694a 100644 --- a/code/game/machinery/computer/orders/order_computer/order_computer.dm +++ b/code/game/machinery/computer/orders/order_computer/order_computer.dm @@ -102,6 +102,10 @@ GLOBAL_LIST_EMPTY(order_console_products) return var/mob/living/living_user = usr switch(action) + if("add_one") + var/datum/orderable_item/wanted_item = locate(params["target"]) in GLOB.order_console_products + grocery_list[wanted_item] += 1 + update_static_data(living_user) if("cart_set") //this is null if the action doesn't need it (purchase, quickpurchase) var/datum/orderable_item/wanted_item = locate(params["target"]) in GLOB.order_console_products diff --git a/code/modules/cargo/order.dm b/code/modules/cargo/order.dm index 675e1f4439e..f5b52d38060 100644 --- a/code/modules/cargo/order.dm +++ b/code/modules/cargo/order.dm @@ -39,6 +39,7 @@ /datum/supply_order var/id + var/cost_type var/orderer var/orderer_rank var/orderer_ckey @@ -53,6 +54,8 @@ var/obj/item/coupon/applied_coupon ///Boolean on whether the manifest can fail or not. var/manifest_can_fail = TRUE + ///Boolean on whether the manifest can be cancelled through cargo consoles. + var/can_be_cancelled = TRUE /datum/supply_order/New( datum/supply_pack/pack, @@ -65,8 +68,11 @@ coupon, charge_on_purchase = TRUE, manifest_can_fail = TRUE, + cost_type = "cr", + can_be_cancelled = TRUE, ) id = SSshuttle.order_number++ + src.cost_type = cost_type src.pack = pack src.orderer = orderer src.orderer_rank = orderer_rank @@ -77,6 +83,7 @@ src.applied_coupon = coupon src.charge_on_purchase = charge_on_purchase src.manifest_can_fail = manifest_can_fail + src.can_be_cancelled = can_be_cancelled /datum/supply_order/proc/generateRequisition(turf/T) var/obj/item/paper/requisition_paper = new(T) diff --git a/code/modules/cargo/orderconsole.dm b/code/modules/cargo/orderconsole.dm index a4f98bd3b4e..bee14241912 100644 --- a/code/modules/cargo/orderconsole.dm +++ b/code/modules/cargo/orderconsole.dm @@ -120,12 +120,14 @@ data["cart"] = list() for(var/datum/supply_order/SO in SSshuttle.shopping_list) data["cart"] += list(list( + "cost_type" = SO.cost_type, "object" = SO.pack.name, "cost" = SO.pack.get_cost(), "id" = SO.id, "orderer" = SO.orderer, "paid" = !isnull(SO.paying_account), //paid by requester - "dep_order" = SO.department_destination ? TRUE : FALSE + "dep_order" = !!SO.department_destination, + "can_be_cancelled" = SO.can_be_cancelled, )) data["requests"] = list() @@ -291,8 +293,8 @@ break if("clear") for(var/datum/supply_order/cancelled_order in SSshuttle.shopping_list) - if(cancelled_order.department_destination) - continue //don't cancel other department's orders + if(cancelled_order.department_destination || cancelled_order.can_be_cancelled) + continue //don't cancel other department's orders or orders that can't be cancelled SSshuttle.shopping_list -= cancelled_order . = TRUE if("approve") diff --git a/code/modules/modular_computers/file_system/programs/budgetordering.dm b/code/modules/modular_computers/file_system/programs/budgetordering.dm index 0a64f267c1a..56ff1158b68 100644 --- a/code/modules/modular_computers/file_system/programs/budgetordering.dm +++ b/code/modules/modular_computers/file_system/programs/budgetordering.dm @@ -125,11 +125,14 @@ data["cart"] = list() for(var/datum/supply_order/SO in SSshuttle.shopping_list) data["cart"] += list(list( + "cost_type" = SO.cost_type, "object" = SO.pack.name, "cost" = SO.pack.get_cost(), "id" = SO.id, "orderer" = SO.orderer, - "paid" = !isnull(SO.paying_account) //paid by requester + "paid" = !isnull(SO.paying_account), //paid by requester + "dep_order" = !!SO.department_destination, + "can_be_cancelled" = SO.can_be_cancelled, )) data["requests"] = list() @@ -251,7 +254,10 @@ . = TRUE break if("clear") - SSshuttle.shopping_list.Cut() + for(var/datum/supply_order/cancelled_order in SSshuttle.shopping_list) + if(cancelled_order.department_destination || cancelled_order.can_be_cancelled) + continue //don't cancel other department's orders or orders that can't be cancelled + SSshuttle.shopping_list -= cancelled_order . = TRUE if("approve") var/id = text2num(params["id"]) diff --git a/tgui/packages/tgui/interfaces/Cargo.js b/tgui/packages/tgui/interfaces/Cargo.js index c25689924ae..1c0626aadc0 100644 --- a/tgui/packages/tgui/interfaces/Cargo.js +++ b/tgui/packages/tgui/interfaces/Cargo.js @@ -400,15 +400,15 @@ const CargoCart = (props, context) => { {(entry.dep_order && (