From 36d442beb8a4e42a178a536777dfda28a0e99cc8 Mon Sep 17 00:00:00 2001 From: Casper3667 <8396443+Casper3667@users.noreply.github.com> Date: Wed, 29 Apr 2026 20:08:00 +0200 Subject: [PATCH] Makes the ops handling fee a percentage, removes supplier fee, ability to remove approved orders and bugfixes (#22350) - qol: "Reduced the crate fee when making operation orders." - bugfix: "Fixed the wording in some of the operation programs." - bugfix: "Fixed the delivery app showing deliveries it shouldn't." - bugfix: "The cargo control program now properly display status messages." - balance: "Supplier fee was set to 0 for all current suppliers, eliminating the 20 credit charge per supplier." - balance: "The operations order handling fee has been turned into a percentage charge instead, and reduced to 5% by default instead of a flat 20 credits." - rscadd: "It is now possible to reject orders that have been approved but not shipped or paid for." --- code/controllers/subsystems/cargo.dm | 11 +++++--- code/datums/cargo.dm | 27 +++++++++++-------- code/modules/cargo/cargo_suppliers.dm | 2 +- code/modules/cargo/exports.dm | 2 +- code/modules/cargo/exports/large_objects.dm | 2 +- .../programs/civilian/cargo_delivery.dm | 2 +- .../programs/civilian/cargo_order.dm | 2 +- html/changelogs/OpsProgramStuff.yml | 12 +++++++++ .../packages/tgui/interfaces/CargoControl.tsx | 22 ++++++++++++--- 9 files changed, 59 insertions(+), 23 deletions(-) create mode 100644 html/changelogs/OpsProgramStuff.yml diff --git a/code/controllers/subsystems/cargo.dm b/code/controllers/subsystems/cargo.dm index 0de84a9afaa..d3df17165cd 100644 --- a/code/controllers/subsystems/cargo.dm +++ b/code/controllers/subsystems/cargo.dm @@ -24,10 +24,10 @@ SUBSYSTEM_DEF(cargo) var/list/all_orders = list() // All orders. // Fee Variables - var/credits_per_crate = 30 // "Cost / Payment" per crate shipped from or to centcomm. + var/credits_per_crate = 15 // "Cost / Payment" per crate shipped from or to centcomm. var/credits_per_platinum = 140 // Per sheet. var/credits_per_phoron = 100 // Per sheet. - var/cargo_handlingfee = 20 // The handling fee cargo takes per crate. + var/cargo_handlingfee = 5 // The handling fee cargo takes per crate, as a percentage of the order's value. var/cargo_handlingfee_min = 0 // The minimum handling fee. var/cargo_handlingfee_max = 500 // The maximum handling fee. var/cargo_handlingfee_change = 1 // If the handling fee can be changed -> for a random event. @@ -359,6 +359,11 @@ SUBSYSTEM_DEF(cargo) /datum/controller/subsystem/cargo/proc/get_handlingfee() return cargo_handlingfee +/datum/controller/subsystem/cargo/proc/get_handlingfee_cost(shipment_cost) + if(shipment_cost) + return (cargo_handlingfee / 100) * shipment_cost + return 0 + // Sets the handling fee and returns a status message. /datum/controller/subsystem/cargo/proc/set_handlingfee(var/fee) if(!fee) @@ -448,7 +453,7 @@ SUBSYSTEM_DEF(cargo) movetime = current_shipment.shuttle_time //Launch it shuttle.launch(src) - . = "The cargo elevator has been called and will arrive in approximately [round(SScargo.movetime/600, 2)] minutes." + . = "The cargo elevator has been called and will arrive in approximately [shuttle.eta_seconds()] seconds." current_shipment.shuttle_called_by = requester_name // Cancels the elevator. Can return a status message. diff --git a/code/datums/cargo.dm b/code/datums/cargo.dm index 1690e545a23..dd068b5dcff 100644 --- a/code/datums/cargo.dm +++ b/code/datums/cargo.dm @@ -137,7 +137,7 @@ switch(type) if(0) //The price of the contents of the crate + the price for the crate + the handling fee + the shipment fee - return price + SScargo.get_cratefee() + SScargo.get_handlingfee() + get_shipment_cost() + return price + SScargo.get_cratefee() + SScargo.get_handlingfee_cost(price) + get_shipment_cost() if(1) //The price of the contents of the crate + the price of the crate + the shipment fee return price + SScargo.get_cratefee() + get_shipment_cost() @@ -275,8 +275,10 @@ for(var/item in get_item_list()) order_data += "
  • [item["name"]]: [item["price"]]电
  • " order_data += "
  • Crate Fee: [SScargo.get_cratefee()]电
  • " - order_data += "
  • Handling Fee: [SScargo.get_handlingfee()]电
  • " - order_data += "
  • Supplier Fee: [get_shipment_cost()]电
  • " + order_data += "
  • Handling Fee: [SScargo.get_handlingfee_cost(get_value(2))]电
  • " + var/supplier_fee = get_shipment_cost() + if(supplier_fee) + order_data += "
  • Supplier Fee: [supplier_fee]电
  • " order_data += "" return order_data.Join("") @@ -325,7 +327,9 @@ //Marks a order as rejected - Returns a status message /datum/cargo_order/proc/set_rejected() - if(status == "submitted") + if(status == "submitted" || status == "approved") + if(paid_by) + return "The order could not be rejected - Already Paid For" status = "rejected" time_approved = worldtime2text() return "The order has been rejected" @@ -441,20 +445,21 @@ invoice_data += "

    Shuttle Data

    " invoice_data += "" + if(shuttle_fee) + invoice_data += "" + invoice_data += "" + invoice_data += "" + invoice_data += "" invoice_data += "" - invoice_data += "" - invoice_data += "" - invoice_data += "" - invoice_data += "" - invoice_data += "" + invoice_data += "" invoice_data += "" invoice_data += "" invoice_data += "" - invoice_data += "" + invoice_data += "" invoice_data += "" invoice_data += "" invoice_data += "" - invoice_data += "" + invoice_data += "" invoice_data += "" invoice_data += "" invoice_data += "
    Supplier fee:[shuttle_fee]
    Supplier fee::[shuttle_fee]
    Shuttle Time:Elevator Time:[shuttle_time]
    Shuttle Called By:Elevator Called By:[shuttle_called_by]
    Shuttle Recalled By:Elevator Recalled By:[shuttle_recalled_by]
    " diff --git a/code/modules/cargo/cargo_suppliers.dm b/code/modules/cargo/cargo_suppliers.dm index b9889ba24b6..6a7ca691de7 100644 --- a/code/modules/cargo/cargo_suppliers.dm +++ b/code/modules/cargo/cargo_suppliers.dm @@ -15,7 +15,7 @@ var/shuttle_time = 100 /// The additional price an order incurs for ordering a shuttle from this supplier. - var/shuttle_price = 20 + var/shuttle_price = 0 /// Whether or not this supplier is available or not. var/available = TRUE diff --git a/code/modules/cargo/exports.dm b/code/modules/cargo/exports.dm index 00cee153ac8..dd8861e0a86 100644 --- a/code/modules/cargo/exports.dm +++ b/code/modules/cargo/exports.dm @@ -132,7 +132,7 @@ then the player gets the profit from selling his own wasted time. /datum/export/proc/total_printout(contr = 0, emag = 0) if(!total_cost && !total_amount) return "" - var/msg = "[total_cost]电: Received [total_amount]电 " + var/msg = "[total_cost]电: Received [total_amount] " if(total_cost > 0) msg = "+" + msg diff --git a/code/modules/cargo/exports/large_objects.dm b/code/modules/cargo/exports/large_objects.dm index bddf702e801..fe710f5983b 100644 --- a/code/modules/cargo/exports/large_objects.dm +++ b/code/modules/cargo/exports/large_objects.dm @@ -11,7 +11,7 @@ . += " Thanks for participating in NanoTrasen Crates Recycling Program." /datum/export/large/crate/wooden - cost = 25 + cost = 15 unit_name = "large wooden crate" export_types = list(/obj/structure/closet/crate/large) exclude_types = list() diff --git a/code/modules/modular_computers/file_system/programs/civilian/cargo_delivery.dm b/code/modules/modular_computers/file_system/programs/civilian/cargo_delivery.dm index fcd3818a0c2..2c3a44ad65b 100644 --- a/code/modules/modular_computers/file_system/programs/civilian/cargo_delivery.dm +++ b/code/modules/modular_computers/file_system/programs/civilian/cargo_delivery.dm @@ -36,7 +36,7 @@ data["id_name"] = id_card ? id_card.name : "-----" //Pass the shipped orders - var/list/order_list = SScargo.get_orders_by_status("shipped", TRUE) + SScargo.get_orders_by_status("approved", TRUE) + SScargo.get_orders_by_status("Unpaid", TRUE, list("shipped", "approved")) + var/list/order_list = SScargo.get_orders_by_status("shipped", TRUE) + SScargo.get_orders_by_status("approved", TRUE) + SScargo.get_orders_by_status("Unpaid", TRUE, list("shipped", "approved", "rejected", "basket", "submitted")) data["order_list"] = order_list diff --git a/code/modules/modular_computers/file_system/programs/civilian/cargo_order.dm b/code/modules/modular_computers/file_system/programs/civilian/cargo_order.dm index 9c660d97446..6d619a3de26 100644 --- a/code/modules/modular_computers/file_system/programs/civilian/cargo_order.dm +++ b/code/modules/modular_computers/file_system/programs/civilian/cargo_order.dm @@ -72,7 +72,7 @@ //Pass the status message along data["status_message"] = status_message - data["handling_fee"] = SScargo.get_handlingfee() + data["handling_fee"] = SScargo.get_handlingfee_cost(co.get_value(2)) data["crate_fee"] = SScargo.get_cratefee() return data diff --git a/html/changelogs/OpsProgramStuff.yml b/html/changelogs/OpsProgramStuff.yml new file mode 100644 index 00000000000..a83b79c1fc2 --- /dev/null +++ b/html/changelogs/OpsProgramStuff.yml @@ -0,0 +1,12 @@ +author: TheGreyWolf + +delete-after: True + +changes: + - qol: "Reduced the crate fee when making operation orders." + - bugfix: "Fixed the wording in some of the operation programs." + - bugfix: "Fixed the delivery app showing deliveries it shouldn't." + - bugfix: "The cargo control program now properly display status messages." + - balance: "Supplier fee was set to 0 for all current suppliers, eliminating the 20 credit charge per supplier." + - balance: "The operations order handling fee has been turned into a percentage charge instead, and reduced to 5% by default instead of a flat 20 credits." + - rscadd: "It is now possible to reject orders that have been approved but not shipped or paid for." diff --git a/tgui/packages/tgui/interfaces/CargoControl.tsx b/tgui/packages/tgui/interfaces/CargoControl.tsx index bdc775c2519..5502a4d9813 100644 --- a/tgui/packages/tgui/interfaces/CargoControl.tsx +++ b/tgui/packages/tgui/interfaces/CargoControl.tsx @@ -135,6 +135,14 @@ export const CargoControl = (props, context) => { } > + + {data.status_message} + act('page', { page: 'overview_main' })} @@ -216,9 +224,6 @@ export const CargoControl = (props, context) => { {data.order_details.price_customer.toFixed(2)}电 - - {data.order_details.price_customer.toFixed(2)}电 - {data.order_details.time_submitted} @@ -418,6 +423,15 @@ export const OverviewApproved = (props, context) => { {order.ordered_by} {order.price_cargo.toFixed(2)}电 +