Bug 5660: php8. Unable to create customer credit note. Fixed.
authorJoe <joe.hunt.consulting@gmail.com>
Tue, 1 Nov 2022 19:53:40 +0000 (20:53 +0100)
committerJoe <joe.hunt.consulting@gmail.com>
Tue, 1 Nov 2022 19:53:40 +0000 (20:53 +0100)
sales/includes/ui/sales_credit_ui.inc

index 0fd4dfc7c87aef892ea3316ede3fef2d2825e7fc..9d9223f405e79dbbdcef86c8f8862963da57e180 100644 (file)
@@ -263,9 +263,9 @@ function credit_edit_item_controls(&$order, $rowcounter, $line_no=-1)
                }
                $item_info = get_item_edit_info($_POST['stock_id']);
 
-               $dec = $item_info['decimals'];
+               $dec = !$item_info ? 0 :  $item_info['decimals'];
                $_POST['qty'] = number_format2(0, $dec);
-               $units = $item_info["units"];
+               $units = !$item_info ? "" : $item_info["units"];
                $price = get_price($_POST['stock_id'],
                        $order->customer_currency, $order->sales_type,
                        $order->price_factor, get_post('OrderDate'));