From: Joe Hunt Date: Wed, 4 Jan 2012 23:33:38 +0000 (+0100) Subject: Do not allow editing of allocated sales invoices in Journal Inquiry. X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=ecea11c9aa6ed2e917dfd6d22d7e0af45eed905a;p=fa-stable.git Do not allow editing of allocated sales invoices in Journal Inquiry. --- diff --git a/gl/inquiry/journal_inquiry.php b/gl/inquiry/journal_inquiry.php index dccef78f..2d9eaabc 100644 --- a/gl/inquiry/journal_inquiry.php +++ b/gl/inquiry/journal_inquiry.php @@ -107,7 +107,14 @@ function edit_link($row) { global $editors; - return isset($editors[$row["type"]]) && !is_closed_trans($row["type"], $row["type_no"]) ? + $ok = true; + if ($row['type'] == ST_SALESINVOICE) + { + $myrow = get_customer_trans($row["type_no"], $row["type"]); + if ($myrow['alloc'] != 0 || get_voided_entry(ST_SALESINVOICE, $row["type_no"]) !== false) + $ok = false; + } + return isset($editors[$row["type"]]) && !is_closed_trans($row["type"], $row["type_no"]) && $ok ? pager_link(_("Edit"), sprintf($editors[$row["type"]], $row["type_no"], $row["type"]), ICON_EDIT) : '';