X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Fdb%2Fvoiding_db.inc;h=43580ae978c031189a6d27d994646e8e9a323c2d;hb=807baf36cadbb2452b15c2321bbcacdbc09a8951;hp=55ff9fb9079a587c4c9205248581fb34ad2b6d65;hpb=95ff74b5722826544743a01daf527aa3c9efe11a;p=fa-stable.git diff --git a/admin/db/voiding_db.inc b/admin/db/voiding_db.inc index 55ff9fb9..43580ae9 100644 --- a/admin/db/voiding_db.inc +++ b/admin/db/voiding_db.inc @@ -53,9 +53,12 @@ function void_transaction($type, $type_no, $date_, $memo_) return _('Selected transaction does not exists.'); if ($type == ST_CUSTDELIVERY) // added 04 Oct 2008 by Joe Hunt. If delivery note has a not voided invoice, then NO. { - $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.'); + } } post_void_customer_trans($type, $type_no); break;