Commit dee31e90 authored by Romain Courteaud's avatar Romain Courteaud

slapos_accounting: show Cancelled status on reversed Invoices

parent 29ee8cc0
...@@ -14,6 +14,15 @@ else: ...@@ -14,6 +14,15 @@ else:
if paid: if paid:
result = "Paid" result = "Paid"
reversal = portal.portal_catalog.getResultValue(
portal_type="Sale Invoice Transaction",
simulation_state="stopped",
default_causality_uid=context.getUid()
)
if reversal is not None and (context.getTotalPrice() + reversal.getTotalPrice()) == 0:
result = "Cancelled"
elif context.getTotalPrice() == 0: elif context.getTotalPrice() == 0:
result = "Free!" result = "Free!"
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment