Check order with 0 to pick if non null
authorMaxime Bourget <bmx007@gmail.com>
Sat, 15 Jun 2013 12:08:22 +0000 (13:08 +0100)
committerMaxime Bourget <bmx007@gmail.com>
Sat, 15 Jun 2013 12:08:22 +0000 (13:08 +0100)
That way checking the box delete the corresponding row in to_pick
(Even though the sum is 0).

includes/order_lines.inc

index 928c70ee887cd8c1b3772401bab584f5ac1f0efd..96c0a27bcb71d8b63a4fda1048b5a8f67afcbc64 100644 (file)
@@ -227,7 +227,7 @@ function pick_checkbox($row)
 {
        $id = $row['debtor_no']."_".$row['branch_code'];
        $name = "chgpck" .$id;
-       $value = $row['quantity_to_pick'] > 0 ? 1:0;
+       $value = $row['quantity_to_pick'] !== null;
 
 // save also in hidden field for testing during 'Update'
  return checkbox(null, $name, $value, true,