Skip to content

Commit

Permalink
[MIRROR] Supply QoL changes (#2787)
Browse files Browse the repository at this point in the history
Co-authored-by: HeyBanditoz <[email protected]>
Co-authored-by: Lexanx <[email protected]>
  • Loading branch information
3 people authored Nov 24, 2024
1 parent 6156a52 commit 5f1eca7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,24 @@

return 1

if(href_list["order_back_to_pending"])
var/id = text2num(href_list["order_back_to_pending"])
var/datum/supply_order/SO = find_order_by_id(id, SSsupply.shoppinglist)
if(SO)
SSsupply.requestlist += SO
SSsupply.shoppinglist -= SO
SSsupply.points += SO.object.cost

else
to_chat(user, SPAN_WARNING("Could not find order number [id] to move back to pending."))

return 1

if(href_list["deny_order"])
var/id = text2num(href_list["deny_order"])
var/datum/supply_order/SO = find_order_by_id(id, SSsupply.requestlist)
if(alert(user, "Are you sure?", "Deny Order", "Yes", "No") != "Yes")
return 1
if(SO)
SSsupply.requestlist -= SO
else
Expand All @@ -244,6 +259,8 @@
if(href_list["cancel_order"])
var/id = text2num(href_list["cancel_order"])
var/datum/supply_order/SO = find_order_by_id(id, SSsupply.shoppinglist)
if(alert(user, "Are you sure?", "Cancel Order", "Yes", "No") != "Yes")
return 1
if(SO)
SSsupply.shoppinglist -= SO
SSsupply.points += SO.object.cost
Expand All @@ -255,6 +272,8 @@
if(href_list["delete_order"])
var/id = text2num(href_list["delete_order"])
var/datum/supply_order/SO = find_order_by_id(id, SSsupply.donelist)
if(alert(user, "Are you sure?", "Delete Order", "Yes", "No") != "Yes")
return 1
if(SO)
SSsupply.donelist -= SO
else
Expand Down
1 change: 1 addition & 0 deletions nano/templates/supply.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@
{{#def.supply_request_item}}
<td>
{{:helper.link('Cancel', 'cancel', {'cancel_order' : value.id})}}
{{:helper.link('Pending', 'arrow_up', {'order_back_to_pending' : value.id})}}
{{:helper.link('Print', 'print', {'print_receipt' : value.id, 'list_id' : value.list_id}, data.can_print ? null : 'disabled')}}
{{/for}}
</table>
Expand Down

0 comments on commit 5f1eca7

Please sign in to comment.