martijnbakker Posted November 2, 2012 Share Posted November 2, 2012 (edited) Hey devs, I upgraded my shop to 1.5.2 and i noticed something odd. When i perform a payment, and look up the order on the backend of Prestashop it claims that it has been paid 3 times. When i look at the invoice it says there has only been 1 payment. I downloaded a new version of Prestshop directly from the site. And i see that there is a correction for this behavior. However i cant find this on my current shop. Should perform a new install of Prestashop? Is this in any way related to the Multishipping option? I have turned that of and it doesnt fix this. Edited November 5, 2012 by martijnbakker (see edit history) Link to comment Share on other sites More sharing options...
JerseyG Posted November 3, 2012 Share Posted November 3, 2012 Hi I noticed this and posted it earlier in this forum. (using V1.5.0) It occurred after I enabled advanced stock management and Multishipping. As I was also getting stock errors I reverted back to 1.4.9, now upgraded to 1.5.2 but I am not using either advanced stock management or Multishipping. On my test server I will enable both and try and duplicate transactions as much as possible to see if I get the errors again. I will come back to you if this problem re occurs. G Link to comment Share on other sites More sharing options...
Goofy03 Posted November 3, 2012 Share Posted November 3, 2012 Hi i have exactly same error with Paypal or SystemPay only on external payment. I never use stock management or Multishipping. However i enable/disable check invoice management and i get an invoice in this 3 payment even if option is disabled. Link to comment Share on other sites More sharing options...
JerseyG Posted November 3, 2012 Share Posted November 3, 2012 My error occurred using the cash with order module and item set to delivered Link to comment Share on other sites More sharing options...
Goofy03 Posted November 5, 2012 Share Posted November 5, 2012 Any news about your problem ? are we alone wit it ? Link to comment Share on other sites More sharing options...
iDEAL Checkout Posted November 5, 2012 Share Posted November 5, 2012 (edited) Hello Guys, We of iDEAL Checkout had a look at the problem, and found the issue. It is related to the stock management indeed. The problem can be found in the file: ../classes/order/orderHistory.php around line: 233 The following code can be found: if ($new_os->invoice && !$order->invoice_number) $order->setInvoice($use_existing_payment); // set orders as paid if ($new_os->paid == 1) { $invoices = $order->getInvoicesCollection(); if ($order->total_paid != 0) $payment_method = Module::getInstanceByName($order->module); foreach ($invoices as $invoice) { $rest_paid = $invoice->getRestPaid(); if ($rest_paid > 0) { $payment = new OrderPayment(); $payment->order_reference = $order->reference; $payment->id_currency = $order->id_currency; $payment->amount = $rest_paid; if ($order->total_paid != 0) $payment->payment_method = $payment_method->displayName; else $payment->payment_method = null; // Update total_paid_real value for backward compatibility reasons if ($payment->id_currency == $order->id_currency) $order->total_paid_real += $payment->amount; else $order->total_paid_real += Tools::ps_round(Tools::convertPrice($payment->amount, $payment->id_currency, false), 2); $order->save(); idealcheckout_log('test', __FILE__, __LINE__); $payment->conversion_rate = 1; $payment->save(); Db::getInstance()->execute(' INSERT INTO `'._DB_PREFIX_.'order_invoice_payment` VALUES('.(int)$invoice->id.', '.(int)$payment->id.', '.(int)$order->id.')'); } } } Replace the code with the following: /* <iDEAL Checkout Fix > */ if($new_os->id == Configuration::get('PS_OS_PAYMENT')) { /* </iDEAL Checkout Fix > */ if ($new_os->invoice && !$order->invoice_number) $order->setInvoice($use_existing_payment); // set orders as paid if ($new_os->paid == 1) { $invoices = $order->getInvoicesCollection(); if ($order->total_paid != 0) $payment_method = Module::getInstanceByName($order->module); foreach ($invoices as $invoice) { $rest_paid = $invoice->getRestPaid(); if ($rest_paid > 0) { $payment = new OrderPayment(); $payment->order_reference = $order->reference; $payment->id_currency = $order->id_currency; $payment->amount = $rest_paid; if ($order->total_paid != 0) $payment->payment_method = $payment_method->displayName; else $payment->payment_method = null; // Update total_paid_real value for backward compatibility reasons if ($payment->id_currency == $order->id_currency) $order->total_paid_real += $payment->amount; else $order->total_paid_real += Tools::ps_round(Tools::convertPrice($payment->amount, $payment->id_currency, false), 2); $order->save(); idealcheckout_log('test', __FILE__, __LINE__); $payment->conversion_rate = 1; $payment->save(); Db::getInstance()->execute(' INSERT INTO `'._DB_PREFIX_.'order_invoice_payment` VALUES('.(int)$invoice->id.', '.(int)$payment->id.', '.(int)$order->id.')'); } } } /* <iDEAL Checkout Fix > */ } /* </iDEAL Checkout Fix > */ This way u can still use the Stock Management, and not worry about dubble or even tripple payments. Edited November 5, 2012 by iDEAL Checkout (see edit history) 1 Link to comment Share on other sites More sharing options...
martijnbakker Posted November 5, 2012 Author Share Posted November 5, 2012 Hello, Thank you for the fix iDEAL Checkout. I tried it on my website, and it works great. Link to comment Share on other sites More sharing options...
JerseyG Posted November 5, 2012 Share Posted November 5, 2012 Hi iDEAL Checkout Many thanks for the fix, I will enable advanced stock management again. G Link to comment Share on other sites More sharing options...
Goofy03 Posted November 5, 2012 Share Posted November 5, 2012 Thanks iDEAL Checkout you solve my issue too. Do you have submit a bug in the forge ? Link to comment Share on other sites More sharing options...
LeGastronome Posted November 24, 2012 Share Posted November 24, 2012 http://forge.prestashop.com/browse/PSCFV-5561?page=com.atlassian.streams.streams-jira-plugin%3Aactivity-stream-issue-tab Link to comment Share on other sites More sharing options...
Recommended Posts