render null shipment when shipment adjustment doesn't exist

This commit is contained in:
Mohamed ABDELLANI
2023-10-30 22:27:57 +01:00
parent 23a56d35a0
commit 6d0f7d7c81

View File

@@ -72,7 +72,15 @@ class Invoice
# contains limited information about the shipment
def shipment
shipment_adjustment.adjustable
shipment_adjustment&.adjustable || null_shipment
end
def null_shipment
Struct.new(
:amount,
:included_tax_total,
:additional_tax_total,
).new(0, 0, 0)
end
def display_shipment_amount_without_taxes