PHP 7.4 bug, continued.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 4 Aug 2020 06:08:33 +0000 (08:08 +0200)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 4 Aug 2020 06:08:33 +0000 (08:08 +0200)
purchasing/includes/db/grn_db.inc

index d3cee3398e5a1e45c872df53caa53fc24579e9be..6b74148968899bc197c4728301e461e6c9fd86d4 100644 (file)
@@ -17,15 +17,14 @@ function update_average_material_cost($supplier, $stock_id, $price, $qty, $date,
        // save a couple of db calls like get_supplier()
        
        $supp = get_supplier($supplier);
-       if ($supplier != null)
+    if ($supplier != null) {
                $currency = $supp['curr_code'];
-       else
+        if ($supp['tax_included'])
+            $price = get_tax_free_price_for_item($stock_id, $price, $supp['tax_group_id'],
+                $supp['tax_included']);
+    } else
                $currency = null;
 
-       if ($supp['tax_included'])
-               $price = get_tax_free_price_for_item($stock_id, $price, $supp['tax_group_id'],
-                       $supp['tax_included']);
-
        if ($currency != null)
        {
                $ex_rate = get_exchange_rate_to_home_currency($currency, $date);