- $childs = get_sales_child_lines($type, $type_no, false); // 2011-03-17 This had been changed. Joe
- if ($childs && db_num_rows($childs))
- return _('This delivery cannot be voided because it was already invoiced.');
+ $vers = get_customer_trans_version($type, $type_no);
+ if ($vers[$type_no] == 1) {
+ $childs = get_sales_child_lines($type, $type_no, false); // 2011-03-17 This had been changed. Joe
+ if ($childs && db_num_rows($childs))
+ return _('This delivery cannot be voided because it was already invoiced.');
+ }