From: Janusz Dobrowolski Date: Tue, 11 Nov 2008 16:33:02 +0000 (+0000) Subject: Fixed false edit conflict errors. X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=dcae4cad340a16dabae3294dc24e3dd634d04478;p=textcart.git Fixed false edit conflict errors. --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0220a37..7b75228 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -22,8 +22,8 @@ $ -> Affected files 11-Nov-2008 Janusz Dobrowolski # Fixed right alignment of amount cells. $ /includes/ui/ui_input.inc -# Fixed display bug for fully received items. - /purchasing/po_receive_items.php +# Fixed display bug for fully received items and false modify conflicts. +$ /purchasing/po_receive_items.php 10-Nov-2008 Joe Hunt ! [0000081] Trial Balance again minor changes. diff --git a/purchasing/po_receive_items.php b/purchasing/po_receive_items.php index 2e2fa35..c3cfc01 100644 --- a/purchasing/po_receive_items.php +++ b/purchasing/po_receive_items.php @@ -114,9 +114,8 @@ function check_po_changed() // Otherwise if you try to fullfill item quantities separately will give error. $sql = "SELECT item_code, quantity_ordered, quantity_received, qty_invoiced FROM ".TB_PREF."purch_order_details - WHERE order_no=" . $_SESSION['PO']->order_no . " - AND (quantity_ordered > quantity_received) - ORDER BY po_detail_item"; + WHERE order_no=" . $_SESSION['PO']->order_no + ." ORDER BY po_detail_item"; $result = db_query($sql, "could not query purch order details"); check_db_error("Could not check that the details of the purchase order had not been changed by another user ", $sql); @@ -125,7 +124,6 @@ function check_po_changed() while ($myrow = db_fetch($result)) { $ln_item = $_SESSION['PO']->line_items[$line_no]; - // only compare against items that are outstanding $qty_outstanding = $ln_item->quantity - $ln_item->qty_received; if ($qty_outstanding > 0) @@ -138,7 +136,7 @@ function check_po_changed() return true; } } - $line_no++; + $line_no++; } /*loop through all line items of the order to ensure none have been invoiced */ return false; @@ -224,15 +222,17 @@ function process_receive_po() if (check_po_changed()) { - echo "
" . _("This order has been changed or invoiced since this delivery was started to be actioned. Processing halted. To enter a delivery against this purchase order, it must be re-selected and re-read again to update the changes made by the other user.") . "
"; - - echo "
" . _("Select a different purchase order for receiving goods against") . "
"; - echo "
OrderNumber . "'>" . _("Re-Read the updated purchase order for receiving goods against") . "
"; + display_error(_("This order has been changed or invoiced since this delivery was started to be actioned. Processing halted. To enter a delivery against this purchase order, it must be re-selected and re-read again to update the changes made by the other user.")); + hyperlink_no_params("$path_to_root/purchasing/inquiry/po_search.php", + _("Select a different purchase order for receiving goods against")); + hyperlink_params("$path_to_root/purchasing/po_receive_items.php", + _("Re-Read the updated purchase order for receiving goods against"), + "PONumber=" . $_SESSION['PO']->order_no); unset($_SESSION['PO']->line_items); unset($_SESSION['PO']); unset($_POST['ProcessGoodsReceived']); $Ajax->activate('_page_body'); - exit; + display_footer_exit(); } $grn = add_grn($_SESSION['PO'], $_POST['DefaultReceivedDate'],