Operations delivery app fixes and improvements (#21720)

A small bundle of fixes with what is displayed, as mentioned in the
changelog.

Notable changes:
- It is now possible to charge department accounts directly using it.
The one doing it is logged in the transaction log for that account so
command can still go and check it. This was a feature I have been
requested repeatedly to make by operations member, to help encourage
people to buy more things for their department. Only a hangar tech
should be able to change the account that is charged as well.
- The delivery and pay buttons are now separate in the delivery app,
permitting someone to pay without having it delivered, or have it
delivered without paying. This also fixes a bug that paying before it
gets shipped to the Horizon could get an order permanently stuck as
being shipped & paid but not delivered.

<img width="575" height="700" alt="image"
src="https://github.com/user-attachments/assets/f14c9c0d-39fb-41b1-b3e9-aa479ccc0804"
/>
<img width="575" height="700" alt="image"
src="https://github.com/user-attachments/assets/7e33b8ef-caff-4e11-9e02-7c0ab3b4dba9"
/>
<img width="452" height="532" alt="image"
src="https://github.com/user-attachments/assets/413d8097-1379-432a-91ec-cd7ed13f0832"
/>
<img width="452" height="532" alt="image"
src="https://github.com/user-attachments/assets/8b73ddc0-3dfa-4503-bfcc-972a32687f97"
/>
<img width="575" height="700" alt="image"
src="https://github.com/user-attachments/assets/93663ba7-e443-45f4-8b87-cc04de35faf7"
/>
<img width="452" height="532" alt="image"
src="https://github.com/user-attachments/assets/8d4a1ba7-fbd5-40c9-a5ef-592c2067074e"
/>
This commit is contained in:
Casper3667
2026-02-02 00:29:38 +01:00
committed by GitHub
parent a802b48e2a
commit 306206f542
7 changed files with 201 additions and 118 deletions
+6 -9
View File
@@ -42,9 +42,8 @@
// Returns a list of all the objects in the order - Formatted as a list to be json_encoded
/datum/cargo_order/proc/get_object_list()
var/list/object_list = list()
for (var/datum/cargo_order_item/coi in items)
for(var/atom/object in coi.ci.items)
object_list.Add(object.name)
for(var/item in get_item_list())
object_list.Add(item["name"])
return object_list
// Gets a list of the order data - Formatted as list to be json_encoded
@@ -253,7 +252,7 @@
if(time_shipped)
order_data += "<u>Shipped at:</u> [time_shipped]<br>"
if(received_by)
order_data += "<u>Received by:</u [received_by]><br>"
order_data += "<u>Received by:</u> [received_by]<br>"
order_data += "<u>Delivered at:</u> [time_delivered]<br>"
order_data += "<hr>"
order_data += "<u>Order ID:</u> [order_id]<br>"
@@ -276,7 +275,7 @@
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>Shuttle Fee: [get_shipment_cost()]</li>"
order_data += "<li>Supplier Fee: [get_shipment_cost()]</li>"
order_data += "</ul>"
return order_data.Join("")
@@ -338,7 +337,7 @@
time_shipped = worldtime2text()
//Marks a order as delivered - Returns a status message
/datum/cargo_order/proc/set_delivered(var/user_name, var/user_id, var/paid=0)
/datum/cargo_order/proc/set_delivered(var/user_name, var/user_id)
if(user_id <= 0)
user_id = null
if(status == "shipped")
@@ -346,8 +345,6 @@
time_delivered = worldtime2text()
received_by = user_name
received_by_id = user_id
if(paid)
set_paid(user_name, user_id)
return "The order has been delivered"
else
return "The order could not be delivered - Invalid Status"
@@ -443,7 +440,7 @@
invoice_data += "<p>Shuttle Data</p>"
invoice_data += "<table>"
invoice_data += "<tr>"
invoice_data += "<td>Shuttle Fee::</td>"
invoice_data += "<td>Supplier fee::</td>"
invoice_data += "<td>[shuttle_fee]</td>"
invoice_data += "</tr>"
invoice_data += "<tr>"