X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Fdb%2Fvoiding_db.inc;h=55ff9fb9079a587c4c9205248581fb34ad2b6d65;hb=71e2a022f298a96a2406de1fc8397270257f9a1f;hp=8323c0d164d7c3a16880ef47801e96754f6cdf4b;hpb=582e4a2443d9ed6ca67f47c05b7d92772b53b805;p=fa-stable.git diff --git a/admin/db/voiding_db.inc b/admin/db/voiding_db.inc index 8323c0d1..55ff9fb9 100644 --- a/admin/db/voiding_db.inc +++ b/admin/db/voiding_db.inc @@ -26,6 +26,8 @@ function void_transaction($type, $type_no, $date_, $memo_) case ST_JOURNAL : // it's a journal entry if (!exists_gl_trans($type, $type_no)) return _('Selected transaction does not exists.'); + if ($wo = check_wo_costing($type, $type_no)) + return sprintf(_('This transaction cannot be voided because it is part of Work Order %s costs.'), $wo); void_journal_trans($type, $type_no); break; @@ -99,12 +101,16 @@ function void_transaction($type, $type_no, $date_, $memo_) case ST_MANUISSUE : // it's a work order issue if (!exists_work_order_issue($type_no)) return _('Selected transaction does not exists.'); + if ($wo = check_void_wo_issue($type_no)) + return sprintf(_('Selected document cannot be voided because related Work Order %s is already closed.'), $wo); void_work_order_issue($type_no); break; case ST_MANURECEIVE : // it's a work order production if (!exists_work_order_produce($type_no)) return _('Selected transaction does not exists.'); + if ($wo = check_void_wo_production($type_no)) + return sprintf(_('Selected document cannot be voided because related Work Order %s is already closed.'), $wo); void_work_order_produce($type_no); break;