Here is a temporary solution ...
Edit the file:
/includes/classes/orders.php
Around line 616 you will see:
PHP Code:
$insert_id = $db->Insert_ID();
Change to read:
PHP Code:
$insert_id = $db->Insert_ID();
$_SESSION['order_number_order_totals'] = $insert_id;
Now edit the file:
/includes/modules/order_total/ot_gv.php
Comment line 122 and add a new line so it reads:
PHP Code:
// $db->Execute("insert into " . TABLE_COUPON_GV_QUEUE . " (customer_id, order_id, amount, date_created, ipaddr) values ('" . (int)$_SESSION['customer_id'] . "', '" . (int)$insert_id . "', '" . $gv_order_amount . "', NOW(), '" . $_SERVER['REMOTE_ADDR'] . "')");
$db->Execute("insert into " . TABLE_COUPON_GV_QUEUE . " (customer_id, order_id, amount, date_created, ipaddr) values ('" . (int)$_SESSION['customer_id'] . "', '" . (int)$_SESSION['order_number_order_totals'] . "', '" . $gv_order_amount . "', NOW(), '" . $_SERVER['REMOTE_ADDR'] . "')");
See if this solves all PayPal with GV Orders so that the gv queue is set right on the orders_id ...