qq|SELECT
a.invnumber, a.ordnumber, a.quonumber, a.cusordnumber,
a.orddate, a.quodate, a.globalproject_id,
- a.transdate AS invdate, a.deliverydate, a.paid, a.storno, a.gldate,
+ a.transdate AS invdate, a.deliverydate, a.paid, a.storno, a.storno_id, a.gldate,
a.shippingpoint, a.shipvia, a.notes, a.intnotes, a.taxzone_id,
a.duedate, a.taxincluded, (SELECT cu.name FROM currencies cu WHERE cu.id=a.currency_id) AS currency, a.shipto_id, a.cp_id,
a.employee_id, a.salesman_id, a.payment_id,
[% IF id && !is_type_credit_note %]
<input class="submit" type="submit" name="action" value="[% 'Credit Note' | $T8 %]" data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]">
[% END %]
-[% IF show_delete && !storno %]
+[% IF show_delete && (!storno || storno_id) %]
<input class="submit" type="submit" name="action" value="[% 'Delete' | $T8 %]">
+[% END %]
+[% IF show_delete && !storno %]
<input class="submit" type="submit" name="action" value="[% 'Post' | $T8 %]" data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]">
[% END %]
<input class="submit" type="submit" name="action" value="[% 'Order' | $T8 %]">