diff --git a/code/controllers/subsystems/cargo.dm b/code/controllers/subsystems/cargo.dm
index 7700404fbb8..b33c37e382d 100644
--- a/code/controllers/subsystems/cargo.dm
+++ b/code/controllers/subsystems/cargo.dm
@@ -114,41 +114,44 @@ var/datum/controller/subsystem/cargo/SScargo
reset_cargo()
//Load the categories
- var/DBQuery/category_query = dbcon.NewQuery("SELECT name, display_name, description, icon, price_modifier FROM ss13_cargo_categories WHERE deleted_at IS NULL ORDER BY order_by ASC")
+ var/DBQuery/category_query = dbcon.NewQuery("SELECT id, name, display_name, description, icon, price_modifier FROM ss13_cargo_categories WHERE deleted_at IS NULL ORDER BY order_by ASC")
category_query.Execute()
while(category_query.NextRow())
CHECK_TICK
+ var/category_id = category_query.item[1]
try
add_category(
- category_query.item[1],
category_query.item[2],
category_query.item[3],
category_query.item[4],
- text2num(category_query.item[5]))
+ category_query.item[5],
+ text2num(category_query.item[6]))
catch(var/exception/ec)
- log_debug("SScargo: Error when loading category: [ec]")
+ log_debug("SScargo: Error when loading category [category_id] from sql: [ec]")
//Load the suppliers
- var/DBQuery/supplier_query = dbcon.NewQuery("SELECT short_name, name, description, tag_line, shuttle_time, shuttle_price, available, price_modifier FROM ss13_cargo_suppliers WHERE deleted_at is NULL")
+ var/DBQuery/supplier_query = dbcon.NewQuery("SELECT id, short_name, name, description, tag_line, shuttle_time, shuttle_price, available, price_modifier FROM ss13_cargo_suppliers WHERE deleted_at is NULL")
supplier_query.Execute()
while(supplier_query.NextRow())
CHECK_TICK
+ var/supplier_id = supplier_query.item[1]
try
add_supplier(
- supplier_query.item[1],
supplier_query.item[2],
supplier_query.item[3],
supplier_query.item[4],
supplier_query.item[5],
supplier_query.item[6],
supplier_query.item[7],
- supplier_query.item[8])
+ supplier_query.item[8],
+ supplier_query.item[9])
catch(var/exception/es)
- log_debug("SScargo: Error when loading supplier: [es]")
+ log_debug("SScargo: Error when loading supplier [supplier_id] from sql: [es]")
//Load the items
var/DBQuery/item_query = dbcon.NewQuery("SELECT id, name, supplier, description, categories, price, items, access, container_type, groupable, item_mul FROM ss13_cargo_items WHERE deleted_at IS NULL AND approved_at IS NOT NULL AND supplier IS NOT NULL ORDER BY order_by ASC, name ASC, supplier ASC")
item_query.Execute()
while(item_query.NextRow())
CHECK_TICK
+ var/item_id = item_query.item[1]
try
add_item(
item_query.item[1],
@@ -163,7 +166,7 @@ var/datum/controller/subsystem/cargo/SScargo
item_query.item[10],
item_query.item[11])
catch(var/exception/ei)
- log_debug("SScargo: Error when loading item from sql: [ei]")
+ log_debug("SScargo: Error when loading item [item_id] from sql: [ei]")
//Loads the cargo data from JSON
/datum/controller/subsystem/cargo/proc/load_from_json()
diff --git a/code/datums/cargo.dm b/code/datums/cargo.dm
index 3d70bcbb88c..279b6000663 100644
--- a/code/datums/cargo.dm
+++ b/code/datums/cargo.dm
@@ -505,17 +505,46 @@
// Generates the invoice at the time of shipping
/datum/cargo_shipment/proc/generate_invoice()
var/list/invoice_data = list()
- invoice_data += "One day
"
- invoice_data += "This will contain the invoice
"
- invoice_data += "Right now its just a placeholder
"
- invoice_data += "Shipment num: [shipment_num]
"
- invoice_data += "shipment cost sell: [shipment_cost_sell]
"
- invoice_data += "shipment cost purchse: [shipment_cost_purchase]
"
- invoice_data += "shuttle fee: [shuttle_fee]
"
- invoice_data += "shuttle time: [shuttle_time]
"
- invoice_data += "shuttle called by: [shuttle_called_by]
"
- invoice_data += "shuttle recalled by: [shuttle_recalled_by]
"
- invoice_data += "centcom message:
[nl2br(message)]"
+ invoice_data += "
Shipment Data
" + invoice_data += "| Shipment Number: | " + invoice_data += "[shipment_num] | " + invoice_data += "
| Shipment Income: | " + invoice_data += "[shipment_cost_sell] | " + invoice_data += "
| Shipment Expense: | " + invoice_data += "[shipment_cost_purchase] | " + invoice_data += "
Shuttle Data
" + invoice_data += "| Shuttle Fee:: | " + invoice_data += "[shuttle_fee] | " + invoice_data += "
| Shuttle Time: | " + invoice_data += "[shuttle_time] | " + invoice_data += "
| Shuttle Called By: | " + invoice_data += "[shuttle_called_by] | " + invoice_data += "
| Shuttle Recalled By: | " + invoice_data += "[shuttle_recalled_by] | " + invoice_data += "
Central Command Message:
" + invoice_data += "[nl2br(message)]" shipment_invoice = invoice_data.Join("") completed = 1 diff --git a/code/modules/modular_computers/file_system/programs/civilian/cargo_control.dm b/code/modules/modular_computers/file_system/programs/civilian/cargo_control.dm index 09cbecbe683..5c0f568960a 100644 --- a/code/modules/modular_computers/file_system/programs/civilian/cargo_control.dm +++ b/code/modules/modular_computers/file_system/programs/civilian/cargo_control.dm @@ -217,10 +217,19 @@ if(href_list["shipment_print"]) var/datum/cargo_shipment/cs = SScargo.get_shipment_by_id(text2num(href_list["shipment_print"])) if(cs && cs.completed && console && console.nano_printer) - if(!console.nano_printer.print_text(cs.get_invoice(),"Shipment Invoice #[cs.shipment_num]")) + var/obj/item/paper/P = console.nano_printer.print_text(cs.get_invoice(),"Shipment Invoice #[cs.shipment_num]") + if(!P) to_chat(usr,"Hardware error: Printer was unable to print the file. It may be out of paper.") return else + //stamp the paper + var/image/stampoverlay = image('icons/obj/bureaucracy.dmi') + stampoverlay.icon_state = "paper_stamp-cent" + if(!P.stamped) + P.stamped = new + P.stamped += /obj/item/stamp + P.add_overlay(stampoverlay) + P.stamps += "