mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-19 03:49:10 +01:00
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."
This commit is contained in:
@@ -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.
|
||||
|
||||
+16
-11
@@ -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 += "<li>[item["name"]]: [item["price"]]电</li>"
|
||||
order_data += "<li>Crate Fee: [SScargo.get_cratefee()]电</li>"
|
||||
order_data += "<li>Handling Fee: [SScargo.get_handlingfee()]电</li>"
|
||||
order_data += "<li>Supplier Fee: [get_shipment_cost()]电</li>"
|
||||
order_data += "<li>Handling Fee: [SScargo.get_handlingfee_cost(get_value(2))]电</li>"
|
||||
var/supplier_fee = get_shipment_cost()
|
||||
if(supplier_fee)
|
||||
order_data += "<li>Supplier Fee: [supplier_fee]电</li>"
|
||||
order_data += "</ul>"
|
||||
|
||||
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 += "<p>Shuttle Data</p>"
|
||||
invoice_data += "<table>"
|
||||
if(shuttle_fee)
|
||||
invoice_data += "<tr>"
|
||||
invoice_data += "<td>Supplier fee:</td>"
|
||||
invoice_data += "<td>[shuttle_fee]</td>"
|
||||
invoice_data += "</tr>"
|
||||
invoice_data += "<tr>"
|
||||
invoice_data += "<td>Supplier fee::</td>"
|
||||
invoice_data += "<td>[shuttle_fee]</td>"
|
||||
invoice_data += "</tr>"
|
||||
invoice_data += "<tr>"
|
||||
invoice_data += "<td>Shuttle Time:</td>"
|
||||
invoice_data += "<td>Elevator Time:</td>"
|
||||
invoice_data += "<td>[shuttle_time]</td>"
|
||||
invoice_data += "</tr>"
|
||||
invoice_data += "<tr>"
|
||||
invoice_data += "<td>Shuttle Called By:</td>"
|
||||
invoice_data += "<td>Elevator Called By:</td>"
|
||||
invoice_data += "<td>[shuttle_called_by]</td>"
|
||||
invoice_data += "</tr>"
|
||||
invoice_data += "<tr>"
|
||||
invoice_data += "<td>Shuttle Recalled By:</td>"
|
||||
invoice_data += "<td>Elevator Recalled By:</td>"
|
||||
invoice_data += "<td>[shuttle_recalled_by]</td>"
|
||||
invoice_data += "</tr>"
|
||||
invoice_data += "</table>"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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."
|
||||
@@ -135,6 +135,14 @@ export const CargoControl = (props, context) => {
|
||||
</>
|
||||
}
|
||||
>
|
||||
<Box
|
||||
mb={2}
|
||||
p={1}
|
||||
backgroundColor="rgba(255,255,255,0.05)"
|
||||
textColor="yellow"
|
||||
>
|
||||
{data.status_message}
|
||||
</Box>
|
||||
<Tabs>
|
||||
<Tabs.Tab
|
||||
onClick={() => act('page', { page: 'overview_main' })}
|
||||
@@ -216,9 +224,6 @@ export const CargoControl = (props, context) => {
|
||||
<LabeledList.Item label="Personal Expense">
|
||||
{data.order_details.price_customer.toFixed(2)}电
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Personal Expense">
|
||||
{data.order_details.price_customer.toFixed(2)}电
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Ordered At">
|
||||
{data.order_details.time_submitted}
|
||||
</LabeledList.Item>
|
||||
@@ -418,6 +423,15 @@ export const OverviewApproved = (props, context) => {
|
||||
<Table.Cell>{order.ordered_by}</Table.Cell>
|
||||
<Table.Cell>{order.price_cargo.toFixed(2)}电</Table.Cell>
|
||||
<Table.Cell>
|
||||
<Button
|
||||
content="Reject"
|
||||
color="red"
|
||||
onClick={() =>
|
||||
act('order_reject', {
|
||||
order_reject: order.order_id.toString(),
|
||||
})
|
||||
}
|
||||
/>
|
||||
<Button
|
||||
content="Details"
|
||||
onClick={() =>
|
||||
@@ -629,7 +643,7 @@ export const Settings = (props, context) => {
|
||||
<LabeledList>
|
||||
<LabeledList.Item label="Handling Fee">
|
||||
<Button
|
||||
content={data.handling_fee}
|
||||
content={`${data.handling_fee}%`}
|
||||
icon="edit"
|
||||
onClick={() => act('handling_fee')}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user